---
title: Nested CSS Code Pairs
url: https://www.emergentmind.com/topics/nested-calderbank-shor-steane-code-pairs
type: topic
---

# Nested CSS Code Pairs

Nested Calderbank–Shor–Steane code pairs are families of CSS constructions in which one code, code space, or chain complex is related to another by an inclusion, a dual-containment condition, or a homological map that preserves the logical sector. In the most classical formulation, the relevant data are linear codes \(C_1 \subsetneq C_0 \subseteq \mathbb{F}_q^n\), or the dual-containing specialization \(C^\perp \subseteq C\), from which CSS stabilizer codes are obtained. In more recent homological formulations, a “nested pair” may instead mean two CSS chain complexes linked by a chain map, a mapping cone, or a pushout, so that logical operators, code parameters, or measurement outcomes are transferred between distinct codes rather than extracted from a single dual-containing classical code. Across these formulations, nested CSS pairs underpin logical measurements, code surgery, code embeddings, communication-efficient quantum secret sharing, and finite-degree quantum LDPC constructions [1705.00239], [2211.03625], [2301.13738], [2507.05361], [2603.24588].

## 1. Algebraic foundations of nesting in CSS theory

A binary CSS code with parameters \([[n,k,d]]\) can be specified by parity-check matrices
\[
H_X : F^n \to F^{r_X},\qquad H_Z : F^n \to F^{r_Z},
\]
satisfying
\[
H_X H_Z^T = 0.
\]
The \(X\)-stabilizers are rows of \(H_X\), the \(Z\)-stabilizers are rows of \(H_Z\), logical \(X\)-operators are representatives in \(\ker(H_Z)\setminus (H_X)\), and logical \(Z\)-operators are in \(\ker(H_X)\setminus (H_Z)\). The corresponding distances are
\[
d_X := \min\{|c| : c \in \ker(H_Z)\setminus (H_X)\},\quad
d_Z := \min\{|c| : c \in \ker(H_X)\setminus (H_Z)\},\quad
d = \min\{d_X,d_Z\}.
\]
Equivalently, the code is a length-3 chain complex
\[
C_2 \xrightarrow{\partial_2} C_1 \xrightarrow{\partial_1} C_0
\]
with \(\partial_2 = H_Z^T\), \(\partial_1 = H_X\), and \(\partial_1\partial_2 = 0\) [2211.03625].

A second, widely used formulation starts from nested classical codes. If \(C_1 \subsetneq C_0 \subseteq \mathbb{F}_q^n\), then \(\mathrm{CSS}(C_0,C_1)\) is an \([[n,k_0-k_1,\delta]]_q\) stabilizer code with
\[
\delta = \min\big\{\wt(C_0 \setminus C_1),\ \wt(C_1^\perp \setminus C_0^\perp)\big\}.
\]
The dual-containing specialization \(C^\perp \subseteq C\) yields an \([[n,2k-n,\ge d]]_q\) stabilizer code that is pure to \(d\) [2211.06910], [1705.00239].

These two formulations are compatible. The parity-check condition \(H_XH_Z^T=0\) is the matrix form of the chain-complex relation \(\partial_1\partial_2=0\), while the classical inclusion \(C_2^\perp \subseteq C_1\) is the conventional CSS orthogonality condition. Nested CSS pairs therefore include both code pairs defined by subspace containment and code pairs defined by morphisms between distinct chain complexes [2211.03625], [2507.05361].

## 2. Dual-containing and geometric realizations

In algebraic coding theory, the most direct nested CSS pair is the chain
\[
C^\perp \subseteq C \subseteq \mathbb{F}_q^n.
\]
The paper on cyclic codes restricts precisely to this situation and uses the CSS lemma: if there exists a classical linear \([n,k,d]_q\) code \(C\) such that \(C^\perp \subseteq C\), then there exists an \([[n, 2k-n, \ge d]]_q\) stabilizer code that is pure to \(d\) [1705.00239].

