---
title: AerPauliExpectation (v0.46)
description: API reference for qiskit.opflow.expectations.AerPauliExpectation in qiskit v0.46
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/0.46/qiskit.opflow.expectations.AerPauliExpectation
---

# AerPauliExpectation

*class* `qiskit.opflow.expectations.AerPauliExpectation`

[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/opflow/expectations/aer_pauli_expectation.py)

Bases: [`ExpectationBase`](/docs/api/qiskit/0.46/qiskit.opflow.expectations.ExpectationBase "qiskit.opflow.expectations.expectation_base.ExpectationBase")

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

> **Deprecated since version 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 in the Qiskit 1.0 release. For code migration guidelines, visit [https://qisk.it/opflow\_migration](https://qisk.it/opflow_migration).

## Methods

### compute\_variance

`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*](/docs/api/qiskit/0.46/qiskit.opflow.OperatorBase "qiskit.opflow.operator_base.OperatorBase")) – The full expectation value Operator after sampling.

**Returns**

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

**Return type**

[list](https://docs.python.org/3/library/stdtypes.html#list) | [float](https://docs.python.org/3/library/functions.html#float)

### convert

`convert(operator)`

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

**Parameters**

**operator** ([*OperatorBase*](/docs/api/qiskit/0.46/qiskit.opflow.OperatorBase "qiskit.opflow.operator_base.OperatorBase")) – The operator to convert. If it contains non-hermitian terms, the operator is decomposed into hermitian and anti-hermitian parts.

**Returns**

The converted operator.

**Return type**

[*OperatorBase*](/docs/api/qiskit/0.46/qiskit.opflow.OperatorBase "qiskit.opflow.operator_base.OperatorBase")
