Skip to content

Backends

Backends define the computational infrastructure used to execute optimization algorithms. Luna Solve supports a variety of backends spanning real quantum hardware, simulators, and classical systems.

QPU Backends

Real quantum hardware backends.

D-Wave QPU

Bases: DWave, QpuTokenBackend

Configuration for D-Wave quantum processing backends.

This class provides settings for problem decomposition and embedding when using D-Wave quantum processors. It can be configured to use either manual embedding parameters or automatic embedding based on problem characteristics.

Attributes:

  • embedding_parameters (Embedding | AutoEmbedding | None) –

    Detailed configuration for manual embedding when not using auto-embedding. If None and decomposer is also None, default embedding parameters will be used. Ignored if decomposer is set to AutoEmbedding. Default is None.

  • qpu_backend (str) –

    Specific D-Wave quantum processing unit (QPU) for your optimization

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

Embedding

Bases: BaseModel

Configuration parameters for embedding problems onto D-Wave QPUs.

Embedding maps logical variables from a problem to physical qubits on the QPU, with chains of qubits representing individual variables.

Attributes:

  • max_no_improvement (int, default=10) –

    Maximum number of consecutive failed iterations to improve the current solution before giving up. Each iteration attempts to find an embedding for each variable such that it is adjacent to all its neighbors.

  • random_seed (Optional[int], default=None) –

    Seed for the random number generator. If None, seed is set by os.urandom().

  • timeout (int, default=1000) –

    Maximum time in seconds before the algorithm gives up.

  • max_beta (Optional[float], default=None) –

    Controls qubit weight assignment using formula (beta^n) where n is the number of chains containing that qubit. Must be greater than 1 if specified. If None, max_beta is effectively infinite.

  • tries (int, default=10) –

    Number of restart attempts before the algorithm stops. On D-Wave 2000Q, a typical restart takes between 1 and 60 seconds.

  • inner_rounds (Optional[int], default=None) –

    Maximum iterations between restart attempts. Restart attempts are typically terminated due to max_no_improvement. If None, effectively infinite.

  • chainlength_patience (int, default=10) –

    Maximum number of consecutive failed iterations to improve chain lengths before moving on. Each iteration attempts to find more efficient embeddings.

  • max_fill (Optional[int], default=None) –

    Restricts the number of chains that can simultaneously use the same qubit during search. Values above 63 are treated as 63. If None, effectively infinite.

  • threads (int, default=1) –

    Maximum number of threads to use. Parallelization is only advantageous when the expected variable degree significantly exceeds the thread count. Min: 1.

  • return_overlap (bool, default=False) –

    Controls return value format:

    • True: Returns (embedding, validity_flag) tuple
    • False: Returns only the embedding

    This function returns an embedding regardless of whether qubits are used by multiple variables.

  • skip_initialization (bool, default=False) –

    If True, skips the initialization pass. Only works with semi-valid embeddings provided through initial_chains and fixed_chains. A semi-valid embedding has chains where every adjacent variable pair (u,v) has a coupler (p,q) in the hardware with p in chain(u) and q in chain(v).

  • initial_chains (Any, default=()) –

    Initial chains inserted before fixed_chains and before initialization. Can be used to restart algorithm from a previous state. Missing or empty entries are ignored. Each value is a list of qubit labels.

  • fixed_chains (Any, default=()) –

    Fixed chains that cannot change during the algorithm. Qubits in these chains are not used by other chains. Missing or empty entries are ignored. Each value is a list of qubit labels.

  • restrict_chains (Any, default=()) –

    Restricts each chain[i] to be a subset of restrict_chains[i] throughout the algorithm. Missing or empty entries are ignored. Each value is a list of qubit labels.

  • suspend_chains (Any, default=()) –

    A metafeature only implemented in the Python interface. For each suspended variable i, suspend_chains[i] is an iterable of iterables (blobs). For each blob in a suspension, at least one qubit from that blob must be in the chain for variable i.

AutoEmbedding

Bases: BaseModel

Configuration for automatic embedding of problems onto D-Wave hardware.

This class provides a simpler interface to configure the embedding process when the details of the underlying hardware are not known or when optimal embedding parameters should be determined automatically.

Attributes:

  • embedding_parameters (EmbeddingParameters, default=EmbeddingParameters()) –

    Detailed configuration parameters for the embedding algorithm. See EmbeddingParameters documentation for details on specific settings.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

IBM Quantum

Bases: IBMBase, QpuTokenBackend

IBM hardware backend.

Run on real IBM quantum hardware. An IBM token is required for authentication.

Attributes:

  • backend_name (str | None) –

    Which IBM device to use. Check the IBM Quantum Platform for available devices. If backend_name=None, the least busy device satisfying the circuit requirements will be selected.

  • dynamical_decoupling (dict[str, Any]) –

    Dynamical decoupling options. Default: {}.

  • optimization_level (int) –

    Transpiler optimization level. Default: 2.

  • use_session (bool) –

    Whether to use a session for execution. When the session is enabled, IBM runtime is billed for the entire period of the algorithm. If not, only the individual jobs are billed, but the overall runtime will be longer due to requeuing. Default: False.

  • token (str | QpuToken | None) –

    IBM Quantum API token for authentication. Can be provided as a plain string or a QpuToken object. Default: None.

  • instance (str | None) –

    IBM Quantum service instance (hub/group/project). Default: None.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