That construction is realized through \(q\)-cyclotomic cosets. If a cyclic code has a defining set consisting of a single \(q\)-coset \(C_x\) containing \(r+1\) consecutive integers, then the BCH bound gives \(d \ge r+2\). Under the conditions of Theorem 3.1, there exists an \([n,n-m^*,d>r+2]_q\) cyclic code, where \(m^*\) is the cardinality of the \(q\)-coset containing those consecutive integers. If additionally \(C_x \cap C_{-x}=\emptyset\), the code is dual-containing and produces an \([[n,n-2m^*,d>r+2]]_q\) quantum code [1705.00239]. The explicit examples include \([[11,1,\ge 4]]_5\), \([[61,51,\ge 3]]_9\), \([[67,61,\ge 3]]_{29}\), and \([[73,67,\ge 3]]_{64}\); some of these satisfy \(n+2-k-2d \le 2\), so they lie close to the Quantum Singleton Bound [1705.00239].

A geometric variant appears in toric-surface constructions. There, the classical code \(C_{S,D}\) is an evaluation code obtained from sections of \(\mathcal{O}_X(D)\) on a smooth complete toric surface, evaluated on a finite support set \(S\subset T_N(\mathbb{F}_q)\). The key duality mechanism is a dualizing differential form
\[
\omega_0 \in H^0\bigl(X,\omega_X(D_1+D_2-2D)\bigr),
\]
whose residues define a weighted dual. The resulting restricted code satisfies
\[
C_{R,\square} \subseteq (C_{R,\square})^{\perp_w},
\]
where \(w_P=\mathrm{Res}_P(\omega_0)\). If the weights are squares, a coordinatewise rescaling produces \(\widetilde C \subseteq \widetilde C^\perp\), hence a dual-containing CSS pair in the usual Euclidean sense [1203.4544]. On toric Hirzebruch surfaces, the construction is made explicit through toric divisors, intersection theory, and residue calculations [1203.4544].

These two lines of work illustrate that “nested CSS pair” need not refer to a single combinatorial paradigm. In one case the nesting is encoded by cyclotomic-coset combinatorics; in the other it is encoded by divisor theory and residues. The invariant feature is the same: a classical code contains an appropriate dual, so that the CSS orthogonality constraint is satisfied [1705.00239], [1203.4544].

## 3. Homological and categorical formulations

A broader notion of nested CSS pair arises when CSS codes are treated as chain complexes rather than merely as dual-containing classical codes. In the homomorphic-measurement framework, one has a data code \((H_X,H_Z)\), an ancilla code \((H_X',H_Z')\), and a binary matrix
\[
\Gamma : F^m \rightarrow F^n
\]
describing the CNOT pattern. The defining compatibility conditions are
\[
(H_Z' \Gamma^T) \subseteq (H_Z),\qquad (H_X \Gamma) \subseteq (H_X').
\]
These conditions imply the existence of maps
\[
\gamma_2 : C_2' \to C_2,\qquad \gamma_1 : C_1' \to C_1,\qquad \gamma_0 : C_0' \to C_0
\]
with
\[
\partial_2 \gamma_2 = \gamma_1 \partial_2',\qquad \gamma_0 \partial_1' = \partial_1 \gamma_1,
\]
so the ancilla and data codes form a commutative diagram of chain complexes. The ancilla–data pair is therefore “nested” by a chain homomorphism rather than by literal subspace inclusion [2211.03625].

The embedding framework of 2025 makes this point systematic. A CSS code with parity-check matrices \(H_Z,H_X\) is represented as
\[
C = \mathbb{F}_2^{n_Z} \xrightarrow{H_Z} \mathbb{F}_2^n \xrightarrow{H_X^T} \mathbb{F}_2^{n_X},
\]
with \(H_1(C)\) encoding \(Z\)-type logicals and \(H_1(C^T)\) encoding \(X\)-type logicals. The central construction is a multi-level cone whose differential is block lower triangular. In the 3-level case,
\[
\partial =
\begin{pmatrix}
\partial^{2} & 0 & 0 \\
g_2          & \partial^{1} & 0 \\
p            & g_1          & \partial^{0}
\end{pmatrix},
\]
and the “embedded” code is the column complex
\[
C^{\bg} : H_2(\partial^2) \xrightarrow{[g_2]} H_1(\partial^1) \xrightarrow{[g_1]} H_0(\partial^0).
\]
Under the regularity assumption \(H_1(\partial^0)=0\) and \(H_1(\partial^2)=0\), Theorem 1.1 gives a natural isomorphism
\[
H_1(\partial^{\bg}) \xrightarrow{\ \cong\ } H_1(\partial).
\]
In this sense, nested CSS pairs consist of an input code and a larger output code with canonically isomorphic logical sectors, even though the output may have more qubits, more checks, different geometry, or lower check weight [2507.05361].

