About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
PauliExpectation
class PauliExpectation(group_paulis=True)
Bases: qiskit.opflow.expectations.expectation_base.ExpectationBase
An Expectation converter for Pauli-basis observables by changing Pauli measurements to a diagonal ({Z, I}^n) basis and appending circuit post-rotations to the measured state function. Optionally groups the Paulis with the same post-rotations (those that commute with one another, or form Abelian groups) into single measurements to reduce circuit execution overhead.
Parameters
group_paulis (bool
) – Whether to group the Pauli measurements into commuting sums, which all have the same diagonalizing circuit.
Methods Defined Here
compute_variance
PauliExpectation.compute_variance(exp_op)
Compute the variance of the expectation estimator.
Parameters
exp_op (OperatorBase
) – The full expectation value Operator after sampling.
Return type
Union
[list
, float
, ndarray
]
Returns
The variances or lists thereof (if exp_op contains ListOps) of the expectation value estimation.
convert
PauliExpectation.convert(operator)
Accepts an Operator and returns a new Operator with the Pauli measurements replaced by diagonal Pauli post-rotation based measurements so they can be evaluated by sampling and averaging.
Parameters
operator (OperatorBase
) – The operator to convert.
Return type
Returns
The converted operator.
Was this page helpful?
Report a bug or request content on GitHub.