QAOA_FO¶
QAOA_FO is Q-CTRL's implementation of the Quantum Approximate Optimization Algorithm (QAOA) through their Fire Opal framework. It is a hybrid quantum-classical algorithm for solving combinatorial optimization problems with enhanced performance through Q-CTRL's error mitigation and control techniques.
The algorithm works by preparing a quantum state through alternating applications of problem-specific (cost) and mixing Hamiltonians, controlled by variational parameters that are optimized classically to maximize the probability of measuring the optimal solution.
QAOA_FO leverages Q-CTRL's expertise in quantum control to improve circuit fidelity and optimization performance. It is particularly suited for problems that can be encoded as quadratic unconstrained binary optimization (QUBO) or Ising models, such as MaxCut, TSP, and portfolio optimization.
Compatible Backends¶
The QAOA_FO
algorithm supports the following backends:
By default, QAOA_FO
uses the Qctrl
backend.
Initialization¶
The following section outlines the default configurations of QAOA_FO
. You can also specify other compatible backends for the algorithm. When backend=None
is specified, the default backend will be initialized automatically. In this case, if the backend requires a token, it will be taken from the environment variables.
from luna_quantum.solve.parameters.algorithms import QAOA_FO
algorithm = QAOA_FO(
backend=None
)
Parameter Details
For a complete overview of available parameters and their usage, see the QAOA_FO API Reference.
Usage¶
from luna_quantum import LunaSolve
LunaSolve.authenticate("<YOUR_LUNA_API_KEY>")
# Define your model and algorithm
model = ...
algorithm = ...
solve_job = algorithm.run(model, name="my-solve-job")
API Reference¶
Bases: LunaAlgorithm[Qctrl]
Quantum Approximate Optimization Algorithm via Fire Opal (QAOA_FO).
QAOA_FO is Q-CTRL's implementation of the Quantum Approximate Optimization Algorithm
(QAOA) through their Fire Opal framework. It is a hybrid quantum-classical algorithm
for solving combinatorial optimization problems with enhanced performance through
Q-CTRL's error mitigation and control techniques. For more details, please refer
to the Fire Opal QAOA documentation <https://docs.q-ctrl.com/fire-opal/execute/run-algorithms/solve-optimization-problems/fire-opals-qaoa-solver>
_.
The algorithm works by preparing a quantum state through alternating applications of problem-specific (cost) and mixing Hamiltonians, controlled by variational parameters that are optimized classically to maximize the probability of measuring the optimal solution.
QAOA_FO leverages Q-CTRL's expertise in quantum control to improve circuit fidelity and optimization performance. It is particularly suited for problems that can be encoded as quadratic unconstrained binary optimization (QUBO) or Ising models, such as MaxCut, TSP, and portfolio optimization.
backend
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_compatible_backends
classmethod
¶
get_compatible_backends() -> tuple[type[Qctrl]]
Check at runtime if the used backend is compatible with the solver.
Returns:
Type | Description |
---|---|
tuple[type[IBackend], ...]
|
True if the backend is compatible with the solver, False otherwise. |
get_default_backend
classmethod
¶
get_default_backend() -> Qctrl
Return the default backend implementation.
This property must be implemented by subclasses to provide the default backend instance to use when no specific backend is specified.
Returns:
Type | Description |
---|---|
IBackend
|
An instance of a class implementing the IBackend interface that serves as the default backend. |
run ¶
run(
model: Model | str,
name: str | None = None,
backend: BACKEND_TYPE | None = None,
client: LunaSolve | str | None = None,
*args: Any,
**kwargs: Any,
) -> SolveJob
Run the configured solver.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Model or str
|
The model to be optimized or solved. It could be an Model instance or a string identifier representing the model id. |
required |
name
|
str | None
|
If provided, the name of the job. Defaults to None. |
None
|
backend
|
BACKEND_TYPE | None
|
Backend to use for the solver. If not provided, the default backend is used. |
None
|
client
|
LunaSolve or str
|
The client interface used to interact with the backend services. If not provided, a default client will be used. |
None
|
*args
|
Any
|
Additional arguments that will be passed to the solver or client. |
()
|
**kwargs
|
Any
|
Additional keyword parameters for configuration or customization. |
{}
|
Returns:
Type | Description |
---|---|
SolveJob
|
The job object containing the information about the solve process. |