EstimatorBackend#

Module: iqm.qaoa.backends

class iqm.qaoa.backends.EstimatorBackend[source]#

Bases: ABC

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

Methods

estimate

The abstract method for estimate() of backends subclassed from EstimatorBackend.

estimate_correlations_z

The abstract method for estimating the exp.

abstract estimate(qaoa_object)[source]#

The abstract method for estimate() of backends subclassed from EstimatorBackend.

The input qaoa_object includes the training parameters (angles), which are typically used in estimation of the energy.

Parameters:

qaoa_object (QUBOQAOA) – The QAOA object whose energy is to be estimated.

Returns:

The estimated expected value of the Hamiltonian with the quantum state implied by the QAOA object.

Return type:

float

abstract estimate_correlations_z(qaoa_object, target_qubits)[source]#

The abstract method for estimating the exp. value of products of Z operators on target_qubits.

The input qaoa_object includes the training parameters (angles), which are used in estimation of the correlations. Some estimators (subclasses of EstimatorBackend) may only be able to estimate the expectation values of at most quadratic products of Z’s.

Parameters:
  • qaoa_object (QUBOQAOA) – The QAOA object whose correlations are to be estimated.

  • target_qubits (set[LogQubit] | list[set[LogQubit]]) – The set of qubits on which the operators act. For example if one is interested in \(\langle Z_1 Z_4 Z_5 \rangle\), then target_qubits == {1, 4, 5}. If one is interested in multiple different correlations, they may set target_qubits as a list of sets and get out a list of correlations. This is likely to be more efficient than repeatedly calling estimate_correlations_z() with each one set of qubits at a time.

Returns:

The estimated expected value of product of Z operators on given target_qubits. Or a list of those, if target_qubits was given as a list.

Return type:

float | list[float]

Inheritance

Inheritance diagram of iqm.qaoa.backends.EstimatorBackend