qiskit-documentation/docs/api/qiskit/0.29/qiskit.ignis.verification.e...

38 lines
1.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: expectation_counts (v0.29)
description: API reference for qiskit.ignis.verification.expectation_counts in qiskit v0.29
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.ignis.verification.expectation_counts
---
<span id="qiskit-ignis-verification-expectation-counts" />
# qiskit.ignis.verification.expectation\_counts
<Function id="qiskit.ignis.verification.expectation_counts" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/verification/tomography/data.py" signature="expectation_counts(counts)">
Converts count dict to an expectation counts dict.
The returned dictionary is also a counts dictionary but the keys correspond to the which subsystems the operators are acting on and the counts are the un-normalized expectation values. The counts can be converted to expectation values by dividing by the value of the all 0s entry. The 0s key is the expectation value of the identity operator, and its value is equal to the number of shots.
**Parameters**
**counts** (`Dict`\[`str`, `int`]) a counts dictionary.
**Return type**
`Dict`\[`str`, `int`]
**Returns**
A new counts dictionary where the counts are un-normalized expectation values for the subsystem measurement operators.
Consider a input counts dictionary for s shots of measurement of the two-qubit operator XZ (X on qubit-1, Z on qubit-0). The dictionary returned will have keys corresponding to:
> * `00`: $s * <II>$,
> * `01`: $s * <IZ>$,
> * `10`: $s * <XI>$,
> * `11`: $s * <XZ>$
</Function>