mimiqcircuits.operations.readouterr¶
Readout error model.
Classes
|
Represents a classical readout error applied immediately after a measurement. |
- class mimiqcircuits.operations.readouterr.ReadoutErr(p0, p1=None)[source]¶
Bases:
OperationRepresents a classical readout error applied immediately after a measurement.
The readout error is modeled by a 2×2 confusion matrix:
\[\begin{split}\begin{pmatrix} P(\text{report } 0 | \text{true } 0) & P(\text{report } 1 | \text{true } 0) = p_0 \\ P(\text{report } 0 | \text{true } 1) = p_1 & P(\text{report } 1 | \text{true } 1) \end{pmatrix}\end{split}\]Can be initialized either from the error probabilities
p0,p1or directly from a 2×2 confusion matrix. Accepts NumPy, SymPy, or SymEngine matrices.Examples
>>> from mimiqcircuits import * >>> ReadoutErr(0.02, 0.03) RErr(0.02,0.03)
>>> import numpy as np >>> ReadoutErr(np.array([[0.98, 0.02], ... [0.03, 0.97]])) RErr(0.02,0.03)
>>> c = Circuit() >>> c.push(ReadoutErr(0.01, 0.02),0) 1-bit circuit with 1 instruction: └── RErr(0.01, 0.02) @ c[0]
- evaluate(d={})[source]¶
Evaluate symbolic parameters numerically. Returns a new ReadoutErr instance with evaluated parameters.
- property opname¶
- property parnames¶