<figure><img src="image_1.png" /></figure>

HAL
open science

# Single-shot and measurement-based quantum error correction via fault complexes

Timo Hillmann, Guillaume Dauphinais, Ilan Tzitrin, Michael Vasmer

► To cite this version:

Timo Hillmann, Guillaume Dauphinais, Ilan Tzitrin, Michael Vasmer. Single-shot and measurement-based quantum error correction via fault complexes. Physical Review A, 2025, 112 (4), pp.L040401. 10.1103/cjb4-l57n. hal-05368432

HAL Id: hal-05368432

https://hal.science/hal-05368432v1

Submitted on 17 Nov 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Single-shot and measurement-based quantum error correction via fault complexes

Timo Hillmann,¹,¹,*, Guillaume Dauphinais,¹ Ilan Tzitrin,¹,† and Michael Vasmer¹,³,⁴

¹Xanadu Quantum Technologies Inc., Toronto, Ontario M5G 2C8, Canada

²Department of Microtechnology and Nanoscience (MC2), Chalmers University of Technology, SE-412 96 Gothenburg, Sweden

³Perimeter Institute for Theoretical Physics, Waterloo, Ontario N2L 2Y5, Canada

⁴Institute for Quantum Computing, Waterloo, Ontario N2L 3G1, Canada

<figure><img src="image_3.png" /></figure>

(Received 11 November 2024; revised 22 April 2025; accepted 16 September 2025; published 9 October 2025)

Photonics provides a viable path to a scalable fault-tolerant quantum computer. The natural framework for this platform is measurement-based quantum computation, where fault-tolerant graph states supersede traditional quantum error-correcting codes. However, the existing formalism for foliation—the construction of fault-tolerant graph states—does not reveal how certain properties, such as single-shot error correction, manifest in the measurement-based setting. We introduce the fault complex, a representation of dynamic quantum error-correction protocols particularly well suited to describe foliation. Our approach enables precise computation of fault tolerance properties of foliated codes and provides insights into circuit-based quantum computation. Analyzing the fault complex yields improved thresholds for three- and four-dimensional toric codes, a generalization of stability experiments, and the existence of single-shot lattice surgery with higher-dimensional topological codes.

DOI: 10.1103/cjb4-157n

*Introduction.* Photonic platforms for quantum computing [1–6] are well suited to measurement-based quantum computing (MBQC) [7]. In this paradigm, in contrast to circuit-based quantum computation (CBQC), the central object is not a quantum error-correcting (QEC) code but a fault-tolerant graph state (FTGS). Various methods for constructing FTGS exist [8–10], with the concept of foliation [11,12] offering a prescription for any Calderbank-Shor-Steane (CSS) code [13,14]. Here, we introduce the *fault complex*, a representation of faults in a dynamic QEC protocol (rather than a static QEC code) formulated in the language of homology and chain complexes [15–18]. We focus on fault complexes obtained via foliation, which we recast in the language of homology as a tensor product [19,20] between a CSS code and a repetition code. This formalism allows us to easily calculate properties like the fault distance and also applies to CBQC, where it represents repeated rounds of error correction. Analysis of the fault complex enables us to understand the decoding of single-shot codes in MBQC and achieve improved error thresholds for three-dimensional (3D) and 4D toric codes [21–24]. Through the explicit calculation of the homology groups of the fault complex, we generalize the notion of stability experiments [25], which in turn allows us to conclude that

single-shot lattice surgery is possible in higher-dimensional topological codes. The fault complex provides a formal language for fault-tolerant protocols, similar to how homological descriptions serve CSS codes, laying the groundwork for future advances in fault-tolerant quantum computation.

*Background and notation.* An $[n, k, d]$ binary linear code $C$ forms a $k$-dimensional subspace within the $n$-dimensional vector space over $\mathbb{F}_2$. Such a code can be defined by a parity-check matrix (PCM) $H$, where the codewords are the elements of ker $H$. The distance $d$ is the minimum Hamming weight of any nonzero codeword. We use $e_i$ to denote the $i$th unit vector and $[M]_j$ to denote the $j$th row of a matrix $M$. We write **0** and **1** for the all-zero and all-one vectors, respectively.

A stabilizer code [26] is the quantum analog of a linear code and is defined by an Abelian subgroup, $S$, of the Pauli group with $-I \notin S$. The codespace is the $+1$ eigenspace of $S$; logical operators commute with $S$ but are not themselves in $S$. The notation $[n, k, d]$ describes a code in which the stabilizer group is generated by $m = n - k$ independent generators, which are themselves elements of the $n$-qubit Pauli group $\mathcal{P}_n$. The number of encoded qubits is $k$ and the distance $d$ is determined by the minimum weight nontrivial logical operator. A stabilizer code admitting a set of stabilizer generators that are each either $X$-type or $Z$-type operators is referred to as a CSS code [13,14]. These codes can be described by two classical binary linear codes with PCMs $H_X$ and $H_Z$ representing stabilizer generators as tensor products of $X$ and $I$, and $Z$ and $I$, respectively. Commutativity of $X$- and $Z$-type generators is expressed through the condition $H_Z^\dagger H_X = 0$. Error correction proceeds via the measurement of the stabilizer generators, yielding the syndrome $s$, which is the list of stabilizer eigenvalues. This allows the detection and correction of Pauli errors that anticommute with stabilizer

<footnote>*Contact author: timo.hillmann@rwth-aachen.de</footnote>

<footnote>†Contact author: ilan@xanadu.ai</footnote>

<footnote>Published by the American Physical Society under the terms of the Creative Commons Attribution 4.0 International license. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI. Funded by Bibsam.</footnote>
<figure><img src="image_4.png" /><figcaption>FIG. 1. Foliation of the surface code viewed as a fault complex. (a) The distance-3 surface code Tanner graph with circles representing qubits, squares representing X and Z checks, and dashed and solid lines representing the connectivity of these checks, respectively. (b), (c) Hypergraph product of (a) with a repetition code check and bit node, respectively. This yields two types of fault locations, teal and yellow, along with primal (red) and dual (purple) detectors. Dashed and solid lines indicate boundary maps of the fault complex. For simplicity, we omit out-of-plane connections. (d) Unit cell of the fault complex obtained by stacking alternating layers of (b) and (c). A dual detector (purple) is formed by the parity of six dual fault locations (yellow). Vertical red dashed lines are omitted for clarity. (e) Mathematical structure of the fault complex and its relation to (b)–(d): colored circles and squares represent chain complex vector spaces and lines represent boundary maps.</figcaption></figure>

generators; a classical decoder is used to infer recovery operators given a syndrome.

Here, a chain complex of length $n$ denotes a collection of $\mathbb{F}_2$-vector spaces $C_i$ and linear maps $\partial_i^C$ called boundary operators,

$$C = \{0\} \xrightarrow{\partial_{n+1}^C} C_n \xrightarrow{\partial_n^C} \dots \xrightarrow{\partial_z^C} C_1 \xrightarrow{\partial_i^C} C_0 \xrightarrow{\partial_0^C} \{0\}, \quad (1)$$

with the composition fulfilling $\partial_i^C \partial_{i+1}^C = 0$. We suppress superscripts if no distinction is necessary. The quotient $H_i(C) := \ker \partial_i/\mathrm{im} \partial_{i+1}$ is called the $i$th homology group of $C$. Associated with $C$ is also a cochain complex, with coboundary operators $\delta^i: C_i \to C_{i+1}$ defined as $\delta^i = \partial_{i+1}^T$:

$$C^T = \{0\} \xrightarrow{\delta^{-1}} C_0 \xrightarrow{\delta^0} C_1 \dots \xrightarrow{\delta^{n-1}} C_n \xrightarrow{\delta^n} \{0\}, \quad (2)$$

with cohomology groups $H^i := \ker \delta^i/\mathrm{im} \delta^{i-1}$.

Each length-1 chain complex describes an $[n, k, d]$ linear code with boundary map $\partial_1 = H$ from $\mathbb{F}_2^n$ to the space of syndromes $\mathbb{F}_2^r$ with $r \ge n-k$. Similarly, a CSS code, $C$, can represented by a length-2 chain (sub)complex

$$\dots \to C_{i+1} \xrightarrow{\partial_{i+1}} C_i \xrightarrow{\partial_i} C_{i-1} \to \dots, \quad (3)$$

where, by convention, $\partial_{i+1} = H_Z^T$ and $\partial_i = H_X$, such that $\partial_i \partial_{i+1} = 0$ is encoded in the condition that $H_X H_Z^T = 0$. Identifying qubits with the space $C_i$, the code parameters are $n = \dim C_i$, $k = \dim H_i(C)$, and the logical operators are elements of the groups $H_i(C)$ and $H^i(C)$, with the smallest weight element defining $d$.

**Motivating example.** A common way to obtain an FTGS from a CSS code is via foliation [11]. In this procedure, the X and Z Tanner graphs of the code are interpreted as alternating layers of the FTGS and data qubits between adjacent layers are entangled with each other; see Figs. 1(a)–1(d). The computation is then performed by a sequence of adaptive local measurements on the FTGS. We observe that foliation can be algebraically formulated as the tensor (or hypergraph [19,20]) product of a base CSS code with a repetition code [27]; see Fig. 1(e). Denote the resulting complex as $\mathcal{F} = C \times \mathcal{R}$, where $C$ is a length-2 chain complex describing a CSS code and $\mathcal{R}$ is a chain complex describing a repetition code. The spaces of

$\mathcal{F}$ are

$$F_j = \bigoplus_{\ell+m=j} R_{\ell} \otimes C_m, \quad (4)$$

where $R_\ell$ and $C_m$ are the $\ell$th and $m$th spaces of $\mathcal{R}$ and $\mathcal{C}$, respectively. The boundary operators of $\mathcal{F}$ are

$$\partial_j = \left( \frac{\mathbb{1}_r \otimes \partial_j^C}{0} \middle| \mathbb{1}_c \otimes \partial_{j-1}^C \right), \quad (5)$$

where $\partial_j^C$ is the $j$th boundary operator of $C$ and $R$ is the $r \times c$ PCM of the binary linear code. One can observe that $\partial_2$ is the biadjacency matrix of the (bipartite) FTGS, whereas $\partial_1$ and $\partial_3^T$ describe the detectors (or foliated stabilizers) of the FTGS. For example, the rows of $\partial_1$ are of the form $(e_\alpha \otimes [H_X]_\beta)[R]_\alpha \otimes e_\beta)$, with an analogous form for the columns of $\partial_3$. These are exactly the foliated stabilizers of [11]; see Fig. 1(d), which illustrates a dual detector. Each detector (row) above is triggered by a fault on one of the qubits participating in the check $[H_X]_\beta$ or by a syndrome fault in an adjacent layer.

**Fault complexes.** Motivated by the previous example, we define a fault complex to be a length-3 chain (sub)complex $\mathcal{F}$,

