59 lines
2.1 KiB
Plaintext
59 lines
2.1 KiB
Plaintext
---
|
||
title: AerPauliExpectation (v0.31)
|
||
description: API reference for qiskit.aqua.operators.expectations.AerPauliExpectation in qiskit v0.31
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.aqua.operators.expectations.AerPauliExpectation
|
||
---
|
||
|
||
# AerPauliExpectation
|
||
|
||
<Class id="qiskit.aqua.operators.expectations.AerPauliExpectation" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/operators/expectations/aer_pauli_expectation.py" signature="AerPauliExpectation" modifiers="class">
|
||
Bases: `qiskit.aqua.operators.expectations.expectation_base.ExpectationBase`
|
||
|
||
An Expectation converter for using Aer’s operator snapshot to take expectations of quantum state circuits over Pauli observables.
|
||
|
||
## Methods
|
||
|
||
<span id="qiskit-aqua-operators-expectations-aerpauliexpectation-compute-variance" />
|
||
|
||
### compute\_variance
|
||
|
||
<Function id="qiskit.aqua.operators.expectations.AerPauliExpectation.compute_variance" signature="AerPauliExpectation.compute_variance(exp_op)">
|
||
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.
|
||
|
||
**Parameters**
|
||
|
||
**exp\_op** (`OperatorBase`) – The full expectation value Operator after sampling.
|
||
|
||
**Return type**
|
||
|
||
`Union`\[`list`, `float`]
|
||
|
||
**Returns**
|
||
|
||
The variances or lists thereof (if exp\_op contains ListOps) of the expectation value estimation, equal to 0.
|
||
</Function>
|
||
|
||
<span id="qiskit-aqua-operators-expectations-aerpauliexpectation-convert" />
|
||
|
||
### convert
|
||
|
||
<Function id="qiskit.aqua.operators.expectations.AerPauliExpectation.convert" signature="AerPauliExpectation.convert(operator)">
|
||
Accept an Operator and return a new Operator with the Pauli measurements replaced by AerSnapshot-based expectation circuits.
|
||
|
||
**Parameters**
|
||
|
||
**operator** (`OperatorBase`) – The operator to convert.
|
||
|
||
**Return type**
|
||
|
||
`OperatorBase`
|
||
|
||
**Returns**
|
||
|
||
The converted operator.
|
||
</Function>
|
||
</Class>
|
||
|