Code surgery provides a categorical analogue. There, a code map is a chain map \(f_\bullet:C_\bullet\to D_\bullet\), and surgery is expressed by a pushout in the category of chain complexes. Merging two codes along a shared logical operator subcomplex \(V_\bullet\) produces a new code \(Q_\bullet\) that identifies the logicals represented on \(C_\bullet\) and \(D_\bullet\). This formulation treats nested CSS pairs as monic chain maps, subcomplex inclusions, and universal colimits rather than only as dual-containing classical code pairs [2301.13738].

## 4. Nested pairs in logical measurement, surgery, and code modification

Homomorphic logical measurement makes the operational role of nested CSS pairs explicit. The ancilla is prepared in
\[
\overline{|0^{\otimes k'}\rangle},
\]
whose \(Z\)-stabilizer space is \(\ker H_X'\). After the CNOT pattern \(\Gamma\), any \(v\in \ker H_X'\) transforms to \(\Gamma v \oplus v\). If \(v \in (H_Z')\), the outcome is classical syndrome information. If \(v\notin (H_Z')\), then \(v\) is a nontrivial ancilla logical \(Z\), and \(\Gamma v\) is a nontrivial \(Z\)-type logical operator of the data code. Thus the logical \(Z\)-operators implementable by a gadget are
\[
\Gamma(\ker H_X') \subseteq \ker H_X
\]
modulo stabilizers [2211.03625].

This framework unifies Shor and Steane measurements. Shor measurement is a degenerate homomorphic gadget with ancilla distance \(d'=1\), while Steane measurement is the identity case \(C_{\text{anc}}=C_{\text{data}}\) and \(\Gamma=I_n\). The intermediate regime uses ancilla codes with \(k'=1\), \(d'=d\), and LDPC structure, thereby “filling the space between Shor and Steane” [2211.03625]. The related syndrome-extraction work on toric codes states that blocks of size \(m\times m\) can be used to decode errors in \(O(L/m)\) rounds of measurements, which makes the interpolation between Shor-style and Steane-style ancillas explicit at the circuit level [2012.15403].

For surface codes, the ancilla can be constructed from a covering space. If the data lattice is \(D=(V,E,F)\) on a closed surface \(M=U/G\), a chosen logical loop \(\ell\) determines a subgroup \(H=\langle g\rangle\), an intermediate quotient \(U/H\), and a finite subcomplex \(A\subset \widetilde D\) encoding exactly one logical qubit with distance \(d_A=d_D\). The induced map
\[
\gamma := p \circ \tilde{\gamma}
\]
yields chain maps \(\gamma_2,\gamma_1,\gamma_0\), with \(\Gamma=\gamma_1\), satisfying the homomorphic conditions. Conventional surface-code decoders, such as minimum-weight perfect matching, can be directly applied to these constructions [2211.03625].

The same operational theme appears in code surgery. If two CSS codes share a separated logical operator subcomplex, their \(\overline Z\)-merge identifies the corresponding logical \(Z\)’s. Under separation, the merged code has
\[
n_Q = n_C + n_D - n_V,\qquad k_Q \ge k_C + k_D - 1,
\]
and, if no extra logical qubits are introduced,
\[
d_Q^X \ge \min(d_C^X,d_D^X).
\]
For LDPC families, the merged code remains LDPC, with
\[
w_Q^Z = \max(w_C^Z, w_D^Z),\quad w_Q^X < w_C^X + w_D^X,
\]
\[
q_Q^Z \le q_C^Z + q_D^Z,\quad q_Q^X = \max(q_C^X, q_D^X).
\]
The sandwiched merge protocol then gives a distance-\(d\) measurement of \(\overline Z_C\overline Z_D\) or, dually, \(\overline X_C\overline X_D\), provided the gauge-fixing and distance-bounded-below conditions hold [2301.13738].

This suggests that nested CSS pairs serve not only as static code constructions but also as transition objects between codes. In homomorphic measurement they transfer a logical observable to an ancilla. In surgery they transfer a shared logical degree of freedom to a pushout code. In both cases, the nesting is the mechanism that controls fault propagation and logical equivalence [2211.03625], [2301.13738].

## 5. Extended, concatenated, and communication-efficient nested pairs

In communication-efficient quantum secret sharing, nested CSS pairs are extended rather than merely embedded. The basic object is the extended CSS code
\[
\mathrm{ECSS}(F_0,F_1,G_E) \equiv \mathrm{CSS}(C_0,C_1),
\]
built from a nested pair \(F_1 \subsetneq F_0 \subseteq \mathbb{F}_q^n\) and a matrix \(G_E\) with row space \(E\subseteq\mathbb{F}_q^n\), subject to
\[
F_0 \cap E = \{0\}.
\]
The resulting classical codes on \(n+e\) qudits are
\[
G_{C_0} =
\begin{bmatrix}
G_{F_0} & 0 \\
G_E     & I_e
\end{bmatrix},\qquad
G_{C_1} =
\begin{bmatrix}
G_{F_1} & 0 \\
G_E     & I_e
\end{bmatrix},
\]
so the logical dimension remains \(f_0-f_1\) [2211.06910].

The access structure is determined by further nested pairs derived from \(F_0,F_1\) and subcodes \(U,V\subseteq E\). With prior access to \(u\) extension qudits, the recovery threshold is
\[
\tau_u = n - \min\!\big\{ \wt\big((F_0+V)\setminus (F_1+V)\big),\ 
\wt\big((F_1+U)^\perp \setminus (F_0+U)^\perp\big) \big\} + 1.
\]
The full CE-QSS construction then uses a nested chain
\[
B_2 \subsetneq B_1 \subsetneq B_0,\qquad A_2 \subseteq A_1 \subsetneq B_0,\qquad E\subseteq B_1,
\]
with
\[
B_0 = B_1 + A_1,\quad B_1 \cap A_1 = \{0\},\quad B_1 = B_2 + E,\quad B_2 \cap E = \{0\}.
\]
An outer \(\mathrm{ECSS}(A_1+B_2,B_2,G_E)\) is concatenated with an inner \(\mathrm{CSS}(A_2+B_1,B_1)\). In the GRS-based instantiation, the resulting CE-QSS scheme meets both the storage and communication cost bounds with equality [2211.06910].

A related, but asymptotic, use of nesting appears in partially concatenated CSS codes. There the key matrices are
\[
\mathscr{H}_X = H_2 G_1,\qquad \mathscr{H}_Z = H_1,
\]
so that
\[
\mathscr{C}_X^\perp \subseteq \mathscr{C}_Z.
\]
This nested pair yields a PC-CSS code \(\mathscr{Q}=[[n_{\mathscr{Q}},k_{\mathscr{Q}},d_{\mathscr{Q}}]]_q\) with
\[
\frac{k_{\mathscr{Q}}}{n_{\mathscr{Q}}} \ge 1-2H_q(\delta_{\mathscr{Q}})-O(1),
\]
thus asymptotically achieving the quantum Gilbert–Varshamov bound. The same paper combines this with Steane’s enlargement by constructing a nested triple
\[
C_1^\perp \subseteq C_1 \subseteq C_3,
\]
which yields enlarged stabilizer codes satisfying
\[
\frac{k_{\mathscr{Q}}}{n_{\mathscr{Q}}} \ge 1-H_q(\delta_{\mathscr{Q}})-H_q\!\Big(\frac{q}{q+1}\delta_{\mathscr{Q}}\Big)-O(1).
\]
It also gives two explicit families,
\[
\mathscr{Q}_1=[[N,\Omega(\sqrt{N}),\Omega(\sqrt{N})]]
\]
and
\[
\mathscr{Q}_2=[[N,\Omega(N/\log N),\Omega(N/\log N)/\Omega(\log N)]],
\]
together with the stated \(O(N)\), \(O(\sqrt N)\), and \(O(\log N)\) encoding and decoding complexities [2107.05174].

Across these constructions, the nested pair is the device that separates roles. One pair carries the secret or the data, another pair carries extension or concatenation structure, and the inclusion relations determine which errors are logical, which are degenerate, and which recovery sets are authorized [2211.06910], [2107.05174].

## 6. Finite-degree quantum LDPC pairs and current directions

The most recent finite-degree LDPC construction makes the nesting explicit at the level of sparse matrices. One starts from
\[
A_X := \begin{bmatrix} A_Z \\ A_\Delta \end{bmatrix},
\]
so that
\[
Row(A_Z) \subseteq Row(A_X).
\]
With a square sparse matrix \(B\), the visible classical codes are
\[
C_Z = B(\ker A_Z),\qquad C_X = \bigl(B(\ker A_X)\bigr)^\perp.
\]
Because \(\ker A_X \subseteq \ker A_Z\), one has \(C_Z^\perp \subseteq C_X\), hence \((C_X,C_Z)\) is a CSS pair [2603.24588].

In the homogeneous regular regime, with a balanced triple satisfying \(j_X+j_Z=k\), the design quantum rate is
\[
R_Q^{\mathrm{des}} = 1 - \frac{2j_Z}{k},
\]
so positivity requires \(j_Z<k/2\). For fixed balanced triples with even degrees and \(4 \le j_Z < k/2\), the actual rates converge in probability to the design rates, and both constituent classical codes have minimum distance \(\Omega(n)\) with high probability. Consequently the CSS relative distances are also linear [2603.24588].

For the seven explicit balanced triples
\[
\mathcal T_{\mathrm{GV}}=
\{(4,6,10), (4,8,12), (5,9,14), (6,14,20), (5,17,22), (4,20,24), (4,26,30)\},
\]
the same paper proves, by a rigorous computer-assisted exponent analysis, that both classical constituents attain the classical GV distance and the resulting CSS code attains the CSS GV bound at finite degree [2603.24588]. This moves the notion of nested CSS pair into a regime where bounded check degree, positive rate, and GV-optimal asymptotic distance coexist.

Several open directions are stated explicitly in the literature. Homomorphic logical measurements are left open beyond the CSS setting: “Generalizations of our framework to non-CSS Pauli measurements is a natural direction, which is left for future work” [2211.03625]. For product-based LDPC codes, the same paper states that “It is unlikely that for codes with product constructions, useful homomorphic gadgets have product structure as well” [2211.03625]. The embedding framework identifies a general homological criterion for preserving logical qubits, but it also notes that distance arguments for some subdivisions remain open [2507.05361]. The finite-degree LDPC construction leaves sparse syndrome representatives and practical BP decoding as unresolved issues and formulates a conjecture that any balanced triple with \(4\le j_Z<k/2\) should attain finite-degree GV behavior [2603.24588].

A common misconception is that nested CSS code pairs are exhausted by the dual-containing condition \(C^\perp \subseteq C\). The literature here shows a broader picture. Nested pairs include dual-containing cyclic and toric-surface codes, ancilla–data pairs linked by a chain homomorphism, input–output code pairs related by mapping cones, and code families glued by surgery pushouts [1705.00239], [1203.4544], [2211.03625], [2301.13738], [2507.05361]. This suggests that “nested CSS pair” is best understood as a structural relation that preserves CSS compatibility while transporting logical information across algebraic, geometric, and operational transformations.

Source: https://www.emergentmind.com/topics/nested-calderbank-shor-steane-code-pairs