$$\dots \to F_{i+2} \xrightarrow{\partial_{i+2}} F_{i+1} \xrightarrow{\partial_{i+1}} F_i \xrightarrow{\partial_i} F_{i-1} \to \dots, \quad (6)$$

where we define *primal fault locations* to be elements of $F_i$ and *dual fault locations* to be elements of $F_{i+1}$. The fault complex has $n = n_i + n_{i+1}$ total faults, where $n_i = \dim F_i$. The boundary map $\partial_{i+1}$ determines equivalent primal and dual faults. We define the primal and dual *detector matrices* to be $D_X = \partial_i$ and $D_Z = \partial_{i+2}^T$, respectively. The syndrome of a primal fault $x \in F_i$ is $D_X^T x$ and the support of a primal detector $u \in F_{i-1}$ is $D_X^T u$ and similarly for dual faults and detectors. In a fault complex, there is no requirement for the commutativity of the primal and dual detector matrices. Instead, we have $\partial_i \partial_{i+1} = 0$, meaning that a primal fault that is equivalent to a dual fault has trivial (primal) syndrome, with an analogous interpretation for $\partial_{i+2}^T \partial_{i+1}^T = 0$.

We refer to the elements of $H^i(\mathcal{F})$ and $H_{i+1}(\mathcal{F})$ as primal and dual *logical correlations*, respectively. These represent the information that the fault complex is designed to protect. Similarly, the elements of $H_i(\mathcal{F})$ and $H^{i+1}(\mathcal{F})$ are the primal
and dual logical errors, respectively. These operators change the values of the logical correlations but have no syndrome and are therefore undetectable. Note that the number of primal logical correlations (or errors) $k_i = \dim H^i(\mathcal{F}) = \dim H_i(\mathcal{F})$ need not equal the number of dual logical correlations (or errors) $k_{i+1} = \dim H_{i+1}(\mathcal{F}) = \dim H^{i+1}(\mathcal{F})$. The primal (dual) fault distance $d_i$ ($d_{i+1}$) of the fault complex is the weight of the minimal weight primal (dual) logical error.

Recently, there have been many proposals for formalizing fault-tolerant protocols [9, 10, 28–35], some of which resemble our fault complexes. In particular, our definition of a fault complex builds on the definition of a fault-tolerant cluster state in [10]. We also note that fault complexes are distinct from the fault-tolerant complexes of [32], which are defined geometrically and are limited to topological codes. Fault complexes have an interpretation in CBQC where the faults can represent both qubit, gate, and measurement errors. In this interpretation, $\partial_{i+1}$ is related to the gauge group of the space-time code; see [36] for further discussion. Here, we concentrate on the interpretation of fault complexes in MBQC.

**Foliated CSS codes.** We now return to our motivating example of the fault complex $\mathcal{F} = \mathcal{C} \times \mathcal{R}$, where $\mathcal{C}$ represents a CSS code and $\mathcal{R}$ represents a repetition code. Suppose that $\mathcal{R}$, $H_X$, and $H_Z$ are full rank. From the Küneth formula, we obtain the number of primal and dual correlations

$$k_i = \dim H_0(\mathcal{R}) \dim H_i(\mathcal{C}) + \dim H_1(\mathcal{R}) \dim H_{i-1}(\mathcal{C}),$$

$$k_{i+1} = \dim H_0(\mathcal{R}) \dim H_{i+1}(\mathcal{C}) + \dim H_1(\mathcal{R}) \dim H_i(\mathcal{C}).$$

One can show [20,36] that the primal and dual fault distances of $\mathcal{F}$ are given by

$$d_i = \min[d_0(\mathcal{R})d_i(\mathcal{C}), d_1(\mathcal{R})d_{i-1}(\mathcal{C})],$$

$$d_{i+1} = \min[d_0(\mathcal{R}^T)d_{i+1}(\mathcal{C}^T), d_1(\mathcal{R}^T)d_i(\mathcal{C}^T)], \quad (7)$$

where $d_i(\mathcal{C})$ and $d_i(\mathcal{C}^T)$ are equal to the minimal weight of an element in $H_i(\mathcal{C})$ and $H^i(\mathcal{C})$, respectively. For trivial homology groups the associated distance is defined as $\infty$.

The logical correlations of $\mathcal{F}$ are recovered from the homology group; that is, for example,

$$\begin{aligned} H_2(\mathcal{F}) &\cong H_0(\mathcal{R}) \otimes H_2(\mathcal{C}) \oplus H_1(\mathcal{R}) \otimes H_1(\mathcal{C}) \\ &= \langle (\mathbf{0}, \mathbf{1} \otimes \ell_Z) \mid \ell_Z \in \ker H_X / \operatorname{im} H_Z^T \rangle, \end{aligned} \quad (8)$$

where $\ell_Z$ is a logical Z operator of the base code. See [36] for a detailed derivation. This operator is a dual logical correlation; it acts as a copy of the logical Z operator on the qubits in the $R_1 \otimes C_1$ block of the $F_1$ space. The dual logical errors are given by

$$\begin{aligned} H^2(\mathcal{F}) &\cong H^0(\mathcal{R}) \otimes H^2(\mathcal{C}) \oplus H^1(\mathcal{R}) \otimes H^1(\mathcal{C}) \\ &= \langle (\mathbf{0}, (1, 0, \dots, 0) \otimes \ell_X) \mid \ell_X \in \ker H_Z / \operatorname{im} H_X^T \rangle, \end{aligned} \quad (9)$$

where $\ell_X$ is a logical X operator of the base code. We observe that this operator acts as a logical X operator on one of the factors in the $R_1 \otimes C_1$ portion of the $F_1$ space. Applying Eq. (7), we find that the (dual) fault distance of $\mathcal{F}$ is $d_2 = d_X$—the X distance of the base code.

For our choice of $\mathcal{R}$, the homology groups $H_0(\mathcal{R})$ and $H^0(\mathcal{R})$ are trivial, so the fault complex lacks primal logical correlations arising from the base code’s logical X. This may seem surprising, given that the foliated surface code can be used to prepare an encoded Bell state on the two boundaries [37]. There is no contradiction, however: the interpretation of fault complexes as foliated codes implicitly assumes that all qubits are measured in the X basis during the protocol and therefore that the encoded Bell state of [37] is measured destructively. The analogous CBQC interpretation is of a memory experiment with logical state preparation and readout both performed in the Z basis. In addition, we note that all the logical correlations can be recovered by considering an alternative repetition code PCM; see [36].

**Stability experiments.** Lattice surgery [38] is the leading technique for performing logical operations on topological codes [39,40] and stability experiments [25] estimate the logical error during a lattice surgery operation. Such experiments test our ability to accurately measure the product of many stabilizer generators.

Returning to our foliated CSS code example, suppose that $H_X$ of the base code $\mathcal{C}$ is rank deficient. The fault complex $\mathcal{F} = \mathcal{R} \times \mathcal{C}$ now has additional logical correlations and errors coming, respectively, from the following homology groups:

$$\begin{aligned} H^1(\mathcal{F}) &\cong \langle (\mathbf{0}, (1, 0, \dots, 0) \otimes g) \mid g \in \ker H_X^T \rangle, \\ H_1(\mathcal{F}) &\cong \langle (\mathbf{0}, \mathbf{1} \otimes h) \mid h \in C_0 / \operatorname{im} H_X \rangle. \end{aligned} \quad (10)$$

Here, $g$ represents any subset of $H_X$ rows that sum to zero and $h$ is any vector in $C_0$ that is not the syndrome of a Z-type error. An example of such a code is a 2D surface code with four smooth boundaries; in this case we have $g = \mathbf{1}$ (the product of all X stabilizers is $I$) and $h = (1, 0, \dots, 0)$ (all valid syndromes have even weight). The logical correlation $g$ is exactly the product of stabilizer generators considered in stability experiments. Using Eq. (7) we find that the primal distance of $\mathcal{F}$ is $d_1 = \delta$, i.e., equal the distance of the repetition code (or the number of CBQC measurement rounds; cf. [25]). A 2D surface code with four smooth boundaries encodes no logical qubits, but if instead we let $\mathcal{C}$ be the 2D toric code (with periodic boundaries) then our formalism shows that the fault complex $\mathcal{F} = \mathcal{R} \times \mathcal{C}$ can be used to perform a combined memory and stability experiment; see [36].

**Single-shot lattice surgery.** Certain CSS codes are naturally associated with length-3 or length-4 chain complexes, where the additional vector spaces represent metachecks, i.e., redundancies between subsets of checks. Metachecks are related to single-shot error correction [23,41,42], where a single round of parity-check measurements suffices for fault-tolerant QEC.

As a prototypical example of a code with metachecks, let $\mathcal{C}$ represent the 3D toric code [21,22] defined on an $L \times L \times L$ cubic tiling, which has single-shot QEC for Z errors. We focus on this code for ease of presentation, but our results also hold for true single-shot CSS codes such as the 4D toric code. We assign the metacheck matrix $M_X = \partial_1^C$ and PCMs $H_X = \partial_2^C$ and $H_Z = (\partial_3^C)^T$. The primal detectors of the fault complex $\mathcal{F} = \mathcal{R} \times \mathcal{C}$ are given by $\partial_2$, which now contains the metachecks; see [36] for the explicit expression. We note that $\mathcal{F}$ is effectively a length-3 chain complex exactly because
"data" and "measurement" faults are treated on an equal footing; see [36] for an extended discussion.

The expression for the primal logical correlations and errors of $\mathcal{F}$ is the same as Eq. (10), but now with $g \in$ ker $H_X^T/\text{im } M_X^T$ and $h \in$ ker $M_X/\text{im } H_X$. As in the previous example, $g$ is the logical correlation relevant for stability experiments and lattice surgery and $h$ is the logical error that can disrupt this correlation. In the 3D toric code, there are three independent choices of $g$ given by all edges cutting through one of the independent 2D planes of the tiling. The corresponding $h$ vectors correspond to noncontractible chains of edges along one of the coordinate axes of the tiling. As a result, all choices of $h$ have extensive weight, i.e., $|h| \ge L$. Thus, even for a fault complex formed using a constant-length repetition code, a macroscopic number of faults ($\sim L$) is necessary to disrupt the $g$ logical correlations. This is captured by the primal fault distance of $\mathcal{F}$, $d_1 = \delta L$, where $\delta = d_1(\mathcal{R})$ is the distance of the repetition code. Therefore, higher dimensional topological codes such as the 3D and 4D toric codes are compatible with single-shot lattice surgery, though at the cost of reduced performance. The full distance can be restored by choosing $\mathcal{R}$ such that $\delta = L = O(\sqrt{d})$ (where $d$ is the distance of the code) or equivalently by performing $O(\sqrt{d})$ rounds of stabilizer measurement in the lattice surgery protocol. This should be contrasted with the 2D toric code case where the number of measurement rounds must be $O(d)$. Thus we expect that a fault-tolerant quantum computing architecture based on the 4D toric code would have an asymptotic space-time overhead reduction when compared to the standard 2D toric code architecture.

