---
title: BaseEstimatorV1 (latest version)
description: API reference for qiskit.primitives.BaseEstimatorV1 in the latest version of qiskit
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.primitives.BaseEstimatorV1
---

# BaseEstimatorV1

*class* `qiskit.primitives.BaseEstimatorV1(*, options=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/base/base_estimator.py#L96-L247)

Bases: `BasePrimitiveV1`, [`Generic`](https://docs.python.org/3/library/typing.html#typing.Generic)\[`T`]

Base class for `EstimatorV1` implementations.

Note that the reference estimator in Qiskit follows the `EstimatorV2` interface specifications instead.

An estimator calculates expectation values for provided quantum circuit and observable combinations.

Implementations of [`BaseEstimatorV1`](#qiskit.primitives.BaseEstimatorV1 "qiskit.primitives.BaseEstimatorV1") should define their own `BaseEstimatorV1._run()` method that will be called by the public-facing [`qiskit.primitives.BaseEstimatorV1.run()`](#qiskit.primitives.BaseEstimatorV1.run "qiskit.primitives.BaseEstimatorV1.run"), which takes the following inputs:

- quantum circuits ($\psi_i(\theta)$): list of (parameterized) quantum circuits (a list of [`QuantumCircuit`](/docs/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") objects).
- observables ($H_j$): a list of [`SparsePauliOp`](/docs/api/qiskit/qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") objects.
- parameter values ($\theta_k$): list of sets of values to be bound to the parameters of the quantum circuits (list of list of float).

The method returns a [`JobV1`](/docs/api/qiskit/qiskit.providers.JobV1 "qiskit.providers.JobV1") object. Calling [`qiskit.providers.JobV1.result()`](/docs/api/qiskit/qiskit.providers.JobV1#result "qiskit.providers.JobV1.result") yields a list of expectation values plus optional metadata like confidence intervals for the estimation.

$$
\langle\psi_i(\theta_k)|H_j|\psi_i(\theta_k)\rangle
$$

Here is an example of how a [`BaseEstimatorV1`](#qiskit.primitives.BaseEstimatorV1 "qiskit.primitives.BaseEstimatorV1") would be used:

```python
# This is a fictional import path.
# There are currently no EstimatorV1 implementations in Qiskit.
from estimator_v1_location import EstimatorV1
from qiskit.circuit.library import RealAmplitudes
from qiskit.quantum_info import SparsePauliOp

psi1 = RealAmplitudes(num_qubits=2, reps=2)
psi2 = RealAmplitudes(num_qubits=2, reps=3)

H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
H2 = SparsePauliOp.from_list([("IZ", 1)])
H3 = SparsePauliOp.from_list([("ZI", 1), ("ZZ", 1)])

theta1 = [0, 1, 1, 2, 3, 5]
theta2 = [0, 1, 1, 2, 3, 5, 8, 13]
theta3 = [1, 2, 3, 4, 5, 6]

estimator = EstimatorV1()

# calculate [ <psi1(theta1)|H1|psi1(theta1)> ]
job = estimator.run([psi1], [H1], [theta1])
job_result = job.result() # It will block until the job finishes.
print(f"The primitive-job finished with result {job_result}")

# calculate [ <psi1(theta1)|H1|psi1(theta1)>,
#             <psi2(theta2)|H2|psi2(theta2)>,
#             <psi1(theta3)|H3|psi1(theta3)> ]
job2 = estimator.run([psi1, psi2, psi1], [H1, H2, H3], [theta1, theta2, theta3])
job_result = job2.result()
print(f"The primitive-job finished with result {job_result}")
```

Initialize `EstimatorV1`.

**Parameters**

**options** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict) *| None*) – Default options.

## Attributes

### options

Return options values for the estimator.

**Returns**

options

## Methods

### run

`run(circuits, observables, parameter_values=None, **run_options)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/base/base_estimator.py#L180-L237)

Run the job of the estimation of expectation value(s).

`circuits`, `observables`, and `parameter_values` should have the same length. The i-th element of the result is the expectation of observable

```python
obs = observables[i]
```

for the state prepared by

```python
circ = circuits[i]
```

with bound parameters

```python
values = parameter_values[i]
```

**Parameters**

- **circuits** ([*Sequence*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)*\[*[*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")*] |* [*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – one or more circuit objects.
- **observables** ([*Sequence*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)*\[BaseOperator |* [*str*](https://docs.python.org/3/library/stdtypes.html#str)*] | BaseOperator |* [*str*](https://docs.python.org/3/library/stdtypes.html#str)) – one or more observable objects. Several formats are allowed; importantly, `str` should follow the string representation format for [`Pauli`](/docs/api/qiskit/qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") objects.
- **parameter\_values** ([*Sequence*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)*\[*[*Sequence*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)*\[*[*float*](https://docs.python.org/3/library/functions.html#float)*]] |* [*Sequence*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)*\[*[*float*](https://docs.python.org/3/library/functions.html#float)*] |* [*float*](https://docs.python.org/3/library/functions.html#float) *| None*) – concrete parameters to be bound.
- **run\_options** – runtime options used for circuit execution.

**Returns**

The job object of EstimatorResult.

**Raises**

- [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError) – Invalid argument type given.
- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – Invalid argument values given.

**Return type**

*T*

### set\_options

`set_options(**fields)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/primitives/base/base_primitive_v1.py#L39-L45)

Set options values for the estimator.

**Parameters**

**\*\*fields** – The fields to update the options
