CSS codes and classical-code relations
Construct complementary bit and phase checks from binary parity matrices and verify their compatibility.
On this page
The question for today
What you’ll understand
- Derive the CSS orthogonality condition over the binary field.
- Calculate X and Z syndromes separately, including a Y error.
- Count encoded qubits and identify a weight-three logical operator in the seven-qubit code.
Classical linear codes provide a systematic way to choose quantum parity checks, but two arbitrary good classical codes cannot simply be combined. Quantum X and Z checks must commute so that the code has a common check sector. Calderbank–Shor–Steane constructions impose exactly that compatibility condition. Their separate treatment of bit and phase components simplifies diagnosis, while a physical Y error reminds us that the two components can occur together and may be statistically correlated.
Translate binary rows into Pauli checks
For a binary row h, form by placing X on each position containing one, and identity elsewhere; define similarly. Rows of a matrix specify X-type checks, and rows of specify Z-type checks. Checks of the same type automatically commute. A mixed pair commutes exactly when its two rows overlap in an even number of positions. Matrix multiplication over the binary field packages all these requirements at once.
In this convention the classical bit patterns obeying Z checks form , while the supports of X stabilizers lie in . Compatibility means that the latter space is contained in the former. Exchanging X and Z gives the complementary inclusion. This specifies conventions explicitly because textbooks may name the two classical codes differently. Counting independent rows, rather than printed rows, gives the quantum dimension and avoids mistaking a redundant parity for another protected degree of freedom.
One seven-column construction
Choose the same three-row matrix H for both types, with rows 1111000, 1100110, and 1010101. Each row has weight four and any two rows overlap twice. Thus even self-overlaps and pairwise overlaps give . The three rows are independent, so six independent quantum checks on seven physical qubits leave one logical qubit. The seven columns are precisely the seven distinct nonzero binary triples.
For an error represented by binary vectors x and z, the Z checks report and the X checks report . A single X error is located by its nonzero column in the first syndrome; a single Z is located in the second. A Y error has both components at the same site and triggers both sets. Treating these syndromes separately is algebraically valid, but multiplying their likelihoods requires an additional independence assumption about the physical noise.
Find what the checks cannot see
The all-seven X and all-seven Z strings commute with every weight-four check and anticommute with each other, so they furnish logical representatives. Smaller representatives can be obtained by multiplying stabilizers. No weight-one or weight-two nonidentity Pauli has zero syndrome: distinct nonzero columns cannot sum to zero. In contrast, columns two, three, and five sum to zero, giving a weight-three Z normalizer element outside the Z stabilizer row space.
Every nonzero row-space word of H has weight four, so that weight-three string is nontrivial on the code. The distance is therefore three, establishing ideal correction of one arbitrary physical-qubit error. This conclusion uses both complementary checks, unlike the three-qubit repetition construction. It still assumes correct initialization, compatible syndrome measurements, and a suitable recovery. Separability of the check matrices helps implementation, but does not automatically make a parity-extraction circuit fault tolerant.
Work it through
Decode both components of a single Y
Using the displayed H and syndrome order , compute the syndrome for and give an ideal recovery. Verify one mixed-check commutator directly.
A Y on site five has up to overall phase. Column five of H is , so both three-bit syndrome vectors equal 011.
Unique nonzero columns locate both components at site five. Recovery squares to identity and restores the code state. Equivalently X-five followed by Z-five works up to an irrelevant overall phase.
The first X row occupies sites 1,2,3,4, while the second Z row occupies 1,2,5,6. Their two shared sites supply two minus signs, whose product is plus one. Hence these complementary checks can share a code sector.
The ordered syndrome is (011, 011); ideal Y-five recovery reverses both components without measuring the encoded amplitudes.
The living notebook
Explore the model
Interactive lab · quantum
Complementary sensitivity of one qubit
Reset and set mixing angle , phase . Compare with a fresh Reset run at . Predict basis probabilities one half in both runs, but opposite Bloch x. This illustrates why complementary information matters. The pure-qubit instrument has no CSS matrices, seven-qubit encoding, noisy checks, or decoder.
- Probability |0⟩
- 71.1%
- Probability |1⟩
- 28.9%
- Bloch (x, y, z)
- 0.78, 0.45, 0.42
A normalized two-level pure state, not an interacting field simulation. Playback adds one radian per second to the relative phase; basis probabilities stay fixed. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forChecks sensitive only to populations cannot protect every phase relation; CSS structure supplies compatible complementary checks.
Pause & reason
Check your understanding
Your turn
Try it yourself
With the same H, a single occurs. Find both syndromes and recovery. Then use the row ranks and columns to justify the number of logical qubits and exclusion of weight-two logical errors.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Only the x component is nonzero. Distinct single-site columns cannot cancel in a binary sum of two columns.
Compare with the solution
Column seven is 001, so and . Apply . The two matrices have rank three, leaving logical qubit. Any nonzero x or z component with support at most two has a syndrome equal to one nonzero column or two distinct columns; neither is zero. Thus no weight-two Pauli is logical. The displayed weight-three Z string completes the distance-three argument.
Keep the idea
Take it with you
- CSS commutation is a binary orthogonality requirement.
- Y errors contribute both bit and phase syndrome components.
- Classical parity structure helps construct codes but does not replace a circuit fault analysis.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.