We address the case of single-shot codes with rank-deficient PCMs without metachecks in [36]. We note that there exist single-shot quantum codes with full-rank PCMs [43,44], to which our arguments above cannot be applied, and the existence of single-shot lattice surgery protocols for these codes remains an open question. We conjecture that codes enabling single-shot lattice surgery without performance degradation can be constructed from the balanced product of two good qLDPC codes [45–49].

**Improved decoding of single-shot codes.** Estimating the error threshold of a single-shot code requires simulating multiple rounds of noisy syndrome measurement until the threshold has converged [50]. Since in MBQC there always exist detectors spanning multiple rounds, decoding must proceed using an overlapping window decoder [21,51–54], which is naturally defined for a fault complex. The fault complex framework provides a systematic guide for constructing efficient simulations and evaluating the performance of these protocols.

A $(w, c)$-overlapping window decoder determines in each round a correction for a window of $w \in \mathbb{N}^+$ rounds and commits a correction to $c \le w$ rounds; see Refs. [53,55] for a more detailed description. Here, one round constitutes a check node and a bit node layer; see Fig. 1. For the 3D toric code, the effective distance of the decoding window then becomes $\min(wL, L^2)$ [36]. However, $wL$ is the weight of timelike logical errors and, in this section, we consider memory experiments, i.e., only spacelike logical errors cause logical failures; see [36] for stability experiment simulations. State-of-the-art

<figure><img src="image_5.png" /><figcaption>FIG. 2. Sustainable thresholds for 3D (a) and 4D (b) toric codes under phenomenological Pauli noise. Markers represent the threshold for a $(w, 1)$-overlapping window decoder as a function of noisy syndrome rounds. The black dashed line shows the threshold for the optimal window choice $w = L$; see [36] for details.</figcaption></figure>

results in decoding higher-dimensional topological codes [24] employ a single-stage decoding approach that is recovered using a (1, 1)-overlapping window decoder [36]. We find that increasing $w$ to 2 or 3 significantly increases the sustainable threshold of 3D and 4D toric codes compared to $w = 1$ when using belief propagation (BP) plus ordered statistics decoding (OSD) [56,57]; see [36] for details concerning the simulations. For $w = 3$, the thresholds for phenomenological Pauli noise (see [36] for a photonic noise model) of approximately 9.65% (3D) and 5.9% (4D) surpass all previous results [23,24,58–64], approaching the thresholds achieved with the optimal window choice $w = L$; see Fig. 2(a) and Fig. 2(b). We note that, for the 3D toric code, we only consider primal faults, as the dual side of the fault complex does not have the single-shot property.

While larger decoding regions increase decoding time, recent advances provide solutions. Findings on localized statistics decoding [65], a parallelizable OSD variant, and belief propagation for higher-dimensional toric codes [64] suggest time-efficient decoding with minimal performance reduction, supporting the practical applicability of our results.

**Conclusion.** We introduced fault complexes to represent dynamic QEC protocols and characterize foliated codes. This approach provided insights into stability experiments and lattice surgery and yielded improved decoding protocols for higher-dimensional topological codes like the 4D toric code. The increased thresholds and space-time overhead advantages make 4D toric codes promising for compatible architectures like photonics [1–6], trapped ions [66], and neutral atoms [67]. While algorithmic fault tolerance [68] offers a lower overhead, it requires complex decoding; 4D toric codes allow simpler windowed decoding. Meanwhile, the lower threshold requirements of 3D toric codes make them suitable for experimental validation in the near term.

Our formalism can extend to circuit-level noise by, for example, reformulating Li's [35] LDPC representation of
fault-tolerant quantum circuits [many of their results in [35, Sec. VIII] are already structurally equivalent to Eq. (5)]. Future work could explore the fault complexes of subsystem codes [69–71] (especially those with single-shot error correction [41,50,72]), symplectic chain complexes for non-CSS codes, and alternative product constructions like balanced [48] and lifted [73] products. In addition, by using alternative linear codes in the construction, we may hope to algebraically recover FTGS beyond foliation [9,32]. See [36] for some initial ideas on these extensions.

*Acknowledgments.* The authors would like to thank B. Brown, C. Chubb, A. Daniel, A. Pesah, T. Stace, A.

Townsend-Teague, and D. Williamson for insightful discussions. We thank R. Alexander, J. E. Bourassa, and E. Sabo for feedback on an earlier draft of this manuscript. Research at Perimeter Institute is supported in part by the Government of Canada through the Department of Innovation, Science and Economic Development Canada and by the Province of Ontario through the Ministry of Colleges and Universities. Computations were performed on the Niagara supercomputer at the SciNet HPC Consortium. SciNet is funded by Innovation, Science and Economic Development Canada, the Digital Research Alliance of Canada, the Ontario Research Fund: Research Excellence, and the University of Toronto.

[1] J. E. Bourassa, R. N. Alexander, M. Vasmer, A. Patil, I. Tzitrin, T. Matsuura, D. Su, B. Q. Baragiola, S. Guha, G. Dauphinais, K. K. Sabapathy, N. C. Menicucci, and I. Dhand, Blueprint for a scalable photonic fault-tolerant quantum computer, *Quantum* **5**, 392 (2021).

[2] I. Tzitrin, T. Matsuura, R. N. Alexander, G. Dauphinais, J. E. Bourassa, K. K. Sabapathy, N. C. Menicucci, and I. Dhand, Fault-tolerant quantum computation with static linear optics, *PRX Quantum* **2**, 040353 (2021).

[3] S. Bartolucci, P. Birchall, H. Bombín, H. Cable, C. Dawson, M. Gimeno-Segovia, E. Johnston, K. Kieling, N. Nickerson, M. Pant, F. Pastawski, T. Rudolph, and C. Sparrow, Fusion-based quantum computation, *Nat. Commun.* **14**, 912 (2023).

[4] K. Alexander et al., A manufacturable platform for photonic quantum computing, *Nature (London)* **641**, 876 (2025).

[5] B. W. Walshe, B. Q. Baragiola, H. Ferretti, J. Gefaell, M. Vasmer, R. Weil, T. Matsuura, T. Jaeken, G. Pantaleoni, Z. Han, T. Hillmann, N. C. Menicucci, I. Tzitrin, and R. N. Alexander, Linear-optical quantum computation with arbitrary error-correcting codes, *Phys. Rev. Lett.* **134**, 100602 (2025).

[6] H. Aghaee Rad et al., Scaling and networking a modular photonic quantum computer, *Nature (London)* **638**, 912 (2025).

[7] H. J. Briegel, D. E. Browne, W. Dür, R. Raussendorf, and M. Van den Nest, Measurement-based quantum computation, *Nat. Phys.* **5**, 19 (2009).

[8] R. Raussendorf and J. Harrington, Fault-tolerant quantum computation with high threshold in two dimensions, *Phys. Rev. Lett.* **98**, 190504 (2007).

[9] N. Nickerson and H. Bombín, Measurement based fault tolerance beyond foliation, arXiv:1810.09621.

[10] M. Newman, L. A. de Castro, and K. R. Brown, Generating fault-tolerant cluster states from crystal structures, *Quantum* **4**, 295 (2020).

[11] A. Bolt, G. Duclos-Cianci, D. Poulin, and T. M. Stace, Foliated quantum error-correcting codes, *Phys. Rev. Lett.* **117**, 070501 (2016).

[12] B. J. Brown and S. Roberts, Universal fault-tolerant measurement-based quantum computation, *Phys. Rev. Res.* **2**, 033305 (2020).

[13] A. M. Steane, Error correcting codes in quantum theory, *Phys. Rev. Lett.* **77**, 793 (1996).

[14] A. R. Calderbank and P. W. Shor, Good quantum error-correcting codes exist, *Phys. Rev. A* **54**, 1098 (1996).

[15] H. Bombin and M. A. Martin-Delgado, Homological error correction: Classical and quantum codes, *J. Math. Phys.* **48**, 052105 (2007).

[16] N. P. Breuckmann and J. N. Eberhardt, Quantum low-density parity-check codes, *PRX Quantum* **2**, 040101 (2021).

[17] M. B. Hastings, Weight reduction for quantum codes, *Quantum Inf. Comput.* **17**, 1307 (2017).

[18] S. Evra, T. Kaufman, and G. Zémor, Decodable quantum ldpc codes beyond the $\sqrt{n}$ distance barrier using high-dimensional expanders, *SIAM J. Comput.* **53**, FOCS20-276 (2022).

[19] J.-P. Tillich and G. Zémor, Quantum LDPC codes with positive rate and minimum distance proportional to the square root of the blocklength, *IEEE Trans. Inf. Theory* **60**, 1193 (2014).

[20] W. Zeng and L. P. Pryadko, Higher-dimensional quantum hypergraph-product codes with finite rates, *Phys. Rev. Lett.* **122**, 230501 (2019).

[21] E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, Topological quantum memory, *J. Math. Phys.* **43**, 4452 (2002).

[22] M. Vasmer and D. E. Browne, Three-dimensional surface codes: Transversal gates and fault-tolerant architectures, *Phys. Rev. A* **100**, 012312 (2019).

[23] A. O. Quintavalle, M. Vasmer, J. Roffe, and E. T. Campbell, Single-shot error correction of three-dimensional homological product codes, *PRX Quantum* **2**, 020340 (2021).

[24] O. Higgott and N. P. Breuckmann, Improved single-shot decoding of higher-dimensional hypergraph-product codes, *PRX Quantum* **4**, 020332 (2023).

[25] C. Gidney, Stability experiments: The overlooked dual of memory experiments, *Quantum* **6**, 786 (2022).

[26] D. Gottesman, Stabilizer codes and quantum error correction, arXiv:quant-ph/9705052.

[27] We note that a similar approach has recently been explored in the context of condensed matter physics [74,75].

[28] C. Gidney, Stim: A fast stabilizer circuit simulator, *Quantum* **5**, 497 (2021).

[29] P.-J. H. S. Derks, A. Townsend-Teague, A. G. Burchards, and J. Eisert, Designing fault-tolerant circuits using detector error models, arXiv:2407.13826.

[30] D. Gottesman, Opportunities and challenges in fault-tolerant quantum computation, arXiv:2210.15844.

[31] N. Delfosse and A. Paetznick, Spacetime codes of clifford circuits, arXiv:2304.05943.
[32] H. Bombin, C. Dawson, T. Farrelly, Y. Liu, N. Nickerson, M. Pant, F. Pastawski, and S. Roberts, Fault-tolerant complexes, arXiv:2308.07844.

[33] X. Fu and D. Gottesman, Error correction in dynamical codes, arXiv:2403.04163.

[34] M. E. Beverland, S. Huang, and V. Kliuchnikov, Fault tolerance of stabilizer channels, arXiv:2401.12017.

