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()andsample()methods use@singledispatchmethodto 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
EstimatorBackendorSamplerBackendand implementing the required methods.
Classes
The template class for estimator backends, i.e., those calculating the expected value of the Hamiltonian. |
|
The estimator class for calculating the expectation value using counts obtained from a sampler. |
|
The estimator class for calculating the expectation value using the tensor network package |
|
Analytical estimator for \(p=1\) QAOA using the closed-form expressions from [2]. |
|
Exact estimator using Qiskit statevector simulation. |
|
The template for sampler backends, i.e., those returning samples from the QAOA. |
|
A sampler that ignores the QAOA and just produces random bitstrings of the correct length. |
|
A sampler that runs the circuit on IQM Resonance and returns the result. |
|
A sampler that simulates the QAOA circuit in |
Inheritance
