Syndrome Measurement
A syndrome measurement learns a stabilizer eigenvalue without resolving the encoded state inside its eigenspace. An ancilla can collect this information, but the same interactions can also spread an ancilla fault onto several data qubits. We will derive the ideal measurement, follow faults through an ordered circuit, and explain how changes between repeated outcomes become detectors for error correction.
Required background. Multi-qubit gates introduces CNOT and parity circuits. Stabilizer formalism explains code subspaces, signed checks and logical operators.
The examples use qubit Pauli checks and ideal Clifford gates except at explicitly specified fault locations. Their conclusions concern one measured check; deciding whether a resulting error is correctable requires the surrounding code.
Pauli-check measurements preserve eigenspace coherence
Section titled “Pauli-check measurements preserve eigenspace coherence”A signed Hermitian Pauli check obeys
For a nonidentity Pauli string its eigenvalues are . The special checks and have only one possible outcome. A phase multiplying a Hermitian string instead gives an anti-Hermitian operator, not a binary observable.
Write the eigenvalue as , where . The projectors and ideal outcome branches are
The trace of retains the outcome probability. If , the conditional state is ; a zero-probability branch has no conditional state. Ignoring the outcome gives
This Lüders measurement removes coherence between the two eigenspaces and preserves coherence within either one. The observable fixes probabilities but does not determine every possible disturbance: a device could additionally rotate a state or measure more finely inside an eigenspace. Quantum instruments describes this distinction.
For example, measuring ideally leaves unchanged. Measuring the two individual Z observables and then multiplying their outcomes gives the same parity but destroys the superposition. A parity circuit must avoid storing which of these two strings occurred.
If stabilizes the whole code, a fixed Pauli error gives
Here is the commutation sign of with , independent of the encoded amplitudes. This is why a stabilizer check can reveal an error syndrome without revealing the logical state. Merely commuting with the stabilizer is insufficient: a logical Pauli can commute with every check and still measure encoded information. Gottesman (1997) develops these stabilizer and measurement rules. General coherent noise may populate several syndrome sectors; ideal measurement can remove the coherence between those sectors.
Ancillas measure Z and X products
Section titled “Ancillas measure Z and X products”Z parity with a target ancilla
Section titled “Z parity with a target ancilla”To measure , prepare an ancilla in , apply data-control/ancilla-target CNOTs, and measure the ancilla in Z. On a basis string,
Every even string gives the same pointer , and every odd string gives . For arbitrary data the final joint state is
Selecting ancilla outcome leaves , proving the ideal branch map above. The ancilla stores the parity, not the individual data bits. An unknown initial reverses the reported parity, so preparation or reset is part of the measurement itself.
X parity with a control ancilla
Section titled “X parity with a control ancilla”To measure , prepare , let the ancilla control each CNOT, and measure it in X. For a product eigenstate ,
The two pointer states are and . The data remain in their original eigenstate. Superpositions within a fixed product eigenspace remain coherent by linearity.
Mixed Pauli products can use local basis changes. With gates acting right to left, and obey
Apply these changes before a Z-parity circuit and their inverses afterward. They add physical gate locations at which faults can occur. Two implementations of the same ideal check need not propagate faults in the same way.
Signed checks and readout bits
Section titled “Signed checks and readout bits”Let the circuit measure a phase-free product , reporting for its eigenvalue and for . If the desired check is , the signed check bit is
For example, converts raw into : the state has but . No gates need change for this relabeling. Any known Pauli-frame or hardware-discriminator offset must be included consistently as well.
A round’s syndrome collects the check outcomes. A detector is a parity of outcomes whose value is predictable in the ideal circuit. A decoder uses many such values and a noise model to choose a recovery. These are successive pieces of the calculation, not different names for one bit string.
Keep the raw outcomes and known offsets distinguishable when analyzing experiments. A missing outcome or flagged leakage event is not a binary zero. For reset, timing and conditional operations between rounds, see mid-circuit measurement and feedforward.
An ancilla fault can spread to later data qubits
Section titled “An ancilla fault can spread to later data qubits”Forward propagation through CNOT with control and target obeys
Only gates after the insertion act on a fault. In a Z-check circuit, ancilla spreads to every later data control. Ancilla remains on the target and flips its eventual Z readout. In an X-check circuit the roles exchange: spreads to later data targets, while flips the X readout without that spreading.
For with interaction order , insert after the second CNOT. The remaining interactions give
The final data error is . The remaining commutes with ancilla Z readout, so the bit is unchanged. A single fault has affected two data qubits.
Time runs left to right. A target-ancilla fault after the second interaction produces on the data. It does not change the ancilla’s Z-basis readout. The first two data qubits have already interacted and receive no error from this later fault.
Data-fault timing also matters. An occurring before data qubit controls its CNOT changes the current parity outcome. If it occurs afterward, its first effect on this repeated check can appear in the next round. A commutes with this particular Z check, so it is invisible to that check.
DiVincenzo and Shor (1996) analyze the danger of ancilla faults spreading in syndrome extraction. Verified ancillas and flag circuits address it with additional resources and code-specific recovery rules; Chamberland and Beverland (2018) develop flag constructions. Fault-free parity correctness alone does not prove fault tolerance. Conversely, a weight-two error is not automatically a logical error: its significance depends on the code and available diagnostic outcomes. See fault-tolerant gates for those criteria.
Repeated outcomes reveal changes
Section titled “Repeated outcomes reveal changes”For an unchanged check, with no ideal operation changing its eigenvalue, successive ideal outcomes agree. A useful bulk detector is therefore
A persistent data error that flips the check produces an event at its onset. A single incorrectly reported round produces events in both neighboring comparisons. These patterns are useful but do not identify a unique microscopic cause.
The first comparison needs a prepared reference . If the initial check eigenvalue is unknown, its first measurement can be intrinsically random; comparing it to an invented zero would not give an ideal deterministic detector. Likewise, a terminal comparison needs a compatible final measurement. For a Z product, destructive Z measurements of its data qubits supply a final parity , including the same sign and frame offsets as the check.
For three rounds, a known initial value and compatible final parity give
Final individual-qubit measurements end the quantum memory experiment. They need not be nondestructive merely because their product reconstructs a stabilizer check.
More generally, a detector has the form
where the set and known offset make this parity zero in the ideal circuit. This is the detector convention used by Gidney (2021) and the Stim detector documentation. An intentional sign change or intervening gate can change the offset or which outcomes belong in the relation. Adjacent times alone do not establish the relation.
If is missing, the displayed and are unavailable. An appropriate protocol may instead compare to , but must account for the longer interval. Detectors can share outcomes and be correlated; their definition does not imply statistical independence. Decoders explains how to combine the available outcomes with a noise model.
Six cases for a repeated four-body check
Section titled “Six cases for a repeated four-body check”Measure for three rounds, using a fresh target ancilla and interaction order each time. Prepare any state in the eigenspace, so . After the last round, read the data in Z and form . Each case below inserts only the named fault; all other operations are ideal.
- A: no fault.
- B: before round 1.
- C: between rounds 1 and 2.
- D: reverse only the reported bit in round 2.
- E: insert after the second CNOT of round 2.
- F: insert at that same location.
| Case | Final data Pauli | Outcomes | Detectors | |
|---|---|---|---|---|
| A | 000 | 0 | 0000 | |
| B | 111 | 1 | 1000 | |
| C | 011 | 1 | 0100 | |
| D | 010 | 0 | 0110 | |
| E | 010 | 0 | 0110 | |
| F | 000 | 0 | 0000 |
Cases B and C change the check persistently, with one detector marking when the change begins. Cases D and E give the same outcomes even though their physical mechanisms differ. A decoder needs other checks or a noise prior to distinguish possible explanations; the local record alone cannot do so.
Case F is more revealing: the data carry , yet every displayed detector is zero. The error commutes with this check and does not affect terminal Z parity. Other checks may detect it. Without specifying a complete code, one cannot decide whether it is a stabilizer, a correctable error or a logical operation. Thus a zero local detector pattern is compatible with a nontrivial change to the data.
Exercises
Section titled “Exercises”1. Verify the Projector and Instrument Identities
Section titled “1. Verify the Projector and Instrument Identities”Let and . For , prove orthogonality, completeness, and positivity. For a density operator , show that is the Born probability and that the unread Lüders map is trace preserving.
Solution
Using ,
Hermiticity of gives , so each idempotent is an orthogonal projector and therefore positive. Direct addition gives , while
Cyclicity of trace and idempotence give
the Born probability. Positivity follows because is positive. Finally,
Thus each branch is CP and trace-nonincreasing, while their sum is trace preserving.
2. Test Why a Stabilizer Hides Logical Information
Section titled “2. Test Why a Stabilizer Hides Logical Information”Let every code state obey . Show that for a fixed Pauli , measuring on reveals only whether commutes or anticommutes with . Then explain why replacing by a logical Pauli can reveal logical amplitudes.
Solution
If with , then
The outcome is fixed by and is independent of the coefficients of the encoded state. This conclusion uses that acts as one scalar on the entire code space.
By contrast, suppose and . On , its measurement has probabilities and and removes coherence between the two logical eigenstates when unread. Although commutes with the stabilizer, it is not itself a stabilizer and is not independent of the logical state.
3. Translate a Signed Check Record
Section titled “3. Translate a Signed Check Record”An unsigned circuit measures and reports . Compute the stored bit and signed eigenvalue first for , then for the negative check . Repeat for , keeping , , and explicit.
Solution
For , , so . If , then and . If , then and both eigenvalues are .
For , , so . At , : but . At , : but . The raw hardware result has not changed; the signed check changes how it must be interpreted and stored.
4. Propagate a Mid-Circuit Ancilla Fault
Section titled “4. Propagate a Mid-Circuit Ancilla Fault”In chronological order , insert after the second CNOT of a Z-check target-ancilla circuit. Derive the data error. Then perform the dual calculation for at the same location in an X-check control-ancilla circuit, and state what happens to the ancilla readout in each case.
Solution
In the Z-check circuit, the first two CNOTs precede the fault and cannot receive propagated errors from it. At the CNOT involving data 3, target maps to ; at the next it maps to . The final operator is therefore
The data error is . The remaining commutes with Z-basis readout and does not flip its bit.
In the X-check circuit, the ancilla is the control. Control copies to each later target, producing
The data error is . The remaining commutes with X-basis readout and does not flip that bit. The complementary ancilla Paulis, for the Z check and for the X check, flip their respective readouts without this data fanout.
5. Construct Boundary-Aware Detectors
Section titled “5. Construct Boundary-Aware Detectors”A check has signed outcomes . Preparation fixes , and compatible final readout gives . Write the initial, bulk, and terminal detectors. Then generalize to a relation supported on an arbitrary set with a known offset . What changes if is invalid?
Solution
The initial detector is . The two bulk detectors are
and the terminal detector is . More generally,
provided the entire parity is deterministic in the ideal circuit. If is invalid, both and are unavailable. They may not be computed by replacing with zero. A separately justified relation such as a gap-spanning parity between and could be used, but only if the protocol establishes its no-fault determinism.
6. Read the Ancilla in the Wrong Basis
Section titled “6. Read the Ancilla in the Wrong Basis”After the Z-parity interaction, the joint state is . Instead of reading the ancilla in Z, read it in X. Find the data Kraus operators and outcome probabilities. Compare this instrument with the correct parity measurement when outcomes are ignored.
Solution
Using and gives
Both outcomes have probability , independent of the data. They reveal no parity information. Conditioned on the outcome, the data undergo either or , so applying after the minus outcome restores the original state.
Ignoring the outcome gives , exactly the unread channel of the correct Z readout. Thus equal unread channels do not imply equal instruments: one readout learns the parity and projects the data, while the other gives a known reversible unitary and an uninformative random bit.
References
Section titled “References”- C. Chamberland and M. E. Beverland, “Flag Fault-Tolerant Error Correction with Arbitrary Distance Codes,” Quantum 2, 53 (2018), doi:10.22331/q-2018-02-08-53.
- D. P. DiVincenzo and P. W. Shor, “Fault-Tolerant Error Correction with Efficient Quantum Codes,” Physical Review Letters 77, 3260–3263 (1996), doi:10.1103/PhysRevLett.77.3260.
- C. Gidney, “Stim: A Fast Stabilizer Circuit Simulator,” Quantum 5, 497 (2021), doi:10.22331/q-2021-07-06-497. See also the detector instruction documentation, accessed 15 October 2026.
- D. Gottesman, Stabilizer Codes and Quantum Error Correction, Ph.D. thesis, California Institute of Technology (1997), arXiv:quant-ph/9705052.