[35] Y. Li, Low-density parity-check representation of fault-tolerant quantum circuits, Phys. Rev. Res. 7, 013115 (2025).

[36] See Supplemental Material at http://link.aps.org/supplemental/10.1103/cjb4-157n for details of the results discussed in the main text, and information on the numerical simulations, which includes Refs. [76–84].

[37] R. Raussendorf, S. Bravyi, and J. Harrington, Long-range quantum entanglement in noisy cluster states, Phys. Rev. A 71, 062313 (2005).

[38] D. Horsman, A. G. Fowler, S. Devitt, and R. V. Meter, Surface code quantum computing by lattice surgery, New J. Phys. 14, 123011 (2012).

[39] A. G. Fowler and C. Gidney, Low overhead quantum computation using lattice surgery, arXiv:1808.06709.

[40] D. Litinski, A game of surface codes: Large-scale quantum computing with lattice surgery, Quantum 3, 128 (2019).

[41] H. Bombín, Single-shot fault-tolerant quantum error correction, Phys. Rev. X 5, 031043 (2015).

[42] E. T. Campbell, A theory of single-shot error correction for adversarial noise, Quantum Sci. Technol. 4, 025006 (2019).

[43] O. Fawzi, A. Grospellier, and A. Leverrier, Constant overhead quantum fault tolerance with quantum expander codes, Commun. ACM 64, 106 (2020).

[44] S. Gu, E. Tang, L. Caha, S. H. Choe, Z. He, and A. Kubica, Single-shot decoding of good quantum LDPC codes, Commun. Math. Phys. 405, 85 (2024).

[45] I. Dinur, M.-H. Hsieh, T.-C. Lin, and T. Vidick, Good quantum LDPC codes with linear time decoders, in STOC 2023: Proceedings of the 55th Annual ACM Symposium on Theory of Computing, Orlando, FL (ACM, New York, 2023), pp. 905–918.

[46] A. Leverrier, S. Apers, and C. Vuillot, Quantum XYZ product codes, Quantum 6, 766 (2022).

[47] P. Panteleev and G. Kalachev, Asymptotically good quantum and locally testable classical LDPC codes, in STOC 2022: Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing (Association for Computing Machinery, New York, 2022), pp. 375–388.

[48] N. P. Breuckmann and J. N. Eberhardt, Balanced product quantum codes, IEEE Trans. Inf. Theory 67, 6653 (2021).

[49] M. B. Hastings, J. Haah, and R. O'Donnell, Fiber bundle codes: Breaking the $n^{1/2}$ polylog(n) barrier for quantum LDPC codes, in STOC 2021: Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing (Association for Computing Machinery, New York, 2021), pp. 1276–1288.

[50] B. J. Brown, N. H. Nickerson, and D. E. Browne, Fault-tolerant error correction with the gauge color code, Nat. Commun. 7, 12302 (2016).

[51] L. Skoric, D. E. Browne, K. M. Barnes, N. I. Gillespie, and E. T. Campbell, Parallel window decoding enables scalable fault tolerant quantum computation, Nat. Commun. 14, 7040 (2023).

[52] L. Berent, T. Hillmann, J. Eisert, R. Wille, and J. Roffe, Analog information decoding of bosonic quantum low-density parity-check codes, PRX Quantum 5, 020349 (2024).

[53] S. Huang and S. Puri, Increasing memory lifetime of quantum low-density parity check codes with sliding-window noisy syndrome decoding, Phys. Rev. A 110, 012453 (2024).

[54] H. Bombín, C. Dawson, Y.-H. Liu, N. Nickerson, F. Pastawski, and S. Roberts, Modular decoding: Parallelizable real-time decoding for quantum computers, arXiv:2303.04846.

[55] T. R. Scruby, T. Hillmann, and J. Roffe, High-threshold, low-overhead and single-shot decodable fault-tolerant quantum memory, arXiv:2406.14445.

[56] P. Panteleev and G. Kalachev, Degenerate quantum LDPC codes with good finite length performance, Quantum 5, 585 (2021).

[57] J. Roffe, D. R. White, S. Burton, and E. Campbell, Decoding across the quantum low-density parity-check code landscape, Phys. Rev. Res. 2, 043423 (2020).

[58] N. P. Breuckmann, K. Duivenvoorden, D. Michels, and B. M. Terhal, Local decoders for the 2d and 4d toric code, Quantum Inf. Comput. 17, 181 (2017).

[59] N. P. Breuckmann and X. Ni, Scalable neural network decoders for higher dimensional quantum codes, Quantum 2, 68 (2018).

[60] K. Duivenvoorden, N. P. Breuckmann, and B. M. Terhal, Renormalization group decoder for a four-dimensional toric code, IEEE Trans. Inf. Theory 65, 2545 (2019).

[61] A. Kubica, The abcs of the color code: A study of topological quantum codes as toy models for fault-tolerant quantum computation and quantum phases of matter, Ph.D. thesis, Caltech, 2018.

[62] M. Vasmer, D. E. Browne, and A. Kubica, Cellular automaton decoders for topological quantum codes with noisy measurements and beyond, Sci. Rep. 11, 2027 (2021).

[63] A. B. Aloshious and P. K. Sarvepalli, Decoding toric codes on three dimensional simplicial complexes, IEEE Trans. Inf. Theory 67, 931 (2021).

[64] T. R. Scruby and K. Nemoto, Local probabilistic decoding of a quantum code, Quantum 7, 1093 (2023).

[65] T. Hillmann, L. Berent, A. O. Quintavalle, J. Eisert, R. Wille, and J. Roffe, Localized statistics decoding for quantum low-density parity-check codes, Nat. Commun. 16, 8214 (2025).

[66] N. Berthusen, J. Dreiling, C. Foltz, J. P. Gaebler, T. M. Gatterman, D. Gresh, N. Hewitt, M. Mills, S. A. Moses, B. Neyenhuis, P. Siegfried, and D. Hayes, Experiments with the four-dimensional surface code on a quantum charge-coupled device quantum computer, Phys. Rev. A 110, 062413 (2024).

[67] D. Bluvstein et al., Logical quantum processor based on reconfigurable atom arrays, Nature (London) 626, 58 (2024).

[68] H. Zhou, C. Zhao, M. Cain, D. Bluvstein, C. Duckering, H.-Y. Hu, S.-T. Wang, A. Kubica, and M. D. Lukin, Low-overhead transversal fault tolerance for universal quantum computation, Nature (2025), doi:10.1038/s41586-025-09543-5.

[69] D. Kribs, R. Laflamme, and D. Poulin, Unified and generalized approach to quantum error correction, Phys. Rev. Lett. 94, 180501 (2005).

[70] D. W. Kribs, R. Laflamme, D. Poulin, and M. Lesosky, Operator quantum error correction, Quantum Inf. Comput. 6, 382 (2006).
[71] D. Poulin, Stabilizer formalism for operator quantum error correction, Phys. Rev. Lett. 95, 230504 (2005).

[72] A. Kubica and M. Vasmer, Single-shot quantum error correction with the three-dimensional subsystem toric code, Nat. Commun. 13, 6272 (2022).

[73] P. Panteleev and G. Kalachev, Quantum LDPC codes with almost linear minimum distance, IEEE Trans. Inf. Theory 68, 213 (2022).

[74] T. Okuda, A. P. Mana, and H. Sukeno, Anomaly inflow for CSS and fractonic lattice models and dualities via cluster state measurement, SciPost Phys. 17, 113 (2024).

[75] T. Okuda, A. Parayil Mana, and H. Sukeno, Anomaly inflow, dualities, and quantum simulation of Abelian lattice gauge theories induced by measurements, Phys. Rev. Res. 6, 043018 (2024).

[76] D. Gottesman, A. Kitaev, and J. Preskill, Encoding a qubit in an oscillator, Phys. Rev. A 64, 012310 (2001).

[77] B. J. Brown, Conservation laws and quantum error correction: Toward a generalized matching decoder, IEEE BITS Inf. Theory Mag. 2, 5 (2022).

[78] C. Wang, J. Harrington, and J. Preskill, Confinement-Higgs transition in a disordered gauge theory and the accuracy threshold for quantum memory, Ann. Phys. (N.Y.) 303, 31 (2003).

[79] J. W. Harrington, Analysis of quantum error-correcting codes: Symplectic lattice codes and toric codes, Ph.D. thesis, California Institute of Technology, 2004.

[80] C. Stahl, Single-shot quantum error correction in intertwined toric codes, Phys. Rev. B 110, 075143 (2024).

[81] W. Zeng and L. P. Pryadko, Minimal distances for certain quantum product codes and tensor products of chain complexes, Phys. Rev. A 102, 062402 (2020).

[82] M. L. Liu, N. Tantivasadakarn, and V. V. Albert, Subsystem CSS codes, a tighter stabilizer-to-CSS mapping, and Goursat's lemma, Quantum 8, 1403 (2024).

[83] A. Bolt, D. Poulin, and T. M. Stace, Decoding schemes for foliated sparse quantum error-correcting codes, Phys. Rev. A 98, 062302 (2018).

[84] D. Bacon, S. T. Flammia, A. W. Harrow, and J. Shi, Sparse quantum codes from quantum circuits, IEEE Trans. Inf. Theory 63, 2464 (2017).
Supplementary Material for “Single-shot and measurement-based quantum error correction via fault complexes”

Timo Hillmann,<fnref n="1" />,²,* Guillaume Dauphinais,<fnref n="1" /> Ilan Tzitrin,<fnref n="1" />,† and Michael Vasmer<fnref n="1" />,³,⁴

¹Xanadu, Toronto, Ontario, M5G 2C8, Canada

²Department of Microtechnology and Nanoscience (MC2),
Chalmers University of Technology, SE-412 96 Gothenburg, Sweden

³Perimeter Institute for Theoretical Physics, Waterloo, Ontario, N2L 2Y5, Canada

⁴Institute for Quantum Computing, Waterloo, Ontario, N2L 3G1, Canada

I. DERIVATION OF LOGICAL CORRELATIONS AND ERRORS

Here, we derive the expressions for logical errors/correlations and fault distances given in the main text and discuss their interpretation in more detail. We consider the fault complex $\mathcal{F} = \mathcal{R} \times \mathcal{C}$, where $\mathcal{C}$ describes a CSS code and $\mathcal{R}$ describes the repetition code whose parity-check matrix has a redundant row<fnref n="1" />, as the main text considers a special case of this. Explicitly,

$$R = \begin{bmatrix} 1 & 1 & 0 & \dots & 0 & 0 \\ 0 & 1 & 1 & \dots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & \dots & 1 & 1 \\ 1 & 0 & 0 & \dots & 0 & 1 \end{bmatrix}. \quad (1)$$

We will refer to the $i^{th}$ boundary operator of $\mathcal{C}$ by $\partial_i$ to ease notational clutter.

To obtain the homology groups of the fault complex, we make use of the Künneth formula:

