qlauncher.routines.qiskit.algorithms.qiskit_native#
Algorithms for Qiskit routines
Summary#
Classes:
Algorithm class with FALQON. |
|
Algorithm class with QAOA. |
|
Abstract class for Qiskit optimization algorithms |
Functions:
Commutator |
Reference#
- class qlauncher.routines.qiskit.algorithms.qiskit_native.QiskitOptimizationAlgorithm(**alg_kwargs)[source]#
Bases:
Algorithm
Abstract class for Qiskit optimization algorithms
- make_tag(problem: Problem, backend: QiskitBackend) str [source]#
- qlauncher.routines.qiskit.algorithms.qiskit_native.commutator(op_a: SparsePauliOp, op_b: SparsePauliOp) SparsePauliOp [source]#
Commutator
- class qlauncher.routines.qiskit.algorithms.qiskit_native.QAOA(p: int = 1, optimizer: Optimizer | None = None, alternating_ansatz: bool = False, aux=None, **alg_kwargs)[source]#
Bases:
QiskitOptimizationAlgorithm
Algorithm class with QAOA.
- Parameters:
p (int) – The number of QAOA steps. Defaults to 1.
optimizer (Optimizer | None) – Optimizer used during algorithm runtime. If set to None turns into COBYLA. Defaults to None,
alternating_ansatz (bool) – Whether to use an alternating ansatz. Defaults to False. If True, it’s recommended to provide a mixer_h to alg_kwargs.
aux – Auxiliary input for the QAOA algorithm.
**alg_kwargs – Additional keyword arguments for the base class.
- name#
The name of the algorithm.
- Type:
str
- aux#
Auxiliary input for the QAOA algorithm.
- p#
The number of QAOA steps.
- Type:
int
- optimizer#
Optimizer used during algorithm runtime.
- Type:
Optimizer
- alternating_ansatz#
Whether to use an alternating ansatz.
- Type:
bool
- parameters#
List of parameters for the algorithm.
- Type:
list
- mixer_h#
The mixer Hamiltonian.
- Type:
SparsePauliOp | None
- property setup: dict#
- class qlauncher.routines.qiskit.algorithms.qiskit_native.FALQON(driver_h: SparsePauliOp | None = None, delta_t: float = 0.03, beta_0: float = 0.0, max_reps: int = 20)[source]#
Bases:
QiskitOptimizationAlgorithm
Algorithm class with FALQON.
- Parameters:
driver_h (Operator | None) – The driver Hamiltonian for the problem.
delta_t (float) – The time step for the evolution operators.
beta_0 (float) – The initial value of beta.
n (int) – The number of iterations to run the algorithm.
**alg_kwargs – Additional keyword arguments for the base class.
- driver_h#
The driver Hamiltonian for the problem.
- Type:
Operator | None
- delta_t#
The time step for the evolution operators.
- Type:
float
- beta_0#
The initial value of beta.
- Type:
float
- n#
The number of iterations to run the algorithm.
- Type:
int
- cost_h#
The cost Hamiltonian for the problem.
- Type:
Operator | None
- n_qubits#
The number of qubits in the problem.
- Type:
int
- parameters#
The list of algorithm parameters.
- Type:
list[str]
- property setup: dict#
- run(problem: Problem, backend: QiskitBackend, formatter: Callable) Result [source]#
Runs the FALQON algorithm