|q⟩ Bad Qubits

advanced · Physics · Stabilizer Formalism & CSS Codes

Checkpoint: Stabilizer Workout

Time to put the whole module together. This checkpoint analyzes the five-qubit perfect code [[5,1,3]][[5,1,3]] — the smallest code that corrects an arbitrary single-qubit error — using only the binary symplectic machinery you have built across the module.

The code under study

The five-qubit code is defined by four cyclic stabilizer generators, each a cyclic shift of the string XZZXIX Z Z X I:

g1=X0Z1Z2X3I4,g2=I0X1Z2Z3X4,g3=X0I1X2Z3Z4,g4=Z0X1I2X3Z4.\begin{aligned} g_1 &= X_0\, Z_1\, Z_2\, X_3\, I_4, \\ g_2 &= I_0\, X_1\, Z_2\, Z_3\, X_4, \\ g_3 &= X_0\, I_1\, X_2\, Z_3\, Z_4, \\ g_4 &= Z_0\, X_1\, I_2\, X_3\, Z_4. \end{aligned}

It is called perfect because it saturates the quantum Hamming bound: with n=5n=5, the 1+3n=161 + 3n = 16 single-qubit error operators (identity plus X,Y,ZX,Y,Z on each of 5 qubits) map onto exactly 2nk=24=162^{n-k} = 2^4 = 16 distinct syndromes, leaving no waste.

What you will verify

This is a synthesis exercise touching every lesson in the module:

  1. It is a valid stabilizer code (the abelian check). The four generators pairwise commute, computed with the symplectic inner product from the Pauli-group and stabilizer-group lessons.
  2. It encodes one logical qubit (k=1k = 1). Stack the generators into the 4×104 \times 10 check matrix and take its F2\mathbb{F}_2 rank: rank=4\operatorname{rank} = 4, so k=nrank=1k = n - \operatorname{rank} = 1.
  3. Its logical operators are correct. Xˉ=X5\bar X = X^{\otimes 5} and Zˉ=Z5\bar Z = Z^{\otimes 5} each commute with all four stabilizers (so they preserve the codespace) yet anticommute with each other (so they act as a genuine logical XX/ZZ pair).
  4. Its distance is d=3d = 3. Every nontrivial logical operator has weight at least 33, which is why the code corrects any single-qubit error: (31)/2=1\lfloor (3-1)/2 \rfloor = 1.

Putting it together

Encode the four generators as (xz)(x \mid z) vectors, then compute all four facts: pairwise commutation, the F2\mathbb{F}_2 rank (hence kk), the logical-operator (anti)commutation relations, and the distance. Return them as an object { k, abelian, logicalOK, distance }. If your reasoning across the module is sound, you will find k=1k = 1, abelian = true, logicalOK = true, and d=3d = 3 — the full signature of the [[5,1,3]][[5,1,3]] perfect code.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.