QCTRL

Bases: QpuTokenBackend

Configuration parameters for Q-CTRL`s Fire Opal Backend.

QAOA (Quantum Approximate Optimization Algorithm) is a quantum algorithm designed for combinatorial optimization problems. This implementation leverages Q-CTRL's Fire Opal framework, which optimizes QAOA execution on quantum hardware to reduce errors and improve solution quality.

Fire Opal's hardware-tailored optimizations enable solving larger problems with better convergence in fewer iterations, reducing overall execution time on real quantum devices.

Attributes:

  • organization_slug (str | None, default=None) –

    Organization identifier from your Q-CTRL account. Required only if you belong to multiple organizations. This can be retrieved from your Q-CTRL account settings or dashboard.

  • backend_name (str | None, default=None) –

    The IBM Quantum backend to use for computations: - Specific backend: e.g., 'ibm_fez', 'ibm_marrakesh' - 'least_busy': Automatically selects the least busy available backend - 'basic_simulator': Uses the basic simulator (default if None) Check your IBM Quantum account for available backends.

  • ibm_credentials (IBMQ | IBMCloud) –

    The IBM backend credentials, i.e. how to access the IBM service. Q-Ctrl currently supports two mehtods, via the old IBMQ pattern or the new IBMCloud pattern. Default is Qctrl.IBMQ()

  • token (QpuToken | str | None, default=None) –

    The Q-Ctrl API token.

Notes

For detailed information about Fire Opal's QAOA solver and its capabilities, see Q-CTRL's documentation

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

IBMCloud

Bases: BaseModel

Configuration parameters for the IBM Cloud backend.

Attributes:

  • instance (str) –

    The Qiskit runtime instance CRN (Cloud Resource Name).

  • token (Union[str, None, QpuToken], default=None) –

    The IBM API token.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

IonQ

Bases: AWSBackendBase

Configuration parameters for IonQ quantum backends, accessed via AWS.

Attributes:

  • device (Literal["Aria1", "Aria2", "Forte1", "ForteEnterprise1"], default="Aria1") –

    The specific IonQ quantum device to use for computations. Options are:

    • "Aria1": IonQ's flagship trapped-ion quantum computer
    • "Aria2": Next-generation IonQ system with improved connectivity
    • "Forte1": IonQ's enterprise-grade quantum system
    • "ForteEnterprise1": Enhanced enterprise version with dedicated access

    Different devices have varying characteristics such as qubit count, connectivity, and error rates.

  • aws_access_key (str | QpuToken | None) –

    The AWS access key

  • aws_secret_access_key (str | QpuToken | None) –

    The AWS secret access key

  • aws_session_token (str | QpuToken | None) –

    The AWS session token

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

device_provider() -> str

Return the device provider identifier.

IQM

Bases: AWSBackendBase

Configuration parameters for IQM quantum backends, accessed via AWS.

Attributes:

  • device (Literal["Garnet"], default="Garnet") –

    The specific IQM quantum device to use for computations. Currently only "Garnet" is available - IQM's superconducting quantum processor with native two-qubit gates and optimized for near-term algorithms.

  • aws_access_key (str | QpuToken | None) –

    The AWS access key

  • aws_secret_access_key (str | QpuToken | None) –

    The AWS secret access key

  • aws_session_token (str | QpuToken | None) –

    The AWS session token

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

device_provider() -> str

Return the device provider identifier.

Rigetti

Bases: AWSBackendBase

Configuration parameters for Rigetti quantum backends, accessed via AWS.

Attributes:

  • device (Literal["Ankaa3"], default="Ankaa3") –

    The specific Rigetti quantum device to use for computations. Currently only "Ankaa-3" is available - Rigetti's latest superconducting quantum processor featuring improved coherence times and gate fidelities.

  • aws_access_key (str | QpuToken | None) –

    The AWS access key

  • aws_secret_access_key (str | QpuToken | None) –

    The AWS secret access key

  • aws_session_token (str | QpuToken | None) –

    The AWS session token

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

device_provider() -> str

Return the device provider identifier.

IBM Quantum

Bases: IBMBase, QpuTokenBackend

IBM hardware backend.

Run on real IBM quantum hardware. An IBM token is required for authentication.

Attributes:

  • backend_name (str | None) –

    Which IBM device to use. Check the IBM Quantum Platform for available devices. If backend_name=None, the least busy device satisfying the circuit requirements will be selected.

  • dynamical_decoupling (dict[str, Any]) –

    Dynamical decoupling options. Default: {}.

  • optimization_level (int) –

    Transpiler optimization level. Default: 2.

  • use_session (bool) –

    Whether to use a session for execution. When the session is enabled, IBM runtime is billed for the entire period of the algorithm. If not, only the individual jobs are billed, but the overall runtime will be longer due to requeuing. Default: False.

  • token (str | QpuToken | None) –

    IBM Quantum API token for authentication. Can be provided as a plain string or a QpuToken object. Default: None.

  • instance (str | None) –

    IBM Quantum service instance (hub/group/project). Default: None.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

Simulated Backends

Classical simulation backends.

AWS

Bases: AWSBackendBase

Configuration parameters for AWS simulator backends.

Attributes:

  • device (Literal["SV1", "DM1", "TN1"], default="SV1") –

    The specific AWS simulator to use for computations. Options are:

    • "SV1": State vector simulator for smaller quantum circuits
    • "DM1": Density matrix simulator for noisy quantum circuits
    • "TN1": Tensor network simulator for larger quantum circuits

    See the AWS Braket docs

  • aws_access_key (str | QpuToken | None) –

    The AWS access key

  • aws_secret_access_key (str | QpuToken | None) –

    The AWS secret access key

  • aws_session_token (str | QpuToken | None) –

    The AWS session token

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

get_qpu_tokens() -> TokenProvider | None

Retrieve a QPU token.

This method is intended to be implemented by subclasses to provide the mechanism for fetching the required Quantum Processing Unit (QPU) tokens, if they are required by the solver implementation. The tokens may either be sourced from a TokenProvider object or result in a None if unavailable.

Returns:

  • TokenProvider | None:

    An object implementing the TokenProvider interface if tokens are available/needed, otherwise None.

device_provider() -> str

Return the device provider identifier.

IBM

Bases: IBMBase

Qiskit Simulator backend.

Use a simulator as backend. The QAOA is executed completely on our server, and no IBM token is required.

Attributes:

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

Statevector

Bases: BaseModel

Ideal state vector simulator.

A dense statevector simulation that can sample measurement outcomes from ideal circuits with all measurements at end of the circuit. For noisy simulations each shot samples a randomly sampled noisy circuit from the noise model.

DensityMatrix

Bases: BaseModel

Density matrix simulator.

A dense density matrix simulation that may sample measurement outcomes from noisy circuits with all measurements at end of the circuit.

Stabilizer

Bases: BaseModel

Stabilizer state simulator for Clifford circuits.

An efficient Clifford stabilizer state simulator that can simulate noisy Clifford circuits if all errors in the noise model are also Clifford errors.

ExtendedStabilizer

Bases: BaseModel

Extended stabilizer simulator for approximating Clifford + T circuits.

An approximate simulator for Clifford + T circuits based on a state decomposition into ranked-stabilizer state. The number of terms grows with the number of non-Clifford (T) gates. The Extended Stabilizer method is made up of two parts. The first is a method of decomposing quantum circuits into stabilizer circuits, a special class of circuit that can be efficiently simulated classically. The second is then a way of combining these circuits to perform measurements.

Attributes:

  • sampling_method (Literal['metropolis', 'resampled_metropolis', 'norm_estimation']) –

    The Markov Chain sampling method. Default: "resampled_metropolis".

  • metropolis_mixing_time (Annotated[PositiveInt, Field(le=5000)]) –

    Set how long the monte-carlo method runs before performing measurements. If the output distribution is strongly peaked, this can be decreased. Default: 5000.

MatrixProductState

Bases: BaseModel

Matrix Product State simulator.

A tensor-network statevector simulator that uses a Matrix Product State (MPS) representation for the state. This can be done either with or without truncation of the MPS bond dimensions depending on the simulator options. The default behaviour is no truncation.

Attributes:

  • max_bond_dimension (Annotated[PositiveInt, Field(le=100)] | None) –

    Sets a limit on the number of Schmidt coefficients retained at the end of the svd algorithm. Coefficients beyond this limit will be discarded. Default: None, i.e., no limit on the bond dimension.

  • truncation_threshold (PositiveFloat) –

    Discard the smallest coefficients for which the sum of their squares is smaller than this threshold. Default: 1e-16.

Aqarios

Bases: IBackend

Configuration class for the Aqarios backend.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

Aqarios GPU

Bases: IBackend

Configuration class for the Aqarios GPU backend.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

Cudaq CPU

Bases: BaseCudaqBackend

CUDA-Q CPU Simulator.

Use a NVIDIA CUDA-Q CPU simulator for circuit execution on Aqarios servers.

You have the choice between the statevector simulator "qpp-cpu" and the density matrix based simulator "density-matrix-cpu".

For more information on the simulators pelase refer to the CUDA-Q documentation.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

Cudaq GPU

Bases: BaseCudaqBackend

CUDA-Q GPU Simulator.

Use a NVIDIA CUDA-Q GPU simulator for circuit execution on Aqarios servers.

You have the choice between the statevector simulator "nvidia", and two tensor network based simulators "tensornet" and "tensornet-mps". The floating point precision can be increased by setting option to "fp64".

For more information on the simulators pelase refer to the CUDA-Q documentation.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

Classical Backends

Classical algorithm backends.

DWave

Bases: IBackend

Configuration class for the DWave backend.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.

ZIB

Bases: IBackend

Configuration class for the ZIB backend.

provider: str property

Retrieve the name of the provider.

Returns:

  • str

    The name of the provider.