MatrixExpectation#

class qiskit.opflow.expectations.MatrixExpectation[ソース]#

ベースクラス: ExpectationBase

An Expectation converter which converts Operator measurements to be matrix-based so they can be evaluated by matrix multiplication.

バージョン 0.24.0 で非推奨: The class qiskit.opflow.expectations.matrix_expectation.MatrixExpectation 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)[ソース]#

Compute the variance of the expectation estimator. Because this expectation works by 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.

戻り値:

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

戻り値の型:

list | float

convert(operator)[ソース]#

Accept an Operator and return a new Operator with the Pauli measurements replaced by Matrix based measurements.

パラメータ:

operator (OperatorBase) – The operator to convert.

戻り値:

The converted operator.

戻り値の型:

OperatorBase