Stabilizer arithmetic is really linear algebra over the two-element field F2. The
bridge between Pauli operators and binary vectors is the check matrix, and once we cross it,
questions about commutation, independence, and code dimension become routine matrix operations.
From Pauli strings to binary vectors
A phase-free Pauli string P=P1⊗⋯⊗Pn is encoded by two length-n binary
vectors x=(x1,…,xn) and z=(z1,…,zn) via the rule
I↦(0,0),X↦(1,0),Z↦(0,1),Y↦(1,1),
read componentwise: xj flags an XorY on qubit j, and zj flags a ZorY. The
single string P becomes the row vector (x∣z)∈F22n. Multiplying two Paulis
(ignoring phase) corresponds to adding their binary vectors mod 2 — exactly what you would
expect, since X⋅Y=iZ has x,z bits (1,0)+(1,1)=(0,1)↦Z.
The check matrix
Stack the binary rows of r stabilizer generators g1,…,gr into an r×2n matrix:
H=[HXHZ],
where HX holds the x-parts and HZ the z-parts. This is the check matrix of the code.
Each row is one generator; each of the 2n columns is one F2 coordinate.
For the three-qubit bit-flip code with g1=Z0Z1, g2=Z1Z2 the check matrix is
H=[000000101101].
The empty left block (HX=0) tells you the code uses only Z-type stabilizers.
Commutation via the symplectic form
The symplectic inner product of two rows becomes a matrix statement. Define the 2n×2nsymplectic form
Λ=(0InIn0).
Then two generators u=(xu∣zu) and v=(xv∣zv) commute iff
uΛvT=xu⋅zv+zu⋅xv≡0(mod2).
The whole stabilizer is abelian precisely when HΛHT=0 over F2.
This is a single matrix equation we can check mechanically.
Independence and code dimension
The generators are independent iff the rows of H are linearly independent over F2,
i.e. rankF2(H)=r. Row reduction (Gaussian elimination with XOR as the
"add" operation) computes this rank. For a stabilizer code on n qubits, the number of encoded
logical qubits is
k=n−rankF2(H).
Each independent generator removes one degree of freedom, halving the codespace; whatever survives
encodes the logical information.
Try it
Build the 4×10 check matrix of the famous five-qubit perfect code with cyclic generators
XZZXI,IXZZX,XIXZZ,ZXIXZ, compute its F2 rank, and report
k=n−rank(H). You should find k=1: the [[5,1,3]] code.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.