Case Study: Measurement Error Mitigation on a Noisy Processor

Executive Summary

Your circuit is correct. Your gates are calibrated. Your results are still wrong — because the readout is wrong. On real superconducting hardware, a qubit prepared in $|1\rangle$ is reported as $0$ a few percent of the time, and the error is asymmetric: $|1\rangle\to0$ is more common than $|0\rangle\to1$, because excited states decay during the microsecond-scale readout window while ground states do not.

This case study builds the standard fix. You will measure the device's confusion matrix, invert it to recover the true distribution from the observed one, and then discover the two ways this technique fails — negative probabilities and exponential scaling — along with what practitioners do instead.

Skills applied

  • Reading measurement as a probabilistic channel on top of the Born rule (§4.4).
  • Building and interpreting a confusion (assignment) matrix.
  • Recovering true distributions by matrix inversion, and its failure modes.
  • Distinguishing readout error from gate error diagnostically.

Background

The symptom

You run a two-qubit Bell circuit — $H$ on qubit 0, CNOT(0→1) — and expect only $00$ and $11$. Over 8,192 shots you observe:

Outcome Counts Expected (ideal)
00 3,918 4,096
01 241 0
10 337 0
11 3,696 0 → 4,096

About 7% of shots land in states the circuit cannot produce. The question is whether the entanglement is broken or the readout is lying.

The model

Readout is a classical noisy channel applied after the quantum measurement. For one qubit it is fully described by two numbers:

$$\epsilon_0 = P(\text{report }1 \mid \text{true }0), \qquad \epsilon_1 = P(\text{report }0 \mid \text{true }1)$$

giving the single-qubit assignment matrix

$$A = \begin{pmatrix} 1-\epsilon_0 & \epsilon_1 \\ \epsilon_0 & 1-\epsilon_1 \end{pmatrix}$$

where $\vec{p}_{\text{observed}} = A\,\vec{p}_{\text{true}}$.

Phase 1: Calibrate the channel

The beauty of readout error is that it can be characterized with circuits containing no gates at all — just prepare each basis state and measure it.

from qiskit import QuantumCircuit

def calibration_circuits(n):
    circuits = []
    for i in range(2**n):
        qc = QuantumCircuit(n, n)
        bits = format(i, f'0{n}b')
        for q, b in enumerate(reversed(bits)):
            if b == '1':
                qc.x(q)
        qc.measure(range(n), range(n))
        circuits.append(qc)
    return circuits

Running the four two-qubit calibration circuits at 8,192 shots each yields the assignment matrix (columns = prepared state, rows = observed):

$$A = \begin{pmatrix} 0.958 & 0.031 & 0.036 & 0.001 \\ 0.021 & 0.945 & 0.001 & 0.033 \\ 0.020 & 0.001 & 0.947 & 0.029 \\ 0.001 & 0.023 & 0.016 & 0.937 \end{pmatrix}$$

Read the diagonal: preparing 00 and reading 00 succeeds 95.8% of the time; 11 succeeds 93.7%. Per-qubit readout fidelity is roughly 97–98%, and two qubits compound it.

Finding 1. Roughly 6% of the anomalous counts are explained by readout alone, before considering the circuit at all.

Phase 2: Confirm the asymmetry

Extract single-qubit rates from the calibration data: $\epsilon_0 \approx 0.021$ (reading 1 when the truth is 0) versus $\epsilon_1 \approx 0.032$ (reading 0 when the truth is 1).

The asymmetry is physical, not statistical. During a ~1 μs readout pulse, a qubit in $|1\rangle$ can decay to $|0\rangle$ via $T_1$ relaxation, and with $T_1 = 90\,\mu s$ the decay probability is $1 - e^{-1/90} \approx 1.1\%$ — accounting for most of the gap between $\epsilon_0$ and $\epsilon_1$.

Finding 2. The error is a $T_1$ signature. This matters because it tells you the fix is hardware (faster readout, better discrimination) rather than calibration.

Phase 3: Invert

