About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
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.