Hello! Welcome to your tenth lesson in our module on Quantum Error Correction Fundamentals.
In our last session, we took a focused look at the classical world, establishing the algebraic machinery of linear codes. You learned how to define a code C using either a generator matrix G or a parity-check matrix H, and, most importantly, you explored the powerful concept of the dual code C^⊥.
Today, we'll see the direct payoff of that work. We will use the tools of classical coding theory to construct the Calderbank-Shor-Steane (CSS) codes, a large and fundamentally important family of quantum stabilizer codes. This construction elegantly demonstrates how properties of classical codes translate into the ability to protect quantum information.
Your learning outcome for this lesson is to: Construct a Calderbank-Shor-Steane (CSS) code from a pair of classical linear codes and derive its distance and logical operators.
We'll see that the key to building a valid CSS code lies in a specific orthogonality relationship between two classical codes—a relationship defined precisely by the dual code concept you've just mastered.
1. The CSS Construction: A "Divide and Conquer" Strategy
The core idea behind CSS codes is to handle bit-flip (X) errors and phase-flip (Z) errors independently, using the machinery of classical codes that are designed to correct bit-flips.
Recall that a classical code C is defined by its parity-check matrix H, where a bit string c is a codeword if Hc^T = 0. An error e is detected if He^T ≠ 0.
The CSS construction uses two classical linear codes to build one quantum code:
-
An
[n, k_Z, d_Z]classical code, let's call itC_Z. We use its(n-k_Z) × nparity-check matrix,H_Z, to defineZ-type stabilizers. For each rowhinH_Z, we create a stabilizerS = Z^h. These stabilizers are designed to detectXerrors. AnXerrorX^ewill anticommute withZ^hife \cdot h \neq 0. The full set ofZstabilizers can detect anyXerrorX^eas long aseis not a codeword inC_Z. -
An
[n, k_X, d_X]classical code,C_X. We use its(n-k_X) × nparity-check matrix,H_X, to defineX-type stabilizers. For each rowh'inH_X, we create a stabilizerS' = X^{h'}. These stabilizers detectZerrors. AnyZerrorZ^eis detected as long aseis not a codeword inC_X.
The Crucial Commutativity Condition
For this set of X-type and Z-type operators to form a valid stabilizer group S, they must all commute with each other.
- Two
X-type stabilizers always commute with each other. - Two
Z-type stabilizers always commute with each other. - An
X-type stabilizerX^{h_x}(whereh_xis a row ofH_X) commutes with aZ-type stabilizerZ^{h_z}(whereh_zis a row ofH_Z) if and only if their supports have an even number of overlapping qubits. This is equivalent to the conditionh_x \cdot h_z = 0(mod 2).
For all stabilizers to commute, every row of H_X must be orthogonal to every row of H_Z. This implies the matrix product H_X H_Z^T = 0.
Now, let's connect this to what we know about dual codes. The rows of H_X form a basis for the dual code C_X^\perp. The condition H_X H_Z^T = 0 means that every basis vector of C_X^\perp is in the null space of H_Z. The null space of H_Z is, by definition, the code C_Z. This leads to the fundamental design rule for CSS codes:
CSS Condition:
C_X^\perp \subseteq C_Z
Because of the symmetric nature of duality ((C^\perp)^\perp = C), this also implies the reverse condition: C_Z^\perp \subseteq C_X. The parity checks of one code must be codewords in the other.
To see a formal walkthrough of this construction, please read the following resource.
Lecture 8: CSS Codes 1 Stabilizer Codes
These lecture notes, titled 'CSS Codes', formalize the intuition we've just discussed. They define the CSS code construction and explicitly derive the commutativity condition.
Please read Section 3, 'Calderbank-Shor-Steane (CSS) Codes', and Section 3.1, 'Description of the CSS Code'. Focus on how the stabilizers are defined from classical codes and how the condition C_X^⊥ ⊆ C_Z arises from requiring the stabilizers to commute.
When this condition is met, we successfully form a quantum stabilizer code CSS(C_X, C_Z).
- Physical Qubits (
n): Same as the block length of the classical codes. - Stabilizer Generators: There are
(n - k_X)independentX-type generators and(n - k_Z)independentZ-type generators. The total number of independent generators is(n - k_X) + (n - k_Z). - Logical Qubits (
k): The number of logical qubits isnminus the number of independent stabilizers.
This gives us a[[n, k_X + k_Z - n]]quantum code.
2. Example: The Steane Code
The Steane [[7, 1, 3]] code is a canonical example of the CSS construction. It is built from just one classical code: the famous Hamming [7, 4, 3] code, which we'll call C_H.
From the previous lesson, we know that C_H is an [n, k] = [7, 4] code. Its dual, C_H^\perp, is an [n, n-k] = [7, 3] code. A special property of the Hamming code is that it is weakly self-dual, meaning C_H^\perp \subseteq C_H. (This is not true for general codes).
This property makes it perfect for the CSS construction. We can choose both classical codes to be the Hamming code:
C_X = C_HC_Z = C_H
The CSS condition C_X^\perp \subseteq C_Z becomes C_H^\perp \subseteq C_H, which we know is true.
Let's calculate the parameters of the resulting quantum code:
n = 7k_X = 4,k_Z = 4k = k_X + k_Z - n = 4 + 4 - 7 = 1
So we get a [[7, 1]] code. We have successfully encoded one logical qubit into seven physical qubits. The stabilizers are generated from the parity-check matrix of the Hamming code, H_H.
Z-stabilizers: The 3 rows ofH_Hdefine 3Z-type stabilizers (e.g.,ZIZIZIZ,IZZIIZZ,IZIZIZZ).X-stabilizers: The same 3 rows ofH_Hdefine 3X-type stabilizers (e.g.,XIXIXIX,IXXIIXX,IXIXIXX).
3. Logical Operators and Distance
The power of a code is determined by its distance, which is the weight of the smallest non-trivial logical operator. For a CSS code, the logical operators have a particularly clear interpretation.
An operator is a logical operator if it commutes with all stabilizers but is not itself a product of stabilizers. Let's analyze a purely X-type logical operator, X_L = X^c.
- Commuting with Stabilizers:
X^cmust commute with allZ-type stabilizers (Z^{h_z}forh_za row ofH_Z). This requiresc \cdot h_z = 0for all suchh_z, which is precisely the condition forcto be a codeword inC_Z. - Not a Stabilizer:
X^cmust not be in the stabilizer groupS. TheX-type stabilizers are of the formX^awherea \in C_X^\perp.
Combining these, a non-trivial logical X operator is of the form X^c where c \in C_Z \setminus C_X^\perp. Symmetrically, a non-trivial logical Z operator is Z^c where `c \in C_X \setminus C_Z^\perp$.
The distance of the quantum code is the minimum weight of such an operator. We define two separate distances for X and Z errors:
- The logical
Xdistance,d_X, is the minimum weight of a non-trivial logicalXoperator:d_X = \min\{ \text{wt}(c) \mid c \in C_Z \setminus C_X^\perp \}. - The logical
Zdistance,d_Z, is the minimum weight of a non-trivial logicalZoperator:d_Z = \min\{ \text{wt}(c) \mid c \in C_X \setminus C_Z^\perp \}.
The overall distance d of the CSS code is the minimum of these two: d = \min(d_X, d_Z).
The following reading provides a detailed derivation of this result.
Lecture 8: CSS Codes 1 Stabilizer Codes
We return to the lecture notes on CSS codes to see the formal derivation for the code's distance.
Please read Section 3.2, 'Distance of the CSS code'. Follow the argument that identifies the undetectable errors (N(S)) and the trivial errors (S) to find the set of non-trivial logical operators (N(S) \ S) and thus derive the code distance.
4. Distance of the Steane Code Revisited
Let's apply this formula to our Steane code example, where C_X = C_Z = C_H (the [7,4,3] Hamming code) and C_X^\perp = C_Z^\perp = C_H^\perp (the [7,3,4] dual code).
-
d_X = \min\{ \text{wt}(c) \mid c \in C_H \setminus C_H^\perp \}
The minimum weight of any non-zero codeword inC_Hisd(C_H) = 3. SinceC_H^\perphas minimum weight 4, none of the weight-3 codewords ofC_Hare inC_H^\perp. Therefore, the minimum weight of an element inC_H \setminus C_H^\perpis simply 3. So,d_X = 3. -
d_Z = \min\{ \text{wt}(c) \mid c \in C_H \setminus C_H^\perp \}
The calculation is identical:d_Z = 3. -
d = \min(d_X, d_Z) = 3.
This confirms that the Steane code is a [[7, 1, 3]] code. Its distance of 3 means it can correct any single-qubit error, since floor((3-1)/2) = 1.
- Logical Operators:
- The logical
\bar{X}operators areX^cwherecis any codeword inC_Hthat is not inC_H^\perp. The lowest-weight choices are the weight-3 codewords of the Hamming code. - Similarly, the logical
\bar{Z}operators areZ^cwherecis any weight-3 codeword of the Hamming code.
- The logical
Test your understanding!
Consider a CSS code constructed from two classical codes:
C_1: a[15, 11, 3]Hamming code.C_2 = C_1^\perp: the dual of the Hamming code, which is a[15, 4, 7]code.
Let's build a CSS code with C_X = C_1 and C_Z = C_2.
- First, verify that this is a valid choice. Does
C_X^\perp \subseteq C_Zhold? - What are the parameters
[[n, k, d]]of the resulting quantum codeCSS(C_1, C_2)?
Show answer
-
Validity Check:
We need to check ifC_X^\perp \subseteq C_Z.
We are givenC_X = C_1. Therefore,C_X^\perp = (C_1)^\perp = C_2.
We are also givenC_Z = C_2.
The conditionC_X^\perp \subseteq C_ZbecomesC_2 \subseteq C_2, which is trivially true. So, this is a valid construction. -
Code Parameters:
n: The block length isn = 15.k: The number of logical qubits isk = k_X + k_Z - n.C_X = C_1is a[15, 11]code, sok_X = 11.C_Z = C_2is a[15, 4]code, sok_Z = 4.k = 11 + 4 - 15 = 0. This code has zero logical qubits! It is a[[15, 0]]code, defining a single quantum state. While a valid code, it cannot store information. This happens becauseC_Z = C_X^\perp, which is the boundary case of the containment conditionC_X^\perp \subseteq C_Z.
d: We need to calculated_Xandd_Z.d_X = \min\{ \text{wt}(c) \mid c \in C_Z \setminus C_X^\perp \}. Here, this is\min\{ \text{wt}(c) \mid c \in C_2 \setminus C_2 \}. The setC_2 \setminus C_2is empty. By convention, the minimum over an empty set is infinity. Sod_X = \infty.d_Z = \min\{ \text{wt}(c) \mid c \in C_X \setminus C_Z^\perp \}. Here,C_X = C_1andC_Z^\perp = (C_2)^\perp = ((C_1)^\perp)^\perp = C_1. So we need\min\{ \text{wt}(c) \mid c \in C_1 \setminus C_1 \}, which is also\infty.
- Something seems off. Let's re-read the definition of logical operators. They are in
N(S) \ S. In our case, the stabilizer groupSis the normalizerN(S).S = {X^a Z^b | a \in C_X^\perp, b \in C_Z^\perp}andN(S) = {X^a Z^b | a \in C_Z, b \in C_X}. SinceC_Z=C_X^\perpandC_X=C_Z^\perp, these sets are identical. There are no non-trivial logical operators, which is consistent withk=0. The distance of ak=0code is usually considered infinite. The code[[15, 0, d]]withd=\min(d(C_1), d(C_2)) = \min(3,7)=3is a better way to think of this.
This example shows that not every valid CSS construction yields a useful code for storing quantum information. To get k > 0, we need k_X + k_Z > n, which requires that C_X^\perp is a proper subset of C_Z.
Conclusion
In this lesson, we bridged the gap between classical and quantum error correction by exploring the elegant CSS construction. You've seen how the properties of two classical codes, linked by the concept of duality, directly determine the parameters and power of a new quantum code.
Key Takeaways:
- CSS codes are built from two classical linear codes,
C_XandC_Z, which handleZandXerrors respectively. - A valid CSS code can be constructed if and only if
C_X^\perp \subseteq C_Z. - The resulting quantum code
CSS(C_X, C_Z)has parameters[[n, k_X + k_Z - n, d]]. - The logical
Xoperators are associated with codewords inC_Z \setminus C_X^\perp. - The logical
Zoperators are associated with codewords inC_X \setminus C_Z^\perp. - The distance
dis the minimum weight of these non-trivial logical operators.
Preview of the next lesson:
We have now studied the Shor code and the general CSS construction. This concludes our module on the fundamentals of quantum error correction. We are now prepared to move into Module 6: "Fault-Tolerant Quantum Computing". In the next lesson, we will begin by distinguishing between Clifford and non-Clifford gates and analyzing the Gottesman-Knill theorem, which sets fundamental limits on the classical simulation of quantum circuits and motivates the need for fault-tolerant designs.