EstimatorSingleLayer#
- class iqm.qaoa.backends.EstimatorSingleLayer[source]#
Bases:
EstimatorBackend
The estimator class for calculating the expectation value analytically (for \(p=1\) QAOA).
Methods
estimate
(qaoa_object)Calculates the expectation value of the Hamiltonian for \(p=1\) QAOA.
- estimate(qaoa_object)[source]#
Calculates the expectation value of the Hamiltonian for \(p=1\) QAOA.
The function calculates the energy (exp. val. of the Hamiltonian) by adding the expectation values of its individual terms expressed through equation (12) in [2]. The calculation includes a constant term (coming from the translation of a QUBO problem to a Hamiltonian).