qiskit.algorithms.estimate_observables
estimate_observables(estimator, quantum_state, observables, parameter_values=None, threshold=1e-12)
Accepts a sequence of operators and calculates their expectation values - means and metadata. They are calculated with respect to a quantum state provided. A user can optionally provide a threshold value which filters mean values falling below the threshold.
Parameters
- estimator (BaseEstimator) – An estimator primitive used for calculations.
- quantum_state (QuantumCircuit) – A (parameterized) quantum circuit preparing a quantum state that expectation values are computed against.
- observables (ListOrDict[BaseOperator | PauliSumOp]) – A list or a dictionary of operators whose expectation values are to be calculated.
- parameter_values (Sequence[float] | None) – Optional list of parameters values to evaluate the quantum circuit on.
- threshold (float) – A threshold value that defines which mean values should be neglected (helpful for ignoring numerical instabilities close to 0).
Return type
ListOrDict[tuple[complex, dict[str, Any]]]
Returns
A list or a dictionary of tuples (mean, metadata).
Raises
AlgorithmError – If a primitive job is not successful.
Was this page helpful?
Report a bug or request content on GitHub.