Part 2 · Time and noise · Chapter 5 · 5 min read
Detection events: what changed since last round
A raw check says what is wrong now; a detection says what is new. You will be able to tell a data error from a measurement error by the shape its detections leave in the grid.
From answers to changes
Chapter 4 ended with a problem. A bit flip on a data qubit fires its checks in the round after it arrives, and they stay lit in every later round, because nothing repairs the flip. Reading the raw grid, you see a column of lit cells but not when the error happened, and a second error elsewhere in the column is hard to separate from the first.
The fix is to ask a different question: not “is this check lit?” but “did this check change?”. A check that read 0 in round 1 and 1 in round 2 has changed once, at the moment the error arrived. Write for the syndrome of round , the three answers of one block and one Pauli type. The detections are the syndromes compared with their predecessors:
In words: is this round’s syndrome XOR the last one. The first round is compared with an all-zero syndrome, and the last with the syndrome recomputed from the data readout, . With rounds that gives rows of detections.
Two errors, two shapes
A data error changes the checks once and then stays. In Raw it is a lit cell that repeats down the column; in Detections it is one lit cell, in the round it arrived. One long-lived error costs one event instead of one per round, which is why a decoder reads detections.
Raw
Detections
- Z check fired
- X check fired
A measurement error is different. The data are intact, so the check reads correctly in the next round. The wrong answer is a lone lit cell in Raw. In Detections it appears twice, because the answer changes when the error arrives and changes back one round later. Two lit cells in consecutive rows in the same column are the signature.
Raw
Detections
- Z check fired
- X check fired
Why it matters here
A decoder sees only the detections. It never learns which qubit flipped; it has to infer the errors from the lit cells.
Many shots at once
Real shots mix these shapes, and the detections of separate errors add mod 2, so two events that light the same cell cancel. The heat map counts, for every check and round, how often a detection lit across all shots. In this run, block A lights in about 5 to 18% of shots per cell, and later rounds are busier because errors accumulate.
- Z check fired
- X check fired
The decoder uses the same objects. dem in engine/decoders.py builds one detector per row of Equation 5.1 and one column per data error and per measurement error. A measurement error column touches two detectors in consecutive rows, as in Figure 5.2. Chapter 7 uses that matrix.
Try it in the simulator
Choose Depolarizing noise, set p to 0.03 and press Run with 256 shots, then open the Heat map view. Look for darker cells: they mark the checks that fire most often. Then switch to Detections and step through single shots, looking for pairs of lit cells in consecutive rows.
Open the simulator with this setupCheck yourself
A check is lit in rounds 2 and 3 of the Raw view and nowhere else. How many detections does that make?
One, in round 2. In round 3 the answer did not change, and the data row compares round 3 with the readout, which still agrees.
What is the Detections signature of a measurement error in the last round?
One detection in the last round and one in the data row, since the recomputed syndrome disagrees with the misread one.
Why compare the last round with the data readout?
Without it, a data error that arrives after the last round would never be seen. The readout carries it and the comparison turns it into a detection.
Sources
- E. Dennis, A. Kitaev, A. Landahl, J. Preskill (2002). Topological quantum memory. Journal of Mathematical Physics 43, 4452. doi.org/10.1063/1.1499754
Supports: comparing syndromes from consecutive rounds and the shapes of data and measurement errors. - A. G. Fowler, M. Mariantoni, J. M. Martinis, A. N. Cleland (2012). Surface codes: Towards practical large-scale quantum computation. Physical Review A 86, 032324. doi.org/10.1103/PhysRevA.86.032324
Supports: syndrome changes between rounds. - Stim documentation. Detector error model file format. github.com/quantumlib/Stim/blob/main/doc/file_format_dem_detector_error_model.md
Supports: detectors and the detector error model as Stim defines them.