$$H_j(\mathcal{F}) \cong H_0(\mathcal{R}) \otimes H_j(\mathcal{C}) \oplus H_1(\mathcal{R}) \otimes H_{j-1}(\mathcal{C}). \quad (2)$$

Similarly, for the cohomology groups, we have

$$H^j(\mathcal{F}) \cong H^0(\mathcal{R}) \otimes H^j(\mathcal{C}) \oplus H^1(\mathcal{R}) \otimes H^{j-1}(\mathcal{C}). \quad (3)$$

For $\mathcal{R}$, one can verify that

$$\begin{align} H_0(\mathcal{R}) &= R_0/\operatorname{im} R, \nonumber \\ H_1(\mathcal{R}) &= \operatorname{ker} R/\{\mathbf{0}\} \cong \operatorname{ker} R, \nonumber \\ H^0(\mathcal{R}) &= \operatorname{ker} R^T/\{\mathbf{0}\} \cong \operatorname{ker} R^T, \nonumber \\ H^1(\mathcal{R}) &= R_1/\operatorname{im} R^T, \end{align} \quad (4)$$

Further calculation shows that

$$\begin{align} \operatorname{im} R &= \operatorname{im} R^T \nonumber \\ &= \operatorname{span}\{(1, 1, 0, \dots, 0), \dots, (0, \dots, 0, 1, 1)\} \tag{5} \end{align}$$

and $\ker R = \ker R^T = \{\mathbf{0}, \mathbf{1}\}$. Therefore

$$\begin{align} H_0(\mathcal{R}) &\cong \{\mathbf{0}, (1, 0, \dots, 0)\}, \nonumber \\ H_1(\mathcal{R}) &\cong \{\mathbf{0}, \mathbf{1}\}, \nonumber \\ H^0(\mathcal{R}) &\cong \{\mathbf{0}, \mathbf{1}\}, \nonumber \\ H^1(\mathcal{R}) &\cong \{\mathbf{0}, (1, 0, \dots, 0)\}. \tag{6} \end{align}$$

Using Eqs. (2) and (6) we have

$$\begin{align} H_i(\mathcal{F}) &\cong H_0(\mathcal{R}) \otimes H_i(\mathcal{C}) \oplus H_1(\mathcal{R}) \otimes H_{i-1}(\mathcal{C}) \tag{7} \\ &= \langle ((1, 0, \dots, 0) \otimes \ell_Z, \mathbf{0}), (\mathbf{0}, \mathbf{1} \otimes h) \rangle, \nonumber \end{align}$$

where $\ell_Z \in \ker \partial_i/\operatorname{im} \partial_{i+1}$ and $h \in \ker \partial_{i-1}/\operatorname{im} \partial_i$. Similarly, we have

$$\begin{align} H^i(\mathcal{F}) &\cong H^0(\mathcal{R}) \otimes H^i(\mathcal{C}) \oplus H^1(\mathcal{R}) \otimes H^{i-1}(\mathcal{C}) \tag{8} \\ &= \langle (\mathbf{1} \otimes \ell_X, \mathbf{0}), (\mathbf{0}, (1, 0, \dots, 0) \otimes g) \rangle, \nonumber \end{align}$$

where $\ell_X \in \ker \partial_{i+1}^T/\operatorname{Im} \partial_i^T$ and $g \in \ker \partial_i^T/\operatorname{im} \partial_{i-1}^T$. We refer to elements of $H^i(\mathcal{C})$ as primal logical correlations and to elements of $H_i(\mathcal{C})$ as primal logical errors. Analogously for the other relevant homology groups, we have

$$\begin{align} H_{i+1}(\mathcal{F}) &\cong H_0(\mathcal{R}) \otimes H_{i+1}(\mathcal{C}) \oplus H_1(\mathcal{R}) \otimes H_i(\mathcal{C}) \tag{9} \\ &= \langle ((1, 0, \dots, 0) \otimes g', \mathbf{0}), (\mathbf{0}, \mathbf{1} \otimes \ell'_Z) \rangle, \nonumber \end{align}$$

where $g' \in \ker \partial_{i+1}/\operatorname{im} \partial_{i+2}$ and $\ell'_Z \in \ker \partial_i/\operatorname{im} \partial_{i+1}$. And

$$\begin{align} H^{i+1}(\mathcal{F}) &\cong H^0(\mathcal{R}) \otimes H^{i+1}(\mathcal{C}) \oplus H^1(\mathcal{R}) \otimes H^i(\mathcal{C}) \tag{10} \\ &= \langle (\mathbf{1} \otimes h', \mathbf{0}), (\mathbf{0}, (1, 0, \dots, 0) \otimes \ell'_X) \rangle, \nonumber \end{align}$$

where $h' \in \ker \partial_{i+2}/\operatorname{im} \partial_{i+1}^T$ and $\ell'_X \in \ker \partial_{i+1}^T/\operatorname{im} \partial_i^T$. We refer to the elements of $H_{i+1}(\mathcal{F})$ as dual logical correlations and to $H^{i+1}(\mathcal{F})$ as dual logical errors.

Recall that the number of primal and dual logical correlations (or errors) of a fault complex are defined to be $k_i = \dim H_i(\mathcal{F})$ and $k_{i+1} = H_{i+1}(\mathcal{F})$, respectively. Using Eq. (2), we obtain the general expression for these quantities

$$\begin{align} k_i &= \dim H_0(\mathcal{R}) \dim H_i(\mathcal{C}) + \dim H_1(\mathcal{R}) \dim H_{i-1}(\mathcal{C}), \nonumber \\ k_{i+1} &= \dim H_0(\mathcal{R}) \dim H_{i+1}(\mathcal{C}) + \dim H_1(\mathcal{R}) \dim H_i(\mathcal{C}), \end{align}$$

which in our case further simplifies via Eq. (6), giving

$$\begin{align} k_i &= \dim H_i(\mathcal{C}) + \dim H_{i-1}(\mathcal{C}), \nonumber \\ k_{i+1} &= \dim H_{i+1}(\mathcal{C}) + \dim H_i(\mathcal{C}), \tag{11} \end{align}$$

<footnote>* timo.hillmann@rwth-aachen.de</footnote>

<footnote>† ilan@xanadu.ai</footnote>

<footnote n="1">¹ One can think of this parity-check matrix as being the vertex-to-edge adjacency matrix of the cycle graph.</footnote>
We see that $k_i \neq k_{i+1}$ in general, with equality only when $\dim H_{i-1} = \dim H_{i+1}$.

Let us now consider the interpretation of the logical correlations and errors in terms of the CSS code described by $\mathcal{C}$. We concentrate on the primal case as the dual case is analogous. Note that each $\ell_Z$ describes the support of a logical $Z$ operator (of the CSS code) and each $\ell_X$ describes the support of a logical $X$ operator. Therefore, symplectic pairs of logical operators in the CSS code lift to symplectic pairs of logical correlations and errors in the fault complex. If $\partial_i$ is full rank, then $\dim \partial_i = C_{i-1}$ and $\ker \partial_i^T = \{0\}$. In this case, the only possible choices for $g$ and $h$ are the zero vector, and therefore the generators of the homology groups all derive from the logical operators of the CSS code. Now suppose that $C_i$ is rank-deficient. In this case, $g$ describes a subset of $X$-type stabilizer generators whose product is the identity, but which is not an $X$-type meta-check of the code. And $h$ is a vector in $C_{i-1}$ with trivial meta-syndrome, but which is not the syndrome of a $Z$-type error (see the main text for an example). If the code does not have $X$-type meta-checks (i.e., $\mathcal{C}$ is length-2) then $g$ can be any subset of $X$-type stabilizer generators with trivial product, and $h$ can be any vector in $C_{i-1}$ that is not the syndrome of a $Z$-type error.

To give an explicit example, suppose that $\mathcal{C}$ describes the 2D toric code with periodic boundaries and the usual stabilizer generators ($X$-type star operators and $Z$-type plaquette operators). This code has two encoded qubits and two non-trivial stabilizer relations as the product of all the stabilizer generators of the same type is the identity. In addition, every error syndrome must have even weight (this is sometimes called a materialized symmetry of the code [1]). Therefore, we can take $g = \mathbf{1}$ and $h = (1, 0, \dots, 0)$.

We note that one can always construct a metacheck matrix for a rank-deficient parity-check matrix by Gaussian elimination. However, at least in topological codes, the metachecks are usually defined to be the relations comprising $O(1)$ stabilizer generators, i.e., the metacheck matrix has low-weight rows (and low-weight columns as it turns out). On the other hand, the spacelike invariants such as $g$ and $g'$ above are relations comprising an extensive number of stabilizer generators. The rationale for this distinction is that if each stabilizer measurement is noisy, then combining an extensive number of measurement outcomes will yield no useful information in the limit of large code size. Indeed, this is what makes it non-trivial to preserve the value of these logical correlations in QEC protocols.

Let us also comment explicitly on the case of a single-shot CSS code with rank-deficient parity-check matrices that is completely described by a length-2 chain complex. Here, there is no explicit notion of metachecks. As noted above, metachecks can be constructed based on the linear dependencies in the parity-check matrices. The resulting metacheck matrices can be interpreted as classical codes with distances $d_{M_X}$ and $d_{M_Z}$. Our results

therefore extend to codes where $d_{M_X}$ and $d_{M_Z}$ are non-trivial. However, such procedures generally lead to higher-weight rows. Determining meta-checks of minimal weight is expected to be (at least) NP-hard, in analogy to determining the minimum distance of a classical code.

## A. Fault distances

The fault distances of $\mathcal{F}$ can essentially be read off Eqs. (7) and (10), but we provide a derivation here for completeness. For an arbitrary length-1 chain complex $\mathcal{R}$, Zeng and Pryadko showed in Ref. [2] that the product complex $\mathcal{F} = \mathcal{R} \times \mathcal{C}$ has homological distances

$$ 
\begin{aligned}
d_j(\mathcal{F}) &= \min[d_0(\mathcal{R})d_i(\mathcal{C}), d_1(\mathcal{R})d_{i-1}(\mathcal{C})], \\
d_j(\mathcal{F}^T) &= \min[d_0(\mathcal{R}^T)d_j(\mathcal{C}^T), d_1(\mathcal{R}^T)d_{j-1}(\mathcal{C}^T)],
\end{aligned} 
\quad (12) $$

where $d_j(\mathcal{C})$ ($d_j(\mathcal{F}^T)$) is equal to the weight of the minimal weight operator in the (co)homology group $H_j(\mathcal{C})$ ($H^j(\mathcal{C})$). For $\mathcal{R}$ above we have

$$ 
\begin{aligned}
d_0(\mathcal{R}) &= d_1(\mathcal{R}^T) = 1, \\
d_1(\mathcal{R}) &= d_0(\mathcal{R}^T) = \delta,
\end{aligned} 
\quad (13) $$

where $\delta$ is the length of the repetition code. Therefore the primal and dual distances of $\mathcal{F}$ are

