EstimatorStateVector#

Module: iqm.qaoa.backends

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

Bases: EstimatorBackend

The estimator class for calculating the expectation value using statevector simulation.

Methods

estimate

Calculates the expectation value of the Hamiltonian from running state-vector simulation in qiskit.

estimate_correlations_z

The method for estimating the exp.

estimate(qaoa_object)[source]#

Calculates the expectation value of the Hamiltonian from running state-vector simulation in qiskit.

Builds a QuantumCircuit for the QAOA and runs the statevector simulation of the circuit, calculating the expectation value of the energy from the statevector. 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.

Using statevector simulator, calculating any expectation value exactly is relatively straightforward.

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