backends

backends#

Full path: iqm.qaoa.backends

Backends for calculating expectation values and generating samples from QAOA instances.

The backends are divided into two main categories:

  • EstimatorBackends: Used for calculating expectation values of Hamiltonians and arbitrary ZZ…Z terms.

  • SamplerBackends: Used for generating samples.

Key Features:

  • Dispatcher Methods: The estimate() and sample() methods use @singledispatchmethod to dynamically route calls to the appropriate implementation based on the type of the input QAOA object (e.g., QUBOQAOA, HUBOQAOA).

  • Extensibility: New backends can be added by subclassing EstimatorBackend or SamplerBackend and implementing the required methods.

Classes

EstimatorBackend

The template class for estimator backends, i.e., those calculating the expected value of the Hamiltonian.

EstimatorFromSampler

The estimator class for calculating the expectation value using counts obtained from a sampler.

EstimatorQUIMB

The estimator class for calculating the expectation value using the tensor network package quimb.

EstimatorSingleLayer

Analytical estimator for \(p=1\) QAOA using the closed-form expressions from [2].

EstimatorStateVector

Exact estimator using Qiskit statevector simulation.

SamplerBackend

The template for sampler backends, i.e., those returning samples from the QAOA.

SamplerRandomBitstrings

A sampler that ignores the QAOA and just produces random bitstrings of the correct length.

SamplerResonance

A sampler that runs the circuit on IQM Resonance and returns the result.

SamplerSimulation

A sampler that simulates the QAOA circuit in qiskit.

Inheritance

Inheritance diagram of iqm.qaoa.backends