Measurement Error Mitigation
Measurement-error mitigation uses a calibrated detector response to estimate the probabilities or observables that an ideal terminal measurement would have produced. The key question is an inverse problem: which latent distributions could have generated the recorded outcomes, and how uncertain is the inferred answer?
This page develops response-matrix inversion, constrained fitting and observable-specific correction. It separates errors from finite sampling, uncertain calibration and an incorrect detector model. The correction estimates terminal statistics; it does not undo measurement backaction or repair an earlier feedforward operation.
Helpful background. SPAM errors explains when detector response can be separated from preparation and coherence effects. Error mitigation introduces bias, variance and sampling cost. Variance and covariance supplies uncertainty propagation.
The classical detector-response model
Section titled “The classical detector-response model”Let be the probability of ideal outcome , and let be the probability of reported outcome . The response model is
Reported outcomes label rows; ideal outcomes label columns. Thus , with each column normalized. All report types—including a resolved erasure or invalid classifier output—must be counted or deliberately merged. Silently discarding reports changes the probabilities being modeled.
For a computational-basis measurement, this relation holds for every input state precisely when its POVM effects have the form
Under that assumption, determines the diagonal POVM. It still does not determine the state after measurement. Basis calibration alone measures the diagonal matrix elements and cannot exclude off-diagonal effects. The more limited relation may also hold on a specified family of input states without determining the detector on all states. See measurement tomography and Maciejewski, Zimborás and Oszmaniec (2020).
Calibration also assumes sufficiently well-known input preparations. If commands prepare latent labels through a response , the measured command-to-report table is . Only trusted basis preparations, , make directly. A separately known full-row-rank can also identify ; otherwise the factorization may be ambiguous. More repeated commands cannot by themselves resolve this ambiguity.
A binary detector, step by step
Section titled “A binary detector, step by step”Write
Here is the probability of reporting one for ideal zero, and is the reverse error. Since ,
For the signed moment , let . Then
The offset matters when the errors are asymmetric. If , the two response columns coincide and all latent distributions give the same reports. If , the detector is more often reversed than correct, but remains algebraically invertible. Sensitivity grows as approaches zero.
For , and , the reports are . The raw signed mean is , while correction gives the intended . This corrects detector bias under the model; it does not subtract errors in the prepared state itself.
Identifiability and sensitivity
Section titled “Identifiability and sensitivity”Full-distribution recovery on the unrestricted probability simplex requires full column rank of . If , column stochasticity implies . Small positive and negative displacements along therefore produce different interior distributions with identical reports. Additional data can narrow sampling uncertainty without distinguishing them.
For square nonsingular , the linear estimate is . A tall full-column-rank response also has a left inverse and can recover the full distribution; it need not lose information just because it is rectangular. For deficient rank, a pseudoinverse chooses a projection, not the missing probabilities.
Singular values describe sensitivity. A perturbation along a left singular vector with singular value is amplified by in inversion. Small singular values can amplify science-shot fluctuations, calibration errors and model mismatch. A condition number is not a test of the model: even the identity is perfectly conditioned while being a completely wrong description of a particular detector.
Negative estimates can be ordinary sampling fluctuations
Section titled “Negative estimates can be ordinary sampling fluctuations”Consider the correctly known response
Every physical latent distribution gives . If empirical frequencies are , inversion yields . These are signed statistical estimates, not physical negative probabilities.
Crucially, empirical frequencies need not lie inside the forward image of the simplex. When the true , one has , yet with independent shots the probability of observing is about . With shots that lower-tail probability is about . A residual must be compared with its sampling distribution and calibration uncertainty before interpreting it as model failure.
For the response above, inversion gives . Binary constrained least squares and multinomial maximum likelihood clip that value into . The gray strip marks the possible mean reported probabilities; finite samples can fall outside it. The constrained estimate remains physical but generally acquires boundary bias.
Fitting a physical distribution
Section titled “Fitting a physical distribution”For a probability vector , constrained least squares minimizes a weighted forward residual. Multinomial maximum likelihood instead maximizes the likelihood of the counts:
where is the normalized nonnegative simplex and is a chosen positive weight matrix. A zero count contributes zero to the likelihood; a positive count at zero modeled probability makes the log likelihood .
For the preceding binary example, both methods choose and predict when the observed frequencies are . Their agreement is special to this one-parameter case; in larger problems the objectives can give different answers. Physical output alone does not prove that the response is correct. Constraints and regularization can reduce variance at the price of bias, especially near a boundary.
Iterative unfolding
Section titled “Iterative unfolding”Iterative Bayesian unfolding is a multiplicative update (D’Agostini, 1995; Nachman et al., 2020):
One way to understand it is to assign each reported count fractionally to possible latent labels using the current conditional probabilities , then add these assigned counts. Summing over proves normalization. The denominator must be positive wherever ; a zero-count, zero-prediction row contributes zero. Start with positive mass on every latent outcome that may be needed, because the update cannot revive a zero component.
This is also an expectation–maximization update for the fixed-response mixture likelihood. Exact updates do not decrease that likelihood, but a stopped iterate depends on its initialization and stopping rule. It is not automatically a posterior distribution over the unknown probabilities. Early stopping acts as regularization; choosing its stopping point from the final comparison data can bias the comparison.
For the binary example, starting from gives after one step and approximately after two. The sequence approaches the likelihood boundary. The remaining forward discrepancy still needs a statistical interpretation.
Estimate an observable without reconstructing every probability
Section titled “Estimate an observable without reconstructing every probability”For a diagonal target with values , the desired mean is . Find report-dependent weights satisfying
Then the average of the observed weights is unbiased under a known correct response:
The equation is solvable precisely when lies in the row space of . On the unrestricted simplex this is also the condition for the observable to be identifiable: an unobservable null direction must not change the target. For example, a detector that distinguishes label two from labels zero and one together identifies their total population, although it cannot distinguish zero from one.
For the asymmetric binary example and ,
Average for each reported zero and for each reported one. The weights need not lie in the observable’s physical range. Their fluctuations determine the sampling cost.
For independent reports and fixed weights,
With , the binary example gives variance approximately . When weights are nonunique, a minimum-Euclidean-norm choice need not minimize variance. A reference distribution can instead guide variance minimization, but weights fitted using science data require analysis of that extra dependence. For designed randomized expectation estimators, see van den Berg, Minev and Temme (2022).
Include calibration uncertainty
Section titled “Include calibration uncertainty”Each calibrated column is a multinomial estimate. With independent trusted preparations of , its covariance is
Fitting a response and then treating it as exactly known omits this uncertainty. Independent column calibrations give independent sampling errors only if they share no fluctuating nuisance parameters or records.
For the binary signed moment, local derivatives at the true parameters are
Use science shots and calibration shots for each column of the asymmetric detector. Propagating the three independent binomial variances gives the following rounded delta-method results:
| Contribution | Variance |
|---|---|
| Science sampling | |
| Detector calibration | |
| Sum |
The corresponding standard error is about . These are local approximations for a fitted inverse, not exact unbiased-ratio guarantees. They become unreliable near singular response matrices, low counts or active constraints. Joint likelihood, resampling of the complete calibration-and-science procedure, and coverage simulations are useful alternatives, with their own assumptions.
If two corrected values reuse calibration parameters , their leading shared covariance is , where is the correction’s sensitivity to . More science shots do not eliminate that shared component. Include cross terms as well if science and calibration acquisitions are dependent.
Drift causes a different error. If the live detector changes to at the same , it gives . The old correction reports , a bias of . That shift does not disappear with more science samples. Interleaved known probes, context-matched checks and time-resolved residuals can reveal it.
Multiqubit structure and randomized readout
Section titled “Multiqubit structure and randomized readout”An unrestricted -bit response has free parameters. A product model has only , but assumes each reported bit depends only on its own ideal bit and that reports are conditionally independent. That assumption needs joint tests.
For ideal , compare a pair-flip detector with independent flips of probability :
| Reports in order | Probability vector |
|---|---|
| Pair flips | |
| Independent flips |
The one-bit error rates agree, but the total-variation distance is and the pair-flip covariance is . Their parity responses differ strongly. Bravyi et al. (2021) develop product and correlated-response methods. Cluster models retain selected correlations; their omitted interactions remain an assumption. Matrix-free and observed-support approaches can reduce computation (Nation et al., 2021), but an unrestricted detector does not become identifiable from fewer calibration data merely because its inverse is never stored.
What bit-flip averaging removes
Section titled “What bit-flip averaging removes”Apply an ideal randomly chosen bit mask before readout and undo the mask in the report. For a fixed classical response, uniform averaging gives
It now depends only on the flip pattern . There are independent pattern probabilities, and an ideal zero-string calibration with the same randomized protocol can sample that pattern distribution. Resolving a general distribution still costs samples; correlations remain (Smith et al., 2021).
For one bit, the asymmetric example becomes
The offsets have been symmetrized. The inserted controls must work as modeled and must not change readout through unaccounted context dependence. Moreover, random masks alone do not generally eliminate off-diagonal POVM effects; the classical-response assumption still matters. Exercise 6 gives a counterexample. More elaborate randomized protocols can have different assumptions.
Erasures, feedforward and meaningful comparisons
Section titled “Erasures, feedforward and meaningful comparisons”A tall response can include erasure reports. For
the input gives reports . Discarding the third outcome leaves acceptance and conditional reports , not the original populations. Keep acceptance and rejected attempts when comparing precision and cost. Unmodeled latent leakage requires additional input sectors or bounds; extra reported rows alone do not characterize it.
For an earlier measurement inside a circuit, a wrong report may already have selected the wrong gate or conditional state. Relabeling the final stored bit cannot reverse that physical action. Measurement in circuits and quantum instruments explain the conditional maps needed by a causal correction protocol.
A useful comparison checks both the assumed response and the complete estimator. Test representative joint outcomes and coherent probes where needed; account for sampling when interpreting residuals; and compare corrected and raw results at equal total resources. Calibration reuse saves cost only while its response remains applicable. Choose model complexity, regularization and stopping with data separate from the final performance comparison. These steps distinguish a successful inference from an accidentally favorable estimate.
Exercises
Section titled “Exercises”1. Separate preparation and detector response
Section titled “1. Separate preparation and detector response”Use the asymmetric detector above, , and . Compare corrections using and the empirical command-to-report table .
Solution
One finds
The reports are . Inverting recovers ; inverting gives instead. The second inverse has included preparation error in the detector model. Directly identifying requires trusted matching basis preparations, or a separate argument establishing the relevant factorization.
2. Derive the binary inverse and its variance
Section titled “2. Derive the binary inverse and its variance”Find and the report weights for the signed observable. Recover the science-shot variance in the worked example.
Solution
For ,
Multiplication by the row gives the two weights. In the example they are and , so the variance is for . At , the columns coincide; no unbiased weighting recovers the signed moment on every input.
3. Explain a negative inverse without rejecting the model
Section titled “3. Explain a negative inverse without rejecting the model”For the symmetric response, observe seven zero reports in shots. Compute the inverse, constrained fit and first two unfolding iterates from a uniform start. Is this observation enough to reject the response?
Solution
The inverse is ; the constrained least-squares and likelihood estimates are . Unfolding gives and approximately . If the true , then
The downward fluctuation is common under a member of the assumed family. A negative inverse is therefore not, by itself, a statistically significant rejection. The uncertainty of calibration and any selection of which residual to inspect must also be considered.
4. Identify a target when the distribution is not identifiable
Section titled “4. Identify a target when the distribution is not identifiable”Let . Which of and can be recovered on every input distribution?
Solution
For , choose report weights ; then . For , the first two components of are always equal, so no solution exists. The latent distributions and have identical reports but opposite values. Additional reports do not remove this ambiguity.
5. Detect correlations invisible in marginal errors
Section titled “5. Detect correlations invisible in marginal errors”For the pair-flip and independent-flip distributions in the table, calculate total variation, connected flip covariance and parity expectation.
Solution
Total variation is half the sum of four absolute differences, giving . The pair model has and marginal means , so covariance is ; the independent model has covariance zero. For parity , the respective means are and . Matching one-bit error rates does not determine the correction of parity.
6. Test the scope of bit-flip averaging
Section titled “6. Test the scope of bit-flip averaging”First symmetrize the asymmetric classical detector. Then consider a qubit POVM with and . Does randomly applying and undoing it in the reported bit make this second measurement diagonal?
Solution
The classical average is , giving diagonal entries and off-diagonal entries . In the POVM example,
It is a valid effect because its eigenvalues are . Its component survives. Basis inputs would suggest columns with zero-report probabilities and , predicting for from its populations, whereas the actual probability is . The classical averaging formula cannot be extended to every coherent detector merely from basis calibration.
7. Propagate finite calibration and drift
Section titled “7. Propagate finite calibration and drift”Reproduce the uncertainty table using independent binomial science and calibration data. Explain why repeated science shots cannot cure the stale-response bias.
Solution
Use variances , and with the three derivatives in the text. Science contributes about and calibration , giving in total. These are delta-method values. A shared calibration contributes cross-covariance to multiple corrected estimates. Drift to moves the mean report to and the stale corrected moment to ; its bias persists as the number of science shots tends to infinity.
8. Recover populations with an erasure report
Section titled “8. Recover populations with an erasure report”Use the three-row response in the text. Show that all reports can identify the two input populations, while simply conditioning on the first two reports gives a different distribution.
Solution
The columns are linearly independent, so a left inverse recovers from the full reported vector under this model. Here , hence . Conditioning alone gives , approximately . It includes detector misassignment and state-dependent erasure; it is not the corrected latent distribution. In a mid-circuit experiment these report probabilities also do not specify the surviving conditional states.
References
Section titled “References”- S. Bravyi, S. Sheldon, A. Kandala, D. C. McKay, and J. M. Gambetta, “Mitigating measurement errors in multiqubit experiments,” Physical Review A 103, 042605 (2021), doi:10.1103/PhysRevA.103.042605.
- G. D’Agostini, “A multidimensional unfolding method based on Bayes’ theorem,” Nuclear Instruments and Methods in Physics Research A 362, 487–498 (1995), doi:10.1016/0168-9002(95)00274-X.
- F. B. Maciejewski, Z. Zimborás, and M. Oszmaniec, “Mitigation of readout noise in near-term quantum devices by classical post-processing based on detector tomography,” Quantum 4, 257 (2020), doi:10.22331/q-2020-04-24-257.
- B. Nachman, M. Urbanek, W. A. de Jong, and C. W. Bauer, “Unfolding quantum computer readout noise,” npj Quantum Information 6, 84 (2020), doi:10.1038/s41534-020-00309-7.
- P. D. Nation, H. Kang, N. Sundaresan, and J. M. Gambetta, “Scalable mitigation of measurement errors on quantum computers,” PRX Quantum 2, 040326 (2021), doi:10.1103/PRXQuantum.2.040326.
- A. W. R. Smith, K. E. Khosla, C. N. Self, and M. S. Kim, “Qubit readout error mitigation with bit-flip averaging,” Science Advances 7, eabi8009 (2021), doi:10.1126/sciadv.abi8009.
- E. van den Berg, Z. K. Minev, and K. Temme, “Model-free readout-error mitigation for quantum expectation values,” Physical Review A 105, 032620 (2022), doi:10.1103/PhysRevA.105.032620.