EstimatorQUIMB#

Module: iqm.qaoa.backends

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

Bases: EstimatorBackend

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

Attributes

CRIT_DEG

Methods

estimate

Calculates the expectation value of the Hamiltonian by contracting the RCC tensor networks in quimb.

estimate_correlations_z

The method for estimating the exp.

estimate(qaoa_object)[source]#

Calculates the expectation value of the Hamiltonian by contracting the RCC tensor networks in quimb.

Uses quimb_tn() to build a Circuit. This object represents the QAOA circuit, so it can be used to calculate expectation values (using the function local_expectation()). The local expectation values are added to get the expectation value of the full Hamiltonian. The calculation includes a constant term (coming from the translation of a QUBO problem to a Hamiltonian).

Parameters:

qaoa_object (QUBOQAOA) – The instance of QUBOQAOA whose expectation value is to be calculated.

Returns:

The expectation value of the energy of the QAOA state using angles.

Return type:

float

estimate_correlations_z(qaoa_object, target_qubits)[source]#

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

The correlations are calculated natively for QUIMB, as a contraction of tensor networks, very similarly to how the expectation value of the Hamiltonian is estimated in estimate().

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, or a list thereof.

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.EstimatorQUIMB