$$ 
\begin{aligned}
d_i &= \min[d_i(\mathcal{C}), \delta d_{i-1}(\mathcal{C})], \\
d_{i+1} &= \min[\delta d_{i+1}(\mathcal{C}^T), d_i(\mathcal{C}^T)].
\end{aligned} 
\quad (14) $$

## II. SINGLE-SHOT DECODING FOR FAULT COMPLEXES

Here we give further details on the decoding of fault complexes with the single-shot property and explain a key difference between the fault complex and CBQC pictures of single-shot decoding.

We consider the fault complex $\mathcal{F} = \mathcal{R} \times \mathcal{C}$, where $\mathcal{R}$ describes a distance $\ell$ repetition code with the parity-check matrix $R$ and $\mathcal{C}$ is a length-4 chain complex describing a CSS code with meta-checks. For a CSS code of this type, we have

$$ 
\begin{aligned}
H_X &= \partial_2^C, & H_Z^T &= \partial_3^C, \\
M_X &= \partial_1^C, & M_Z^T &= \partial_4^C,
\end{aligned} 
\quad (15) $$

where $M_X$ and $M_Z$ denote the meta-check matrices for $X$ and $Z$ checks, respectively.

Recall that the fault complex is formally a length-5 chain complex

$$ \mathcal{F} = F_5 \xrightarrow{\partial_5} F_4 \xrightarrow{\partial_4} F_3 \xrightarrow{\partial_3} F_2 \xrightarrow{\partial_2} F_1 \xrightarrow{\partial_1} F_0, \quad (16) $$

with boundary maps given by

$$ \partial_j = \left( \begin{array}{c|c} 1_{r_j} \otimes \partial_j^C & R \otimes 1_{n_{j-1}} \\ \hline 0 & 1_{c_j} \otimes \partial_{j-1}^C \end{array} \right). \quad (17) $$
We identify the primal and dual qubits with the vector spaces $C_2$ and $C_3$, respectively. Hence, the graph state connectivity is specified by $\partial_3$, while the primal and dual detectors are given by $D_X = \partial_2$ and $D_Z = \partial_4^T$, respectively.

Per the main text, this fault complex has no “meta-detectors” and can be reduced to a length-3 sub-complex without any loss of information. To understand why this is the case, first notice that the detector matrices $D_X$ and $D_Z$ already contain fault locations, using the terminology of CBQC, of data and ancilla faults. This can be seen by constructing, e.g., the matrix $D_X$ for $\delta = 2$ and performing column and row operations

$$D_X = \begin{pmatrix} M_X & & & \\ & H_X & & \\ & & M_X & \\ & & & H_X \\ & & & & M_X \end{pmatrix}. \quad (18)$$

In the above matrix, the odd rows detect ancilla faults and the even rows detect data faults, while odd columns are ancilla fault locations and even columns are data fault locations. Unlike in the CBQC framework for single-shot error correction, in the fault complex picture, there is no distinction between data faults and ancilla faults, or equivalently between detectors arising from stabilizers ($H_X$) and detectors arising from meta-checks ($M_X$). Thus, for any error $e_X$ with syndrome $s_X = D_X e_X$ we have $\partial_1 s_X = \partial_1 \partial_2 e_X = 0$. This distinction runs deep in the CBQC community and has historically influenced decoder design, particularly in phenomenological noise simulations where faults are sampled in separate steps. In such simulations, faults on data qubits are first drawn from the space $C_i$, and only afterwards are ancilla qubit faults sampled from $C_{i+1}$. This sequential treatment reinforces the mindset that data and ancilla faults are fundamentally distinct and should be handled separately. Consequently, decoder designs—especially for single-shot codes with metachecks—have traditionally relied on heuristics to merge these distinct fault types into an effective decoding matrix-[3, 4]. By contrast, the fault complex framework eliminates this conceptual divide. By embedding data and measurement faults in the same vector spaces, $F_i$ and $F_{i+1}$ for primal and dual faults, respectively, it provides a natural and systematic way to construct the appropriate detector check matrices. This is illustrated in Eq. (18) where the structure of $D_X$ naturally recovers the effective parity-check matrix for decoding. Rather than relying on intuition, as was done in prior works, the fault complex formalism directly specifies the correct boundary operators, yielding the appropriate check structure from first principles. The first block (teal) is the relevant check matrix for a single round of the overlapping window decoder, specifying a single detector block in the overlapping window decoder for $w = 1$. The second block (red) is identical to the single-stage decoding matrix proposed in Ref. [4].

This block can be recovered from block one by treating the ancilla faults from the previous round (first column of block one) as perfect, which eliminates them from the decoding problem. The full block is the relevant detector check matrix for a window size $w = 2$.

Thus, the fault complex formalism provides a rigorous derivation of the single-shot decoding strategy—resolving prior uncertainties about how to construct the appropriate parity-check matrix for decoding single-shot codes with metachecks.

## A. Insights on decoding

Formalizing the simulation framework in the language of fault complexes yielded important insights in the improved decoding of single-shot code with metachecks. In the following, we will explain based on the example of 4D toric code how those insights were obtained from analyzing the fault complex of the code.

The 4D toric code of linear lattice size $L$ has code distance $d_C = L^2$ and metacheck distance $d_M = L$. A code with distance $d$ can correct up errors up to weight $[(d-1)/2]$. Then, over a window size $w \in \mathbb{N}$ the distance of the corresponding fault complex $d(\mathcal{F})$ according to Eq. (14) is given by $d(\mathcal{F}) = \min[wL, L^2]$. Then, for $w = 1$ and $L$ odd, one would not expect $L+1$ to have improved error suppression over $L$ as the weight of correctable errors is identical. However, here and in Ref. [4] numerical results have shown that $L+1$ does indeed improve performance, which appears paradoxical from this perspective.

Our formalism allowed us to understand this apparent paradox by recognizing that the distance $\min[wL, L^2]$ has contributions from logical correlations of different roles. First, the emphtime-like distance, which scales as $wL$, and the space-like distance, which scales as $L^2$.

In Ref. [4] as well as in Figure 2 of the main text, memory experiments are performed which only space-like logical errors cause logical failures. Nevertheless, also in memory experiments, time-like errors can occur and accumulate over repeated rounds of error correction but remain unproblematic as long as they are not converted into space-like errors. However, the decoder can convert accumulated time-like errors into space-like errors. This conversion process becomes significant when analyzing single-shot thresholds, necessitating simulations over many rounds of error correction to observe threshold convergence.

We find that convergence of threshold estimates is much slower for $w = 1$, where the time-like distance is minimal. Due to the increased time-like distance for $w > 1$, when a time-like fault is converted into a space-like fault, this fault is more likely to directly cause a logical failure. This is the intuitive explanation for the observation of the faster convergence of the threshold. In the case $w = L$, the time-like and space-like distances become identical, and convergence is immediate
and it is not necessary to simulate multiple error correction rounds in principle. However, due to boundary effects, even in that case convergence should be checked carefully.

### III. NUMERICAL SIMULATIONS

Here we describe in more detail how the simulations are performed to obtain the sustainable thresholds of the 3D and 4D toric codes. All simulations in the manuscript were performed using a private version of FlamingPy [5].

#### A. Phenomenological noise

We begin by describing the case of phenomenological noise. Since we are only considering a single type of Pauli error in our simulations, we only need to decode a single side of the fault complex. First, we construct the associated fault complex through foliation based on the base code, e.g., the 3D toric code, over $\delta$ rounds. In the cluster state picture, this corresponds to a cluster state of $2\delta + 1$ layers. As we are using 30 iterations of the minimum belief propagation (BP) algorithm, potentially followed by ordered statistics decoding post-processing with an order-60 combination sweep (CS-60) search strategy, we do not require the gauge group generators. Given the dual detectors $D_Z$, we sample faults corresponding to each matrix column from an i.i.d noise model with probability $p$. Any faults occurring on the initial and final layer are removed to assert that we are starting and ending in a code state. This assumption is equivalent to the usual assumption in the phenomenological noise model simulations that the final syndrome measurement is noise-free. For each trial, the sampled fault vector is sliced up according to the ($w, 1$)-overlapping window decoder before being passed to the local decoder. A more explicit description of this can be found in Refs. [6, 7]. After the full correction $c_\delta$ over $\delta$ rounds is calculated, we check whether the residual error is a logical error. For the 3D and 4D toric codes that possess 3 and 6 logical qubits, we count as a failure if at least a single logical qubit remains in error.

#### B. Photonic GKP noise

Additionally, we investigated the threshold under a noise model for Xanadu's photonic architecture based on Gottesman-Kitaev-Preskill (GKP) qubits [8–10], with cluster state construction and error model details provided below and in [11, 12]. For the 4D toric code, we observe a threshold of approximately 10.35 dB, comparable to that of the 2D variant [9, 10]. The 3D code achieves a threshold of approximately 7.95 dB. In both cases, the $w = 3$ decoder archives thresholds comparable to the $w = L$ decoder, see Fig. 1(a) and Fig. 1(b).

When simulating Xanadu's photonic architecture based on optical Gottesman-Kitaev-Preskill qubits [9–12], a few adjustments to the simulation routine are necessary. First, as we are aiming to simulate an approximation of the physical noise model, we now require knowledge about the bi-adjacency matrix of the (qubit-level) fault-tolerant graph state. As described in Ref. [11, 12], using the process of *macronization* and *stiching* the qubit-level graph state can equivalently be described by several GKP Bell pairs and linear-optical circuit elements, e.g., phase shifters and beam splitters. For each optical mode describing a GKP state, we sample a random displacement from the normal distribution $N(0, \sigma^2)$ with variance $\sigma^2$ and propagate the sampled displacement through the linear optical circuit until the final homodyne measurement stage. Computationally, this propagation of sampled displacements amounts to a series of matrix vector multiplications that introduce local correlations between the modes. This is an effective model to describe a finite-energy GKP qunaught state with $-10 \log_{10}(\sigma^2/\sigma_{\text{vac}}^2)$ dB of per-peak squeezing, where we set the vacuum variance $\sigma_{\text{vac}}^2 = 2$. As described in more detail in Refs. [9–12], the sampled displacements can be processed to yield measurement outcomes for the individual modes when they are measured in the *reduction* step described in Ref. [11]. To improve the logical error suppression and the observed threshold, we employ as an inner decoder on the level of the GKP code an algorithm different from the binning strategy mentioned in Refs. [9, 10]. Our correlation-aware inner decoder, described in detail in Ref. [12, see the supplementary information Section VI.A], reduces the effective error probability.

