MerLean-example

7 Def 4: CSS Code

Definition 50 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}\).

Definition 51 Three-term chain complex of a CSS code

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

\[ C_1 \xrightarrow {\, H_Z^T\, } C_0 \xrightarrow {\, H_X\, } C_{-1}, \]

where the objects are

\[ C_i = \begin{cases} \mathbb {F}_2^{r_Z} & \text{if } i = 1, \\ \mathbb {F}_2^n & \text{if } i = 0, \\ \mathbb {F}_2^{r_X} & \text{if } i = -1, \\ 0 & \text{otherwise,} \end{cases} \]

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\).

Proof

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

\[ d_{1,0} \circ d_{0,-1} = H_Z^T \circ H_X = 0. \]

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

\[ H_Z^T \circ H_X = 0. \]

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\).

Definition 52 Number of physical qubits
#

Let \(Q\) be a CSS code with parameters \((n, r_X, r_Z)\). The number of physical qubits is

\[ n(Q) := n = \dim C_0. \]
Definition 53 Number of logical qubits

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:

\[ k(Q) := \dim _{\mathbb {F}_2} H_0(Q) = \dim _{\mathbb {F}_2}\! \left(\ker H_X \, \big/\, \operatorname {im}(H_Z^T)\big|_{\ker H_X}\right). \]

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\).

Definition 54 X-distance
#

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)\):

\[ d_X(Q) := \inf \bigl\{ \, \operatorname {wt}(x) \mid x \in \ker H_X,\; x \notin \operatorname {im}(H_Z^T) \, \bigr\} , \]

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\).

Definition 55 Z-distance
#

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

\[ d_Z(Q) := \inf \bigl\{ \, \operatorname {wt}(\varphi ) \mid \varphi \in \ker \bigl((H_Z^T)^\vee \bigr),\; \varphi \notin \operatorname {im}(H_X^\vee ) \, \bigr\} , \]

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.

Definition 56 CSS code distance
#

Let \(Q\) be a CSS code. The overall distance is

\[ d(Q) := \min \bigl(d_X(Q),\, d_Z(Q)\bigr). \]
Definition 57 \([\! [n,k,d]\! ]\)-code predicate
#

Let \(Q\) be a CSS code and let \(k, d \in \mathbb {N}\). We say \(Q\) is an \([\! [n,k,d]\! ]\)-code if

\[ k(Q) = k \quad \text{and} \quad d(Q) = d, \]

i.e., \(Q\) encodes exactly \(k\) logical qubits with overall distance \(d\).

Definition 58 \([\! [n,k,d_X,d_Z]\! ]\)-code predicate

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

\[ k(Q) = k, \quad d_X(Q) = d_X, \quad \text{and} \quad d_Z(Q) = d_Z. \]

This predicate is used when the X- and Z-distances are distinct and one wishes to record both separately.