Source code for qplex.algorithms.mixers.quantum_mixer
from abc import ABC, abstractmethod
from typing import List
[docs]
class QuantumMixer(ABC):
"""Abstract base class defining the interface for quantum mixers.
Provides a template for implementing various mixing operators that preserve
problem constraints while exploring the solution space.
"""
[docs]
@abstractmethod
def generate_circuit(self, n_qubits: int, theta: str) -> List[
str]: # pragma: no cover
"""Generate OpenQASM3 circuit instructions for the mixing operation.
Parameters
----------
n_qubits : int
Number of qubits in the circuit
theta : str
Mixing angle parameter name/value
Returns
-------
List[str]
OpenQASM3 instructions implementing the mixer
"""
pass