<figure><img src="image_6.png" /><figcaption>FIG. 1. Sustainable thresholds for 3D (a) and 4D (b) toric codes under a noise model for a photonic GKP-based architecture. Markers represent the threshold for a ($w, 1$)-overlapping window decoder as a function of noisy syndrome rounds. The black dashed line shows the threshold for the optimal window choice $w = L$. In the 3D case, we only consider primal faults, whereas in the 4D case, we consider both primal and dual faults.</figcaption></figure>
<figure><img src="image_7.png" /><figcaption>FIG. 2. Example of the threshold fitting procedure for the 3D toric code under the photonic GKP noise model with an $w = 2$ overlapping window decoder after 129 rounds of noisy syndrome measurements. **Left:** Histogram of the bootstrap resamples, with the mean and 99% confidence interval highlighted in blue. **Center:** Collapse plot of the fitted data. **Right:** Threshold plot of the data obtained from the sustainable threshold simulation with the threshold value highlighted as a black dashed line and 99% confidence intervals as a grey shading.</figcaption></figure>

bility of individual qubits in the cluster state. From this, an effective qubit-level noise model can be obtained and the rest of the simulation routine continues as described in the previous section.

### C. Threshold estimation

The common way of obtaining an estimate of the threshold based on the simulation of finite system sizes consists of performing a quadratic fit with the rescaled error rate [13, 14], that is,

$$x = (p - p_{th})d^{1/\mu}, \qquad (19)$$

$$f(x) = ax^2 + bx + c, \qquad (20)$$

with $p_{th}$ the threshold to be fitted, $d$ the code distance, $\mu$ a scaling parameter and $a, b, c$ free parameters of the quadratic polynomial. However, this approach cannot be followed for determining the threshold estimate of sustainable threshold simulations. For a sufficiently large number of decoding rounds, the observed logical error rate will saturate at $p_L = 1 - (0.5)^k$ in the vicinity of the threshold, i.e., for $p \approx p_{th}$. Thus, it is impossible to observe a threshold as a crossing of curves for finite system sizes: this crossing lies in a region where the error rates saturate. To capture accurately the behavior described above, we consider fitting to an alternative model, that is,

$$g(x) = a \left[ 1 - \left( 1 - \frac{1 + \tanh(bx)}{2} \right)^c \right], \qquad (21)$$

where $x$ is the rescaled error rate as in Eq. (19) and $a, b, c$ are free fit parameters. In principle, if the fit is performed over a sufficient range of $x$, one does not need to fit $a$ and can set it instead to its analytical value $a \equiv 1 - (0.5)^k$;

however, we leave $a$ as a free parameter. The parameter $c$ typically scales with the number of decoding rounds.

To estimate the threshold based on the model Eq. (21), we use the bootstrap resampling technique with 10000 resamples; see [15] for an implementation. The obtained (asymmetric) error bars represent the 99% confidence intervals. Fig. 2 contains some example plots for the threshold fitting procedure.

### D. Stability experiments

To further support our claim that 3D and 4D toric codes are compatible with single-shot lattice surgery, we perform simulations of stability experiments. Stability experiments can be used as a proxy for simulating lattice surgery because they probe the accuracy of reliably inferring the outcomes of an extensive number of stabilizers [16]. We perform numerical simulations over 32 decoding rounds for a 3D toric code of linear size $L$ (with periodic boundaries in time to avoid finite-size effects). In this case, the corresponding fault complex is equivalent to the chain complex that describes an asymmetric 4D toric code with dimensions $L \times L \times L \times w$ for each decoding window. Decoding proceeds with an $(w, 1)$ overlapping window decoder. In this case, the effective primal fault distance is $d_1 = wL$, i.e., for $w \le L$ the distance is limited by the size of the decoding window. But even for $w = 1$ we expect to observe an error threshold based on the distance scaling $d \sim L$. The $w = 1$ case corresponds to single-shot lattice surgery, but we note that any $w = O(1)$ corresponds to constant-time overhead lattice surgery. Our results are summarized in Fig. 3. As expected from the distance calculation, we observe an error threshold for all values of $w$, with the logical error rate decreasing with increasing $L$ below the threshold. By increasing the decoding window size $w$ from $w = 1$
<figure><img src="image_8.png" /><figcaption>FIG. 3. Logical error rate for the time-like logical correlation of a 3D toric code for different window sizes of the overlapping window decoder. In (a) $w = 1$, (b) $w = 2$, and (c) $w = 3$. Vertical black dashed lines indicate the fitted threshold. The shading indicates a confidence interval, indicating hypotheses whose likelihoods are within a factor of 1000 of the maximum likelihood estimate.</figcaption></figure>

in Fig. 3(a), to larger, but constant, values of $w = 2$ in Fig. 3(b) and $w = 3$ in Fig. 3(c) we observe increased error thresholds in the stability experiments. We note that choosing $w$ adaptively on the code size, e.g., $w = L$, balances time-like and space-like errors. In practice, this allows one to find a trade-off between the number of syndrome measurement rounds required for lattice surgery, and thus the time overhead for logical gates, and the achievable logical error rates of the gate. We emphasize that these observations are in stark contrast to stability experiments with non-single-shot codes, as performed by Gidney [16] on the 2D surface code, where the effective distance is independent of $L$. For two codes with $L_2 > L_1$, the code with $L_1$ will always have a lower error rate than the code with $L_2$ if decoded over the same window size $w$. Additionally, as expected, we observe exponential suppression of the logical error rate below threshold; see Fig. 4.

In the main text, we also proposed a joint memory and stability experiment for the 2D toric code with periodic boundary conditions (this would also work in higher dimensions). This experiment proceeds in the same way as a memory experiment, namely

1. Initialize all qubits in the $|0\rangle$ state.

2. Measure the stabilizers $T$ times.

3. Measure all qubits in the $Z$ basis.

After decoding, we can then estimate the final values of

<figure><img src="image_9.png" /><figcaption>FIG. 4. Stability experiments with the $L = 5$ 3D toric code. (a) Logical error rate as a function of the Pauli error rate $p$ for various sizes of the decoding window $w$. (b) Scaling of the logical error rate below the threshold as a function of the size of the decoding window $w$.</figcaption></figure>

the logical $Z$ operators, and the product of all the $X$ stabilizers (in a single round). These observables correspond, respectively, to the logical correlations of the fault complex descending from the logical $Z$ operators of the 2D toric code (memory), and to the logical correlation descending from the redundancy in $H_X$ (stability). Each of these observables should be deterministic in the absence of errors, so using this experiment, we can estimate the probability of a spacelike logical error that disrupts the memory observable or a timelike logical error that disrupts the stability observable. We can vary the code distance $d$ and the number of rounds $T$ in order to estimate the threshold for both types of observable.

## IV. FAULT COMPLEXES OF SUBSYSTEM CODES

Here, we briefly discuss the extension of our fault complex formalism to subsystem codes [17–19]. We recall that a CSS subsystem code is defined by two (gauge) matrices $G_X$ and $G_Z$, but unlike in the subspace code case, we do not require that $G_X G_Z^T = 0$ [20]. The $X$-type stabilizers of the subsystem code are the elements of the row space of $G_X$ that have even overlap all rows of $G_Z$, and vice versa for the $Z$-type stabilizers. We use the notation $H_X$ and $H_Z$ for the $X$- and $Z$-type stabilizer matrices, respectively.

Prior work on foliation [21–23] gives us clues for the correct form of the fault complexes of subsystem codes. We know that in a foliated CSS subsystem code, the
ancilla qubit connections correspond to the rows of $G_X$ and $G_Z$, and the data qubits connections are unchanged. This suggests that—for a length-3 fault complex—the boundary operator $\partial_2$ describing the cluster state connectivity should be as in Eq. (17) with $\partial_i^C = G_Z^T$ and $\partial_{i-1}^C = G_X$. However, for the other boundary operators, we should use $H_X$ and $H_Z$ instead of $G_X$ and $G_Z$, as subsystem code detectors are formed from the stabilizers, not the checks. Explicitly,

$$D_X = \partial_1 = \left( \mathbf{1}_r \otimes H_X \mid R \otimes \mathbf{1}_{n_0} \right), \quad (22)$$

$$\partial_2 = \left( \frac{\mathbf{1}_r \otimes G_Z^T}{0} \mid \mathbf{1}_c \otimes G_X \right), \quad (23)$$

$$D_Z^T = \partial_3 = \left( \frac{R \otimes \mathbf{1}_{n_2}}{\mathbf{1}_c \otimes H_Z^T} \right). \quad (24)$$

For the case of CSS subsystem codes with meta-checks, we expect that $D_X$ and $D_Z$ would simply need to include $M_X$ and $M_Z$ (the meta-check matrices) and would resemble Eq. (18). Given the similarity of the detector matrices, the decoding problem for these codes should be identical in structure to the decoding problem for fault complexes we have previously covered. It would be, therefore, interesting to examine the performance of, e.g., subsystem codes with single-shot error correction [24–27] using the approach explored in this work.

The changes outlined above are relatively minor, and we therefore anticipate that foliated CSS subsystem codes can be represented naturally as fault complexes. The main barrier to formalizing our intuition is finding the appropriate representation of CSS subsystem codes as chain complexes (see [26, 28] for some possibilities). We leave this for future work.

## V. FAULT COMPLEXES OF CIRCUIT MODELS

In Ref. [29], Li proposes a low-density parity-check representation of fault-tolerant quantum circuits. The formalism introduced there can be seen as another perspective of space-time codes; see also Refs. [30–33]. In Sec. VIII of [29], the author gives explicit expressions obtained from their formalism for operations that do not couple X and Z type operators, resulting in two disjoint Tanner graphs. In particular, they obtain the matrix representation, for what we call the gauge group generators, as

$$G_X = \begin{pmatrix} \mathbf{a}_X \otimes \mathbf{1}_n & 1_{m_X^C} \otimes \mathbf{H}_X^T \\ \mathbf{d}_X^T \otimes H_Z & 0 \end{pmatrix}, \quad (25)$$

$$G_Z = \begin{pmatrix} \mathbf{a}_Z \otimes \mathbf{1}_n & 1_{m_Z^C} \otimes \mathbf{H}_Z^T \\ \mathbf{d}_Z^T \otimes H_X & 0 \end{pmatrix}, \quad (26)$$

where $m_X^C$ ($m_Z^C$) denotes the number of rows of $\mathbf{a}_X$ ($\mathbf{a}_Z$), the detector matrices are given by

$$D_X = \left( \mathbf{1}_{m_X^B} \otimes H_X \quad \mathbf{a}_X^T \otimes \mathbf{1}_{r_X} \right), \quad (27)$$

$$D_Z = \left( \mathbf{1}_{m_Z^B} \otimes H_Z \quad \mathbf{a}_Z^T \otimes \mathbf{1}_{r_Z} \right), \quad (28)$$

and logical operators as

$$L_X = (\mathbf{g}_X \otimes \ell_X), \quad (29)$$

$$L_Z = (\mathbf{g}_Z \otimes \ell_Z), \quad (30)$$

Here, the quantities $\mathbf{a}_X$ and $\mathbf{d}_X$ are specific to the concrete circuit, however, they already have large similarity with matrices obtained from the hypergraph product of a length-2 chain complex with a length-1 complex.

