AerPauliExpectation#

class qiskit.opflow.expectations.AerPauliExpectation[source]#

Bases: ExpectationBase

An Expectation converter for using Aer's operator snapshot to take expectations of quantum state circuits over Pauli observables.

0.24.0 ভার্সন থেকে ডেপ্রিকেটেড: The class qiskit.opflow.expectations.aer_pauli_expectation.AerPauliExpectation is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit https://qisk.it/opflow_migration.

Methods

compute_variance(exp_op)[source]#

Compute the variance of the expectation estimator. Because Aer takes this expectation with matrix multiplication, the estimation is exact and the variance is always 0, but we need to return those values in a way which matches the Operator's structure.

প্যারামিটার:

exp_op (OperatorBase) -- The full expectation value Operator after sampling.

রিটার্নস:

The variances or lists thereof (if exp_op contains ListOps) of the expectation value estimation, equal to 0.

রিটার্ন টাইপ:

list | float

convert(operator)[source]#

Accept an Operator and return a new Operator with the Pauli measurements replaced by AerSnapshot-based expectation circuits.

প্যারামিটার:

operator (OperatorBase) -- The operator to convert. If it contains non-hermitian terms, the operator is decomposed into hermitian and anti-hermitian parts.

রিটার্নস:

The converted operator.

রিটার্ন টাইপ:

OperatorBase