qiskit.opflow.expectations.PauliExpectation¶

class
PauliExpectation
(group_paulis=True)[소스]¶ An Expectation converter for Paulibasis observables by changing Pauli measurements to a diagonal ({Z, I}^n) basis and appending circuit postrotations to the measured state function. Optionally groups the Paulis with the same postrotations (those that commute with one another, or form Abelian groups) into single measurements to reduce circuit execution overhead.
 매개변수
group_paulis (
bool
) – Whether to group the Pauli measurements into commuting sums, which all have the same diagonalizing circuit.

__init__
(group_paulis=True)[소스]¶  매개변수
group_paulis (
bool
) – Whether to group the Pauli measurements into commuting sums, which all have the same diagonalizing circuit.
Methods
__init__
([group_paulis]) type group_paulis
bool
compute_variance
(exp_op)Compute the variance of the expectation estimator.
convert
(operator)Accepts an Operator and returns a new Operator with the Pauli measurements replaced by diagonal Pauli postrotation based measurements so they can be evaluated by sampling and averaging.

compute_variance
(exp_op)[소스]¶ Compute the variance of the expectation estimator.
 매개변수
exp_op (
OperatorBase
) – The full expectation value Operator after sampling. 반환 형식
Union
[list
,float
,ndarray
] 반환값
The variances or lists thereof (if exp_op contains ListOps) of the expectation value estimation.

convert
(operator)[소스]¶ Accepts an Operator and returns a new Operator with the Pauli measurements replaced by diagonal Pauli postrotation based measurements so they can be evaluated by sampling and averaging.
 매개변수
operator (
OperatorBase
) – The operator to convert. 반환 형식
OperatorBase
 반환값
The converted operator.