Interactive Calculator · Noise and Error Correction
Readout Error Correction Calculator
Enter how often your device misreads a qubit and the counts you observed, and recover the probabilities you would have seen with a perfect readout.
Bit strings use Qiskit order: qubit 0 is the right-hand bit.
Shots
1,000
Noise amplification
×1.064
Correction multiplies statistical error by this factor
Observed (raw)
Corrected (after clipping negatives and renormalising)
To keep the same statistical precision after correcting, you need roughly 1.13 times as many shots.
Correct measurement errors on one or two qubits by inverting a confusion matrix, see when the correction produces impossible negative probabilities, and learn what the correction costs in extra shots.
What this calculator does
Every quantum computation ends with a measurement, and measurements are imperfect. A qubit prepared in state 0 may be reported as 1 a small fraction of the time, and a qubit prepared in state 1 may be reported as 0 with a different probability. These readout errors bias every result you collect. A standard first step in error mitigation is to measure how the device misreads each state and then undo the effect mathematically.
This tool does the arithmetic. Enter the chance that a true 0 reads as 1 and the chance that a true 1 reads as 0 for each qubit, then enter the counts you observed. It builds the confusion matrix, inverts it and returns the corrected probabilities. It supports one qubit, or two qubits with independent errors, where the full matrix is the tensor product of the two single-qubit matrices. Bit strings use Qiskit's order, with qubit 0 as the right-hand bit.
The correction can produce small negative probabilities when the data are noisy. The tool flags this, and shows a clipped and renormalised version. It also reports the noise amplification: how much the correction increases the statistical uncertainty, and the extra shots needed to compensate.
How to use it
Try the one-qubit preset: errors of 2 percent (0 read as 1) and 4 percent (1 read as 0), with observed counts of 620 zeros and 380 ones. The corrected result is 61.70 percent and 38.30 percent. The shift is only 0.3 percentage points, but when you compare an experiment with a precise theoretical prediction, shifts of this size matter.
Next try the Bell-pair preset. An ideal Bell pair gives 00 and 11 with 50 percent each. With the same errors on both qubits, the predicted raw readout is 48.1 percent for 00, 2.9 percent each for 01 and 10, and 46.1 percent for 11. The tool recovers the ideal 50, 0, 0, 50 from those numbers. Notice how readout error alone creates counts in 01 and 10 that look like gate errors, which is one reason to correct readout before judging a circuit.
Finally use the third preset, where the observed result is 995 zeros and 5 ones. Inverting gives a corrected probability of 1.016 for state 0 and −0.016 for state 1. The negative value signals that the true probability of 1 is close to zero and that the shot noise pushed the estimate below it. The tool clips the negative value, renormalises and shows 100 percent and 0 percent.
What the correction costs
Correction is not free. For one qubit the inverse of the confusion matrix has entries larger than one, and statistical noise in the counts is multiplied by 1 ÷ (1 − e₀ − e₁), where e₀ and e₁ are the two error probabilities. With 2 percent and 4 percent that factor is 1.064. The variance grows by its square, 1.13, so you need about 13 percent more shots to regain the same precision. For two qubits the factors multiply, and for n qubits with independent errors the amplification grows exponentially with n. That is why practical methods for larger devices use simpler assumptions or approximate corrections.
Limits and cautions
The confusion matrix is measured at one time and can drift, so a correction built from stale data may be wrong. The tool assumes the readout errors are independent between qubits, which real devices violate through crosstalk. It corrects only the misreading at the end of the circuit. It does not touch errors that occurred during the circuit, and readout correction alone cannot make a noisy computation correct. A good check is to run a circuit with a known answer, such as a single X gate, before and after correction. The example values on this page are illustrative and do not describe any particular device.
The formulas behind it
Single-qubit confusion matrix
M = [[1 − e₀, e₁], [e₀, 1 − e₁]]
Columns are the true state (0, 1) and rows are the reported state. e₀ is the chance a true 0 reads as 1, and e₁ the chance a true 1 reads as 0.
Correction
p_true = M⁻¹ · p_observed
For one qubit M⁻¹ = 1/(1 − e₀ − e₁) · [[1 − e₁, −e₁], [−e₀, 1 − e₀]].
Two qubits
M = M₁ ⊗ M₀
Assumes the two qubits misread independently. Qubit 0 is the right-hand bit.
Noise amplification
factor = 1 ÷ (1 − e₀ − e₁)
Statistical error is multiplied by this factor, so the shots needed to keep the same precision grow by its square.
Worked examples
One qubit
- e₀ = 2%, e₁ = 4%. Observed: 620 zeros and 380 ones, so (0.62, 0.38).
- 1 − e₀ − e₁ = 0.94.
- Corrected P(0) = (0.96 × 0.62 − 0.04 × 0.38) ÷ 0.94 = 0.6170.
ResultTrue probabilities 61.70% and 38.30%.
A Bell pair
- Both qubits have e₀ = 2% and e₁ = 4%.
- Ideal state: 00 and 11 at 50% each.
- Raw readout: 00 = 48.1%, 01 = 2.9%, 10 = 2.9%, 11 = 46.1%.
- Apply the inverse of the tensor-product matrix.
ResultThe correction returns 50%, 0%, 0%, 50%. The stray 01 and 10 counts were readout error, not gate error.
A negative result
- Observed 995 zeros and 5 ones: (0.995, 0.005).
- Corrected P(0) = (0.96 × 0.995 − 0.04 × 0.005) ÷ 0.94 = 1.016, so P(1) = −0.016.
ResultClip to 0 and renormalise: the true state is almost certainly a clean 0.
Frequently asked questions
Where do I find my readout errors?
Prepare each basis state many times and count how often the device reports the wrong value. Many providers also publish a readout error for each qubit, which changes over time.
Why can corrected probabilities be negative?
Because the inverse amplifies statistical noise. If the true probability is near zero, noise can push the estimate slightly below it. Clipping and renormalising is a simple fix.
Does this correct gate errors?
No. It corrects only the final misreading. Errors during the circuit change the true state, and no correction at the output can undo them.
What about more than two qubits?
With independent errors the matrix is a tensor product of single-qubit matrices, so the method extends. The cost of the correction and the failure of the independence assumption grow with size.
References
- Bravyi, S., Sheldon, S., Kandala, A., McKay, D. C., & Gambetta, J. M. (2021). Mitigating measurement errors in multiqubit experiments. Physical Review A, 103, 042605. (Cited from memory; I did not open it for this page.)
- Temme, K., Bravyi, S., & Gambetta, J. M. (2017). Error mitigation for short-depth quantum circuits. Physical Review Letters, 119, 180509. (Cited from memory.)
- Worked examples: my own arithmetic with illustrative error rates, checked with NumPy.
Keep exploring
- Lesson: From Simulator to Real Hardware
- Algorithm: Quantum Error Mitigation
- Paper: Error Mitigation for Short-Depth Quantum Circuits
- Term: Readout Error
- Calculator: Shot Count
- Calculator: Error Mitigation Overhead
These calculators use simplified, published models for education and planning. Real devices and systems differ, so treat results as estimates. They are not engineering, investment, legal, or security advice.