7 Def 4: CSS Code
A CSS (Calderbank–Shor–Steane) quantum code of parameters \((n, r_X, r_Z)\) consists of:
An X-type parity check matrix \(H_X : \mathbb {F}_2^n \to \mathbb {F}_2^{r_X}\), a linear map over \(\mathbb {F}_2\).
A Z-type parity check matrix transpose \(H_Z^T : \mathbb {F}_2^{r_Z} \to \mathbb {F}_2^n\), a linear map over \(\mathbb {F}_2\).
The CSS condition: \(H_X \circ H_Z^T = 0\).
The map \(H_Z^T\) serves as the differential from degree \(1\) to degree \(0\) in the associated chain complex \(C_1 \xrightarrow {H_Z^T} C_0 \xrightarrow {H_X} C_{-1}\).
Let \(Q = (H_X, H_Z^T)\) be a CSS code with parameters \((n, r_X, r_Z)\). The associated chain complex \(\operatorname {complex}(Q)\) is the three-term chain complex in \(\operatorname {Mod}_{\mathbb {F}_2}\) of the form
where the objects are
and the differentials are \(d_{1,0} = H_Z^T\) and \(d_{0,-1} = H_X\), with all other differentials zero. This is well-defined as a chain complex because \(\partial ^2 = 0\), which follows from the CSS condition \(H_X \circ H_Z^T = 0\).
We must verify that \(d \circ d = 0\), i.e., for all integers \(i, j, k\) with \(j + 1 = i\) and \(k + 1 = j\), the composition \(d_{i,j} \circ d_{j,k} = 0\).
For degrees \(i, j, k\) with \(j + 1 = i\) and \(k + 1 = j\), the only non-trivial case occurs when \(i = 1\), \(j = 0\), and \(k = -1\) (since all other differentials are zero by definition). In this case, we must show
We expand the composition: rewriting using \(i = 1\), the first differential is \(d_{1,0} = \operatorname {eqToHom} \circ H_Z^T \circ \operatorname {eqToHom}\), and the second is \(d_{0,-1} = \operatorname {eqToHom} \circ H_X \circ \operatorname {eqToHom}\). Applying associativity of composition and composing the adjacent \(\operatorname {eqToHom}\) morphisms (which cancel to the identity since they are inverse transport maps), we reduce to showing
We have \(\operatorname {ofHom}(H_Z^T) \circ \operatorname {ofHom}(H_X) = \operatorname {ofHom}(H_Z^T \circ H_X)\), and by the CSS condition \(Q.\mathtt{css\_ condition}\), we have \(H_X \circ H_Z^T = 0\), which gives \(H_Z^T \circ H_X = 0\) after noting the composition order. Thus the composition is \(0\).
For all other combinations of \(i, j, k\): if \(i = 1\) but \(j \neq 0\), this contradicts \(j + 1 = 1\), hence \(j = 0\) by integer arithmetic. If \(i \neq 1\) and \(i = 0\), \(j = -1\), then \(k = -2\), and \(d_{-1,-2} = 0\) by the shape condition (neither \(-1 \to 0\) nor \(-1 \to -2\) are non-trivial differentials), so the composition is \(0\). In all remaining cases, \(d_{i,j} = 0\), making the composition immediately \(0\).
Let \(Q\) be a CSS code with parameters \((n, r_X, r_Z)\). The number of physical qubits is
Let \(Q = (H_X, H_Z^T)\) be a CSS code. The number of logical qubits is the dimension of the degree-\(0\) homology of the chain complex:
More precisely, \(k(Q) = \operatorname {finrank}_{\mathbb {F}_2}\bigl(\ker H_X \, /\, (\operatorname {range}(H_Z^T))^{-1}(\ker H_X)\bigr)\), where the quotient is taken of the subspace of \(\ker H_X\) by the image of \(H_Z^T\) within \(\ker H_X\).
Let \(Q = (H_X, H_Z^T)\) be a CSS code. The X-distance is the minimum Hamming weight of a vector in \(\ker H_X\) that does not lie in \(\operatorname {im}(H_Z^T)\):
where \(\operatorname {wt}(x) = |\operatorname {supp}(x)|\) is the Hamming weight. By convention, \(d_X = 0\) when \(\ker H_X = \operatorname {im}(H_Z^T)\) (trivial homology), since the infimum of the empty set is \(0\).
Let \(Q = (H_X, H_Z^T)\) be a CSS code. The Z-distance is defined using the dual maps. Since \(H_Z = (H_Z^T)^T\), the kernel of \(H_Z\) corresponds to the kernel of the dual map \((H_Z^T)^\vee : ({\mathbb {F}_2^n})^\vee \to ({\mathbb {F}_2^{r_Z}})^\vee \), and the image of \(H_X^T\) corresponds to the range of the dual map \(H_X^\vee : ({\mathbb {F}_2^{r_X}})^\vee \to ({\mathbb {F}_2^n})^\vee \). Over \(\mathbb {F}_2\) with canonical bases, \((\mathbb {F}_2^n)^\vee \cong \mathbb {F}_2^n\) via the dot product equivalence. Using this identification, the Z-distance is
where \(\operatorname {wt}(\varphi )\) is the Hamming weight of \(\varphi \) viewed as a vector in \(\mathbb {F}_2^n\) via the dot product isomorphism. By convention, \(d_Z = 0\) when the cohomology is trivial.
Let \(Q\) be a CSS code. The overall distance is
Let \(Q\) be a CSS code and let \(k, d \in \mathbb {N}\). We say \(Q\) is an \([\! [n,k,d]\! ]\)-code if
i.e., \(Q\) encodes exactly \(k\) logical qubits with overall distance \(d\).
Let \(Q\) be a CSS code and let \(k, d_X, d_Z \in \mathbb {N}\). We say \(Q\) is an \([\! [n,k,d_X,d_Z]\! ]\)-code if
This predicate is used when the X- and Z-distances are distinct and one wishes to record both separately.