43 lines
2.9 KiB
Plaintext
43 lines
2.9 KiB
Plaintext
---
|
||
title: eval_observables
|
||
description: API reference for qiskit.algorithms.eval_observables
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: function
|
||
python_api_name: qiskit.algorithms.eval_observables
|
||
---
|
||
|
||
<span id="qiskit-algorithms-eval-observables" />
|
||
|
||
# qiskit.algorithms.eval\_observables
|
||
|
||
<Function id="qiskit.algorithms.eval_observables" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.24/qiskit/algorithms/aux_ops_evaluator.py" signature="eval_observables(quantum_instance, quantum_state, observables, expectation, threshold=1e-12)">
|
||
Deprecated: 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.
|
||
|
||
<Admonition title="Deprecated since version 0.24.0" type="danger">
|
||
The function `qiskit.algorithms.aux_ops_evaluator.eval_observables()` is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. Instead, use the function `qiskit.algorithms.observables_evaluator.estimate_observables`. See [https://qisk.it/algo\_migration](https://qisk.it/algo_migration) for a migration guide.
|
||
</Admonition>
|
||
|
||
**Parameters**
|
||
|
||
* **quantum\_instance** ([*QuantumInstance*](qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") *|*[*Backend*](qiskit.providers.Backend "qiskit.providers.Backend")) – A quantum instance used for calculations.
|
||
* **quantum\_state** ([*Statevector*](qiskit.quantum_info.Statevector "qiskit.quantum_info.Statevector") *|*[*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") *|*[*OperatorBase*](qiskit.opflow.OperatorBase "qiskit.opflow.OperatorBase")) – An unparametrized quantum circuit representing a quantum state that expectation values are computed against.
|
||
* **observables** (*ListOrDict\[*[*OperatorBase*](qiskit.opflow.OperatorBase "qiskit.opflow.OperatorBase")*]*) – A list or a dictionary of operators whose expectation values are to be calculated.
|
||
* **expectation** ([*ExpectationBase*](qiskit.opflow.expectations.ExpectationBase "qiskit.opflow.expectations.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).
|
||
|
||
**Returns**
|
||
|
||
A list or a dictionary of tuples (mean, standard deviation).
|
||
|
||
**Raises**
|
||
|
||
**ValueError** – If a `quantum_state` with free parameters is provided.
|
||
|
||
**Return type**
|
||
|
||
ListOrDict\[tuple\[complex, complex]]
|
||
</Function>
|
||
|