More evidence that our formalism can also describe fault-tolerant error correction is found by considering the explicit example of the r-times repeated measurement of stabilizer generators. This example is discussed in Sec. VII C of Ref. [29]. For this example, translating the notation of Li to our notation, $\mathbf{a}_X$ is the check matrix of the repetition code and $g_X$ is the all-one vector, equivalent to what we have obtained in Section I from the Küneth formula. The matrix $\mathbf{d}_X$ is equivalent to the r-dimensional identity matrix $\mathbf{1}_r$ up to an additional all-zero row. Similar expressions are obtained when expressing $D_Z$ and $L_Z$.

## VI. “FOLIATION” BEYOND THE REPETITION CODE

We consider as an example a classical linear code that extends the repetition code. In particular, we focus on a code family defined by the polynomial $t(x) = 1+x+x^2$. Note that, in a similar notation, the ordinary repetition code is defined by the polynomial $1+x$.

The polynomial $t(x)$ defines a family of classical linear codes with parameters $[n = 3s, k = 2, d = 2s]$, where the parameter $s > 0$ determines the size $3s \times 3s$ of the circulant matrices used in the code construction.

Codewords of the classical code take the form

$$\ell_1 = \underbrace{(1, \dots, 1)}_{s \text{ times}} \otimes (1, 1, 0), \quad (31)$$

$$\ell_2 = \underbrace{(1, \dots, 1)}_{s \text{ times}} \otimes (1, 0, 1). \quad (32)$$

Compared to the ordinary repetition code, this code encodes two logical bits, at the cost of a reduced distance.

We compute the (co-)homology of the chain complex whose boundary map is associated with the check matrix
$\tilde{\mathcal{R}}$ of this code. The resulting homology groups are

$$H_0(\tilde{\mathcal{R}}) = \tilde{R}_0/\mathrm{im}(\tilde{\mathcal{R}}) \cong \{\mathbf{0}, (1, 0, \dots, 0), (0, 1, 0, \dots, 0)\}, \quad (33)$$

$$H_1(\tilde{\mathcal{R}}) \cong \ker(\tilde{\mathcal{R}}) \cong \{\mathbf{0}, \ell_1, \ell_2\}, \quad (34)$$

$$H^0(\tilde{\mathcal{R}}) \cong \ker(\tilde{R}^T) \cong \{\mathbf{0}, \ell_1, \ell_2\}, \quad (35)$$

$$H^1(\tilde{\mathcal{R}}) = \tilde{R}_1/\mathrm{im}(\tilde{R}^T) \cong \{\mathbf{0}, (1, 0, \dots, 0), (0, 1, 0, \dots, 0)\}. \quad (36)$$

As a result, the number of logical correlations and logical errors in the fault complex is increased. To be explicit, assuming for simplicity that the base CSS code has full-rank check matrices, the primal logical errors $H_i(\mathcal{F})$ and the primal logical correlations $H^i(\mathcal{F})$ are given by

$$H_i(\mathcal{F}) \cong H_0(\tilde{\mathcal{R}}) \otimes H_i(\mathcal{C}) \oplus H_1(\tilde{\mathcal{R}}) \otimes H_{i-1}(\mathcal{C}) \\ = \langle ((1, 0, \dots, 0) \otimes \ell_Z, (0, 1, 0, \dots, 0) \otimes \ell_Z, \mathbf{0}) \rangle, \quad (37)$$

where $\ell_Z \in \ker(\partial_i)/\mathrm{im}(\partial_{i+1})$.

Similarly, the primal logical correlations are

$$H^i(\mathcal{F}) \cong H^0(\tilde{\mathcal{R}}) \otimes H^i(\mathcal{C}) \oplus H^1(\tilde{\mathcal{R}}) \otimes H^{i-1}(\mathcal{C}) \\ = \langle (\ell_1 \otimes \ell_X, \ell_2 \otimes \ell_X, \mathbf{0}) \rangle, \quad (38)$$

where $\ell_X \in \ker(\partial_{i+1})/\mathrm{im}(\partial_i)$.

We emphasize that, due to the structure of the check matrix $\tilde{\mathcal{R}}$—as evident from its polynomial description $t(x) = 1 + x + x^2$—each bit is involved in three checks. As a consequence, the space-time code described by $\mathcal{F}$ is non-matchable, even if the underlying (static) CSS code chain complex $\mathcal{C}$ is associated with a matchable code.

Additionally, we note that, while the graph state / fault complex now hosts an additional logical correlation and logical error, it is not immediately obvious how to operate on this correlation. A similar issue arises in constructing CSS codes with multiple logical qubits.

Nevertheless, it may be beneficial to consider codes beyond the repetition code for “foliation” when the base code is already a non-matchable LDPC code. In such cases, the decoding problem already requires algorithms such as BP-OSD, making this extension a natural choice.

[1] B. J. Brown, Conservation laws and quantum error correction: Toward a generalized matching decoder, IEEE BITS the Information Theory Magazine 2, 5 (2022).

[2] W. Zeng and L. P. Pryadko, Higher-dimensional quantum hypergraph-product codes with finite rates, Phys. Rev. Lett. 122, 230501 (2019).

[3] A. O. Quintavalle, M. Vasmer, J. Roffe, and E. T. Campbell, Single-shot error correction of three-dimensional homological product codes, PRX Quantum 2, 020340 (2021).

[4] O. Higgott and N. P. Breuckmann, Improved single-shot decoding of higher-dimensional hypergraph-product codes, PRX Quantum 4, 020332 (2023), arXiv:2206.03122 [quant-ph].

[5] FlamingPy repository, https://github.com/XanaduAI/flamingpy.

[6] S. Huang and S. Puri, Increasing memory lifetime of quantum low-density parity check codes with sliding-window noisy syndrome decoding, Phys. Rev. A 110, 012453 (2024).

[7] T. R. Scruby, T. Hillmann, and J. Roffe, High-threshold, low-overhead and single-shot decodable fault-tolerant quantum memory (2024), arXiv:2406.14445 [quant-ph].

[8] D. Gottesman, A. Kitaev, and J. Preskill, Encoding a qubit in an oscillator, Phys. Rev. A 64, 012310 (2001).

[9] J. E. Bourassa, R. N. Alexander, M. Vasmer, A. Patil, I. Tzitrin, T. Matsuura, D. Su, B. Q. Baragiola, S. Guha, G. Dauphinais, K. K. Sabapathy, N. C. Menicucci, and I. Dhand, Blueprint for a scalable photonic fault-tolerant quantum computer, Quantum 5, 392 (2021), arXiv:2010.02905.

[10] I. Tzitrin, T. Matsuura, R. N. Alexander, G. Dauphinais, J. E. Bourassa, K. K. Sabapathy, N. C. Menicucci, and I. Dhand, Fault-tolerant quantum computation with static linear optics, PRX Quantum 2, 040353 (2021), arXiv:2104.03241.

[11] B. W. Walshe, B. Q. Baragiola, H. Ferretti, J. Gefaell, M. Vasmer, R. Weil, T. Matsuura, T. Jaeken, G. Pantaleoni, Z. Han, T. Hillmann, N. C. Menicucci, I. Tzitrin, and R. N. Alexander, Linear-optical quantum computation with arbitrary error-correcting codes, Phys. Rev. Lett. 134, 100602 (2025), arXiv:2408.04126 [quant-ph].

[12] H. Aghaee Rad and others, Scaling and networking a modular photonic quantum computer, Nature 638, 912 (2025).

[13] C. Wang, J. Harrington, and J. Preskill, Confinement-higgs transition in a disordered gauge theory and the accuracy threshold for quantum memory, Annals of Physics 303, 31 (2003).

[14] J. W. Harrington, Analysis of Quantum Error-Correcting Codes: Symplectic Lattice Codes and Toric Codes, Ph.D. thesis, California Institute of Technology (2004).

[15] Threshold bootstrap code, https://gist.github.com/chubbc/59f7dcb8d5d6f7a1a8f5ccc237c8d61d.

[16] C. Gidney, Stability experiments: The overlooked dual of memory experiments, ArXiv220413834 Quant-Ph (2022), arXiv:2204.13834 [quant-ph].

[17] D. Kribs, R. Laflamme, and D. Poulin, Unified and generalized approach to quantum error correction, Phys. Rev. Lett. 94, 180501 (2005).

[18] D. W. Kribs, R. Laflamme, D. Poulin, and M. Lesosky, Operator quantum error correction, Quantum Info. Comput. 6, 382-399 (2006).

[19] D. Poulin, Stabilizer formalism for operator quantum error correction, Phys. Rev. Lett. 95, 230504 (2005).

[20] M. L. Liu, N. Tantivasadakarn, and V. V. Albert, Subsystem CSS codes, a tighter stabilizer-to-CSS mapping, and Goursat's Lemma, Quantum 8, 1403 (2024).

[21] A. Bolt, G. Duclos-Cianci, D. Poulin, and T. M. Stace, Foliated quantum error-correcting codes, Phys. Rev.
Lett. 117, 070501 (2016).

[22] A. Bolt, D. Poulin, and T. M. Stace, Decoding schemes for foliated sparse quantum error-correcting codes, Phys. Rev. A 98, 062302 (2018).

[23] B. J. Brown and S. Roberts, Universal fault-tolerant measurement-based quantum computation, Phys. Rev. Research 2, 033305 (2020).

[24] H. Bombín, Single-shot fault-tolerant quantum error correction, Phys. Rev. X 5, 031043 (2015).

[25] B. J. Brown, N. H. Nickerson, and D. E. Browne, Fault-tolerant error correction with the gauge color code, Nat Commun 7, 12302 (2016).

[26] A. Kubica and M. Vasmer, Single-shot quantum error correction with the three-dimensional subsystem toric code, Nat. Commun. 13, 6272 (2022).

[27] C. Stahl, Single-shot quantum error correction in inter-

twined toric codes, Phys. Rev. B 110, 075143 (2024).

[28] W. Zeng and L. P. Pryadko, Minimal distances for certain quantum product codes and tensor products of chain complexes, Phys. Rev. A 102, 062402 (2020).

[29] Y. Li, Low-density parity-check representation of fault-tolerant quantum circuits, Phys. Rev. Res. 7, 013115 (2025), arXiv:2403.10268 [quant-ph].

[30] D. Bacon, S. T. Flammia, A. W. Harrow, and J. Shi, Sparse quantum codes from quantum circuits, IEEE Trans. Inf. Theory 63, 2464 (2017).

[31] N. Delfosse and A. Paetznick, Spacetime codes of clifford circuits (2023), arXiv:2304.05943 [quant-ph].

[32] D. Gottesman, Opportunities and challenges in fault-tolerant quantum computation (2022), arXiv:2210.15844 [quant-ph].

[33] X. Fu and D. Gottesman, Error correction in dynamical codes (2024), arXiv:2403.04163 [quant-ph].