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.eval_observables
eval_observables(quantum_instance, quantum_state, observables, expectation, threshold=1e-12)
Pending deprecation: Accepts a list or a dictionary of operators and calculates their expectation values - means and standard deviations. 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.
This function has been superseded by the qiskit.algorithms.observables_evaluator.eval_observables()
function. It will be deprecated in a future release and subsequently removed after that.
Parameters
- quantum_instance (
Union
[QuantumInstance
,Backend
]) – A quantum instance used for calculations. - quantum_state (
Union
[Statevector
,QuantumCircuit
,OperatorBase
]) – An unparametrized quantum circuit representing a quantum state that expectation values are computed against. - observables (
Union
[List
[Optional
[OperatorBase
]],Dict
[str
,OperatorBase
]]) – A list or a dictionary of operators whose expectation values are to be calculated. - expectation (
ExpectationBase
) – An instance of ExpectationBase which defines a method for calculating expectation values. - threshold (
float
) – A threshold value that defines which mean values should be neglected (helpful for ignoring numerical instabilities close to 0).
Return type
Union
[List
[Optional
[Tuple
[complex
, complex
]]], Dict
[str
, Tuple
[complex
, complex
]]]
Returns
A list or a dictionary of tuples (mean, standard deviation).
Raises
ValueError – If a quantum_state
with free parameters is provided.
Was this page helpful?
Report a bug or request content on GitHub.