Notes on quantum error correction · Part 3 · beyond Roffe's guide · previous: Part 2.5 · next: Part 4
CSS codes
Every stabilizer met so far has been made only of \(X\)s or only of \(Z\)s. Codes with that property are CSS codes, after Calderbank, Shor and Steane, and the property earns a part of its own: such a code is two classical codes in disguise, one catching bit flips and one catching phase flips, and everything about it can be read off two binary matrices. This part starts from the codes of parts 1 and 2, extracts the pattern, and then builds the Steane \([[7,1,3]]\) code from the classical Hamming code. The interactive figures are at the end, followed by problems; the references list where to read further.
Two codes you already know, written as matrices
The three-qubit code of part 1 has stabilizers \(Z_1Z_2\) and \(Z_2Z_3\). Record where each one acts as a row of 0s and 1s, one column per qubit:
\[ H_Z = H_{\text{rep}} = \begin{pmatrix} 1&1&0 \\ 0&1&1 \end{pmatrix}, \qquad \text{and no } X \text{ checks.} \]A bit flip on qubit \(j\) anticommutes with exactly the stabilizers whose row has a 1 in column \(j\), so the syndrome can be read straight off the matrix: \(X_1\) flips the first check only, \(X_2\) both, \(X_3\) the second only. Write the error as a binary vector as well, \(e_X = 100\) for \(X_1\), \(010\) for \(X_2\), \(001\) for \(X_3\), and the three syndromes of part 1 are the three columns of \(H_Z\): in one formula, \(s = H_Z e_X\), with arithmetic mod 2. This matrix is the parity-check matrix of the classical three-bit repetition code, which flags a flipped bit by comparing neighbours; the quantum code makes the same comparisons with \(Z\)-type stabilizers.
The Shor code of part 2 has eight stabilizers, six of \(Z\) type and two of \(X\) type, so it needs a matrix of each kind. Written in blocks of three qubits, with \(H_{\text{rep}}\) the \(2 \times 3\) matrix just above and \(0\) a \(2 \times 3\) block of zeros,
\[ \begin{aligned} H_Z &= \begin{pmatrix} H_{\text{rep}} & 0 & 0 \\ 0 & H_{\text{rep}} & 0 \\ 0 & 0 & H_{\text{rep}} \end{pmatrix}, \\[0.4em] H_X &= \begin{pmatrix} 1\,1\,1 & 1\,1\,1 & 0\,0\,0 \\ 0\,0\,0 & 1\,1\,1 & 1\,1\,1 \end{pmatrix}. \end{aligned} \]The six \(Z\) rows compare neighbouring qubits inside each block and catch bit flips exactly as the three-qubit code does, three times over; the two \(X\) rows compare the phases of neighbouring blocks and catch phase flips. The \([[4,2,2]]\) code of part 2 is the smallest case of all, \(H_X = H_Z = (1\,1\,1\,1)\), one check of each type. Figure A draws each of these codes as its pair of matrices.
What the three codes share is that no stabilizer mixes \(X\) and \(Z\). That is the CSS property, and a code with it is specified completely by \(H_X\) and \(H_Z\). The rest of this part is about what those two matrices must satisfy and what they tell you.
\(Z\) checks catch \(X\) errors, and \(X\) checks catch \(Z\) errors
For a binary vector \(u\) of length \(n\), write \(X^{u}\) for the product of \(X\) on every qubit where \(u\) has a 1, so that \(X^{110} = X_1X_2\), and likewise \(Z^{v}\). Two such operators obey
\[ X^{u} Z^{v} = (-1)^{u \cdot v}\, Z^{v} X^{u}, \qquad u \cdot v = \textstyle\sum_j u_j v_j \bmod 2, \]because each qubit where both act contributes one sign of \(-1\). So they commute when they overlap on an even number of qubits and anticommute when the overlap is odd. A check \(Z^{h}\) is therefore flipped to \(-1\) by an error \(X^{e_X}\) exactly when \(h \cdot e_X = 1\), and it is blind to \(Z\) errors, which commute with it. Stacking the rows \(h\) of \(H_Z\) into one matrix product, and doing the same for \(H_X\), gives the two halves of the syndrome:
\[ s_Z = H_Z\, e_X, \qquad s_X = H_X\, e_Z . \]Here an arbitrary Pauli error has been split into its two parts, \(E = X^{e_X} Z^{e_Z}\) up to a phase; a \(Y_j\) puts a 1 in both \(e_X\) and \(e_Z\). The crossing of letters is the whole point of the construction, and the usual source of confusion: \(s_Z\) is the readout of the \(Z\)-type checks, and what they detect is bit flips.
Classical linear codes
Each half of the syndrome equation is a classical problem, so this is the place for the classical vocabulary. A binary linear code \(C\) with parameters \([n, k, d]\) is a set of \(2^k\) words of \(n\) bits that is closed under addition mod 2 and in which every nonzero word has at least \(d\) ones. It is usually given by a parity-check matrix \(H\) with \(m\) rows: the codewords are the words every check accepts,
\[ C = \ker H = \{ c \in \mathbb F_2^n : Hc = 0 \}, \qquad k = n - \operatorname{rank} H , \]and a pattern of flips \(e\) added to any codeword shows up as the syndrome \(s = H(c \oplus e) = He\), which depends on the flips alone. The repetition code \([3,1,3]\) is the kernel of the matrix \(H_Z\) of the three-qubit code: its codewords are \(000\) and \(111\), each single flip has its own syndrome, and \(k = 3 - 2 = 1\). The Hamming code \([7,4,3]\) has
\[ H_{\text{Ham}} = \begin{pmatrix} 0&0&0&1&1&1&1 \\ 0&1&1&0&0&1&1 \\ 1&0&1&0&1&0&1 \end{pmatrix}, \]whose \(j\)-th column is the number \(j\) written in binary. Flipping bit \(j\) alone gives the syndrome \(He = \) column \(j\), so the decoder reads the syndrome as a number and flips that bit back: every single error is corrected, \(k = 7 - 3 = 4\), and the lightest nonzero codeword has weight 3.
The dual code \(C^\perp\) consists of the words that overlap every codeword evenly; it is spanned by the rows of \(H\). The dual of the Hamming code is the simplex code \([7,3,4]\), whose eight words are the sums of rows of \(H_{\text{Ham}}\): the all-zero word and seven words of weight four, listed in the left column of table 1 below. Each of them is also a Hamming codeword, because every row of \(H_{\text{Ham}}\) has even weight and every pair of rows overlaps in exactly two places, so \(H_{\text{Ham}} h^{\mathsf T} = 0\) for each row \(h\). In matrix form, \(H_{\text{Ham}} H_{\text{Ham}}^{\mathsf T} = 0\); in words, the Hamming code contains its own dual, \(C^\perp \subset C\). This containment is the ingredient the Steane code needs.
The CSS construction
Now run the pattern backwards. Choose any two binary matrices with \(n\) columns, \(H_X\) and \(H_Z\), and declare the rows of \(H_X\) to be the supports of \(X\)-type stabilizers and the rows of \(H_Z\) the supports of \(Z\)-type ones. Checks of the same type commute automatically. By the sign rule above, an \(X\) row \(u\) and a \(Z\) row \(v\) commute when \(u \cdot v = 0\), so all the checks commute, and generate a stabilizer group, if and only if
\[ H_X H_Z^{\mathsf T} = 0 . \]Read as codes, this says that every row of \(H_X\) lies in \(\ker H_Z\): the support of each \(X\) check must look like "no error" to every \(Z\) check, and symmetrically. For the Shor code, each \(X\) row covers two whole blocks, so every \(Z\) row, which compares two qubits of one block, meets it in zero or two places.
The parameters follow the recipe of part 2 (reading \(n\), \(k\) and \(d\) off the stabilizers). Each independent check halves the space, and here the independent checks are the independent rows, so
\[ k = n - \operatorname{rank} H_X - \operatorname{rank} H_Z . \]A logical \(\bar X\) is an \(X^{v}\) that no check detects, \(H_Z v = 0\), yet is not itself a product of \(X\) checks, \(v \notin \operatorname{row} H_X\); a logical \(\bar Z\) is the same with the roles swapped. The distance is the weight of the lightest logical operator of either type, \(d = \min(d_X, d_Z)\) with
\[ \begin{aligned} d_X &= \min\{ |v| : v \in \ker H_Z,\ v \notin \operatorname{row} H_X \}, \\ d_Z &= \min\{ |v| : v \in \ker H_X,\ v \notin \operatorname{row} H_Z \} . \end{aligned} \]Try it on the three-qubit code. \(\ker H_Z = \{000, 111\}\), and there are no \(X\) checks to subtract, so \(d_X = 3\) with \(\bar X = X_1X_2X_3\). With no \(H_X\) at all, \(\ker H_X\) is every word, while \(\operatorname{row} H_Z = \{000, 110, 011, 101\}\) is the even-weight words; the lightest word outside it has a single 1, so \(d_Z = 1\) with \(\bar Z = Z_1\). That is part 1's conclusion, \(d = 1\), in two lines, and it says in general that a CSS code needs rows in both matrices to have distance against both kinds of error. Problem 3 runs the same computation for the Shor code and finds \(d_X = d_Z = 3\).
The same construction in the language of codes
Calderbank, Shor and Steane described the construction with two classical codes rather than two matrices, and most of the literature follows them. Let \(C_1 = \ker H_Z\), the classical code whose checks catch bit flips, and \(C_2 = \operatorname{row} H_X\), the words that are supports of \(X\) checks. The commutation condition says precisely that \(C_2 \subseteq C_1\). The codewords are uniform superpositions over the cosets of \(C_2\) inside \(C_1\),
\[ \ket{x + C_2} = \frac{1}{\sqrt{|C_2|}} \sum_{y \in C_2} \ket{x \oplus y}, \qquad x \in C_1 , \]and the reason is the projection of part 2 (eq. 34): applying \(\tfrac12(\I + X^{h})\) for each \(X\) check to \(\ket{x}\) adds the terms \(\ket{x \oplus y}\) for every sum \(y\) of rows, which is all of \(C_2\), while the \(Z\) checks are already \(+1\) on every term because \(x \oplus y \in C_1\). Two words \(x, x'\) give the same codeword exactly when \(x \oplus x' \in C_2\), so there are \(|C_1| / |C_2| = 2^{k_1 - k_2}\) codewords, \(k = k_1 - k_2\). A logical \(\bar X\) is a word of \(C_1\) and a logical \(\bar Z\) a word of \(\ker H_X = C_2^\perp\), so \(d \ge \min\bigl(d(C_1), d(C_2^\perp)\bigr)\). Table 2 is a dictionary between the two languages. Calderbank and Shor used the code form to prove that families of quantum codes with \(k/n\) and \(d/n\) both bounded away from zero exist, by choosing good classical codes with \(C_2 \subset C_1\).
| In matrices | In codes |
|---|---|
| rows of \(H_Z\): the \(Z\) checks | parity checks of \(C_1 = \ker H_Z\) |
| rows of \(H_X\): the \(X\) checks | a basis of \(C_2 = \operatorname{row} H_X\) |
| \(H_X H_Z^{\mathsf T} = 0\) | \(C_2 \subseteq C_1\) |
| \(k = n - \operatorname{rank} H_X - \operatorname{rank} H_Z\) | \(k = k_1 - k_2\) |
| \(d_X\): lightest word of \(\ker H_Z\) outside \(\operatorname{row} H_X\) | lightest word of \(C_1\) outside \(C_2\); at least \(d(C_1)\) |
| \(d_Z\): lightest word of \(\ker H_X\) outside \(\operatorname{row} H_Z\) | lightest word of \(C_2^\perp\) outside \(C_1^\perp\); at least \(d(C_2^\perp)\) |
Decoding in two halves
Because \(s_Z\) depends only on \(e_X\) and \(s_X\) only on \(e_Z\), decoding a CSS code is two classical decoding problems: find the lightest \(\hat e_X\) with \(H_Z \hat e_X = s_Z\) and the lightest \(\hat e_Z\) with \(H_X \hat e_Z = s_X\), then apply \(X^{\hat e_X} Z^{\hat e_Z}\). Any classical decoder for the two component codes can be reused. The price is that a \(Y\) error, which is correlated across the two halves, is treated as an independent \(X\) and \(Z\); that loses nothing when both halves decode correctly, since \(X_jZ_j\) is \(Y_j\) up to a phase, but it costs something when they do not. This split is what makes CSS codes the default setting for the LDPC codes of part 4.
The Steane code
Everything is now in place for a code that corrects any single-qubit error with seven qubits, fewer than Shor's nine. Take \(H_X = H_Z = H_{\text{Ham}}\). The commutation condition is the containment checked above, \(H_{\text{Ham}} H_{\text{Ham}}^{\mathsf T} = 0\), and \(k = 7 - 3 - 3 = 1\). In the language of codes, \(C_1\) is the Hamming code and \(C_2 = C_1^\perp\) the simplex code, so \(k = 4 - 3 = 1\) and \(d \ge \min(3, 3) = 3\): the \([[7,1,3]]\) Steane code. Its two codewords are the two cosets of the simplex code inside the Hamming code,
\[ \begin{aligned} \ket0_\L &= \tfrac{1}{\sqrt8} \sum_{y \in C_{\text{simplex}}} \ket{y}, \\ \ket1_\L &= \bar X \ket0_\L, \qquad \bar X = X^{\otimes 7}, \quad \bar Z = Z^{\otimes 7} , \end{aligned} \]with the sixteen terms written out in table 1.
| Term of \(\ket0_\L\) | Weight | Term of \(\ket1_\L\) | Weight |
|---|---|---|---|
| 0000000 | 0 | 1111111 | 7 |
| 0001111 | 4 | 1110000 | 3 |
| 0110011 | 4 | 1001100 | 3 |
| 0111100 | 4 | 1000011 | 3 |
| 1010101 | 4 | 0101010 | 3 |
| 1011010 | 4 | 0100101 | 3 |
| 1100110 | 4 | 0011001 | 3 |
| 1101001 | 4 | 0010110 | 3 |
Why these are the codewords: start from \(\ket{0000000}\), which every \(Z\) check accepts, and project with the three \(X\) checks as in part 2. The product \((\I + X^{h_1})(\I + X^{h_2})(\I + X^{h_3})\) expands into the eight sums of rows, which are the simplex words, and each of them is a Hamming codeword, so the \(Z\) checks stay \(+1\) on every term: the containment \(C^\perp \subset C\) is used exactly here. \(\bar X = X^{\otimes 7}\) commutes with every check, because every row has even weight, and is not a product of \(X\) checks, whose supports have weight 0 or 4; it maps the left column of table 1 onto the right. \(\bar Z = Z^{\otimes 7}\) multiplies a basis state by \((-1)^{\text{weight}}\), which is \(+1\) on every term of \(\ket0_\L\) and \(-1\) on every term of \(\ket1_\L\).
The distance is 3. \(X^{\otimes 7}\) times the weight-four stabilizer \(X^{0001111}\) is \(X_1X_2X_3\), a logical operator of weight three, and nothing lighter exists because the lightest Hamming codeword outside the simplex code has weight 3; that is \(d_X\), and \(d_Z\) is the same by the symmetry \(H_X = H_Z\). So every single-qubit error is corrected, and the decoder is the Hamming decoder run twice: an \(X\) error on qubit \(j\) gives \(s_Z = j\) in binary, a \(Z\) error gives \(s_X = j\), and a \(Y\) gives both. Figure A opens on this case: \(X_5\) lights the first and third rows of \(H_Z\), and \(101\) is 5.
Because \(H_X = H_Z\), swapping \(X \leftrightarrow Z\) maps the stabilizer group to itself, so a Hadamard on every qubit maps the codespace to itself and acts as a logical Hadamard. A gate applied qubit by qubit like this is called transversal, and every CSS code also has a transversal CNOT between two code blocks, which is one reason CSS codes are the usual setting for fault-tolerant computation.
Interactive figures
Figure A shows a CSS code as its two check matrices, one column per qubit; part 2.5 draws the same two matrices as a graph. Click a qubit to cycle through \(X\), \(Z\) and \(Y\): the \(X\) part of the error lights the rows of \(H_Z\) it anticommutes with, the \(Z\) part those of \(H_X\), and the decoder solves each half on its own. It opens on the Steane code with \(X_5\): the lit rows read \(s_Z = 101\), which is 5 in binary. The menu also holds the Shor code, the \([[4,2,2]]\) code, where any single error matches every column at once, and the three-qubit code with its empty \(H_X\).
Figure B builds a CSS code from any two classical codes of length seven and tests the condition \(H_X H_Z^{\mathsf T} = 0\). Hamming with Hamming gives the Steane code; Hamming with the even-weight code gives a \([[7,3,2]]\) detection code; Hamming with the repetition code fails, and the product matrix shows which checks anticommute.
Problems
Each solution is hidden until you open it. Numbers can be checked against the figures above.
The Steane code from the Hamming code. (a) Check \(H_{\text{Ham}} H_{\text{Ham}}^{\mathsf T} = 0\) by looking at row weights and overlaps. (b) What is \(k\)? (c) Give the weights of the eight basis states in \(\ket0_\L\) and in \(\ket1_\L = X^{\otimes7}\ket0_\L\), and use them to show that \(\bar Z = Z^{\otimes7}\) acts correctly.
Solution
(a) Each row has weight 4 (even), and each pair of rows overlaps in two places (rows 1 and 2 at positions 6, 7; rows 1 and 3 at 5, 7; rows 2 and 3 at 3, 7). Every entry of the product is an even number, so zero mod 2.
(b) \(k = 7 - 3 - 3 = 1\).
(c) \(\ket0_\L\) is the sum over the simplex code: one word of weight 0 and seven of weight 4. Complementing gives \(\ket1_\L\): one word of weight 7 and seven of weight 3. \(Z^{\otimes7}\) multiplies a basis state by \((-1)^{\text{weight}}\): \(+1\) on every term of \(\ket0_\L\), \(-1\) on every term of \(\ket1_\L\).
Decoding the Steane code by hand. (a) The error is \(X_3Z_5\). Compute \(s_Z = H_Z e_X\) and \(s_X = H_X e_Z\), and the correction. (b) The error is \(Y_6\). (c) The error is \(X_1X_2\). What does the decoder do, and what is left?
Solution
(a) Column \(j\) of \(H_{\text{Ham}}\) is \(j\) in binary: \(s_Z = 011\) (3) and \(s_X = 101\) (5), so the decoder applies \(X_3\) and \(Z_5\).
(b) \(Y_6\) has both parts: \(s_Z = s_X = 110\) (6). The decoder applies \(X_6\) and \(Z_6\), which equals \(Y_6\) up to a phase.
(c) \(s_Z = 001 \oplus 010 = 011\), pointing at qubit 3, so the decoder applies \(X_3\). The net \(X_1X_2X_3\) has \(s_Z = 0\), and \(1110000\) is a Hamming codeword but not a simplex word (those have weight 0 or 4), so it is a weight-3 logical \(\bar X\): the same failure as \(X_1X_2\) in the Shor code.
Shor's code as a CSS code. Write \(H_X\) and \(H_Z\) for the Shor code, check \(H_X H_Z^{\mathsf T} = 0\), find \(k\), and compute \(d_X\) and \(d_Z\) from their definitions.
Solution
\(H_Z\) has six rows, \(110000000\), \(011000000\), \(000110000\), \(000011000\), \(000000110\) and \(000000011\); \(H_X\) has \(111111000\) and \(000111111\). Each \(X\) row meets each \(Z\) row in 0 or 2 places, so the product vanishes. The ranks are 6 and 2, so \(k = 9 - 2 - 6 = 1\).
\(\ker H_Z\) is the set of words constant on each block (\(000\) or \(111\)). Removing \(\operatorname{row} H_X\), whose words are \(0\), \(111111000\), \(000111111\) and \(111000111\), leaves \(111000000\) as the lightest, so \(d_X = 3\). \(\ker H_X\) is the set of words whose blocks have equal parity; \(\operatorname{row} H_Z\) is the set with every block even. The lightest word outside is one bit per block, \(100100100\), so \(d_Z = 3\).
The \(X\)-type logical \(X_1X_2X_3\) is the operator called \(\bar Z\) in part 2: the names follow the codewords of eq. 43, not the type of the operator.
A detection code from the even-weight code. Take \(H_X = (1\,1\,1\,1\,1\,1\,1)\) and \(H_Z = H_{\text{Ham}}\). (a) Is this a valid CSS code? (b) What is \(k\)? (c) Find \(d_X\) and \(d_Z\). Which errors of weight 2 go undetected? (This is the \([[7,3,2]]\) code of figure B.)
Solution
(a) The all-ones row meets each Hamming row in 4 places: even, so \(H_X H_Z^{\mathsf T} = 0\).
(b) \(k = 7 - 1 - 3 = 3\).
(c) \(d_X\): the lightest Hamming codeword outside \(\{0, 1111111\}\) has weight 3. \(d_Z\): \(\ker H_X\) is the even-weight words, \(\operatorname{row} H_Z\) is the simplex code (weights 0 and 4), and any weight-2 word lies in the first but not the second, so \(d_Z = 2\). All 21 errors \(Z_iZ_j\) go undetected and act as logical operators; every \(X\) error of weight 2 is detected.
Why Hamming with repetition fails. Take \(H_X = H_{\text{Ham}}\) and \(H_Z\) the checks \(x_i \oplus x_{i+1}\) of the length-7 repetition code. Find a pair of checks that anticommute, and explain in terms of codes why no choice of rows could work.
Solution
\(X_4X_5X_6X_7\) (the first Hamming row) and \(Z_3Z_4\) overlap only on qubit 4, so they anticommute; 10 of the 18 pairs do.
\(H_X H_Z^{\mathsf T} = 0\) says every row of \(H_Z\) lies in \(\ker H_X\), the Hamming code. The repetition checks have weight 2, and the Hamming code has no nonzero word lighter than 3, so none of them can.
The [[4,2,2]] code in both languages. Take \(H_X = H_Z = (1\,1\,1\,1)\). (a) List \(C_1 = \ker H_Z\) and \(C_2 = \operatorname{row} H_X\) as sets of words, with \(k_1\) and \(k_2\), and check \(C_2 \subseteq C_1\). (b) Compute \(k\) from the ranks and from \(k_1 - k_2\). (c) List the cosets of \(C_2\) in \(C_1\) and write the codeword each one gives; compare eq. 32 of part 2. (d) Compute \(d_X\) and \(d_Z\) from their definitions.
Solution
(a) \(C_1\) is the even-weight words \(0000\), \(1100\), \(1010\), \(1001\), \(0110\), \(0101\), \(0011\), \(1111\), so \(k_1 = 3\). \(C_2 = \{0000, 1111\}\), \(k_2 = 1\). \(1111\) has even weight, so \(C_2 \subseteq C_1\); equivalently \((1\,1\,1\,1)\cdot(1\,1\,1\,1) = 4 = 0\) mod 2.
(b) \(k = 4 - 1 - 1 = 2 = 3 - 1\).
(c) The cosets \(x \oplus C_2\) are \(\{0000, 1111\}\), \(\{0110, 1001\}\), \(\{1010, 0101\}\) and \(\{1100, 0011\}\), and each coset summed with equal amplitudes is one codeword: \(\ket{00}_\L\), \(\ket{01}_\L\), \(\ket{10}_\L\) and \(\ket{11}_\L\) of eq. 32, in that order. Four cosets, \(2^k = 4\).
(d) \(d_X\): the lightest word of \(C_1\) outside \(C_2\) has weight 2, for instance \(1100\), so \(d_X = 2\) and \(X_1X_2\) is a logical operator. \(d_Z\): \(\ker H_X\) is again the even-weight words and \(\operatorname{row} H_Z = \{0000, 1111\}\), so \(d_Z = 2\), with \(Z_1Z_2\). The code is \([[4,2,2]]\), as part 2 found by listing Pauli strings.
Kernel or row space? A CSS code comes with four subspaces of \(\mathbb F_2^n\): \(\operatorname{row} H_X\), \(\ker H_Z\), \(\operatorname{row} H_Z\) and \(\ker H_X\). (a) For an \(X\)-type operator \(X^v\), say what each of \(v \in \operatorname{row} H_X\), \(v \in \ker H_Z\) and \(v \notin \ker H_Z\) means for the code, in the three classes of part 2: harmless, logical, detected. (b) For the Steane code name each of the four subspaces as a classical code and give its dimension. (c) Classify \(X^v\) for \(v = 1000000\), \(0001111\), \(1110000\) and \(1111111\), and give the syndrome where there is one. (d) Why are the answers for \(Z^v\) the same?
Solution
(a) \(v \in \operatorname{row} H_X\): \(X^v\) is a product of \(X\) checks, a stabilizer, harmless. \(v \in \ker H_Z\): every \(Z\) check overlaps \(v\) evenly, so \(X^v\) commutes with all of them and gives syndrome zero; it is harmless if \(v\) is also in \(\operatorname{row} H_X\) and logical otherwise. \(v \notin \ker H_Z\): some \(Z\) check sees it, \(s_Z = H_Z v \ne 0\), detected. The \(X\) checks never enter, since they commute with every \(X^v\).
(b) \(\ker H_Z = \ker H_X\) is the Hamming code \([7,4,3]\), dimension 4; \(\operatorname{row} H_X = \operatorname{row} H_Z\) is the simplex code \([7,3,4]\), dimension 3, whose seven non-zero words all have weight 4.
(c) \(1000000\): weight 1, not a Hamming codeword, detected, with \(s_Z\) equal to column 1 of \(H_{\text{Ham}}\), \(001\). \(0001111\): a row of \(H_{\text{Ham}}\), so \(X_4X_5X_6X_7\) is a stabilizer. \(1110000\): each row of \(H_{\text{Ham}}\) meets it in 0 or 2 places, so it is a Hamming codeword, and its weight 3 is not a simplex weight: logical, the \(\bar X = X_1X_2X_3\) of the text. \(1111111\): meets every row in 4 places, so a Hamming codeword, and not in the simplex code: logical. It differs from \(1110000\) by \(0001111\), a stabilizer, so \(X^{\otimes7}\) and \(X_1X_2X_3\) are the same logical operator.
(d) Swapping the roles of \(X\) and \(Z\) swaps \(H_X\) with \(H_Z\), and for the Steane code they are equal, so every statement about \(X^v\) holds for \(Z^v\) with \(s_X = H_X v\) in place of \(s_Z\).
References
- A. R. Calderbank and P. W. Shor, “Good quantum error-correcting codes exist”, Phys. Rev. A 54, 1098 (1996). arXiv:quant-ph/9512032 · doiThe construction from a pair of nested classical codes, and the proof that good quantum codes exist.
- A. M. Steane, “Error correcting codes in quantum theory”, Phys. Rev. Lett. 77, 793 (1996). doiThe seven-qubit code and the classical-code view of quantum error correction.
- A. M. Steane, “Multiple particle interference and quantum error correction”, Proc. R. Soc. Lond. A 452, 2551 (1996). arXiv:quant-ph/9601029 · doiThe same construction in more detail, including the conditions on the two classical codes.
- A. M. Steane, “Simple quantum error-correcting codes”, Phys. Rev. A 54, 4741 (1996). arXiv:quant-ph/9605021 · doiFurther small CSS codes and how to find them.
- D. Gottesman, Stabilizer codes and quantum error correction, PhD thesis, Caltech (1997). arXiv:quant-ph/9705052The stabilizer formalism in full, with CSS codes as a special case and transversal gates.
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press (2000; 10th anniversary edition 2010), section 10.4.2.Textbook treatment of classical linear codes, CSS codes and the Steane code.
- J. Roffe, “Quantum error correction: an introductory guide”, Contemporary Physics 60, 226 (2019). arXiv:1907.11157 · doiThe introductory guide that parts 1 and 2 follow.