If $\vec{p}_{\text{obs}} = A \vec{p}_{\text{true}}$, then $\vec{p}_{\text{true}} = A^{-1}\vec{p}_{\text{obs}}$.

import numpy as np

observed = np.array([3918, 241, 337, 3696]) / 8192
corrected = np.linalg.inv(A) @ observed
print(np.round(corrected, 4))

The corrected distribution comes out at approximately

Outcome Observed Corrected
00 0.478 0.497
01 0.029 0.004
10 0.041 0.008
11 0.451 0.491

The forbidden outcomes drop from 7.0% to 1.2%, and 00/11 return to nearly 50/50.

Finding 3. The Bell state is fine. Roughly 85% of the anomaly was readout; the residual ~1.2% is genuine circuit infidelity from the CNOT and decoherence.

Phase 4: Where inversion breaks

Two failure modes, both of which you will meet on real hardware.

Negative probabilities. $A^{-1}$ is not a stochastic matrix, so nothing constrains the output to be a valid distribution. With low counts or high noise, corrected entries routinely come out negative — which is meaningless. The standard remedy is constrained least squares: find the valid probability vector $\vec{p}$ minimizing $\|A\vec{p} - \vec{p}_{\text{obs}}\|^2$ subject to $p_i \ge 0$, $\sum p_i = 1$.

from scipy.optimize import minimize

def mitigate(A, observed):
    n = len(observed)
    obj = lambda p: np.sum((A @ p - observed)**2)
    cons = [{'type': 'eq', 'fun': lambda p: np.sum(p) - 1}]
    bounds = [(0, 1)] * n
    res = minimize(obj, x0=observed, bounds=bounds, constraints=cons)
    return res.x

Exponential cost. The full assignment matrix for $n$ qubits is $2^n \times 2^n$ and requires $2^n$ calibration circuits. At 20 qubits that is a million circuits — impossible. Practical mitigation therefore assumes readout errors are uncorrelated between qubits and builds $A$ as a tensor product of $2\times2$ matrices, needing only $2n$ calibration circuits. The assumption is approximately true and measurably false on devices with readout crosstalk.

Phase 5: Reporting honestly

Mitigation is not error correction. It does not make the device more accurate; it makes your estimate of the ideal distribution less biased, at the cost of increased variance. Two rules follow:

  1. Always report both raw and mitigated results, plus the mitigation method. A mitigated number without its raw counterpart is uninterpretable.
  2. Mitigation cannot rescue a broken circuit. If the corrected distribution still shows large forbidden populations, the problem is gates or coherence, not readout — which is exactly the diagnostic value of doing this analysis.

Discussion Questions

  1. Why can readout error be characterized with gate-free circuits, and why is that methodologically valuable?
  2. Inversion returned a negative probability for one outcome in a colleague's run. What does that tell you about their shot count, and what should they do?
  3. The tensor-product assumption reduces $2^n$ circuits to $2n$. Design an experiment that would detect a violation of it.
  4. Mitigation reduces bias and increases variance. When is that trade a bad deal?

Your Turn: Extensions

  • Build the calibration circuits, assemble $A$, and mitigate a GHZ state on 3 qubits using both inversion and constrained least squares; compare.
  • Simulate readout error with a Qiskit NoiseModel at known $\epsilon_0, \epsilon_1$ and verify that mitigation recovers the injected values.
  • Estimate how the variance of a mitigated expectation value grows with the condition number of $A$.

Key Takeaways

  • Readout error is a classical channel stacked on top of the Born rule and is characterized with no gates at all.
  • The $|1\rangle\to0$ asymmetry is a $T_1$ fingerprint — measurement takes time, and excited states decay during it.
  • Inverting the assignment matrix recovers the true distribution but can produce invalid probabilities; constrained least squares is the robust version.
  • Full mitigation costs $2^n$ calibration circuits; practical methods assume uncorrelated readout and cost $2n$.
  • Mitigation is a statistical correction, not error correction. Always publish the raw counts alongside.