BaseEstimatorV2
class qiskit.primitives.BaseEstimatorV2
Bases: ABC
Base class for EstimatorV2
implementations.
An estimator calculates expectation values for provided quantum circuit and observable combinations. Implementations of this BaseEstimatorV2
interface must define their own run()
method, which is designed to take the following inputs:
pubs: list of pubs (Primitive Unified Blocs). An estimator pub is a list
or tuple of two to four elements that define the unit of work for the estimator. These are:
A single
QuantumCircuit
, possibly parametrized,whose final state we define as .
One or more observables (specified as any
ObservablesArrayLike
, including
Pauli
,SparsePauliOp
,str
) that specify which expectation values to estimate, denoted .A collection parameter value sets to bind the circuit against,
Optionally, the estimation precision.
precision: the estimation precision. This specification is optional and will be overriden by
the pub-wise shots if provided.
All estimator implementations must implement default value for the precision
in the run()
method. This default value will be used any time precision=None
is specified, which can take place in the run()
kwargs or at the pub level.
Methods
run
abstract run(pubs, *, precision=None)
Estimate expectation values for each provided pub (Primitive Unified Bloc).
Parameters
- pubs (Iterable[EstimatorPubLike]) – An iterable of pub-like objects, such as tuples
(circuit, observables)
or(circuit, observables, parameter_values)
. - precision (float | None) – The target precision for expectation value estimates of each run Estimator Pub that does not specify its own precision. If None the estimator’s default precision value will be used.
Returns
A job object that contains results.
Return type