qiskit-documentation/docs/api/qiskit/0.38/qiskit_aer.primitives.Estim...

83 lines
2.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Estimator
description: API reference for qiskit_aer.primitives.Estimator
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit_aer.primitives.Estimator
---
# Estimator
<Class id="qiskit_aer.primitives.Estimator" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-aer/tree/stable/0.11/qiskit_aer/primitives/estimator.py" signature="Estimator(circuits: Iterable[QuantumCircuit] | QuantumCircuit, observables: Iterable[SparsePauliOp] | SparsePauliOp, *args, parameters: Iterable[Iterable[Parameter]] | None = None, **kwargs)" modifiers="class">
Bases: [`qiskit.primitives.base_estimator.BaseEstimator`](qiskit.primitives.BaseEstimator "qiskit.primitives.base_estimator.BaseEstimator")
Aer implmentation of Estimator.
**Run Options**
* **shots** (None or int) The number of shots. If None and approximation is True, it calculates the exact expectation values. Otherwise, it calculates expectation values with sampling.
* **seed** (int) Set a fixed seed for the sampling.
<Admonition title="Note" type="note">
Precedence of seeding for `seed_simulator` is as follows:
1. `seed_simulator` in runtime (i.e. in `__call__()`)
2. `seed` in runtime (i.e. in `__call__()`)
3. `seed_simulator` of `backend_options`.
4. default.
`seed` is also used for sampling from a normal distribution when approximation is True.
</Admonition>
**Parameters**
* **circuits** Quantum circuits that represent quantum states.
* **observables** Observables.
* **parameters** Parameters of quantum circuits, specifying the order in which values will be bound. Defaults to `[circ.parameters for circ in circuits]` The indexing is such that `parameters[i, j]` is the j-th formal parameter of `circuits[i]`.
* **backend\_options** Options passed to AerSimulator.
* **transpile\_options** Options passed to transpile.
* **approximation** If True, it calculates expectation values with normal distribution approximation.
* **skip\_transpilation** If True, transpilation is skipped.
## Methods
### close
<Function id="qiskit_aer.primitives.Estimator.close" signature="Estimator.close()">
Close the session and free resources
</Function>
## Attributes
### circuits
<Attribute id="qiskit_aer.primitives.Estimator.circuits">
Quantum circuits that represents quantum states.
**Returns**
The quantum circuits.
</Attribute>
### observables
<Attribute id="qiskit_aer.primitives.Estimator.observables">
Observables to be estimated.
**Returns**
The observables.
</Attribute>
### parameters
<Attribute id="qiskit_aer.primitives.Estimator.parameters">
Parameters of the quantum circuits.
**Returns**
Parameters, where `parameters[i][j]` is the j-th parameter of the i-th circuit.
</Attribute>
</Class>