Introduction
Topological quantum codes are defined by local checks but store quantum information nonlocally, which protects it against local noise [1 , 2 ] . Codes in three or more dimensions offer capabilities beyond those of two-dimensional codes: some admit transversal non-Clifford gates [3 , 4 , 5 ] , and some support single-shot decoding [6 , 7 , 8 , 9 ] . Such codes come in many forms, however, and it is often unclear which of their features are genuinely new and which are inherited from simpler codes. For example, the three-dimensional color code has a transversal non-Clifford gate, yet it is locally equivalent to three copies of the three-dimensional toric code [5 ] , so it can be decoded with toric-code decoders [10 ] .
A systematic way to organize topological codes is to ask when two of them are related by local transformations, that is, when they realize the same topological phase [11 ] . Toric codes are the simplest and best-understood representatives, so a basic question is when a given code is equivalent to a stack of toric codes. We address this question for translation-invariant CSS codes [12 , 13 ] , a family that includes bivariate bicycle codes [14 ] . We allow finite-depth local CSS-preserving Clifford circuits that commute with translations, together with the addition of ancillas, and call an equivalence of this kind to a toric-code stack a decoupling .
In two dimensions, a finite-depth local circuit that commutes with translations preserves how translations act on the anyons of a translation-invariant topological Pauli stabilizer code [15 ] . Translations act trivially on the anyons of a toric-code stack, but they can permute the anyons of a general topological code, a phenomenon known as weak breaking of translation symmetry [16 , 17 , 18 ] . One must therefore coarse-grain, retaining only a finite-index subgroup of translations, or superlattice , whose elements preserve every anyon type. Such a code can always be mapped to a toric-code stack, possibly after adding ancillas, by a finite-depth local circuit commuting with the translations of some superlattice [19 , 20 , 21 , 22 ] , although the known constructions may coarse-grain more than necessary. For topological CSS codes, Wang et al. showed that preserving every anyon type is also sufficient: a decoupling already exists on the superlattice of all anyon-preserving translations [23 ] .
In D ≥ 3 D \ge3 D ≥ 3 spatial dimensions, excitations of CSS codes can be pointlike, looplike, or higher-dimensional; in each of the X X X and Z Z Z sectors, they are sorted by dimension into superselection layers [24 ] . The two-dimensional argument applies to every layer, so the retained translations must act trivially on each of them (this is possible only if every layer has finitely many excitation types, which excludes fracton models [25 , 26 ] such as Haah’s cubic code [27 ] and the X-cube model [28 ] ). For codes with a single nonzero layer, Song [15 ] proved that a decoupling exists after coarse-graining precisely when the retained translations act trivially on that layer. Li and Williamson [29 ] established toric-stack equivalence for qubit CSS codes obtained from three-term segments of length-D D D free resolutions whose Z X ZX Z X duals are also resolutions. Color codes [30 , 31 ] , explicitly decoupled earlier by Kubica et al. [5 ] , are examples of such single-layer codes.
When several layers coexist, however, the full excitation structure, called the superselection profile [15 ] , also records how the layers are glued together. This gluing is an additional obstruction to decoupling: Song constructed three-dimensional examples in which translations act trivially on every layer, yet the gluing prevents a decoupling that retains these translations. In this work, we show that for translation-invariant topological p p p -ary CSS codes in any spatial dimension D D D , with p p p any prime, further coarse-graining always removes this obstruction, provided that every layer has finitely many excitation types. The code can then be decoupled by an explicit circuit of SUM (qudit CNOT) and SWAP gates.
Our main result is a decoupling criterion: a code can be decoupled on a superlattice exactly when, after coarse-graining to that superlattice, its profile is that of a toric-code stack. This condition has two parts: the translations in the superlattice must act trivially on every layer, and the gluing must vanish. Once the first holds, each further coarse-graining by a factor of p p p in every direction detaches one more layer from those below it. Hence, for a code with m m m nonzero layers, a further factor of p m − 1 p^{m-1} p m − 1 suffices. Coarse-graining in every direction can be more than necessary; when at most two layers are nonzero, as in every three-dimensional code, we also determine the minimal coarse-graining. We turn these results into two algorithms: the first finds a sufficient superlattice, and the second constructs the decoupling circuit on it, in polynomial time for fixed spatial dimension once the profile has been computed (Proposition 1). Finally, the criterion also applies to finite systems: a torus encodes the maximal number of logical qudits exactly when the code can be decoupled on its period lattice.
The rest of the paper is organized as follows. Section II reviews the algebraic framework. Section III defines the inter-layer gluing and shows, for a glued code from Ref. [15 ] , that it obstructs decoupling. Section IV removes the gluing by coarse-graining, states the decoupling criterion (Theorem 1), turns it into algorithms, and applies it to tori. Section V removes the gluing of the glued code. Section VI discusses applications to decoding and logical gates, and open questions. Some proofs, including the explicit construction of the decoupling circuit, are deferred to the appendixes.
Preliminaries
We first describe decouplings and excitations in a common algebraic language. In this language, a decoupling becomes a commuting square of invertible maps, and the excitations form the superselection profile, which a decoupling cannot change. We then introduce coarse-graining, which a decoupling generally requires because translations can act nontrivially on the excitations of a code but not on those of a toric-code stack.
Polynomial representation and the decoupling problem
Following Haah [32 ] , we use translation invariance to turn the decoupling problem into one about modules over a ring of Laurent polynomials. Consider the lattice Z D \mathbb{Z}^{D} Z D , D ≥ 2 D \ge2 D ≥ 2 , with q q q p p p -ary qudits in each unit cell. The generalized Pauli operators act as X ∣ a ⟩ = ∣ a + 1 ⟩ X\lvert a\rangle=\lvert a+1\rangle X ∣ a ⟩ = ∣ a + 1 ⟩ and Z ∣ a ⟩ = ω a ∣ a ⟩ Z\lvert a\rangle=\omega^{a}\lvert a\rangle Z ∣ a ⟩ = ω a ∣ a ⟩ , with a ∈ F p a \in\mathbb{F}_{p} a ∈ F p and ω = e 2 π i / p \omega=e^{2\pi i/p} ω = e 2 π i / p [33 ] . Let R = F p [ x 1 ± 1 , … , x D ± 1 ] R=\mathbb{F}_{p}[x_{1}^{\pm1},\ldots,x_{D}^{\pm1}] R = F p [ x 1 ± 1 , … , x D ± 1 ] , the Laurent polynomial ring, write x α : = x 1 α 1 ⋯ x D α D x^{\alpha}:=x_{1}^{\alpha_{1}}\cdots x_{D}^{\alpha_{D}} x α := x 1 α 1 ⋯ x D α D for α ∈ Z D \alpha\in\mathbb{Z}^{D} α ∈ Z D , and let e 1 , … , e q e_{1},\ldots,e_{q} e 1 , … , e q denote the standard basis of R q R^{q} R q . A finitely supported X-type Pauli operator, modulo phases, is represented by an element u ∈ R q u \in R^{q} u ∈ R q : the term λ x α e i \lambda x^{\alpha}e_{i} λ x α e i represents X λ X^{\lambda} X λ on qudit i i i of the unit cell at α \alpha α . We write X ( u ) X(u) X ( u ) for the operator represented by u u u , and define Z ( v ) Z(v) Z ( v ) for v ∈ R q v \in R^{q} v ∈ R q in the same way. Multiplication of operators corresponds to addition of representatives, and translating an operator by α \alpha α multiplies its representative by x α x^{\alpha} x α .
To express commutation, we use the antipode f ↦ f ‾ f \mapsto\overline{f} f ↦ f , the ring automorphism of R R R that sends each x i x_{i} x i to x ‾ i : = x i − 1 \overline{x}_{i}:=x_{i}^{-1} x i := x i − 1 . For a matrix over R R R , † denotes the transpose with the antipode applied entrywise. Commutation between X- and Z-type operators is then encoded by the sesquilinear symplectic form ( u , v ) ↦ u † v ∈ R (u,v)\mapsto u^{\dagger}v \in R ( u , v ) ↦ u † v ∈ R [23 , 32 ] . If λ ∈ F p \lambda\in\mathbb{F}_{p} λ ∈ F p is the coefficient of x α x^{\alpha} x α in u † v u^{\dagger}v u † v , then X ( x α u ) Z ( v ) = x − α Z ( v ) X ( x α u ) X(x^{\alpha}u)Z(v)=x^{-\alpha}Z(v)X(x^{\alpha}u) X ( x α u ) Z ( v ) = x − α Z ( v ) X ( x α u ) . In particular, X ( u ) X(u) X ( u ) commutes with every translate of Z ( v ) Z(v) Z ( v ) if and only if u † v = 0 u^{\dagger}v=0 u † v = 0 .
A translation-invariant CSS code is specified by its check matrices H X ∈ R s × q H_{X}\in R^{s\times q} H X ∈ R s × q and H Z ∈ R r × q H_{Z}\in R^{r\times q} H Z ∈ R r × q . The a a a th column H X † e a H_{X}^{\dagger}e_{a} H X † e a of H X † H_{X}^{\dagger} H X † , with e a e_{a} e a the a a a th standard basis vector of R s R^{s} R s , represents the a a a th X-type check. Its translate by α \alpha α is represented by x α H X † e a x^{\alpha}H_{X}^{\dagger}e_{a} x α H X † e a , and likewise for H Z † H_{Z}^{\dagger} H Z † . The checks, taken with trivial phase, and their translates generate the stabilizer group. By the symplectic form above, the a a a th entry of H X v H_{X}v H X v encodes the commutation exponents of Z ( v ) Z(v) Z ( v ) with the translates of the a a a th X-type check. In other words, H X H_{X} H X maps a Z-type operator to the X-check syndrome it creates, and im H X \operatorname{im}H_{X} im H X consists of the syndromes created by finitely supported Z-type operators.
Following Ref. [23 ] , we represent the code by the complex
R r → H Z † R q → H X R s R^{r}\xrightarrow{H_{Z}^{\dagger}}R^{q}\xrightarrow{H_{X}}R^{s} R r H Z † R q H X R s
{#eq:1}
and its dual R s → H X † R q → H Z R r R^{s}\xrightarrow{H_{X}^{\dagger}}R^{q}\xrightarrow{H_{Z}}R^{r} R s H X † R q H Z R r . This degree convention places the qudits in degree zero; we use it throughout the paper because it matches the superselection profile of Sec. II C. We call the code topological if [15 , 32 ]
ker H X = im H Z † , ker H Z = im H X † . (1) \ker H_{X}=\operatorname{im}H_{Z}^{\dagger}, \qquad\ker H_{Z}=\operatorname{im}H_{X}^{\dagger}. \tag*{(1)} ker H X = im H Z † , ker H Z = im H X † . (1)
These equalities imply that the stabilizers commute, H X H Z † = 0 H_{X}H_{Z}^{\dagger}=0 H X H Z † = 0 , and they exclude finitely supported logical operators on the infinite lattice. In the polynomial representation, a translation-invariant CSS-preserving Clifford circuit maps each Z Z Z -type operator Z ( v ) Z(v) Z ( v ) to Z ( U v ) Z(Uv) Z ( U v ) for an invertible matrix U U U over R R R . Since it preserves the symplectic form, it maps each X X X -type operator X ( u ) X(u) X ( u ) to X ( ( U † ) − 1 u ) X((U^{\dagger})^{-1}u) X (( U † ) − 1 u ) [23 ] . We call the complex (1) of the code C c o d e C_{\mathrm{code}} C code and compare it with the complex C s t a c k C_{\mathrm{stack}} C stack of a toric-code stack (Sec. II B). We write d c o d e d_{\mathrm{code}} d code and d s t a c k d_{\mathrm{stack}} d stack for their differentials and d c o d e n , d s t a c k n d_{\mathrm{code}}^{n},d_{\mathrm{stack}}^{n} d code n , d stack n for the components from degree n n n to degree n + 1 n+1 n + 1 , so that d c o d e 0 = H X d_{\mathrm{code}}^{0}=H_X d code 0 = H X . After ancillas and identity X X X -type checks (zero rows of H X H_X H X ) are adjoined (Appendix C), we may assume that C c o d e 0 C_{\mathrm{code}}^{0} C code 0 and C s t a c k 0 C_{\mathrm{stack}}^{0} C stack 0 have equal ranks, and likewise C c o d e 1 C_{\mathrm{code}}^{1} C code 1 and C s t a c k 1 C_{\mathrm{stack}}^{1} C stack 1 .
We claim that the circuit decouples the code if, for some invertible V V V , the square
C c o d e 0 → d c o d e 0 C c o d e 1 U ↓ ↓ V C s t a c k 0 → d s t a c k 0 C s t a c k 1 (2) \begin{CD}
C_{\mathrm{code}}^{0} @>{d_{\mathrm{code}}^{0}}>> C_{\mathrm{code}}^{1} \\
@V{U}VV @VV{V}V \\
C_{\mathrm{stack}}^{0} @>{d_{\mathrm{stack}}^{0}}>> C_{\mathrm{stack}}^{1} \tag*{(2)}
\end{CD} C code 0 U ↓ ⏐ C stack 0 d code 0 d stack 0 C code 1 ↓ ⏐ V C stack 1 (2)
commutes, d s t a c k 0 U = V d c o d e 0 d_{\mathrm{stack}}^{0}U=Vd_{\mathrm{code}}^{0} d stack 0 U = V d code 0 . Indeed, by the topological condition (1) , the Z Z Z -type stabilizers of the code form the submodule im H Z T = ker d c o d e 0 \operatorname{im}H_Z^{\mathsf{T}}=\ker d_{\mathrm{code}}^{0} im H Z T = ker d code 0 , and the X X X -type stabilizers form im ( d c o d e 0 ) † \operatorname{im}(d_{\mathrm{code}}^{0})^{\dagger} im ( d code 0 ) † ; for the stack, these submodules are ker d s t a c k 0 \ker d_{\mathrm{stack}}^{0} ker d stack 0 and im ( d s t a c k 0 ) † \operatorname{im}(d_{\mathrm{stack}}^{0})^{\dagger} im ( d stack 0 ) † . Since U U U and V V V are invertible, the commuting square gives U ker d c o d e 0 = ker d s t a c k 0 U\ker d_{\mathrm{code}}^{0}=\ker d_{\mathrm{stack}}^{0} U ker d code 0 = ker d stack 0 , so the circuit maps the Z Z Z -type stabilizers of the code onto those of the stack. Taking the dagger of d s t a c k 0 U = V d c o d e 0 d_{\mathrm{stack}}^{0}U=Vd_{\mathrm{code}}^{0} d stack 0 U = V d code 0 gives ( U † ) − 1 ( d c o d e 0 ) † = ( d s t a c k 0 ) † ( V † ) − 1 (U^{\dagger})^{-1}(d_{\mathrm{code}}^{0})^{\dagger}=(d_{\mathrm{stack}}^{0})^{\dagger}(V^{\dagger})^{-1} ( U † ) − 1 ( d code 0 ) † = ( d stack 0 ) † ( V † ) − 1 , so ( U † ) − 1 im ( d c o d e 0 ) † = im ( d s t a c k 0 ) † (U^{\dagger})^{-1}\operatorname{im}(d_{\mathrm{code}}^{0})^{\dagger}=\operatorname{im}(d_{\mathrm{stack}}^{0})^{\dagger} ( U † ) − 1 im ( d code 0 ) † = im ( d stack 0 ) † . The same thus holds for the X X X -type stabilizers. Theorem 1 in Sec. IV states when such U U U and V V V exist, with U U U realized by a circuit of SUM and SWAP gates.
The targets of a decoupling are stacks of higher-form toric codes. For 1 ≤ j ≤ D − 1 1\leq j\leq D-1 1 ≤ j ≤ D − 1 , the j j j -form toric code T C j ( D ) ( F p ) \mathrm{TC}_{j}^{(D)}(\mathbb{F}_p) TC j ( D ) ( F p ) on the D D D -dimensional cubic lattice places one qudit on each j j j -cell [2 , 5 , 15 , 34 ] . Each ( j − 1 ) (j-1) ( j − 1 ) -cell carries an X X X -type check acting on the j j j -cells that contain it, and each ( j + 1 ) (j+1) ( j + 1 ) -cell carries a Z Z Z -type check acting on the j j j -cells in its boundary.
To fix the polynomial convention, let w i = x i − 1 w_i=x_i-1 w i = x i − 1 , and let e 1 , … , e D e_1,\ldots,e_D e 1 , … , e D be the edges of the unit cell at the origin, one along each direction. A wedge product e i 1 ∧ ⋯ ∧ e i k e_{i_1}\wedge\cdots\wedge e_{i_k} e i 1 ∧ ⋯ ∧ e i k is the oriented k k k -cell that these edges span, and multiplying it by x α x^\alpha x α translates it by α \alpha α . The cells and their boundaries form the cellular chain complex of the cubic lattice, which in this polynomial form is the Koszul complex K ∙ K_{\bullet} K ∙ : its terms are K k = ⋀ k R D K_k=\bigwedge^k R^D K k = ⋀ k R D , and its differential
∂ k ( e i 1 ∧ ⋯ ∧ e i k ) = ∑ a = 1 k ( − 1 ) a − 1 w i a e i 1 ∧ ⋯ ∧ e ^ i a ∧ ⋯ ∧ e i k (3) \partial_k(e_{i_1}\wedge\cdots\wedge e_{i_k})=\sum_{a=1}^{k}(-1)^{a-1}w_{i_a}e_{i_1}\wedge\cdots\wedge\widehat{e}_{i_a}\wedge\cdots\wedge e_{i_k} \tag*{(3)} ∂ k ( e i 1 ∧ ⋯ ∧ e i k ) = a = 1 ∑ k ( − 1 ) a − 1 w i a e i 1 ∧ ⋯ ∧ e i a ∧ ⋯ ∧ e i k (3)
sends a k k k -cell to its oriented boundary. For I = { i 1 < ⋯ < i k } I=\{i_1<\cdots<i_k\} I = { i 1 < ⋯ < i k } , the cells e I = e i 1 ∧ ⋯ ∧ e i k e_I=e_{i_1}\wedge\cdots\wedge e_{i_k} e I = e i 1 ∧ ⋯ ∧ e i k form a basis of K k K_k K k , with e ∅ = 1 e_{\varnothing}=1 e ∅ = 1 . The augmentation ϵ : K 0 = R → F p \epsilon:K_0=R\to\mathbb{F}_p ϵ : K 0 = R → F p , x α ↦ 1 x^\alpha\mapsto1 x α ↦ 1 , adds up the coefficients of a 0-chain; its kernel m = ( w 1 , … , w D ) \mathfrak{m}=(w_1,\ldots,w_D) m = ( w 1 , … , w D ) is the augmentation ideal. Since w 1 , … , w D w_1,\ldots,w_D w 1 , … , w D is a regular sequence, the sequence ⋯ → K 1 → ϵ K 0 → ϵ F p → 0 \cdots\to K_1\xrightarrow{\epsilon}K_0\xrightarrow{\epsilon}\mathbb{F}_p\to0 ⋯ → K 1 ϵ K 0 ϵ F p → 0 is exact [35 Cor. 4.5.5] , so K ∙ K_{\bullet} K ∙ is a free resolution of the R R R -module F p \mathbb{F}_p F p , on which R R R acts through ϵ \epsilon ϵ .
Following the convention of Sec. II A, we write T j T_j T j for K ∙ K_{\bullet} K ∙ regarded as a cochain complex with K k K_k K k in degree j − k j-k j − k , so that the qudit module K j K_j K j lies in degree zero. The code T C j ( D ) ( F p ) \mathrm{TC}_{j}^{(D)}(\mathbb{F}_p) TC j ( D ) ( F p ) is represented by the part of T j T_j T j in degrees − 1 -1 − 1 to 1 1 1 ,
K j + 1 → ∂ j + 1 K j → ∂ j K j − 1 , K_{j+1}\xrightarrow{\partial_{j+1}}K_j\xrightarrow{\partial_j}K_{j-1}, K j + 1 ∂ j + 1 K j ∂ j K j − 1 ,
that is, H X = ∂ j H_X=\partial_j H X = ∂ j and H Z T = ∂ j + 1 H_Z^{\mathsf{T}}=\partial_{j+1} H Z T = ∂ j + 1 .
Figure 1 shows the two toric codes in three dimensions. In T C 1 ( 3 ) ( F p ) \mathrm{TC}_{1}^{(3)}(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) [36 ] , qudits lie on edges, X X X -type checks on vertices, and Z Z Z -type checks on plaquettes; T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) is obtained by passing to the dual lattice and swapping X X X and Z Z Z . Both codes have local relations among their checks. In T C 1 ( 3 ) ( F p ) \mathrm{TC}_{1}^{(3)}(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) , the oriented product of the Z Z Z -type checks on the six plaquettes of a cube is the identity, and in T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) , so is that of the X X X -type checks on the six edges at a vertex. In each product, every qudit involved is acted on by two of the checks with opposite exponents. The two codes differ in the dimension of their X X X -check excitations: a Z Z Z -type operator Z ( v ) Z(v) Z ( v ) with v ∈ K j v\in K_j v ∈ K j violates the X X X -type checks on the boundary ∂ j v \partial_jv ∂ j v , so these excitations are pointlike in T C 1 ( 3 ) ( F p ) \mathrm{TC}_{1}^{(3)}(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) and loop-like in T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) . Relations among the X X X -type checks and excitations of different dimensions are what the superselection profile of Sec. II C keeps track of.
Figure 1. Three-dimensional toric codes. (a) T C 1 ( 3 ) ( F p ) \mathrm{TC}_{1}^{(3)}(\mathbb{F}_{p}) TC 1 ( 3 ) ( F p ) , with qudits on edges. (b) T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_{p}) TC 2 ( 3 ) ( F p ) , with qudits on plaquettes. The right panels show local relations among the checks; in each oriented product, every qudit involved is acted on by exactly two of the checks, with opposite exponents. In all figures, blue refers to T C 1 ( 3 ) ( F p ) \mathrm{TC}_{1}^{(3)}(\mathbb{F}_{p}) TC 1 ( 3 ) ( F p ) and orange to T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_{p}) TC 2 ( 3 ) ( F p ) ; stars mark X X X -type checks and diamonds Z Z Z -type checks, and colored edges and plaquettes mark qudits.
For nonnegative integers t 1 , … , t D − 1 t_1,\ldots,t_{D-1} t 1 , … , t D − 1 , the toric-code stack ⨁ j = 1 D − 1 T C j ( D ) ( F p ) ⊕ t j \bigoplus_{j=1}^{D-1}\mathrm{TC}_{j}^{(D)}(\mathbb{F}_p)^{\oplus t_j} ⨁ j = 1 D − 1 TC j ( D ) ( F p ) ⊕ t j consists of t j t_j t j copies of T C j ( D ) ( F p ) \mathrm{TC}_{j}^{(D)}(\mathbb{F}_p) TC j ( D ) ( F p ) for each j j j . Its complex C s t a c k = ⨁ j T j ⊕ t j C_{\mathrm{stack}}=\bigoplus_jT_j^{\oplus t_j} C stack = ⨁ j T j ⊕ t j serves as the target in Eq. (2) .
Superselection profiles
A finitely supported Z Z Z -type operator Z ( v ) Z(v) Z ( v ) creates the syndrome H X v ∈ R s H_Xv\in R^s H X v ∈ R s of violated X X X -type checks. Two syndromes represent the same excitation type if their difference is created by a finitely supported Z Z Z -type operator, that is, if it lies in im H X \operatorname{im}H_X im H X . In two dimensions, the topological condition allows one to choose X X X -type checks with no local relations [32 Lemma 7.1] . Every finitely supported syndrome can then occur, possibly created by an operator of infinite support. The pointlike excitation types therefore form the module coker H X = R s / im H X H_X=R^s/\operatorname{im}H_X H X = R s / im H X , in which addition describes fusion and the action of R R R describes translations.
In higher dimensions, local relations among the X X X -type checks (metachecks) restrict which syndromes can occur. We call the syndromes compatible with all of them admissible . In T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_{p}) TC 2 ( 3 ) ( F p ) , for example, the relation among the X X X -type checks at each vertex (Figure 1 ) implies that every syndrome created by a Z Z Z -type operator consists of closed loops. In general, choose a relation map γ † : R t → R s \gamma^{\dagger}:R^{t}\to R^{s} γ † : R t → R s with im γ † = ker H X † \operatorname{im}\gamma^{\dagger}=\ker H_{X}^{\dagger} im γ † = ker H X † , whose columns represent the local relations. The admissible syndromes form ker γ \ker\gamma ker γ , and the pointlike excitation types form ker γ / im H X \ker\gamma/\operatorname{im}H_{X} ker γ / im H X . This quotient misses the looplike and higher-dimensional excitations: for T C 2 ( 3 ) ( F p ) \mathrm{TC}_{2}^{(3)}(\mathbb{F}_{p}) TC 2 ( 3 ) ( F p ) it vanishes, although the code has looplike excitations. Capturing them requires the complete hierarchy of relations.
To describe all excitations independently of the chosen generators, consider the module M X = coker H X † = R q / im H X † M_{X}=\operatorname{coker}H_{X}^{\dagger}=R^{q}/\operatorname{im}H_{X}^{\dagger} M X = coker H X † = R q / im H X † of finitely supported X X X -type Pauli operators modulo X X X -type stabilizers. Choose a free resolution P ∙ \mathbf{P}_{\bullet} P ∙ of M X M_{X} M X that begins with H X † H_{X}^{\dagger} H X † and γ † \gamma^{\dagger} γ † ,
⋯ ⟶ R t → γ † R s → H X † R q ⟶ M X ⟶ 0. (4) \cdots\longrightarrow R^{t} \xrightarrow{\gamma^{\dagger}} R^{s} \xrightarrow{H_{X}^{\dagger}} R^{q} \longrightarrow M_{X} \longrightarrow0. \tag*{(4)} ⋯ ⟶ R t γ † R s H X † R q ⟶ M X ⟶ 0. (4)
Its successive terms record the qudits, the X X X -type checks, the relations among checks, the relations among relations, and so on. Replacing each map of P ∙ \mathbf{P}_{\bullet} P ∙ by its dagger gives the cochain complex
0 ⟶ R q → H X R s → γ R t ⟶ ⋯ (5) 0 \longrightarrow R^{q} \xrightarrow{H_{X}} R^{s} \xrightarrow{\gamma} R^{t} \longrightarrow\cdots \tag*{(5)} 0 ⟶ R q H X R s γ R t ⟶ ⋯ (5)
Its first two maps are the syndrome map and the relation map above. Formally, Eq. (5) is obtained by applying Hom R ( ⋅ ‾ , R ) \operatorname{Hom}_{R}(\overline{\mathord{\cdot}},R) Hom R ( ⋅ , R ) to P ∙ \mathbf{P}_{\bullet} P ∙ , where M ‾ \overline{M} M denotes an R R R -module M M M with R R R acting through the antipode. It computes R Hom R ( M ‾ X , R ) \mathbb{R}\operatorname{Hom}_{R}(\overline{M}_{X},R) R Hom R ( M X , R ) [35 Sec. 10.7] . Its degree-zero cohomology, ker H X = im H Z † \ker H_{X}=\operatorname{im}H_{Z}^{\dagger} ker H X = im H Z † , consists of Z Z Z -type stabilizers rather than excitations. Following Song [15 ] , we discard it and define the superselection profile as the positive-degree truncation
E X : = τ ≥ 1 R Hom R ( M ‾ X , R ) . (6) \mathcal{E}_{X}:=\tau_{\geq1}\mathbb{R}\operatorname{Hom}_{R}(\overline{M}_{X},R). \tag*{(6)} E X := τ ≥ 1 R Hom R ( M X , R ) . (6)
Here the canonical truncations τ ≥ k \tau_{\geq k} τ ≥ k and τ ≤ k \tau_{\leq k} τ ≤ k retain the cohomology in degrees n ≥ k n\geq k n ≥ k and n ≤ k n\leq k n ≤ k , respectively. The cohomology modules
E X j : = H j ( E X ) ≅ Ext R j ( M ‾ X , R ) , j ≥ 1 , E_{X}^{j}:=H^{j}(\mathcal{E}_{X})\cong\operatorname{Ext}_{R}^{j}(\overline{M}_{X},R),\qquad j\geq1, E X j := H j ( E X ) ≅ Ext R j ( M X , R ) , j ≥ 1 ,
are the superselection layers (called charge modules in Ref. [24 ] ). The elements of E X j E_{X}^{j} E X j are types of ( j − 1 ) (j-1) ( j − 1 ) -dimensional excitations [15 ] , with fusion and translations described as for coker H X H_{X} H X . In particular, E X 1 E_{X}^{1} E X 1 is the quotient ker γ / im H X \ker\gamma/\operatorname{im}H_{X} ker γ / im H X found above. Only the degrees 1 ≤ j ≤ D − 1 1\leq j\leq D-1 1 ≤ j ≤ D − 1 can occur (Lemma 3, Appendix A2; see also Refs. [15 , 24 ] ), so a topological code in D D D dimensions has excitations of dimension at most D − 2 D-2 D − 2 .
The profile does not depend on the chosen generators. Indeed, M X M_{X} M X depends only on the X X X -type stabilizer submodule, and different resolutions give quasi-isomorphic complexes, that is, complexes related by cochain maps that induce isomorphisms on cohomology. We write ≃ \simeq ≃ for isomorphism in the derived category D ( R ) D(R) D ( R ) of R R R -modules, in which quasi-isomorphic complexes become isomorphic.
For T C j ( D ) ( F p ) \mathrm{TC}_{j}^{(D)}(\mathbb{F}_{p}) TC j ( D ) ( F p ) , applying the dagger to the part of T j T_{j} T j in nonnegative degrees gives a free resolution of M X M_{X} M X , because the dual Koszul complex is exact below its top degree [15 ] . The complex (6) is then K j → K j − 1 → ⋯ → K 0 K_{j}\to K_{j-1}\to\cdots\to K_{0} K j → K j − 1 → ⋯ → K 0 . Since K ∙ K_{\bullet} K ∙ resolves F p \mathbb{F}_{p} F p , its only cohomology in positive degrees is K 0 / im ∂ 1 = F p K_{0}/\operatorname{im}\partial_{1}=\mathbb{F}_{p} K 0 / im ∂ 1 = F p , in degree j j j . Hence E X ≃ F p [ − j ] \mathcal{E}_{X}\simeq\mathbb{F}_{p}[-j] E X ≃ F p [ − j ] , and T C j ( D ) ( F p ) \mathrm{TC}_{j}^{(D)}(\mathbb{F}_{p}) TC j ( D ) ( F p ) has a single nonzero layer E X j ≅ F p E_{X}^{j}\cong\mathbb{F}_{p} E X j ≅ F p , generated by its ( j − 1 ) (j-1) ( j − 1 ) -dimensional X X X -check excitation (Sec. III B).
The profile is unchanged by translation-invariant CSS-preserving Clifford circuits and by adjoining ancillas (Lemma 7, Appendix A4). Since the profile of T C j ( D ) ( F p ) \mathrm{TC}_{j}^{(D)}(\mathbb{F}_{p}) TC j ( D ) ( F p ) is F p [ − j ] \mathbb{F}_p[-j] F p [ − j ] , a toric-code stack has the profile ⨁ j F p [ − j ] ⊕ t j \bigoplus_j \mathbb{F}_p[-j]^{\oplus t_j} ⨁ j F p [ − j ] ⊕ t j . Therefore, a decoupling requires the profile of the code to have the same form.
Coarse-graining
Coarse-graining to a superlattice Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D of index N : = [ Z D : Λ ] N := [\mathbb{Z}^D : \Lambda] N := [ Z D : Λ ] groups N N N unit cells into one, with N q Nq N q qudits. Only the translations in Λ \Lambda Λ remain; they span the subring F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] of Laurent polynomials whose exponents lie in Λ \Lambda Λ [32 ] . Regarding R R R -modules as F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -modules is called restriction of scalars [37 Ch. 2] , and we write ( ⋅ ) ∣ F p [ Λ ] (\cdot)|_{\mathbb{F}_p[\Lambda]} ( ⋅ ) ∣ F p [ Λ ] for the restriction of a module, complex, or derived object. Since R R R is a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -module with a basis of monomials representing Z D / Λ \mathbb{Z}^D/\Lambda Z D /Λ , expanding H X H_X H X and H Z H_Z H Z in this basis gives the check matrices of the coarse-grained code. We say that a code can be decoupled on Λ \Lambda Λ if the coarse-grained code can be decoupled. By Lemma 8 (Appendix B.1), the coarse-grained code is again topological, and its profile and layers are the restrictions E X ∣ F p [ Λ ] \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] and E X j ∣ F p [ Λ ] E_X^j|_{\mathbb{F}_p[\Lambda]} E X j ∣ F p [ Λ ] (see also Ref. [24 ] for the layers). In particular, every layer keeps its F p \mathbb{F}_p F p -dimension.
Since the layers of a toric-code stack are finite dimensional over F p \mathbb{F}_p F p , a code with an infinite-dimensional layer, such as Haah’s cubic code [27 ] , cannot be decoupled on any superlattice. We therefore let the layers be finite dimensional, with t j = dim F p E X j t_j = \dim_{\mathbb{F}_p} E_X^j t j = dim F p E X j . Regarding E X j E_X^j E X j as an F p \mathbb{F}_p F p -vector space of dimension t j t_j t j , every translation acts on it by an invertible linear map, that is, by a matrix in GL ( t j , F p ) \operatorname{GL}(t_j,\mathbb{F}_p) GL ( t j , F p ) once a basis is chosen. The translations that act trivially on every layer form the kernel Λ t r i v \Lambda_{\mathrm{triv}} Λ triv of the resulting homomorphism Z D → ∏ j GL ( t j , F p ) \mathbb{Z}^D \to\prod_j \operatorname{GL}(t_j,\mathbb{F}_p) Z D → ∏ j GL ( t j , F p ) , a superlattice because this group is finite. From here through Sec. IV A, we coarse-grain to Λ t r i v \Lambda_{\mathrm{triv}} Λ triv , write R R R for F p [ Λ t r i v ] \mathbb{F}_p[\Lambda_{\mathrm{triv}}] F p [ Λ triv ] with variables x i = x β i x_i = x^{\beta_i} x i = x β i for a basis β 1 , … , β D \beta_1,\ldots,\beta_D β 1 , … , β D of Λ t r i v \Lambda_{\mathrm{triv}} Λ triv , and keep the notation E X \mathcal{E}_X E X and E X j E_X^j E X j for the restricted profile and layers. Every x i x_i x i then acts trivially on every layer, so
m E X j = 0 , E X j ≅ ( R / m ) ⊕ t j ≅ F p t j , (7) \mathfrak{m}E_X^j = 0,\qquad E_X^j \cong(R/\mathfrak{m})^{\oplus t_j} \cong\mathbb{F}_p^{t_j}, \tag*{(7)} m E X j = 0 , E X j ≅ ( R / m ) ⊕ t j ≅ F p t j , (7)
where m \mathfrak{m} m is the augmentation ideal of § 2 B, now in the new variables. Hence every layer agrees with the corresponding layer of ⨁ j TC j ( D ) ( F p ) ⊕ t j \bigoplus_j \operatorname{TC}_j^{(D)}(\mathbb{F}_p)^{\oplus t_j} ⨁ j TC j ( D ) ( F p ) ⊕ t j .
Obstruction: inter-layer gluing
After coarse-graining to Λ t r i v \Lambda_{\mathrm{triv}} Λ triv , every layer agrees with that of a toric-code stack, but the profile need not: it also records how the layers are glued together. Song showed that this gluing can be nonzero [15 ] . We now make the gluing precise and show, with an example, that it obstructs decoupling.
Inter-layer gluing and its description
Successive layers are related by the canonical truncation triangles [35 Secs. 1.2 and 10.4] ,
τ ≤ j − 1 E X ⟶ τ ≤ j E X ⟶ E X j [ − j ] → δ j ( τ ≤ j − 1 E X ) [ 1 ] . (8) \tau_{\leq j-1}\mathcal{E}_X \longrightarrow\tau_{\leq j}\mathcal{E}_X \longrightarrow E_X^j[-j] \xrightarrow{\delta_j} (\tau_{\leq j-1}\mathcal{E}_X)[1]. \tag*{(8)} τ ≤ j − 1 E X ⟶ τ ≤ j E X ⟶ E X j [ − j ] δ j ( τ ≤ j − 1 E X ) [ 1 ] . (8)
Here A [ n ] A[n] A [ n ] denotes a complex A A A shifted by n n n , with A [ n ] k = A k + n A[n]^k = A^{k+n} A [ n ] k = A k + n and differential ( − 1 ) n d A (-1)^n d_A ( − 1 ) n d A , and an R R R -module is regarded as a complex in degree zero. The connecting morphism δ j \delta_j δ j records how the j j j th layer is attached to the lower ones. We call these morphisms the inter-layer gluing . The profile splits when all δ j \delta_j δ j vanish, equivalently when
E X ≃ ⨁ j ≥ 1 E X j [ − j ] (9) \mathcal{E}_X \simeq\bigoplus_{j\geq1} E_X^j[-j] \tag*{(9)} E X ≃ j ≥ 1 ⨁ E X j [ − j ] (9)
in $D(R) (Lemma 6, Appendix A.3). Since the layers already agree with those of ⨁ j TC j ( D ) ( F p ) ⊕ t j \bigoplus_j \operatorname{TC}_j^{(D)}(\mathbb{F}_p)^{\oplus t_j} ⨁ j TC j ( D ) ( F p ) ⊕ t j , the profile has the form ⨁ j F p [ − j ] ⊕ t j \bigoplus_j \mathbb{F}_p[-j]^{\oplus t_j} ⨁ j F p [ − j ] ⊕ t j exactly when it splits. More generally, over a superlattice Λ \Lambda Λ of the original lattice, the profile has this form exactly when Λ ⊆ Λ t r i v \Lambda\subseteq\Lambda_{\mathrm{triv}} Λ ⊆ Λ triv and every δ j \delta_j δ j restricts to zero over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] . By § 2 C, a nonzero gluing therefore obstructs decoupling.
The gluing δ j \delta_j δ j maps the j j j th layer into the part τ ≤ j − 1 E X \tau_{\leq j-1}\mathcal{E}_X τ ≤ j − 1 E X of the profile below it, shifted by one. Once this part has split as
τ ≤ j − 1 E X ≃ ⨁ i = 1 j − 1 E X i [ − i ] , (10) \tau_{\leq j-1}\mathcal{E}_X \simeq\bigoplus_{i=1}^{j-1} E_X^i[-i], \tag*{(10)} τ ≤ j − 1 E X ≃ i = 1 ⨁ j − 1 E X i [ − i ] , (10)
composing with this splitting turns δ j \delta_j δ j into a morphism from E X j [ − j ] E_X^j[-j] E X j [ − j ] to ⨁ i < j E X i [ − i + 1 ] \bigoplus_{i<j} E_X^i[-i+1] ⨁ i < j E X i [ − i + 1 ] . Its component for the i i i th layer is a class
κ j i ∈ Hom D ( R ) ( E X j [ − j ] , E X i [ − i + 1 ] ) = Ext R j − i + 1 ( E X j , E X i ) , (11) \kappa_{ji} \in\operatorname{Hom}_{D(R)}(E_X^j[-j],E_X^i[-i+1])
= \operatorname{Ext}_R^{j-i+1}(E_X^j,E_X^i), \tag*{(11)} κ j i ∈ Hom D ( R ) ( E X j [ − j ] , E X i [ − i + 1 ]) = Ext R j − i + 1 ( E X j , E X i ) , (11)
where we shifted both arguments by j j j and used Hom D ( R ) ( A , B [ n ] ) = Ext R n ( A , B ) \operatorname{Hom}_{D(R)}(A,B[n])=\operatorname{Ext}_R^n(A,B) Hom D ( R ) ( A , B [ n ]) = Ext R n ( A , B ) for modules A A A and B B B [35 Def. 10.7.1 and Cor. 10.7.5] . Thus δ j \delta_j δ j vanishes if and only if every κ j i \kappa_{ji} κ j i does. In that case, the triangle (8) splits and Eq. (10) extends to degree $j (Lemma 5, {xref}Appendix A.3`). Physically, κ j i \kappa_{ji} κ j i describes how ( j − 1 ) (j-1) ( j − 1 ) -dimensional excitations carry ( i − 1 ) (i-1) ( i − 1 ) -dimensional ones. These classes can be described by their values on unit cells.
Lemma 1. Let A A A and B B B be R R R -modules that are finite dimensional over F p \mathbb{F}_p F p , with m A = m B = 0 \mathfrak{m}A=\mathfrak{m}B=0 m A = m B = 0 . Every class κ ∈ Ext R n ( A , B ) \kappa\in\operatorname{Ext}_R^n(A,B) κ ∈ Ext R n ( A , B ) is represented, on the free resolution K ∙ ⊗ F p A K_\bullet\otimes_{\mathbb{F}_p} A K ∙ ⊗ F p A of A A A , by a unique R R R -linear map f : K n ⊗ F p A → B f: K_n\otimes_{\mathbb{F}_p} A \to B f : K n ⊗ F p A → B , and
Ext R n ( A , B ) ≅ Hom R ( K n ⊗ F p A , B ) ≅ ⨁ ∣ I ∣ = n Hom F p ( A , B ) , \operatorname{Ext}_R^n(A,B) \cong\operatorname{Hom}_R(K_n\otimes_{\mathbb{F}_p} A,B) \cong\bigoplus_{|I|=n}\operatorname{Hom}_{\mathbb{F}_p}(A,B), Ext R n ( A , B ) ≅ Hom R ( K n ⊗ F p A , B ) ≅ ∣ I ∣ = n ⨁ Hom F p ( A , B ) ,
where the second isomorphism sends f f f to the maps f I : a ↦ f ( e I ⊗ a ) f_I:a\mapsto f(e_I\otimes a) f I : a ↦ f ( e I ⊗ a ) . Since translations act trivially on B B B , the class κ \kappa κ thus assigns the value f I f_I f I to every unit n n n -cell of orientation I I I .
By Eq. (7) , the gluing class κ j i \kappa_{ji} κ j i is the case A = E X j A=E_X^j A = E X j and B = E X i B=E_X^i B = E X i .
Concrete example: the glued code
We illustrate the gluing with a topological code from Ref. [15 ] , which we call the glued code (GC). It is obtained from T C 1 ( 3 ) ( F p ) ⊕ T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p)\oplus\mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) ⊕ TC 2 ( 3 ) ( F p ) by adding the two coupling terms boxed in Eq. (12) below. Its layers coincide with those of T C 1 ( 3 ) ( F p ) ⊕ T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p)\oplus\mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) ⊕ TC 2 ( 3 ) ( F p ) , so translations act trivially on them and Λ t r i v ( G C ) = Z 3 \Lambda_{\mathrm{triv}}(\mathrm{GC})=\mathbb{Z}^3 Λ triv ( GC ) = Z 3 , but its gluing δ 2 ( G C ) \delta_2(\mathrm{GC}) δ 2 ( GC ) is nonzero. Physically, a looplike excitation of T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) carries a pointlike excitation of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) (Figure 2 (a)), a charge whose value is the area enclosed by the projection of the loop onto the x 1 x 2 x_1x_2 x 1 x 2 -plane, up to sign. By Sec. III A, the GC therefore admits no decoupling on the original lattice.
Figure 2. Couplings in the code of Eq. (12) . Panels (a) and (b) show the fourth columns of H X ( G C ) H_X(\mathrm{GC}) H X ( GC ) and H Z ( G C ) † H_Z(\mathrm{GC})^\dagger H Z ( GC ) † , respectively; the blue star in (a) and the blue edge in (b) come from the boxed entries.
a. The code. Take D = 3 D=3 D = 3 . The qudits and checks sit where they do in T C 1 ( 3 ) ( F p ) ⊕ T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p)\oplus\mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) ⊕ TC 2 ( 3 ) ( F p ) (Figure 1 ). Within a unit cell, we order them as ( e 1 , e 2 , e 3 ; e 12 , e 13 , e 23 ) (e_1,e_2,e_3;e_{12},e_{13},e_{23}) ( e 1 , e 2 , e 3 ; e 12 , e 13 , e 23 ) for the qudits, ( e ∅ ; e 1 , e 2 , e 3 ) (e_{\varnothing};e_1,e_2,e_3) ( e ∅ ; e 1 , e 2 , e 3 ) for the X X X -type checks, and ( e 12 , e 13 , e 23 ; e 123 ) (e_{12},e_{13},e_{23};e_{123}) ( e 12 , e 13 , e 23 ; e 123 ) for the Z Z Z -type checks, with those of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) before the semicolons. In these bases, let
H X ( G C ) = ( w 1 w 2 w 3 − 1 0 0 0 0 0 − w 2 − w 3 0 0 0 0 w 1 0 − w 3 0 0 0 0 w 1 w 2 ) , H Z ( G C ) † = ( − w 2 − w 3 0 0 w 1 0 − w 3 0 0 w 1 w 2 1 0 0 0 w 3 0 0 0 − w 2 0 0 0 w 1 ) (12) H_X(\mathrm{GC})=
\begin{pmatrix}
w_1&w_2&w_3&-1&0&0\\
0&0&0&-w_2&-w_3&0\\
0&0&0&w_1&0&-w_3\\
0&0&0&0&w_1&w_2
\end{pmatrix},
\qquad
H_Z(\mathrm{GC})^\dagger=
\begin{pmatrix}
-w_2&-w_3&0&0\\
w_1&0&-w_3&0\\
0&w_1&w_2&1\\
0&0&0&w_3\\
0&0&0&-w_2\\
0&0&0&w_1
\end{pmatrix} \tag*{(12)} H X ( GC ) = w 1 0 0 0 w 2 0 0 0 w 3 0 0 0 − 1 − w 2 w 1 0 0 − w 3 0 w 1 0 0 − w 3 w 2 , H Z ( GC ) † = − w 2 w 1 0 0 0 0 − w 3 0 w 1 0 0 0 0 − w 3 w 2 0 0 0 0 0 1 w 3 − w 2 w 1 (12)
The lines separate the blocks of the two toric codes.
b. The couplings. Each column of H X ( G C ) H_X(\mathrm{GC}) H X ( GC ) is the syndrome of Z Z Z on one qudit at the origin (§ 2 A). The fourth column (Figure 2 (a)) is the syndrome of Z Z Z on the plaquette e 12 e_{12} e 12 . As in T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) , its entries − w 2 = 1 − x 2 -w_2=1-x_2 − w 2 = 1 − x 2 and w 1 = x 1 − 1 w_1=x_1-1 w 1 = x 1 − 1 state that Z Z Z on e 12 e_{12} e 12 violates the X X X -type checks on the bottom, top, left, and right edges of the plaquette with the exponents 1 , − 1 , − 1 , 1 1,-1,-1,1 1 , − 1 , − 1 , 1 . The boxed entry adds a violation, with exponent − 1 -1 − 1 , of the X X X -type check of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) at its corner e ∅ e_{\varnothing} e ∅ . The fourth column of H Z ( G C ) † H_Z(\mathrm{GC})^\dagger H Z ( GC ) † (Figure 2 (b)) is the Z Z Z -type check of T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) on a cube, which acts on its six plaquettes and, through the boxed entry, on the x 3 x_3 x 3 -edge e 3 e_3 e 3 at its corner e ∅ e_{\varnothing} e ∅ .
The boxed entries thus define maps c X : K 2 → K 0 c_X:K_2\to K_0 c X : K 2 → K 0 and c Z : K 3 → K 1 c_Z:K_3\to K_1 c Z : K 3 → K 1 , with c X e 12 = − e ∅ c_Xe_{12}=-e_{\varnothing} c X e 12 = − e ∅ and c Z e 123 = e 3 c_Ze_{123}=e_3 c Z e 123 = e 3 , so that
H X ( G C ) = ( ∂ 1 c X 0 ∂ 2 ) , H Z ( G C ) † = ( ∂ 2 c Z 0 ∂ 3 ) . (13) H_X(\mathrm{GC})=
\begin{pmatrix}
\partial_1&c_X\\
0&\partial_2
\end{pmatrix},
\qquad
H_Z(\mathrm{GC})^\dagger=
\begin{pmatrix}
\partial_2&c_Z\\
0&\partial_3
\end{pmatrix}. \tag*{(13)} H X ( GC ) = ( ∂ 1 0 c X ∂ 2 ) , H Z ( GC ) † = ( ∂ 2 0 c Z ∂ 3 ) . (13)
Appendix A5 writes the GC as a mapping cone of the two toric codes, confirms that it is topological with layers E X 1 ( G C ) ≅ E X 2 ( G C ) ≅ F p E_X^1(\mathrm{GC})\cong E_X^2(\mathrm{GC})\cong\mathbb{F}_p E X 1 ( GC ) ≅ E X 2 ( GC ) ≅ F p , and shows that δ 2 ( G C ) \delta_2(\mathrm{GC}) δ 2 ( GC ) is represented, up to sign, by f = ε c X : K 2 → F p f=\varepsilon c_X:K_2\to\mathbb{F}_p f = ε c X : K 2 → F p , whose plaquette values ( f 12 , f 13 , f 23 ) (f_{12},f_{13},f_{23}) ( f 12 , f 13 , f 23 ) are ( − 1 , 0 , 0 ) (-1,0,0) ( − 1 , 0 , 0 ) . By Lemma 1, δ 2 ( G C ) ≠ 0 \delta_2(\mathrm{GC})\ne0 δ 2 ( GC ) = 0 , so the profile does not split.
c. Why the gluing obstructs decoupling. We call a violated X X X -type check of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) a charge, with the exponent as its value, and Z Z Z on a path of edges a string. A string violates the checks of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) at its two endpoints with opposite exponents, so strings move charges but preserve their total (Figure 3 (b)). Z Z Z on an x 1 x 2 x_1x_2 x 1 x 2 -plaquette creates a small loop of violated checks of T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) together with the charge − 1 -1 − 1 at its corner (Figure 2 (a) and Figure 3 (a)); Z Z Z on the other plaquettes creates no charge. Hence Z Z Z on an oriented surface of plaquettes creates the loop ℓ \ell ℓ along its boundary with a total charge equal to minus the signed area enclosed by the projection of ℓ \ell ℓ onto the x 1 x 2 x_1x_2 x 1 x 2 -plane.
Figure 3. Why the charge cannot be detached from the loop on the original lattice (x 1 x 2 x_1x_2 x 1 x 2 -plane, both codes superposed; open stars mark checks no longer violated). (a) Z Z Z on a plaquette creates a loop and the charge − 1 -1 − 1 at its corner. (b) An attached string moves the charge but preserves the total. (c) A new check: the X X X -type check of T C ( 3 ) ( F p ) \mathrm{TC}^{(3)}(\mathbb{F}_p) TC ( 3 ) ( F p ) at a vertex times a power of that of T C ( 3 ) ( F p ) \mathrm{TC}^{(3)}(\mathbb{F}_p) TC ( 3 ) ( F p ) on the x 1 x_1 x 1 -edge above it. (d) With every vertex relabeled, the top edge of a plaquette removes the charge at its corner, but the bottom edge creates it at the vertex below.
Decoupling must detach the charge from the loop, as in T C 1 ( 3 ) ( F p ) ⊕ T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p)\oplus\mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) ⊕ TC 2 ( 3 ) ( F p ) , with translation-invariant U U U and V V V in the square (Eq. (2) ). A circuit with U = ( I h 0 0 I ) U=\left(\begin{smallmatrix}I&h^0\\0&I\end{smallmatrix}\right) U = ( I 0 h 0 I ) , where h 0 : K 2 → K 1 h^0:K_2\to K_1 h 0 : K 2 → K 1 , attaches a string to Z Z Z on each plaquette (Figure 3 (b)). Relabeling the checks, by multiplying each X X X -type check of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) by powers of nearby X X X -type checks of T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) as recorded by h 1 : K 1 → K 0 h^1:K_1\to K_0 h 1 : K 1 → K 0 , acts on syndromes by V = ( I h 1 0 I ) V=\left(\begin{smallmatrix}I&h^1\\0&I\end{smallmatrix}\right) V = ( I 0 h 1 I ) (Figure 3 (c)). By Eq. (13) , the square commutes exactly when c X = ∂ 1 h 0 − h 1 ∂ 2 c_X=\partial_1h^0-h^1\partial_2 c X = ∂ 1 h 0 − h 1 ∂ 2 , that is, when the strings and the relabeling cancel the coupling. On the original lattice, this equation has no solution: evaluated on the plaquette e 12 e_{12} e 12 , its left side has total charge − 1 -1 − 1 , whereas strings preserve the total charge and a translation-invariant relabeling contributes opposite charges from opposite edges (Figure 3 (d)).
Main result: decoupling after sufficient coarse-graining
Section III showed that the gluing can survive coarse-graining to Λ t r i v \Lambda_{\mathrm{triv}} Λ triv and then obstructs decoupling. We now show that further coarse-graining always removes it, and that the resulting condition, that the profile is that of a toric-code stack, also suffices for decoupling (Theorem 1). Together, these results yield two explicit algorithms, the second of polynomial cost.
Removing the inter-layer gluing
We remove the gluing one layer at a time, in increasing degree. For n > 0 n>0 n > 0 , coarse-graining by a factor of p p p in every direction turns p n p^n p n unit n n n -cells of each orientation I I I into one, which therefore carries the value p n f I = 0 p^n f_I=0 p n f I = 0 . The following lemma, proved together with Lemma 1 in Appendix B 2, makes this precise.
Lemma 2. Let A A A and B B B be R R R -modules that are finite dimensional over F p \mathbb{F}_p F p , with m A = m B = 0 m_A=m_B=0 m A = m B = 0 . For every n > 0 n>0 n > 0 , every class in Ext R n ( A , B ) \operatorname{Ext}^{n}_{R}(A,B) Ext R n ( A , B ) restricts to zero over F p [ p Λ t r i v ] \mathbb{F}_p[p\Lambda_{\mathrm{triv}}] F p [ p Λ triv ] .
Once the lower layers have split as in Eq. (10) , every gluing class κ j i \kappa_{ji} κ j i of the next layer lies in Ext \operatorname{Ext} Ext of positive degree j − i + 1 j-i+1 j − i + 1 . Lemma 2 therefore removes them after coarse-graining by a factor of p p p in every direction, and the splitting extends to that layer (Sec. III A). Restriction preserves the lower splitting and the trivial translation action, so the same argument applies on the new lattice.
The decoupling criterion
We now return to the original lattice Z D \mathbb{Z}^D Z D and state the main result.
Theorem 1 (Decoupling criterion). Consider a translation-invariant topological p p p -ary CSS code on Z D \mathbb{Z}^D Z D , D ≥ 2 D\ge2 D ≥ 2 , and let Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D be a superlattice. The code can be decoupled on Λ \Lambda Λ if and only if its profile over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is that of a toric-code stack,
E X ∣ F p [ Λ ] ≃ ⨁ j = 1 D − 1 F p [ − j ] ⊕ t j (14) \mathcal{E}_X\big\vert_{\mathbb{F}_p[\Lambda]} \simeq\bigoplus_{j=1}^{D-1}\mathbb{F}_p[-j]^{\oplus t_j} \tag*{(14)} E X F p [ Λ ] ≃ j = 1 ⨁ D − 1 F p [ − j ] ⊕ t j (14) in D ( F p [ Λ ] ) \mathrm{D}(\mathbb{F}_p[\Lambda]) D ( F p [ Λ ]) , for some nonnegative integers t j t_j t j . In that case, a decoupling onto ⨁ j T C j ( D ) ( F p ) ⊕ t j \bigoplus_j \mathrm{TC}^{(D)}_j(\mathbb{F}_p)^{\oplus t_j} ⨁ j TC j ( D ) ( F p ) ⊕ t j can be realized by a finite-depth local circuit of SUM and SWAP gates, possibly after adding ancillas.
Necessity follows from § 2 C, applied to the code coarse-grained to Λ \Lambda Λ : circuits and ancillas leave the profile unchanged, and a toric-code stack has the profile above. Sufficiency is proved constructively in Appendix C, and Sec. IV C turns the proof into an algorithm.
The profile of the Z Z Z sector is defined with X X X and Z Z Z exchanged. Since on-site qudit Fourier transforms exchange the two sectors, map SUM and SWAP circuits to SUM and SWAP circuits, and map T C j ( D ) ( F p ) \mathrm{TC}^{(D)}_j(\mathbb{F}_p) TC j ( D ) ( F p ) to T C D − j ( D ) ( F p ) \mathrm{TC}^{(D)}_{D-j}(\mathbb{F}_p) TC D − j ( D ) ( F p ) , the criterion holds equally with this profile.
The decoupling algorithms
Lemma 2 and Theorem 1 turn into two algorithms. Algorithm 1 coarse-grains the code so that its profile is that of a toric-code stack, or reports that no superlattice achieves this. Algorithm 2 then constructs the decoupling circuit on the coarse-grained lattice.
When line 4 stops, no superlattice works (§ 2 D). Otherwise, the translations in Λ t r i v \Lambda_{\mathrm{triv}} Λ triv act trivially on every layer, and line 6 removes the gluing by sufficient coarse-graining (Sec. IV A), so the profile over F p [ Λ s u f f ] \mathbb{F}_p[\Lambda_{\mathrm{suff}}] F p [ Λ suff ] has the form (15). The restricted complex is that of the coarse-
Table 1.
Algorithm 2: Decoupling circuit
Input: a complex C c o d e C_{\mathrm{code}} C code as in Lemma 4 whose profile is that of a toric-code stack
Output: the multiplicities t j t_j t j and a finite-depth circuit of SUM and SWAP gates that decouples the code, with ancillas
compute a basis of each cohomology module of C c o d e C_{\mathrm{code}} C code , which gives t j t_j t j and representing cocycles;
compute a cochain map Γ : C s t a c k → C c o d e \Gamma:C_{\mathrm{stack}}\to C_{\mathrm{code}} Γ : C stack → C code that sends the generators of H j ( C s t a c k ) H^j(C_{\mathrm{stack}}) H j ( C stack ) to these cocycles, and a contraction of its mapping cone, which gives a homotopy inverse Δ \Delta Δ (Appendix C 4);
construct a stable isomorphism of the check cokernels, adjoining identity X X X -type checks (Lemma 10, Appendix C 1);
lift it to invertible U U U and V V V , adjoining ancillas (Lemma 11, Appendix C 2);
factor U U U into layers of SUM gates and on-site SWAP gates (Lemma 12, Appendix C 3);
return t j t_j t j and the circuit;
grained code (Lemma 8, Appendix B 1), so it need not be recomputed.
Line 6 may coarse-grain less, at the cost of computing the gluing classes. For each layer, it then suffices to coarse-grain to a superlattice over which the gluing classes of that layer restrict to zero, and Appendix B 3 determines the smallest such superlattices. For the glued code, coarse-graining by a factor of p p p along a single direction suffices (Sec. V).
Algorithm 2 follows the proof of sufficiency in Appendix C, applied to the output of Algorithm 1 with F p [ Λ s u f f ] \mathbb{F}_p[\Lambda_{\mathrm{suff}}] F p [ Λ suff ] in place of R R R . Each of its lines solves linear equations over a Laurent polynomial ring, or evaluates explicit formulas in their solutions. In a fixed number of variables, such equations have solutions of polynomially bounded degree [38 Thms. 3.2 and 3.4] , so the coefficients of the unknowns satisfy a linear system over F p \mathbb{F}_p F p of polynomial size.
Proposition 1 (Polynomial cost). The number of arithmetic operations over F p \mathbb{F}_p F p used by Algorithm 2 is bounded by a polynomial in the number of coefficients of the differentials of its input, counted with all exponents in a common box. The degree of this polynomial depends only on the spatial dimension D D D . The same polynomial bounds the depth of the output circuit and its number of ancillas per unit cell.
The proof, in Appendix C 5, rests on worst-case degree bounds, so this polynomial is far from practical. Algorithm 2 receives the code coarse-grained to Λ s u f f \Lambda_{\mathrm{suff}} Λ suff , roughly [ Z D : Λ s u f f ] [\mathbb{Z}^{D}:\Lambda_{\mathrm{suff}}] [ Z D : Λ suff ] times larger than the original code, and Proposition 1 bounds neither this index nor the cost of Algorithm 1.
Both algorithms are implemented, with exact arithmetic over F p \mathbb{F}_p F p , in the open-source Python package css-decoupling [39 ] , which verifies its outputs, including the commuting square (2) and the action of the re-
turned circuit. It solves the linear systems with Gröbner bases and by default coarse-grains less than line 6 of Algorithm 1, using the gluing classes. For D = 2 D=2 D = 2 , it also implements the algorithm of Ref. [23 ] .
Logical qudits on a torus
The decoupling criterion also governs finite systems. In two dimensions, a torus encodes the maximal number of logical qudits only when its periods are compatible with those of the anyons. Otherwise, it is said to be topologically frustrated [40 ] . In any dimension, if the code can be decoupled on the period lattice of a torus, the decoupling circuit is compatible with the periodic boundary conditions. It maps the code on the torus to a toric-code stack, which encodes ∑ j ( D j ) t j \sum_j \binom{D}{j}t_j ∑ j ( j D ) t j logical qudits.
Corollary 1 (Logical qudits on a torus). Let the layers E X j E_X^j E X j be finite dimensional over F p \mathbb{F}_p F p , with t j = dim F p E X j t_j=\dim_{\mathbb{F}_p}E_X^j t j = dim F p E X j . A torus with period lattice L ⊆ Z D L\subseteq\mathbb{Z}^D L ⊆ Z D encodes at most ∑ j ( D j ) t j \sum_j\binom{D}{j}t_j ∑ j ( j D ) t j logical qudits, with equality if and only if the code can be decoupled on L L L .
The proof, in Appendix D, shows that each layer E X j E_X^j E X j contributes at most ( D j ) t j \binom{D}{j}t_j ( j D ) t j logical qudits and that a nontrivial translation action or a nonzero gluing on L L L lowers this count. By Theorem 1 and Sec. III A, these are exactly the obstructions to decoupling on L L L .
Example: removing the gluing
We return to the GC of Sec. III B and remove its gluing. Coarse-graining by a factor of p p p along a single direction already suffices, whereas Ref. [15 ] coarse-grained in every direction for p = 2 p=2 p = 2 . On an L 1 × L 2 × L 3 L_1\times L_2\times L_3 L 1 × L 2 × L 3 torus, the gluing also lowers the number of logical qudits unless p p p divides L 1 L 2 L_1L_2 L 1 L 2 .
a. The superlattice. There are m = 2 m=2 m = 2 nonzero layers, so Algorithm 1 coarse-grains to Λ s u f f ( G C ) = p Z 3 \Lambda_{\mathrm{suff}}(\mathrm{GC})=p\mathbb{Z}^3 Λ suff ( GC ) = p Z 3 . Coarse-graining along x 2 x_2 x 2 alone, to Z × p Z × Z \mathbb{Z}\times p\mathbb{Z}\times\mathbb{Z} Z × p Z × Z , already suffices; each new unit cell contains p p p original ones, stacked along x 2 x_2 x 2 .
b. The restricted gluing class. On this superlattice, the unit x 1 x 2 x_1x_2 x 1 x 2 -plaquette consists of p p p original plaquettes, so its total charge is − p = 0 -p=0 − p = 0 in F p \mathbb{F}_p F p . The other two unit plaquettes probe one edge segments in the x 1 x 2 x_1x_2 x 1 x 2 -plane and carry no charge. These charges are the values of the restricted gluing class (Lemma 9, Appendix B 2), so by Lemma 1, ∂ 2 ( G C ) \partial_2(\mathrm{GC}) ∂ 2 ( GC ) restricts to zero and the coarse-grained profile splits as F p [ − 1 ] ⊕ F p [ − 2 ] \mathbb{F}_p[-1]\oplus\mathbb{F}_p[-2] F p [ − 1 ] ⊕ F p [ − 2 ] . Coarse-graining along x 1 x_1 x 1 works equally well, and index p p p is the smallest possible (Appendix B 3).
c. The decoupling procedure. Coarse-graining lifts the obstruction of Sec. III B: the relabeling and the strings now need to commute only with the translations in Z × p Z × Z \mathbb{Z}\times p\mathbb{Z}\times\mathbb{Z} Z × p Z × Z , so they may treat the rows of a unit cell differently. For p = 2 p=2 p = 2 , we relabel only the checks of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) at vertices with even x 2 x_2 x 2 , multiplying each by the check of T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) on the x 1 x_1 x 1 -edge directly above it (Figure 4 (a)). Applying Z Z Z to an x 1 x 2 x_1x_2 x 1 x 2 -plaquette at even x 2 x_2 x 2 then creates no charge: its corner check is violated both directly and through the plaquette’s top edge, and the two violations cancel since p = 2 p=2 p = 2 . Applying Z Z Z to an x 1 x 2 x_1x_2 x 1 x 2 -plaquette at odd x 2 x_2 x 2 creates charges at its corner and, through its bottom edge, at the vertex below. The string on the x 2 x_2 x 2 -edge joining them removes both (Figure 4 (b)).
Figure 4. Removing the gluing for p = 2 p=2 p = 2 after coarse-graining to Z × 2 Z × Z \mathbb{Z}\times2\mathbb{Z}\times\mathbb{Z} Z × 2 Z × Z (drawn as in Figure 3 ; the new unit cells, one plaquette wide and two high, are bounded above and below by dotted lines, and rows at odd x 2 x_2 x 2 are shaded). (a) Only the checks at vertices with even x 2 x_2 x 2 are relabeled, each with the check on the x 1 x_1 x 1 -edge directly above it. (b) Z Z Z on a plaquette at even x 2 x_2 x 2 (left) creates a loop without charge; Z Z Z on a plaquette at odd x 2 x_2 x 2 (right) creates two charges, which an attached string removes.
For general p p p , Green’s theorem writes the charge of a loop ℓ \ell ℓ , which is minus the signed area it encloses, as
∮ ℓ x 2 d x 1 = ∑ α α 2 ℓ α ≡ ∑ α ( α 2 mod p ) ℓ α ( m o d p ) . \oint_{\ell} x_2\,\mathrm{d}x_1 = \sum_{\alpha}\alpha_2\ell_\alpha\equiv\sum_{\alpha}(\alpha_2 \mathbin{\operatorname{mod}} p)\ell_\alpha\pmod{p}. ∮ ℓ x 2 d x 1 = α ∑ α 2 ℓ α ≡ α ∑ ( α 2 mod p ) ℓ α ( mod p ) .
where the sum is the discrete version of the line integral, with ℓ α \ell_\alpha ℓ α the exponent of ℓ \ell ℓ on the x 1 x_1 x 1 -edge at α \alpha α . We cancel the contribution of each x 1 x_1 x 1 -edge by multiplying the check of T C 1 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_1(\mathbb{F}_p) TC 1 ( 3 ) ( F p ) at the vertex below it by the check of T C 2 ( 3 ) ( F p ) \mathrm{TC}^{(3)}_2(\mathbb{F}_p) TC 2 ( 3 ) ( F p ) on the edge raised to the power − ( α 2 mod p ) -(\alpha_2 \mathbin{\operatorname{mod}} p) − ( α 2 mod p ) , which repeats every p p p rows. Strings then remove the remaining charges, whose total vanishes.
d. The torus. Corollary [1 ] can be checked on this code. Here Λ t r i v ( G C ) = Z 3 \Lambda_{\mathrm{triv}}(\mathrm{GC})=\mathbb{Z}^3 Λ triv ( GC ) = Z 3 , yet an L 1 × L 2 × L 3 L_1\times L_2\times L_3 L 1 × L 2 × L 3 torus encodes the maximal number of logical qudits, 6, if p p p divides L 1 L 2 L_1L_2 L 1 L 2 , and 4 otherwise, as found for p = 2 p=2 p = 2 in Ref. [15 ] . When p ∤ L 1 L 2 p\nmid L_1L_2 p ∤ L 1 L 2 , applying Z Z Z to an x 1 x 2 x_1x_2 x 1 x 2 -plane gives a logical operator of T C ( 3 ) ( F p ) \mathrm{TC}^{(3)}(\mathbb{F}_p) TC ( 3 ) ( F p ) , but here it also creates the total charge − L 1 L 2 -L_1L_2 − L 1 L 2 , which strings cannot remove. Applying Z Z Z to a closed string along x 3 x_3 x 3 gives a logical operator of T C ( 3 ) ( F p ) \mathrm{TC}^{(3)}(\mathbb{F}_p) TC ( 3 ) ( F p ) , but here it is a stabilizer: the product of all Z Z Z -type checks on cubes is Z Z Z on all L 1 L 2 L_1L_2 L 1 L 2 parallel strings along x 3 x_3 x 3 . These strings are equivalent up to stabilizers, so their product is the L 1 L 2 L_1L_2 L 1 L 2 th power of one of them; since L 1 L 2 L_1L_2 L 1 L 2 is invertible modulo p p p , that string is itself a stabilizer. As above, the unit x 1 x 2 x_1x_2 x 1 x 2 -plaquette of the period lattice consists of L 1 L 2 L_1L_2 L 1 L 2 original plaquettes and carries the charge − L 1 L 2 -L_1L_2 − L 1 L 2 , while the other two carry none. The gluing therefore restricts to zero over the period lattice exactly when p p p divides L 1 L 2 L_1L_2 L 1 L 2 , in agreement with Corollary [1 ] .
Discussion
For fault-tolerant quantum computation, a decoupling serves as a dictionary between a code and its toric-code stack. The circuit, its inverse, and the map between syndromes are all local, so any property that such maps change only by constant factors is shared by the code and the stack. Single-shot decoding is one such property: it rests on the confinement of syndrome dislocations [6 ] , which local maps distort only by bounded amounts. We therefore expect a code with finitely many excitation types in every layer to admit single-shot decoding of Z Z Z -type errors exactly when it has no pointlike X X X -check excitations, E X 1 = 0 E^1_X=0 E X 1 = 0 , and likewise with X X X and Z Z Z exchanged. Single-shot decoding of both error types then requires D ≥ 4 D\geq4 D ≥ 4 , as in the four-dimensional toric code [2 ] . The same dictionary turns toric-code decoders into decoders for the code, as for the color code [10 ] : map the syndrome to that of the stack, decode the stack, and pull the correction back through the circuit. This would extend matching decoders for two-dimensional translation-invariant codes [41 ] to higher-dimensional codes [7 , 9 ] , although the circuit correlates errors across the toric codes of the stack, so decoding them independently may cost performance.
The dictionary extends to logical gates. On tori where a code can be decoupled, conjugation by the circuit maps its constant-depth logical gates to those of the toric-code stack, and back. The constant-depth gates of all such codes, non-Clifford ones included, therefore correspond to those of toric-code stacks, for which cup products give systematic constructions [42 , 43 ] . For qubits, for instance, a constant-depth circuit of C D − 1 Z \mathrm{C}^{D-1}Z C D − 1 Z gates implements a logical C D − 1 Z \mathrm{C}^{D-1}Z C D − 1 Z gate on D D D copies of the D D D -dimensional code with qubits on edges [42 ] , and the transversal non-Clifford gate of the color code becomes a constant-depth gate on three toric codes [5 ] . Pulled back through a decoupling, such gates may supply non-Clifford gates for codes in which none is yet known.
Up to constant factors, then, every code to which our results apply behaves like a stack of toric codes, and its advantages must lie in those constants and in finite geometry. The gross code illustrates this: it cannot be decoupled on the period lattice of its torus [40 ] , so it encodes fewer logical qubits than a stack with the same layers (Corollary [1 ] ), yet it is a leading candidate for low-overhead quantum memory [14 ] . On such a torus, the circuit no longer fits the periodic boundary conditions, but it can still be applied away from a cut, leaving a toric-code stack with a domain wall along the cut, much as an anyon-permuting translation leaves an anyon-permuting domain wall in two dimensions. Decoding and logical operations on such tori may then reduce to those of toric codes with domain walls. Alternatively, one can choose period lattices, possibly twisted [44 ] , on which the code can be decoupled.
Our criterion decides whether a code can be decoupled, but not how cheaply. One cost is the translation symmetry that must be given up. When at most two layers are nonzero, as in every three-dimensional code, a single gluing class sets this cost beyond what is needed for translations to act trivially on every layer. In three dimensions, its values on the three unit plaquettes decide whether the gluing is absent, or disappears after coarse-graining by a factor of p p p along one direction or along two (Corollary 2). With three or more layers, possible only for D ≥ 4 D \ge4 D ≥ 4 , the gluing classes are no longer intrinsic: those of a higher layer are defined only once the lower layers have been split, and they depend on how this was done. Minimizing the coarse-graining layer by layer then gives only an upper bound, and the smallest superlattice on which the code can be decoupled is not known.
The other cost is the circuit itself. Our construction aims at explicitness rather than economy: it does not minimize the depth or the range of the gates, and it adjoins ancillas (Appendix C). Whether ancillas can always be avoided is open, as is whether retaining more translation symmetry forces a deeper or longer-range circuit.
Our notion of equivalence is deliberately fine. Up to gapped interfaces and coarse-graining, toric codes are trivial, and in this coarser sense Yang and Yu have classified the Pauli stabilizer codes with finitely many excitation types in every layer, which they call mobile [45 , 46 ] . A decoupling retains more: it is an explicit circuit, it commutes with a prescribed superlattice of translations, and it counts the copies of each toric code. If all translations are kept, codes with the same layers can still differ in their gluing and then realize distinct translation-symmetry-enriched phases [15 , 47 ] ; the glued code, whose loops carry a charge set by the projected area they enclose, is the simplest example.
Each of our assumptions marks a frontier. For composite qudit dimensions, the layers and their gluing are no longer enough: such qudits admit twisted quantum doubles [48 ] and Clifford obstructions that these cannot see [15 ] . Beyond CSS codes, a translation-invariant Clifford equivalence need not be a circuit at all, since nontrivial Clifford quantum cellular automata exist in three dimensions [49 ] . For foliated fracton codes such as the X-cube model, which have infinitely many excitation types, coarse-graining splits off layers of two-dimensional toric codes rather than removing an obstruction [50 ] ; a criterion with such layers as additional building blocks might characterize foliated fracton phases [51 ] .
Acknowledgments
This work was supported by the National Natural Science Foundation of China under Grants No. 12575022, No. 12522502, No. 12471445, and No. 12447101, the Scientific Research Innovation Capability Support Project for Young Faculty under Grant No. ZY2025157, the Shanghai Committee of Science and Technology under Grant No. 25LZ2600800, the Tsinghua Dushi Program, and the Strategic Priority Research Program of the Chinese Academy of Sciences under Grant No. XDB1680200.
Data availability
The Python package css-decoupling [39 ] implements Algorithms 1 and 2. Version 0.1.0 is openly available at https://github.com/hmx21/css-decoupling . The Lean 4 formalization, version 0.1.0, is available at https://github.com/hmx21/css-decoupling-lean ; it uses Lean v4.34.0 and Mathlib commit 5ed2965. Using only the standard axioms of Lean, it proves Theorem 1, Propositions 1 and 2, Corollaries 1 and 2, Lemmas 1–13, the correctness of Algorithm 1, and the results for the glued code in Secs. III B and V. It implements Algorithm 2 as a Lean program, for which it proves Proposition 1; it does not verify the Python package.
Complexes and the superselection profile
Section II C introduced the profile in the language of derived categories and stated several of its properties without proof. This appendix fixes the conventions behind that language and proves these properties, together with a finite free model of the profile on which the other appendices build.
Conventions
As in the main text, ≃ \simeq ≃ denotes isomorphism in the derived category D ( R ) \mathrm{D}(R) D ( R ) , and A [ n ] A[n] A [ n ] is the shifted complex with A [ n ] k = A k + n A[n]^k=A^{k+n} A [ n ] k = A k + n and differential ( − 1 ) n d A (-1)^n d_A ( − 1 ) n d A . Thus A [ 1 ] A[1] A [ 1 ] is the translation T A TA T A of Ref. [35 ] , Prop. 10.2.4, written A [ − 1 ] A[-1] A [ − 1 ] there. The mapping cone of a cochain map c : A → B c:A\to B c : A → B has the terms B n ⊕ A n + 1 B^n\oplus A^{n+1} B n ⊕ A n + 1 and the differential ( d B c 0 − d A ) \left(\begin{smallmatrix}d_B&c\\0&-d_A\end{smallmatrix}\right) ( d B 0 c − d A ) . With ι \iota ι the inclusion of B B B and δ \delta δ the projection onto A [ 1 ] A[1] A [ 1 ] , the sequence A → c B → ι Cone ( c ) → δ A [ 1 ] A\xrightarrow{c}B\xrightarrow{\iota}\operatorname{Cone}(c)\xrightarrow{\delta}A[1] A c B ι Cone ( c ) δ A [ 1 ] is a distinguished triangle in D ( R ) \mathrm{D}(R) D ( R ) [35 ] , Def. 10.1.3 and Prop. 10.4.1. Up to reordering the two summands and changing the sign of the A A A -component, this is the convention of Ref. [35 ] .
For a cochain complex A A A , the canonical truncations are
( τ ≥ k A ) n = { 0 , n < k , A k / im d k − 1 , n = k , A n , n > k . (\tau_{\ge k}A)^n =
\begin{cases}
0, & n<k,\\
A^k/\operatorname{im}d^{k-1}, & n=k,\\
A^n, & n>k.
\end{cases} ( τ ≥ k A ) n = ⎩ ⎨ ⎧ 0 , A k / im d k − 1 , A n , n < k , n = k , n > k .
( τ ≤ k A ) n = { A n , n < k , ker d A k , n = k , 0 , n > k . (\tau_{\le k}A)^n =
\begin{cases}
A^n, & n<k,\\
\ker d^k_A, & n=k,\\
0, & n>k.
\end{cases} ( τ ≤ k A ) n = ⎩ ⎨ ⎧ A n , ker d A k , 0 , n < k , n = k , n > k .
with the induced differentials. They retain the cohomology of A A A in degrees n ≥ k n\ge k n ≥ k and n ≤ k n\le k n ≤ k , respectively. For R R R -modules A A A and B B B , regarded as complexes in degree zero, Hom D ( R ) ( A , B [ n ] ) = Ext R n ( A , B ) \operatorname{Hom}_{D(R)}(A,B[n])=\operatorname{Ext}^{n}_{R}(A,B) Hom D ( R ) ( A , B [ n ]) = Ext R n ( A , B ) [35 Def. 10.7.1 and Cor. 10.7.5] . Concretely, let P ∙ → A P_\bullet\to A P ∙ → A be a projective resolution with differentials ∂ n : P n → P n − 1 \partial_n:P_n\to P_{n-1} ∂ n : P n → P n − 1 , placed with P n P_n P n in degree − n -n − n . A cochain map P ∙ → B [ n ] P_\bullet\to B[n] P ∙ → B [ n ] has a single component f : P n → B f:P_n\to B f : P n → B ,
\begin{CD}
P_\bullet: @. \cdots@>{}>{} P_{n+1} @>{\partial_{n+1}}>> P_n @>{\partial_n}>> P_{n-1} @>{}>{} \cdots\\
B[n]: @. \cdots@>{}>{} 0 @>{}>{} B @>{}>{} 0 @>{}>{} \cdots
\end{CD}
and it commutes with the differentials exactly when f ∂ n + 1 = 0 f\partial_{n+1}=0 f ∂ n + 1 = 0 . In other words, f f f is an n n n -cocycle of Hom R ( P ∙ , B ) \operatorname{Hom}_{R}(P_\bullet,B) Hom R ( P ∙ , B ) . Every class in Ext R n ( A , B ) \operatorname{Ext}^{n}_{R}(A,B) Ext R n ( A , B ) is represented by such a cocycle. Two cocycles represent the same class if and only if they differ by a coboundary h ∂ n h\partial_n h ∂ n , with h : P n − 1 → B h:P_{n-1}\to B h : P n − 1 → B the dashed map, that is, exactly when the two cochain maps are homotopic.
Degree bound and a finite free model
By Hilbert’s syzygy theorem and localization, the ring R R R has global dimension at most D D D [35 Thm. 3.2.2 and Cor. 4.3.8] . Both results of this subsection rest on this bound: it limits the degrees of the layers, and it lets us represent the profile by a bounded complex of finite free modules, which Appendixes C and D use in explicit computations.
Lemma 3. For a translation-invariant topological CSS code in D D D dimensions, E X j = 0 E^{j}_{X}=0 E X j = 0 for j ≥ D j\ge D j ≥ D .
Proof. By the topological condition (1) , ker H Z = im H X † \ker H_Z=\operatorname{im}H_X^{\dagger} ker H Z = im H X † , so H Z H_Z H Z induces an isomorphism M X = R q / im H X † ≅ im H Z ⊆ R r M_X=R^q/\operatorname{im}H_X^{\dagger}\cong\operatorname{im}H_Z\subseteq R^r M X = R q / im H X † ≅ im H Z ⊆ R r . Since R r R^r R r is free, the exact sequence 0 → M X → R r → coker H Z → 0 0\to M_X\to R^r\to\operatorname{coker}H_Z\to0 0 → M X → R r → coker H Z → 0 gives
Ext R n ( M X , N ) ≅ Ext R n + 1 ( coker H Z , N ) , n ≥ 1 , \operatorname{Ext}^{n}_{R}(M_X,N)\cong\operatorname{Ext}^{n+1}_{R}(\operatorname{coker}H_Z,N),\qquad n\ge1, Ext R n ( M X , N ) ≅ Ext R n + 1 ( coker H Z , N ) , n ≥ 1 , for every R R R -module N N N . Since R R R has global dimension at most D D D , the right-hand side vanishes for n ≥ D n\ge D n ≥ D . Hence M X M_X M X has projective dimension at most D − 1 D-1 D − 1 . The antipode is a ring automorphism of R R R , so M X M_X M X has the same projective dimension, and E X j = Ext R j ( M X , R ) = 0 E^{j}_{X}=\operatorname{Ext}^{j}_{R}(M_X,R)=0 E X j = Ext R j ( M X , R ) = 0 for j ≥ D j\ge D j ≥ D .
Together with the truncation in Eq. (6) , this leaves only the degrees 1 ≤ j ≤ D − 1 1\le j\le D-1 1 ≤ j ≤ D − 1 .
Since R R R is also Noetherian, every submodule of a finite free R R R -module is finitely generated and has a resolution by finite free modules of length at most D − 1 D-1 D − 1 . Schreyer’s algorithm computes such a resolution [52 Thm. 15.10 and Cor. 15.11] without finding a basis of a projective module: after its generators are multiplied by monomials, the submodule is defined over the polynomial ring F p [ x 1 , … , x D ] \mathbb{F}_p[x_1,\ldots,x_D] F p [ x 1 , … , x D ] , where the algorithm applies, and localizing to R R R preserves exactness and freeness. This gives the following bounded model of the profile.
Lemma 4. The complex (1) of a translation-invariant topological CSS code extends to a bounded complex of finite free R R R -modules, again denoted C c o d e C_{\mathrm{code}} C code , that vanishes outside degrees ∣ n ∣ ≤ D + 2 \lvert n\rvert\le D+2 ∣ n ∣ ≤ D + 2 , is exact in degrees n ≤ 0 n\le0 n ≤ 0 , and whose part in nonnegative degrees has the form (5) . Then H n ( C c o d e ) ≅ E X n H^n(C_{\mathrm{code}})\cong E_X^n H n ( C code ) ≅ E X n for n ≥ 1 n\ge1 n ≥ 1 and C c o d e ≃ E X C_{\mathrm{code}}\simeq\mathcal{E}_X C code ≃ E X . The complex C s t a c k C_{\mathrm{stack}} C stack of a toric-code stack satisfies C s t a c k ≃ ⨁ j F p [ − j ] ⊕ t j C_{\mathrm{stack}}\simeq\bigoplus_j\mathbb{F}_p[-j]^{\oplus t_j} C stack ≃ ⨁ j F p [ − j ] ⊕ t j .
Proof. We extend Eq. (4) to a finite free resolution of M X M_X M X by resolving ker γ † \ker\gamma^\dagger ker γ † , and we resolve ker H Z † \ker H_Z^\dagger ker H Z † , both as above. Since these resolutions have length at most D − 1 D-1 D − 1 , the complex below vanishes outside degrees $\lvert n\rvert\le D+2. In nonnegative degrees, we attach the complex (5) obtained from the first; in degrees below − 1 -1 − 1 , we attach the second. Then C c o d e C_{\mathrm{code}} C code is a bounded complex of finite free modules,
C c o d e : ⋯ ⟶ R r → H Z † R q → H X R s → γ R t ⟶ ⋯ C_{\mathrm{code}}:\quad\cdots\longrightarrow R^r\xrightarrow{H_Z^\dagger}R^q\xrightarrow{H_X}R^s\xrightarrow{\gamma}R^t\longrightarrow\cdots C code : ⋯ ⟶ R r H Z † R q H X R s γ R t ⟶ ⋯ The topological condition (1) gives ker H X = im H Z † \ker H_X=\operatorname{im}H_Z^\dagger ker H X = im H Z † , and the attached resolution of ker H Z † \ker H_Z^\dagger ker H Z † makes C c o d e C_{\mathrm{code}} C code exact in all lower degrees. Hence H n ( C c o d e ) = 0 H^n(C_{\mathrm{code}})=0 H n ( C code ) = 0 for n ≤ 0 n\le0 n ≤ 0 and H n ( C c o d e ) ≅ E X n H^n(C_{\mathrm{code}})\cong E_X^n H n ( C code ) ≅ E X n for n ≥ 1 n\ge1 n ≥ 1 .
The profile E X \mathcal{E}_X E X is represented by the truncation τ ≥ 1 \tau_{\ge1} τ ≥ 1 of the complex (5) . It has the same cohomology as C c o d e C_{\mathrm{code}} C code , but its degree-one term is coker d c o d e 0 \operatorname{coker}d_{\mathrm{code}}^0 coker d code 0 , which is not free in general. Consider the diagram
\begin{CD}
C_{\mathrm{code}}: @. \cdots@>{}>{} R^r @>{H_Z^\dagger}>> R^q @>{H_X}>> R^s @>{\gamma}>> R^t @>{}>{} \cdots\\
@. @. @VVV @VVV @VVV @VVV \\
\mathcal{E}_X: @. \cdots@>{}>{} 0 @>{}>{} 0 @>{}>{} \operatorname{coker}d_{\mathrm{code}}^0 @>{\widetilde{\gamma}}>> R^t @>{}>{} \cdots
\end{CD}
where π c o d e \pi_{\mathrm{code}} π code is the projection and γ ~ [ c ] = γ c \widetilde{\gamma}[c]=\gamma c γ [ c ] = γ c is well defined since γ H X = 0 \gamma H_X=0 γ H X = 0 . Its vertical maps commute with the differentials because π c o d e H X = 0 \pi_{\mathrm{code}}H_X=0 π code H X = 0 and γ ~ π c o d e = γ \widetilde{\gamma}\pi_{\mathrm{code}}=\gamma γ π code = γ . The resulting cochain map C c o d e → E X C_{\mathrm{code}}\to\mathcal{E}_X C code → E X is a quasi-isomorphism, so C c o d e ≃ E X C_{\mathrm{code}}\simeq\mathcal{E}_X C code ≃ E X . Indeed, in degrees n ≤ 0 n\le0 n ≤ 0 both rows have zero cohomology. In degree one, both have the cohomology ker γ / im H X \ker\gamma/\operatorname{im}H_X ker γ / im H X , on which π c o d e \pi_{\mathrm{code}} π code induces the identity. From degree two on, the rows coincide, except that γ \gamma γ is replaced by γ ~ \widetilde{\gamma} γ , which has the same image since π c o d e \pi_{\mathrm{code}} π code is surjective.
For the toric-code stack, C s t a c k = ⨁ j T j ⊕ t j C_{\mathrm{stack}}=\bigoplus_j T_j^{\oplus t_j} C stack = ⨁ j T j ⊕ t j is already a bounded complex of finite free modules. Applying the augmentation ε \varepsilon ε to the term K 0 K_0 K 0 , which lies in degree j j j of each copy of T j T_j T j , gives a quasi-isomorphism C s t a c k → ⨁ j F p [ − j ] ⊕ t j C_{\mathrm{stack}}\to\bigoplus_j\mathbb{F}_p[-j]^{\oplus t_j} C stack → ⨁ j F p [ − j ] ⊕ t j , since K ∗ K_* K ∗ is a free resolution of F p \mathbb{F}_p F p (Sec. II B).
Truncation triangles and gluing
To decide when the profile splits, we identify each truncation triangle (8) with the distinguished triangle of a mapping cone, to which Lemma 5 below applies. For a cochain complex A A A and an integer j j j , let c j : A ′ = τ ≤ j − 1 A ⟶ A ′ ′ = τ ≤ j A c_j : A'=\tau_{\leq j-1}A \longrightarrow A''=\tau_{\leq j}A c j : A ′ = τ ≤ j − 1 A ⟶ A ′′ = τ ≤ j A be the inclusion. The map Cone ( c j ) ⟶ A ′ ′ / A ′ \operatorname{Cone}(c_j)\longrightarrow A''/A' Cone ( c j ) ⟶ A ′′ / A ′ , ( a ′ ′ , a ′ ) ⟼ [ a ′ ′ ] (a'',a')\longmapsto[a''] ( a ′′ , a ′ ) ⟼ [ a ′′ ] , is a surjective cochain map whose kernel, the cone of the identity of A ′ A' A ′ , is acyclic. The map is therefore a quasi-isomorphism. The quotient A ′ ′ / A ′ A''/A' A ′′ / A ′ is the two-term complex A j − 1 / ker d A j − 1 ⟶ ker d A j A^{j-1}/\ker d_A^{j-1}\longrightarrow\ker d_A^j A j − 1 / ker d A j − 1 ⟶ ker d A j in degrees j − 1 j-1 j − 1 and j j j . Its differential is injective with cokernel H j ( A ) H^j(A) H j ( A ) , so A ′ ′ / A ′ ≃ H j ( A ) [ − j ] A''/A'\simeq H^j(A)[-j] A ′′ / A ′ ≃ H j ( A ) [ − j ] . Replacing the cone by H j ( A ) [ − j ] H^j(A)[-j] H j ( A ) [ − j ] gives the triangle
τ ≤ j − 1 A ⟶ τ ≤ j A ⟶ H j ( A ) [ − j ] → δ j ( τ ≤ j − 1 A ) [ 1 ] , \tau_{\leq j-1}A \longrightarrow\tau_{\leq j}A \longrightarrow H^j(A)[-j] \xrightarrow{\delta_j}(\tau_{\leq j-1}A)[1], τ ≤ j − 1 A ⟶ τ ≤ j A ⟶ H j ( A ) [ − j ] δ j ( τ ≤ j − 1 A ) [ 1 ] ,
in which δ j \delta_j δ j is the inverse of the quasi-isomorphism Cone ( c j ) ⟶ H j ( A ) [ − j ] \operatorname{Cone}(c_j)\longrightarrow H^j(A)[-j] Cone ( c j ) ⟶ H j ( A ) [ − j ] followed by the projection onto ( τ ≤ j − 1 A ) [ 1 ] (\tau_{\leq j-1}A)[1] ( τ ≤ j − 1 A ) [ 1 ] . For A = E X A=\mathcal{E}_X A = E X , this is Eq. (8) [35 Example 10.4.9] .
Lemma 5. For a cochain map c : A ⟶ B c:A\longrightarrow B c : A ⟶ B and its distinguished triangle A → c B → ι Cone ( c ) → δ A [ 1 ] A\xrightarrow{c}B\xrightarrow{\iota}\operatorname{Cone}(c)\xrightarrow{\delta}A[1] A c B ι Cone ( c ) δ A [ 1 ] , the following are equivalent: (i) δ = 0 \delta=0 δ = 0 ; (ii) ι \iota ι has a section, that is, a morphism σ : Cone ( c ) ⟶ B \sigma:\operatorname{Cone}(c)\longrightarrow B σ : Cone ( c ) ⟶ B with ι σ = I \iota\sigma=I ι σ = I ; (iii) there is an isomorphism A ⊕ Cone ( c ) ≃ B A\oplus\operatorname{Cone}(c)\simeq B A ⊕ Cone ( c ) ≃ B whose restriction to A A A is c c c and whose composite with ι \iota ι is the projection onto Cone ( c ) \operatorname{Cone}(c) Cone ( c ) .
Proof. (i)⇒ \Rightarrow ⇒ (ii). Applying Hom D ( R ) ( Cone ( c ) , − ) \operatorname{Hom}_{D(R)}(\operatorname{Cone}(c),-) Hom D ( R ) ( Cone ( c ) , − ) to the triangle gives the exact sequence
Hom ( Cone ( c ) , B ) → ι ∘ − Hom ( Cone ( c ) , Cone ( c ) ) → δ ∘ − Hom ( Cone ( c ) , A [ 1 ] ) \operatorname{Hom}(\operatorname{Cone}(c),B)\xrightarrow{\iota\circ-}\operatorname{Hom}(\operatorname{Cone}(c),\operatorname{Cone}(c))\xrightarrow{\delta\circ-}\operatorname{Hom}(\operatorname{Cone}(c),A[1]) Hom ( Cone ( c ) , B ) ι ∘− Hom ( Cone ( c ) , Cone ( c )) δ ∘− Hom ( Cone ( c ) , A [ 1 ])
of morphism groups in D ( R ) D(R) D ( R ) [35 Example 10.2.8] . Since δ ∘ I = δ = 0 \delta\circ I=\delta=0 δ ∘ I = δ = 0 , exactness gives σ \sigma σ with ι σ = I \iota\sigma=I ι σ = I .
(ii)⇒ \Rightarrow ⇒ (iii). A morphism in D ( R ) D(R) D ( R ) is an isomorphism if and only if it induces isomorphisms on all cohomology modules. The triangle gives the long exact sequence
H n ( B ) → H n ( ι ) H n ( Cone ( c ) ) → H n ( δ ) H n + 1 ( A ) ⟶ ⋯ H^n(B)\xrightarrow{H^n(\iota)}H^n(\operatorname{Cone}(c))\xrightarrow{H^n(\delta)}H^{n+1}(A)\longrightarrow\cdots H n ( B ) H n ( ι ) H n ( Cone ( c )) H n ( δ ) H n + 1 ( A ) ⟶ ⋯
[35 Cor. 10.1.4] . Since H n ( ι ) H n ( σ ) = I H^n(\iota)H^n(\sigma)=I H n ( ι ) H n ( σ ) = I , every H n ( ι ) H^n(\iota) H n ( ι ) is surjective, so every connecting map H n ( δ ) H^n(\delta) H n ( δ ) vanishes. The sequence then breaks into short exact sequences 0 ⟶ H n ( A ) ⟶ H n ( B ) ⟶ H n ( Cone ( c ) ) ⟶ 0 0\longrightarrow H^n(A)\longrightarrow H^n(B)\longrightarrow H^n(\operatorname{Cone}(c))\longrightarrow0 0 ⟶ H n ( A ) ⟶ H n ( B ) ⟶ H n ( Cone ( c )) ⟶ 0 , split by H n ( σ ) H^n(\sigma) H n ( σ ) . Hence ( c σ ) : A ⊕ Cone ( c ) ⟶ B (c\ \sigma):A\oplus\operatorname{Cone}(c)\longrightarrow B ( c σ ) : A ⊕ Cone ( c ) ⟶ B induces isomorphisms on cohomology and is an isomorphism. Its restriction to A A A is c c c , and its composite with ι \iota ι is ( ι c ι σ ) = ( 0 I ) (\iota c\ \iota\sigma)=(0\ I) ( ιc ι σ ) = ( 0 I ) , the projection onto Cone ( c ) \operatorname{Cone}(c) Cone ( c ) , because consecutive maps of a distinguished triangle compose to zero.
(iii)⇒ \Rightarrow ⇒ (i). Restricting the isomorphism to Cone ( c ) \operatorname{Cone}(c) Cone ( c ) gives a section σ \sigma σ of ι \iota ι , and δ = δ ι σ = 0 \delta=\delta\iota\sigma=0 δ = δ ι σ = 0 , again because consecutive maps compose to zero.
The next lemma justifies the description of a split profile in Sec. III A.
Lemma 6. The profile splits as in Eq. (9) if and only if every δ j \delta_j δ j vanishes.
Proof. By the construction above, the triangle (8) is isomorphic to that of the inclusion c j c_j c j , with Cone ( c j ) ≃ E X j [ − j ] \operatorname{Cone}(c_j)\simeq E_X^j[-j] Cone ( c j ) ≃ E X j [ − j ] and δ = δ j \delta=\delta_j δ = δ j , so Lemma 5 applies to it. If all δ j \delta_j δ j vanish, the implication (i)⇒ \Rightarrow ⇒ (iii) gives τ ≤ j E X ≃ τ ≤ j − 1 E X ⊕ E X j [ − j ] \tau_{\leq j}\mathcal{E}_X\simeq\tau_{\leq j-1}\mathcal{E}_X\oplus E_X^j[-j] τ ≤ j E X ≃ τ ≤ j − 1 E X ⊕ E X j [ − j ] for every j j j , and induction on j j j gives Eq. (9) . Conversely, the truncations are functorial for cochain maps and preserve quasi-isomorphisms, so an isomorphism E X ≃ ⨁ i E X i [ − i ] \mathcal{E}_X\simeq\bigoplus_i E_X^i[-i] E X ≃ ⨁ i E X i [ − i ] in D ( R ) D(R) D ( R ) identifies each triangle (8) with the corresponding triangle of ⨁ i E X i [ − i ] \bigoplus_i E_X^i[-i] ⨁ i E X i [ − i ] , whose map onto E X j [ − j ] E_X^j[-j] E X j [ − j ] has a section. Every δ j \delta_j δ j then vanishes by the implication (ii)⇒ \Rightarrow ⇒ (i).
Invariance of the profile
The necessity part of Theorem 1 uses that a decoupling cannot change the profile. We check this for each of its ingredients, together with the identity X X X -type checks adjoined in Appendix C.
Lemma 7. Up to isomorphism, the profile E X \mathcal{E}_X E X is unchanged by translation-invariant CSS-preserving Clifford circuits, by adjoining ancillas in the state ∣ + ⟩ \lvert+\rangle ∣ + ⟩ or ∣ 0 ⟩ \lvert0\rangle ∣ 0 ⟩ , and by adjoining identity X X X -type checks.
Proof. The profile depends only on the module M X = R q / im H X † M_X=R^q/\operatorname{im}H_X^\dagger M X = R q / im H X † (Sec. II C). A translation-invariant CSS-preserving Clifford circuit acts on X X X -type representatives by an invertible matrix ( U T ) − 1 (U^T)^{-1} ( U T ) − 1 over R R R (Sec. II A). If it maps one code onto another, it maps the X X X -type stabilizer submodule of the first onto that of the second and therefore induces an isomorphism of the modules M X M_X M X . Adjoining an ancilla per unit cell in the state ∣ + ⟩ \lvert+\rangle ∣ + ⟩ replaces H X H_X H X by diag ( H X , I a ) \operatorname{diag}(H_X,I_a) diag ( H X , I a ) and H Z H_Z H Z by ( H Z 0 ) (H_Z\ 0) ( H Z 0 ) . Then im H X † \operatorname{im}H_X^\dagger im H X † gains the summand R a R^a R a , and M X M_X M X is unchanged. Adjoining them in the state ∣ 0 ⟩ \lvert0\rangle ∣ 0 ⟩ replaces H X H_X H X by ( H X 0 ) (H_X\ 0) ( H X 0 ) and H Z H_Z H Z by diag ( H Z , I a ) \operatorname{diag}(H_Z,I_a) diag ( H Z , I a ) , which replaces M X M_X M X by M X ⊕ R a M_X\oplus R^a M X ⊕ R a . Since R a R^a R a is free, R Hom R ( R a , R ) \mathbf{R}\operatorname{Hom}_R(R^a,R) R Hom R ( R a , R ) is concentrated in degree zero and is removed by the truncation τ ≥ 1 \tau_{\geq1} τ ≥ 1 . Finally, an identity X X X -type check adds a zero row to H X H_X H X and leaves im H X † \operatorname{im}H_X^\dagger im H X † unchanged.
Example: profile of the glued code
This subsection computes the profile and the gluing of the GC of Sec. III B, in the notation there.
a. The mapping cone. The block form (13) describes the code as the two toric codes joined by the couplings. Algebraically, this is a mapping cone. Extended by zero, c Z c_Z c Z and c X c_X c X form a cochain map $c:T_2[-1]\longrightarrow T_1 between the complexes of the two toric codes (§ 2 B):
degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 → − ∂ 3 K 2 → − ∂ 2 K 1 → − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 → ∂ 3 K 2 → ∂ 2 K 1 → ∂ 1 K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\quad3\\
&T_2[-1]\quad K_3 \xrightarrow{-\partial_3} K_2 \xrightarrow{-\partial_2} K_1 \xrightarrow{-\partial_1} K_0\\
&\hspace{5.2cm}\downarrow c_Z\qquad\qquad\downarrow c_X\\
&T_1\quad K_3 \xrightarrow{\partial_3} K_2 \xrightarrow{\partial_2} K_1 \xrightarrow{\partial_1} K_0
\end{aligned} degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 − ∂ 3 K 2 − ∂ 2 K 1 − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 ∂ 3 K 2 ∂ 2 K 1 ∂ 1 K 0
The shift by one degree reverses the sign of the differential in the top row, so the square containing c Z c_Z c Z and c X c_X c X commutes because ∂ 1 c Z + c X ∂ 3 = 0 \partial_1c_Z+c_X\partial_3=0 ∂ 1 c Z + c X ∂ 3 = 0 , as c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 c_X\partial_3e_{123}=-w_3e_{\varnothing}=-\partial_1c_Ze_{123} c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 .
With the convention recalled in Appendix A 1, the mapping cone Cone ( c ) \operatorname{Cone}(c) Cone ( c ) has the term ( T 1 ) n ⊕ ( T 2 ) n (T_1)^n\oplus(T_2)^n ( T 1 ) n ⊕ ( T 2 ) n in degree n n n and the differential ( ∂ 0 0 ∂ ) \left(\begin{smallmatrix}\partial&0\\0&\partial\end{smallmatrix}\right) ( ∂ 0 0 ∂ ) . Written out, it is
degree − 2 − 1 0 1 2 K 3 → ∂ 3 K 2 ⊕ K 3 → H Z ( G C ) K 1 ⊕ K 2 H X ( G C ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 → ( 0 ∂ 1 ) K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\\
&K_3 \xrightarrow{\partial_3} K_2\oplus K_3 \xrightarrow{H_Z(\mathrm{GC})} K_1\oplus K_2\\
&\hspace{2.5cm}H_X(\mathrm{GC})\downarrow\qquad\qquad\qquad\qquad\downarrow(0\ \partial_1)\\
&\hspace{2.5cm}K_0\oplus K_1 \xrightarrow{(0\ \partial_1)} K_0
\end{aligned} degree − 2 − 1 0 1 2 K 3 ∂ 3 K 2 ⊕ K 3 H Z ( GC ) K 1 ⊕ K 2 H X ( GC ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 ( 0 ∂ 1 ) K 0
By Eq. (13) , its part in degrees − 1 -1 − 1 to 1 1 1 is the complex (1) of the code, and its outer maps are the local relations among the checks shown in Figure 1 .
b. The gluing class. Let C c o d e ( G C ) = Cone ( c ) C_{\mathrm{code}}(\mathrm{GC})=\operatorname{Cone}(c) C code ( GC ) = Cone ( c ) . The short exact sequence 0 → T 1 → C c o d e ( G C ) → T 2 → 0 0\to T_1\to C_{\mathrm{code}}(\mathrm{GC})\to T_2\to0 0 → T 1 → C code ( GC ) → T 2 → 0 and its dual, together with Koszul exactness, show that the code is topological. They also show that C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) is exact in degrees n ≤ 0 n\leq0 n ≤ 0 and that its part in non-negative degrees has the form (5) , so the quotient map C c o d e ( G C ) → τ ≥ 1 C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC})\to\tau_{\geq1}C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) → τ ≥ 1 C code ( GC ) , whose target represents E X ( G C ) \mathcal{E}_X(\mathrm{GC}) E X ( GC ) , is a quasi-isomorphism. Since T j ≃ F p [ − j ] T_j\simeq\mathbb{F}_p[-j] T j ≃ F p [ − j ] , the only nonzero layers are E X 1 ( G C ) ≅ E X 2 ( G C ) ≅ F p E_X^1(\mathrm{GC})\cong E_X^2(\mathrm{GC})\cong\mathbb{F}_p E X 1 ( GC ) ≅ E X 2 ( GC ) ≅ F p .
The inclusion T 1 ↪ C c o d e ( G C ) T_1\hookrightarrow C_{\mathrm{code}}(\mathrm{GC}) T 1 ↪ C code ( GC ) identifies T 1 T_1 T 1 with τ ≤ 1 C c o d e ( G C ) \tau_{\leq1}C_{\mathrm{code}}(\mathrm{GC}) τ ≤ 1 C code ( GC ) in D ( R ) D(R) D ( R ) , so the rotated cone triangle is isomorphic to the truncation triangle:
T 1 ⟶ C c o d e ( G C ) ⟶ T 2 → − c [ 1 ] T 1 [ 1 ] F p [ − 1 ] ⟶ E X ( G C ) ⟶ F p [ − 2 ] → δ 2 ( G C ) F p . \begin{aligned}
T_1&\longrightarrow C_{\mathrm{code}}(\mathrm{GC})\longrightarrow T_2
\xrightarrow{-c[1]}T_1[1]\\
\mathbb{F}_p[-1]&\longrightarrow\mathcal{E}_X(\mathrm{GC})\longrightarrow\mathbb{F}_p[-2]
\xrightarrow{\delta_2(\mathrm{GC})}\mathbb{F}_p.
\end{aligned} T 1 F p [ − 1 ] ⟶ C code ( GC ) ⟶ T 2 − c [ 1 ] T 1 [ 1 ] ⟶ E X ( GC ) ⟶ F p [ − 2 ] δ 2 ( GC ) F p .
Thus δ 2 ( G C ) \delta_2(\mathrm{GC}) δ 2 ( GC ) corresponds to − c [ 1 ] -c[1] − c [ 1 ] . Up to sign, it is represented by f = ε c X : K 2 → F p f=\varepsilon c_X:K_2\to\mathbb{F}_p f = ε c X : K 2 → F p , whose plaquette values ( f 12 , f 13 , f 23 ) (f_{12},f_{13},f_{23}) ( f 12 , f 13 , f 23 ) are ( − 1 , 0 , 0 ) (-1,0,0) ( − 1 , 0 , 0 ) .
Restriction to superlattices
In § 2 D, we took the profile of the coarse-grained code to be the restriction of the profile of the original code; in other words, coarse-graining a code and taking its profile commute. This appendix justifies this and proves the results that rest on it.
Profile of the coarse-grained code
We first prove this commutation.
Lemma 8. Let Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D be a superlattice. The coarse-grained code over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is again topological, and its profile and layers are E X ∣ F p [ Λ ] \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] and E X j ∣ F p [ Λ ] E_X^j|_{\mathbb{F}_p[\Lambda]} E X j ∣ F p [ Λ ] .
Proof. Let N = [ Z D : Λ ] N=[\mathbb{Z}^D:\Lambda] N = [ Z D : Λ ] . Fix representatives α 1 , … , α N \alpha_1,\ldots,\alpha_N α 1 , … , α N of Z D / Λ \mathbb{Z}^D/\Lambda Z D /Λ . They label the original unit cells within one unit cell of Λ \Lambda Λ . Sorting the monomials of a Laurent polynomial by the coset of their exponents gives
R = ⨁ k = 1 N F p [ Λ ] x α k . R=\bigoplus_{k=1}^{N}\mathbb{F}_p[\Lambda]x^{\alpha_k}. R = k = 1 ⨁ N F p [ Λ ] x α k .
so R R R is a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -module with basis x α 1 , … , x α N x^{\alpha_1},\ldots,x^{\alpha_N} x α 1 , … , x α N . Restriction of scalars keeps a module and its maps but retains only the action of F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] . It is exact and sends R q R^q R q to F p [ Λ ] N q \mathbb{F}_p[\Lambda]^{Nq} F p [ Λ ] N q : the q q q qudits of each original unit cell become N q Nq N q qudits per unit cell of Λ \Lambda Λ . Replacing each entry h h h of a matrix H H H over R R R by the N × N N\times N N × N matrix over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] of multiplication by h h h in this basis gives the matrix H ∣ F p [ Λ ] H|_{\mathbb{F}_p[\Lambda]} H ∣ F p [ Λ ] of the restricted map. The check matrices of the coarse-grained code are H X ∣ F p [ Λ ] H_X|_{\mathbb{F}_p[\Lambda]} H X ∣ F p [ Λ ] and H Z ∣ F p [ Λ ] H_Z|_{\mathbb{F}_p[\Lambda]} H Z ∣ F p [ Λ ] [32 ] . For example, for D = 1 D=1 D = 1 and Λ = 2 Z \Lambda=2\mathbb{Z} Λ = 2 Z with representatives 0 0 0 and 1 1 1 , multiplication by x x x sends 1 ↦ x 1\mapsto x 1 ↦ x and x ↦ x 2 ⋅ 1 x\mapsto x^2\cdot1 x ↦ x 2 ⋅ 1 , so
x ∣ F p [ Λ ] = ( 0 x 2 1 0 ) . x|_{\mathbb{F}_p[\Lambda]}=
\begin{pmatrix}
0 & x^2\\
1 & 0
\end{pmatrix}. x ∣ F p [ Λ ] = ( 0 1 x 2 0 ) .
a unit translation moves the first original cell of a coarse-grained cell to the second, and the second to the first original cell of the next coarse-grained cell.
The profile is defined through the dagger and through duals into R R R , so we need to check that restriction is compatible with both. For the dagger, recall that the coefficient of x α x^\alpha x α in u † v u^\dagger v u † v is the commutation exponent of Z ( v ) Z(v) Z ( v ) with the translate of X ( u ) X(u) X ( u ) by α \alpha α (§ 2 A). The coarse-grained code sees only the translates by α ∈ Λ \alpha\in\Lambda α ∈ Λ , so its symplectic form should keep only these coefficients. Accordingly, let θ : R → F p [ Λ ] \theta:R\to\mathbb{F}_p[\Lambda] θ : R → F p [ Λ ] keep the monomials with exponents in Λ \Lambda Λ and discard the others. In the example above, θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 \theta(a_0+a_1x+a_2x^2+a_3x^3)=a_0+a_2x^2 θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 . The map θ \theta θ is F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear, commutes with the antipode because Λ = − Λ \Lambda=-\Lambda Λ = − Λ , and satisfies θ ( x − α k x α l ) = 1 \theta(x^{-\alpha_k}x^{\alpha_l})=1 θ ( x − α k x α l ) = 1 if k = l k=l k = l and 0 0 0 otherwise, since α l − α k ∈ Λ \alpha_l-\alpha_k\in\Lambda α l − α k ∈ Λ only for k = l k=l k = l . Writing u = ∑ k x α k u k u=\sum_k x^{\alpha_k}u_k u = ∑ k x α k u k and v = ∑ l x α l v l v=\sum_l x^{\alpha_l}v_l v = ∑ l x α l v l with u k , v l ∈ F p [ Λ ] q u_k,v_l\in\mathbb{F}_p[\Lambda]^q u k , v l ∈ F p [ Λ ] q , we obtain
θ ( u † v ) = ∑ k u k † v k , \theta(u^\dagger v)=\sum_k u_k^\dagger v_k, θ ( u † v ) = k ∑ u k † v k ,
the standard form in the expanded coordinates, as expected. Applying θ \theta θ to ( H u ) † v = u † ( H † v ) (Hu)^\dagger v=u^\dagger(H^\dagger v) ( H u ) † v = u † ( H † v ) therefore shows that ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] (H|_{\mathbb{F}_p[\Lambda]})^\dagger=(H^\dagger)|_{\mathbb{F}_p[\Lambda]} ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] . Consequently, the coarse-grained check matrices satisfy the topological condition (1) over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , and the coarse-grained code has the module M X ∣ F p [ Λ ] M_X|_{\mathbb{F}_p[\Lambda]} M X ∣ F p [ Λ ] .
For duals, let P P P be a finite free R R R -module with basis e i e_i e i . Composition with θ \theta θ gives an F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear map
Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ] ) , f ⟼ θ ∘ f . \operatorname{Hom}_R(P,R)|_{\mathbb{F}_p[\Lambda]}\longrightarrow\operatorname{Hom}_{\mathbb{F}_p[\Lambda]}(P|_{\mathbb{F}_p[\Lambda]},\mathbb{F}_p[\Lambda]),
\qquad
f\longmapsto\theta\circ f. Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ]) , f ⟼ θ ∘ f .
@page 13/22 starts_mid=1 ends_mid=1 between the complexes of the two toric codes (§ 2 B):
degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 → − ∂ 3 K 2 → − ∂ 2 K 1 → − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 → ∂ 3 K 2 → ∂ 2 K 1 → ∂ 1 K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\quad3\\
&T_2[-1]\quad K_3 \xrightarrow{-\partial_3} K_2 \xrightarrow{-\partial_2} K_1 \xrightarrow{-\partial_1} K_0\\
&\hspace{5.2cm}\downarrow c_Z\qquad\qquad\downarrow c_X\\
&T_1\quad K_3 \xrightarrow{\partial_3} K_2 \xrightarrow{\partial_2} K_1 \xrightarrow{\partial_1} K_0
\end{aligned} degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 − ∂ 3 K 2 − ∂ 2 K 1 − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 ∂ 3 K 2 ∂ 2 K 1 ∂ 1 K 0
The shift by one degree reverses the sign of the differential in the top row, so the square containing c Z c_Z c Z and c X c_X c X commutes because ∂ 1 c Z + c X ∂ 3 = 0 \partial_1c_Z+c_X\partial_3=0 ∂ 1 c Z + c X ∂ 3 = 0 , as c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 c_X\partial_3e_{123}=-w_3e_{\varnothing}=-\partial_1c_Ze_{123} c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 .
With the convention recalled in Appendix A 1, the mapping cone Cone ( c ) \operatorname{Cone}(c) Cone ( c ) has the term ( T 1 ) n ⊕ ( T 2 ) n (T_1)^n\oplus(T_2)^n ( T 1 ) n ⊕ ( T 2 ) n in degree n n n and the differential ( ∂ 0 0 ∂ ) \left(\begin{smallmatrix}\partial&0\\0&\partial\end{smallmatrix}\right) ( ∂ 0 0 ∂ ) . Written out, it is
degree − 2 − 1 0 1 2 K 3 → ∂ 3 K 2 ⊕ K 3 → H Z ( G C ) K 1 ⊕ K 2 H X ( G C ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 → ( 0 ∂ 1 ) K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\\
&K_3 \xrightarrow{\partial_3} K_2\oplus K_3 \xrightarrow{H_Z(\mathrm{GC})} K_1\oplus K_2\\
&\hspace{2.5cm}H_X(\mathrm{GC})\downarrow\qquad\qquad\qquad\qquad\downarrow(0\ \partial_1)\\
&\hspace{2.5cm}K_0\oplus K_1 \xrightarrow{(0\ \partial_1)} K_0
\end{aligned} degree − 2 − 1 0 1 2 K 3 ∂ 3 K 2 ⊕ K 3 H Z ( GC ) K 1 ⊕ K 2 H X ( GC ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 ( 0 ∂ 1 ) K 0
By Eq. (13) , its part in degrees − 1 -1 − 1 to 1 1 1 is the complex (1) of the code, and its outer maps are the local relations among the checks shown in Figure 1 .
b. The gluing class. Let C c o d e ( G C ) = Cone ( c ) C_{\mathrm{code}}(\mathrm{GC})=\operatorname{Cone}(c) C code ( GC ) = Cone ( c ) . The short exact sequence 0 → T 1 → C c o d e ( G C ) → T 2 → 0 0\to T_1\to C_{\mathrm{code}}(\mathrm{GC})\to T_2\to0 0 → T 1 → C code ( GC ) → T 2 → 0 and its dual, together with Koszul exactness, show that the code is topological. They also show that C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) is exact in degrees n ≤ 0 n\leq0 n ≤ 0 and that its part in non-negative degrees has the form (5) , so the quotient map C c o d e ( G C ) → τ ≥ 1 C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC})\to\tau_{\geq1}C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) → τ ≥ 1 C code ( GC ) , whose target represents E X ( G C ) \mathcal{E}_X(\mathrm{GC}) E X ( GC ) , is a quasi-isomorphism. Since T j ≃ F p [ − j ] T_j\simeq\mathbb{F}_p[-j] T j ≃ F p [ − j ] , the only nonzero layers are E X 1 ( G C ) ≅ E X 2 ( G C ) ≅ F p E_X^1(\mathrm{GC})\cong E_X^2(\mathrm{GC})\cong\mathbb{F}_p E X 1 ( GC ) ≅ E X 2 ( GC ) ≅ F p .
The inclusion T 1 ↪ C c o d e ( G C ) T_1\hookrightarrow C_{\mathrm{code}}(\mathrm{GC}) T 1 ↪ C code ( GC ) identifies T 1 T_1 T 1 with τ ≤ 1 C c o d e ( G C ) \tau_{\leq1}C_{\mathrm{code}}(\mathrm{GC}) τ ≤ 1 C code ( GC ) in D ( R ) D(R) D ( R ) , so the rotated cone triangle is isomorphic to the truncation triangle:
T 1 ⟶ C c o d e ( G C ) ⟶ T 2 → − c [ 1 ] T 1 [ 1 ] F p [ − 1 ] ⟶ E X ( G C ) ⟶ F p [ − 2 ] → δ 2 ( G C ) F p . \begin{aligned}
T_1&\longrightarrow C_{\mathrm{code}}(\mathrm{GC})\longrightarrow T_2
\xrightarrow{-c[1]}T_1[1]\\
\mathbb{F}_p[-1]&\longrightarrow\mathcal{E}_X(\mathrm{GC})\longrightarrow\mathbb{F}_p[-2]
\xrightarrow{\delta_2(\mathrm{GC})}\mathbb{F}_p.
\end{aligned} T 1 F p [ − 1 ] ⟶ C code ( GC ) ⟶ T 2 − c [ 1 ] T 1 [ 1 ] ⟶ E X ( GC ) ⟶ F p [ − 2 ] δ 2 ( GC ) F p .
Thus δ 2 ( G C ) \delta_2(\mathrm{GC}) δ 2 ( GC ) corresponds to − c [ 1 ] -c[1] − c [ 1 ] . Up to sign, it is represented by f = ε c X : K 2 → F p f=\varepsilon c_X:K_2\to\mathbb{F}_p f = ε c X : K 2 → F p , whose plaquette values ( f 12 , f 13 , f 23 ) (f_{12},f_{13},f_{23}) ( f 12 , f 13 , f 23 ) are ( − 1 , 0 , 0 ) (-1,0,0) ( − 1 , 0 , 0 ) .
Restriction to superlattices
In § 2 D, we took the profile of the coarse-grained code to be the restriction of the profile of the original code; in other words, coarse-graining a code and taking its profile commute. This appendix justifies this and proves the results that rest on it.
Profile of the coarse-grained code
We first prove this commutation.
Lemma 8. Let Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D be a superlattice. The coarse-grained code over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is again topological, and its profile and layers are E X ∣ F p [ Λ ] \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] and E X j ∣ F p [ Λ ] E_X^j|_{\mathbb{F}_p[\Lambda]} E X j ∣ F p [ Λ ] .
Proof. Let N = [ Z D : Λ ] N=[\mathbb{Z}^D:\Lambda] N = [ Z D : Λ ] . Fix representatives α 1 , … , α N \alpha_1,\ldots,\alpha_N α 1 , … , α N of Z D / Λ \mathbb{Z}^D/\Lambda Z D /Λ . They label the original unit cells within one unit cell of Λ \Lambda Λ . Sorting the monomials of a Laurent polynomial by the coset of their exponents gives
R = ⨁ k = 1 N F p [ Λ ] x α k . R=\bigoplus_{k=1}^{N}\mathbb{F}_p[\Lambda]x^{\alpha_k}. R = k = 1 ⨁ N F p [ Λ ] x α k .
so R R R is a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -module with basis x α 1 , … , x α N x^{\alpha_1},\ldots,x^{\alpha_N} x α 1 , … , x α N . Restriction of scalars keeps a module and its maps but retains only the action of F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] . It is exact and sends R q R^q R q to F p [ Λ ] N q \mathbb{F}_p[\Lambda]^{Nq} F p [ Λ ] N q : the q q q qudits of each original unit cell become N q Nq N q qudits per unit cell of Λ \Lambda Λ . Replacing each entry h h h of a matrix H H H over R R R by the N × N N\times N N × N matrix over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] of multiplication by h h h in this basis gives the matrix H ∣ F p [ Λ ] H|_{\mathbb{F}_p[\Lambda]} H ∣ F p [ Λ ] of the restricted map. The check matrices of the coarse-grained code are H X ∣ F p [ Λ ] H_X|_{\mathbb{F}_p[\Lambda]} H X ∣ F p [ Λ ] and H Z ∣ F p [ Λ ] H_Z|_{\mathbb{F}_p[\Lambda]} H Z ∣ F p [ Λ ] [32 ] . For example, for D = 1 D=1 D = 1 and Λ = 2 Z \Lambda=2\mathbb{Z} Λ = 2 Z with representatives 0 0 0 and 1 1 1 , multiplication by x x x sends 1 ↦ x 1\mapsto x 1 ↦ x and x ↦ x 2 ⋅ 1 x\mapsto x^2\cdot1 x ↦ x 2 ⋅ 1 , so
x ∣ F p [ Λ ] = ( 0 x 2 1 0 ) . x|_{\mathbb{F}_p[\Lambda]}=
\begin{pmatrix}
0 & x^2\\
1 & 0
\end{pmatrix}. x ∣ F p [ Λ ] = ( 0 1 x 2 0 ) .
a unit translation moves the first original cell of a coarse-grained cell to the second, and the second to the first original cell of the next coarse-grained cell.
The profile is defined through the dagger and through duals into R R R , so we need to check that restriction is compatible with both. For the dagger, recall that the coefficient of x α x^\alpha x α in u † v u^\dagger v u † v is the commutation exponent of Z ( v ) Z(v) Z ( v ) with the translate of X ( u ) X(u) X ( u ) by α \alpha α (§ 2 A). The coarse-grained code sees only the translates by α ∈ Λ \alpha\in\Lambda α ∈ Λ , so its symplectic form should keep only these coefficients. Accordingly, let θ : R → F p [ Λ ] \theta:R\to\mathbb{F}_p[\Lambda] θ : R → F p [ Λ ] keep the monomials with exponents in Λ \Lambda Λ and discard the others. In the example above, θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 \theta(a_0+a_1x+a_2x^2+a_3x^3)=a_0+a_2x^2 θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 . The map θ \theta θ is F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear, commutes with the antipode because Λ = − Λ \Lambda=-\Lambda Λ = − Λ , and satisfies θ ( x − α k x α l ) = 1 \theta(x^{-\alpha_k}x^{\alpha_l})=1 θ ( x − α k x α l ) = 1 if k = l k=l k = l and 0 0 0 otherwise, since α l − α k ∈ Λ \alpha_l-\alpha_k\in\Lambda α l − α k ∈ Λ only for k = l k=l k = l . Writing u = ∑ k x α k u k u=\sum_k x^{\alpha_k}u_k u = ∑ k x α k u k and v = ∑ l x α l v l v=\sum_l x^{\alpha_l}v_l v = ∑ l x α l v l with u k , v l ∈ F p [ Λ ] q u_k,v_l\in\mathbb{F}_p[\Lambda]^q u k , v l ∈ F p [ Λ ] q , we obtain
θ ( u † v ) = ∑ k u k † v k , \theta(u^\dagger v)=\sum_k u_k^\dagger v_k, θ ( u † v ) = k ∑ u k † v k ,
the standard form in the expanded coordinates, as expected. Applying θ \theta θ to ( H u ) † v = u † ( H † v ) (Hu)^\dagger v=u^\dagger(H^\dagger v) ( H u ) † v = u † ( H † v ) therefore shows that ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] (H|_{\mathbb{F}_p[\Lambda]})^\dagger=(H^\dagger)|_{\mathbb{F}_p[\Lambda]} ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] . Consequently, the coarse-grained check matrices satisfy the topological condition (1) over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , and the coarse-grained code has the module M X ∣ F p [ Λ ] M_X|_{\mathbb{F}_p[\Lambda]} M X ∣ F p [ Λ ] .
For duals, let P P P be a finite free R R R -module with basis e i e_i e i . Composition with θ \theta θ gives an F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear map
Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ] ) , f ⟼ θ ∘ f . \operatorname{Hom}_R(P,R)|_{\mathbb{F}_p[\Lambda]}\longrightarrow\operatorname{Hom}_{\mathbb{F}_p[\Lambda]}(P|_{\mathbb{F}_p[\Lambda]},\mathbb{F}_p[\Lambda]),
\qquad
f\longmapsto\theta\circ f. Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ]) , f ⟼ θ ∘ f .
@page 13/22 starts_mid=1 ends_mid=1 between the complexes of the two toric codes (§ 2 B):
degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 → − ∂ 3 K 2 → − ∂ 2 K 1 → − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 → ∂ 3 K 2 → ∂ 2 K 1 → ∂ 1 K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\quad3\\
&T_2[-1]\quad K_3 \xrightarrow{-\partial_3} K_2 \xrightarrow{-\partial_2} K_1 \xrightarrow{-\partial_1} K_0\\
&\hspace{5.2cm}\downarrow c_Z\qquad\qquad\downarrow c_X\\
&T_1\quad K_3 \xrightarrow{\partial_3} K_2 \xrightarrow{\partial_2} K_1 \xrightarrow{\partial_1} K_0
\end{aligned} degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 − ∂ 3 K 2 − ∂ 2 K 1 − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 ∂ 3 K 2 ∂ 2 K 1 ∂ 1 K 0
The shift by one degree reverses the sign of the differential in the top row, so the square containing c Z c_Z c Z and c X c_X c X commutes because ∂ 1 c Z + c X ∂ 3 = 0 \partial_1c_Z+c_X\partial_3=0 ∂ 1 c Z + c X ∂ 3 = 0 , as c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 c_X\partial_3e_{123}=-w_3e_{\varnothing}=-\partial_1c_Ze_{123} c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 .
With the convention recalled in Appendix A 1, the mapping cone Cone ( c ) \operatorname{Cone}(c) Cone ( c ) has the term ( T 1 ) n ⊕ ( T 2 ) n (T_1)^n\oplus(T_2)^n ( T 1 ) n ⊕ ( T 2 ) n in degree n n n and the differential ( ∂ 0 0 ∂ ) \left(\begin{smallmatrix}\partial&0\\0&\partial\end{smallmatrix}\right) ( ∂ 0 0 ∂ ) . Written out, it is
degree − 2 − 1 0 1 2 K 3 → ∂ 3 K 2 ⊕ K 3 → H Z ( G C ) K 1 ⊕ K 2 H X ( G C ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 → ( 0 ∂ 1 ) K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\\
&K_3 \xrightarrow{\partial_3} K_2\oplus K_3 \xrightarrow{H_Z(\mathrm{GC})} K_1\oplus K_2\\
&\hspace{2.5cm}H_X(\mathrm{GC})\downarrow\qquad\qquad\qquad\qquad\downarrow(0\ \partial_1)\\
&\hspace{2.5cm}K_0\oplus K_1 \xrightarrow{(0\ \partial_1)} K_0
\end{aligned} degree − 2 − 1 0 1 2 K 3 ∂ 3 K 2 ⊕ K 3 H Z ( GC ) K 1 ⊕ K 2 H X ( GC ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 ( 0 ∂ 1 ) K 0
By Eq. (13) , its part in degrees − 1 -1 − 1 to 1 1 1 is the complex (1) of the code, and its outer maps are the local relations among the checks shown in Figure 1 .
b. The gluing class. Let C c o d e ( G C ) = Cone ( c ) C_{\mathrm{code}}(\mathrm{GC})=\operatorname{Cone}(c) C code ( GC ) = Cone ( c ) . The short exact sequence 0 → T 1 → C c o d e ( G C ) → T 2 → 0 0\to T_1\to C_{\mathrm{code}}(\mathrm{GC})\to T_2\to0 0 → T 1 → C code ( GC ) → T 2 → 0 and its dual, together with Koszul exactness, show that the code is topological. They also show that C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) is exact in degrees n ≤ 0 n\leq0 n ≤ 0 and that its part in non-negative degrees has the form (5) , so the quotient map C c o d e ( G C ) → τ ≥ 1 C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC})\to\tau_{\geq1}C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) → τ ≥ 1 C code ( GC ) , whose target represents E X ( G C ) \mathcal{E}_X(\mathrm{GC}) E X ( GC ) , is a quasi-isomorphism. Since T j ≃ F p [ − j ] T_j\simeq\mathbb{F}_p[-j] T j ≃ F p [ − j ] , the only nonzero layers are E X 1 ( G C ) ≅ E X 2 ( G C ) ≅ F p E_X^1(\mathrm{GC})\cong E_X^2(\mathrm{GC})\cong\mathbb{F}_p E X 1 ( GC ) ≅ E X 2 ( GC ) ≅ F p .
The inclusion T 1 ↪ C c o d e ( G C ) T_1\hookrightarrow C_{\mathrm{code}}(\mathrm{GC}) T 1 ↪ C code ( GC ) identifies T 1 T_1 T 1 with τ ≤ 1 C c o d e ( G C ) \tau_{\leq1}C_{\mathrm{code}}(\mathrm{GC}) τ ≤ 1 C code ( GC ) in D ( R ) D(R) D ( R ) , so the rotated cone triangle is isomorphic to the truncation triangle:
T 1 ⟶ C c o d e ( G C ) ⟶ T 2 → − c [ 1 ] T 1 [ 1 ] F p [ − 1 ] ⟶ E X ( G C ) ⟶ F p [ − 2 ] → δ 2 ( G C ) F p . \begin{aligned}
T_1&\longrightarrow C_{\mathrm{code}}(\mathrm{GC})\longrightarrow T_2
\xrightarrow{-c[1]}T_1[1]\\
\mathbb{F}_p[-1]&\longrightarrow\mathcal{E}_X(\mathrm{GC})\longrightarrow\mathbb{F}_p[-2]
\xrightarrow{\delta_2(\mathrm{GC})}\mathbb{F}_p.
\end{aligned} T 1 F p [ − 1 ] ⟶ C code ( GC ) ⟶ T 2 − c [ 1 ] T 1 [ 1 ] ⟶ E X ( GC ) ⟶ F p [ − 2 ] δ 2 ( GC ) F p .
Thus δ 2 ( G C ) \delta_2(\mathrm{GC}) δ 2 ( GC ) corresponds to − c [ 1 ] -c[1] − c [ 1 ] . Up to sign, it is represented by f = ε c X : K 2 → F p f=\varepsilon c_X:K_2\to\mathbb{F}_p f = ε c X : K 2 → F p , whose plaquette values ( f 12 , f 13 , f 23 ) (f_{12},f_{13},f_{23}) ( f 12 , f 13 , f 23 ) are ( − 1 , 0 , 0 ) (-1,0,0) ( − 1 , 0 , 0 ) .
Restriction to superlattices
In § 2 D, we took the profile of the coarse-grained code to be the restriction of the profile of the original code; in other words, coarse-graining a code and taking its profile commute. This appendix justifies this and proves the results that rest on it.
Profile of the coarse-grained code
We first prove this commutation.
Lemma 8. Let Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D be a superlattice. The coarse-grained code over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is again topological, and its profile and layers are E X ∣ F p [ Λ ] \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] and E X j ∣ F p [ Λ ] E_X^j|_{\mathbb{F}_p[\Lambda]} E X j ∣ F p [ Λ ] .
Proof. Let N = [ Z D : Λ ] N=[\mathbb{Z}^D:\Lambda] N = [ Z D : Λ ] . Fix representatives α 1 , … , α N \alpha_1,\ldots,\alpha_N α 1 , … , α N of Z D / Λ \mathbb{Z}^D/\Lambda Z D /Λ . They label the original unit cells within one unit cell of Λ \Lambda Λ . Sorting the monomials of a Laurent polynomial by the coset of their exponents gives
R = ⨁ k = 1 N F p [ Λ ] x α k . R=\bigoplus_{k=1}^{N}\mathbb{F}_p[\Lambda]x^{\alpha_k}. R = k = 1 ⨁ N F p [ Λ ] x α k .
so R R R is a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -module with basis x α 1 , … , x α N x^{\alpha_1},\ldots,x^{\alpha_N} x α 1 , … , x α N . Restriction of scalars keeps a module and its maps but retains only the action of F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] . It is exact and sends R q R^q R q to F p [ Λ ] N q \mathbb{F}_p[\Lambda]^{Nq} F p [ Λ ] N q : the q q q qudits of each original unit cell become N q Nq N q qudits per unit cell of Λ \Lambda Λ . Replacing each entry h h h of a matrix H H H over R R R by the N × N N\times N N × N matrix over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] of multiplication by h h h in this basis gives the matrix H ∣ F p [ Λ ] H|_{\mathbb{F}_p[\Lambda]} H ∣ F p [ Λ ] of the restricted map. The check matrices of the coarse-grained code are H X ∣ F p [ Λ ] H_X|_{\mathbb{F}_p[\Lambda]} H X ∣ F p [ Λ ] and H Z ∣ F p [ Λ ] H_Z|_{\mathbb{F}_p[\Lambda]} H Z ∣ F p [ Λ ] [32 ] . For example, for D = 1 D=1 D = 1 and Λ = 2 Z \Lambda=2\mathbb{Z} Λ = 2 Z with representatives 0 0 0 and 1 1 1 , multiplication by x x x sends 1 ↦ x 1\mapsto x 1 ↦ x and x ↦ x 2 ⋅ 1 x\mapsto x^2\cdot1 x ↦ x 2 ⋅ 1 , so
x ∣ F p [ Λ ] = ( 0 x 2 1 0 ) . x|_{\mathbb{F}_p[\Lambda]}=
\begin{pmatrix}
0 & x^2\\
1 & 0
\end{pmatrix}. x ∣ F p [ Λ ] = ( 0 1 x 2 0 ) .
a unit translation moves the first original cell of a coarse-grained cell to the second, and the second to the first original cell of the next coarse-grained cell.
The profile is defined through the dagger and through duals into R R R , so we need to check that restriction is compatible with both. For the dagger, recall that the coefficient of x α x^\alpha x α in u † v u^\dagger v u † v is the commutation exponent of Z ( v ) Z(v) Z ( v ) with the translate of X ( u ) X(u) X ( u ) by α \alpha α (§ 2 A). The coarse-grained code sees only the translates by α ∈ Λ \alpha\in\Lambda α ∈ Λ , so its symplectic form should keep only these coefficients. Accordingly, let θ : R → F p [ Λ ] \theta:R\to\mathbb{F}_p[\Lambda] θ : R → F p [ Λ ] keep the monomials with exponents in Λ \Lambda Λ and discard the others. In the example above, θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 \theta(a_0+a_1x+a_2x^2+a_3x^3)=a_0+a_2x^2 θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 . The map θ \theta θ is F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear, commutes with the antipode because Λ = − Λ \Lambda=-\Lambda Λ = − Λ , and satisfies θ ( x − α k x α l ) = 1 \theta(x^{-\alpha_k}x^{\alpha_l})=1 θ ( x − α k x α l ) = 1 if k = l k=l k = l and 0 0 0 otherwise, since α l − α k ∈ Λ \alpha_l-\alpha_k\in\Lambda α l − α k ∈ Λ only for k = l k=l k = l . Writing u = ∑ k x α k u k u=\sum_k x^{\alpha_k}u_k u = ∑ k x α k u k and v = ∑ l x α l v l v=\sum_l x^{\alpha_l}v_l v = ∑ l x α l v l with u k , v l ∈ F p [ Λ ] q u_k,v_l\in\mathbb{F}_p[\Lambda]^q u k , v l ∈ F p [ Λ ] q , we obtain
θ ( u † v ) = ∑ k u k † v k , \theta(u^\dagger v)=\sum_k u_k^\dagger v_k, θ ( u † v ) = k ∑ u k † v k ,
the standard form in the expanded coordinates, as expected. Applying θ \theta θ to ( H u ) † v = u † ( H † v ) (Hu)^\dagger v=u^\dagger(H^\dagger v) ( H u ) † v = u † ( H † v ) therefore shows that ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] (H|_{\mathbb{F}_p[\Lambda]})^\dagger=(H^\dagger)|_{\mathbb{F}_p[\Lambda]} ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] . Consequently, the coarse-grained check matrices satisfy the topological condition (1) over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , and the coarse-grained code has the module M X ∣ F p [ Λ ] M_X|_{\mathbb{F}_p[\Lambda]} M X ∣ F p [ Λ ] .
For duals, let P P P be a finite free R R R -module with basis e i e_i e i . Composition with θ \theta θ gives an F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear map
Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ] ) , f ⟼ θ ∘ f . \operatorname{Hom}_R(P,R)|_{\mathbb{F}_p[\Lambda]}\longrightarrow\operatorname{Hom}_{\mathbb{F}_p[\Lambda]}(P|_{\mathbb{F}_p[\Lambda]},\mathbb{F}_p[\Lambda]),
\qquad
f\longmapsto\theta\circ f. Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ]) , f ⟼ θ ∘ f .
@page 13/22 starts_mid=1 ends_mid=1 between the complexes of the two toric codes (§ 2 B):
degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 → − ∂ 3 K 2 → − ∂ 2 K 1 → − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 → ∂ 3 K 2 → ∂ 2 K 1 → ∂ 1 K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\quad3\\
&T_2[-1]\quad K_3 \xrightarrow{-\partial_3} K_2 \xrightarrow{-\partial_2} K_1 \xrightarrow{-\partial_1} K_0\\
&\hspace{5.2cm}\downarrow c_Z\qquad\qquad\downarrow c_X\\
&T_1\quad K_3 \xrightarrow{\partial_3} K_2 \xrightarrow{\partial_2} K_1 \xrightarrow{\partial_1} K_0
\end{aligned} degree − 2 − 1 0 1 2 3 T 2 [ − 1 ] K 3 − ∂ 3 K 2 − ∂ 2 K 1 − ∂ 1 K 0 ↓ c Z ↓ c X T 1 K 3 ∂ 3 K 2 ∂ 2 K 1 ∂ 1 K 0
The shift by one degree reverses the sign of the differential in the top row, so the square containing c Z c_Z c Z and c X c_X c X commutes because ∂ 1 c Z + c X ∂ 3 = 0 \partial_1c_Z+c_X\partial_3=0 ∂ 1 c Z + c X ∂ 3 = 0 , as c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 c_X\partial_3e_{123}=-w_3e_{\varnothing}=-\partial_1c_Ze_{123} c X ∂ 3 e 123 = − w 3 e ∅ = − ∂ 1 c Z e 123 .
With the convention recalled in Appendix A 1, the mapping cone Cone ( c ) \operatorname{Cone}(c) Cone ( c ) has the term ( T 1 ) n ⊕ ( T 2 ) n (T_1)^n\oplus(T_2)^n ( T 1 ) n ⊕ ( T 2 ) n in degree n n n and the differential ( ∂ 0 0 ∂ ) \left(\begin{smallmatrix}\partial&0\\0&\partial\end{smallmatrix}\right) ( ∂ 0 0 ∂ ) . Written out, it is
degree − 2 − 1 0 1 2 K 3 → ∂ 3 K 2 ⊕ K 3 → H Z ( G C ) K 1 ⊕ K 2 H X ( G C ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 → ( 0 ∂ 1 ) K 0 \begin{aligned}
&\text{degree}\quad-2\quad-1\quad0\quad1\quad2\\
&K_3 \xrightarrow{\partial_3} K_2\oplus K_3 \xrightarrow{H_Z(\mathrm{GC})} K_1\oplus K_2\\
&\hspace{2.5cm}H_X(\mathrm{GC})\downarrow\qquad\qquad\qquad\qquad\downarrow(0\ \partial_1)\\
&\hspace{2.5cm}K_0\oplus K_1 \xrightarrow{(0\ \partial_1)} K_0
\end{aligned} degree − 2 − 1 0 1 2 K 3 ∂ 3 K 2 ⊕ K 3 H Z ( GC ) K 1 ⊕ K 2 H X ( GC ) ↓ ↓ ( 0 ∂ 1 ) K 0 ⊕ K 1 ( 0 ∂ 1 ) K 0
By Eq. (13) , its part in degrees − 1 -1 − 1 to 1 1 1 is the complex (1) of the code, and its outer maps are the local relations among the checks shown in Figure 1 .
b. The gluing class. Let C c o d e ( G C ) = Cone ( c ) C_{\mathrm{code}}(\mathrm{GC})=\operatorname{Cone}(c) C code ( GC ) = Cone ( c ) . The short exact sequence 0 → T 1 → C c o d e ( G C ) → T 2 → 0 0\to T_1\to C_{\mathrm{code}}(\mathrm{GC})\to T_2\to0 0 → T 1 → C code ( GC ) → T 2 → 0 and its dual, together with Koszul exactness, show that the code is topological. They also show that C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) is exact in degrees n ≤ 0 n\leq0 n ≤ 0 and that its part in non-negative degrees has the form (5) , so the quotient map C c o d e ( G C ) → τ ≥ 1 C c o d e ( G C ) C_{\mathrm{code}}(\mathrm{GC})\to\tau_{\geq1}C_{\mathrm{code}}(\mathrm{GC}) C code ( GC ) → τ ≥ 1 C code ( GC ) , whose target represents E X ( G C ) \mathcal{E}_X(\mathrm{GC}) E X ( GC ) , is a quasi-isomorphism. Since T j ≃ F p [ − j ] T_j\simeq\mathbb{F}_p[-j] T j ≃ F p [ − j ] , the only nonzero layers are E X 1 ( G C ) ≅ E X 2 ( G C ) ≅ F p E_X^1(\mathrm{GC})\cong E_X^2(\mathrm{GC})\cong\mathbb{F}_p E X 1 ( GC ) ≅ E X 2 ( GC ) ≅ F p .
The inclusion T 1 ↪ C c o d e ( G C ) T_1\hookrightarrow C_{\mathrm{code}}(\mathrm{GC}) T 1 ↪ C code ( GC ) identifies T 1 T_1 T 1 with τ ≤ 1 C c o d e ( G C ) \tau_{\leq1}C_{\mathrm{code}}(\mathrm{GC}) τ ≤ 1 C code ( GC ) in D ( R ) D(R) D ( R ) , so the rotated cone triangle is isomorphic to the truncation triangle:
T 1 ⟶ C c o d e ( G C ) ⟶ T 2 → − c [ 1 ] T 1 [ 1 ] F p [ − 1 ] ⟶ E X ( G C ) ⟶ F p [ − 2 ] → δ 2 ( G C ) F p . \begin{aligned}
T_1&\longrightarrow C_{\mathrm{code}}(\mathrm{GC})\longrightarrow T_2
\xrightarrow{-c[1]}T_1[1]\\
\mathbb{F}_p[-1]&\longrightarrow\mathcal{E}_X(\mathrm{GC})\longrightarrow\mathbb{F}_p[-2]
\xrightarrow{\delta_2(\mathrm{GC})}\mathbb{F}_p.
\end{aligned} T 1 F p [ − 1 ] ⟶ C code ( GC ) ⟶ T 2 − c [ 1 ] T 1 [ 1 ] ⟶ E X ( GC ) ⟶ F p [ − 2 ] δ 2 ( GC ) F p .
Thus δ 2 ( G C ) \delta_2(\mathrm{GC}) δ 2 ( GC ) corresponds to − c [ 1 ] -c[1] − c [ 1 ] . Up to sign, it is represented by f = ε c X : K 2 → F p f=\varepsilon c_X:K_2\to\mathbb{F}_p f = ε c X : K 2 → F p , whose plaquette values ( f 12 , f 13 , f 23 ) (f_{12},f_{13},f_{23}) ( f 12 , f 13 , f 23 ) are ( − 1 , 0 , 0 ) (-1,0,0) ( − 1 , 0 , 0 ) .
Restriction to superlattices
In § 2 D, we took the profile of the coarse-grained code to be the restriction of the profile of the original code; in other words, coarse-graining a code and taking its profile commute. This appendix justifies this and proves the results that rest on it.
Profile of the coarse-grained code
We first prove this commutation.
Lemma 8. Let Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D be a superlattice. The coarse-grained code over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is again topological, and its profile and layers are E X ∣ F p [ Λ ] \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] and E X j ∣ F p [ Λ ] E_X^j|_{\mathbb{F}_p[\Lambda]} E X j ∣ F p [ Λ ] .
Proof. Let N = [ Z D : Λ ] N=[\mathbb{Z}^D:\Lambda] N = [ Z D : Λ ] . Fix representatives α 1 , … , α N \alpha_1,\ldots,\alpha_N α 1 , … , α N of Z D / Λ \mathbb{Z}^D/\Lambda Z D /Λ . They label the original unit cells within one unit cell of Λ \Lambda Λ . Sorting the monomials of a Laurent polynomial by the coset of their exponents gives
R = ⨁ k = 1 N F p [ Λ ] x α k . R=\bigoplus_{k=1}^{N}\mathbb{F}_p[\Lambda]x^{\alpha_k}. R = k = 1 ⨁ N F p [ Λ ] x α k .
so R R R is a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -module with basis x α 1 , … , x α N x^{\alpha_1},\ldots,x^{\alpha_N} x α 1 , … , x α N . Restriction of scalars keeps a module and its maps but retains only the action of F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] . It is exact and sends R q R^q R q to F p [ Λ ] N q \mathbb{F}_p[\Lambda]^{Nq} F p [ Λ ] N q : the q q q qudits of each original unit cell become N q Nq N q qudits per unit cell of Λ \Lambda Λ . Replacing each entry h h h of a matrix H H H over R R R by the N × N N\times N N × N matrix over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] of multiplication by h h h in this basis gives the matrix H ∣ F p [ Λ ] H|_{\mathbb{F}_p[\Lambda]} H ∣ F p [ Λ ] of the restricted map. The check matrices of the coarse-grained code are H X ∣ F p [ Λ ] H_X|_{\mathbb{F}_p[\Lambda]} H X ∣ F p [ Λ ] and H Z ∣ F p [ Λ ] H_Z|_{\mathbb{F}_p[\Lambda]} H Z ∣ F p [ Λ ] [32 ] . For example, for D = 1 D=1 D = 1 and Λ = 2 Z \Lambda=2\mathbb{Z} Λ = 2 Z with representatives 0 0 0 and 1 1 1 , multiplication by x x x sends 1 ↦ x 1\mapsto x 1 ↦ x and x ↦ x 2 ⋅ 1 x\mapsto x^2\cdot1 x ↦ x 2 ⋅ 1 , so
x ∣ F p [ Λ ] = ( 0 x 2 1 0 ) . x|_{\mathbb{F}_p[\Lambda]}=
\begin{pmatrix}
0 & x^2\\
1 & 0
\end{pmatrix}. x ∣ F p [ Λ ] = ( 0 1 x 2 0 ) .
a unit translation moves the first original cell of a coarse-grained cell to the second, and the second to the first original cell of the next coarse-grained cell.
The profile is defined through the dagger and through duals into R R R , so we need to check that restriction is compatible with both. For the dagger, recall that the coefficient of x α x^\alpha x α in u † v u^\dagger v u † v is the commutation exponent of Z ( v ) Z(v) Z ( v ) with the translate of X ( u ) X(u) X ( u ) by α \alpha α (§ 2 A). The coarse-grained code sees only the translates by α ∈ Λ \alpha\in\Lambda α ∈ Λ , so its symplectic form should keep only these coefficients. Accordingly, let θ : R → F p [ Λ ] \theta:R\to\mathbb{F}_p[\Lambda] θ : R → F p [ Λ ] keep the monomials with exponents in Λ \Lambda Λ and discard the others. In the example above, θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 \theta(a_0+a_1x+a_2x^2+a_3x^3)=a_0+a_2x^2 θ ( a 0 + a 1 x + a 2 x 2 + a 3 x 3 ) = a 0 + a 2 x 2 . The map θ \theta θ is F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear, commutes with the antipode because Λ = − Λ \Lambda=-\Lambda Λ = − Λ , and satisfies θ ( x − α k x α l ) = 1 \theta(x^{-\alpha_k}x^{\alpha_l})=1 θ ( x − α k x α l ) = 1 if k = l k=l k = l and 0 0 0 otherwise, since α l − α k ∈ Λ \alpha_l-\alpha_k\in\Lambda α l − α k ∈ Λ only for k = l k=l k = l . Writing u = ∑ k x α k u k u=\sum_k x^{\alpha_k}u_k u = ∑ k x α k u k and v = ∑ l x α l v l v=\sum_l x^{\alpha_l}v_l v = ∑ l x α l v l with u k , v l ∈ F p [ Λ ] q u_k,v_l\in\mathbb{F}_p[\Lambda]^q u k , v l ∈ F p [ Λ ] q , we obtain
θ ( u † v ) = ∑ k u k † v k , \theta(u^\dagger v)=\sum_k u_k^\dagger v_k, θ ( u † v ) = k ∑ u k † v k ,
the standard form in the expanded coordinates, as expected. Applying θ \theta θ to ( H u ) † v = u † ( H † v ) (Hu)^\dagger v=u^\dagger(H^\dagger v) ( H u ) † v = u † ( H † v ) therefore shows that ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] (H|_{\mathbb{F}_p[\Lambda]})^\dagger=(H^\dagger)|_{\mathbb{F}_p[\Lambda]} ( H ∣ F p [ Λ ] ) † = ( H † ) ∣ F p [ Λ ] . Consequently, the coarse-grained check matrices satisfy the topological condition (1) over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , and the coarse-grained code has the module M X ∣ F p [ Λ ] M_X|_{\mathbb{F}_p[\Lambda]} M X ∣ F p [ Λ ] .
For duals, let P P P be a finite free R R R -module with basis e i e_i e i . Composition with θ \theta θ gives an F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear map
Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ] ) , f ⟼ θ ∘ f . \operatorname{Hom}_R(P,R)|_{\mathbb{F}_p[\Lambda]}\longrightarrow\operatorname{Hom}_{\mathbb{F}_p[\Lambda]}(P|_{\mathbb{F}_p[\Lambda]},\mathbb{F}_p[\Lambda]),
\qquad
f\longmapsto\theta\circ f. Hom R ( P , R ) ∣ F p [ Λ ] ⟶ Hom F p [ Λ ] ( P ∣ F p [ Λ ] , F p [ Λ ]) , f ⟼ θ ∘ f .
natural in P P P . It is bijective. An R R R -linear map f f f is determined by the elements f ( e i ) ∈ R f(e_i)\in R f ( e i ) ∈ R , each of which has N N N coordinates in F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , f ( e i ) = ∑ α x α f i α f(e_i)=\sum_{\alpha}x^\alpha f_{i\alpha} f ( e i ) = ∑ α x α f i α . An F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linear map on P ‾ F p [ Λ ] \overline{P}_{\mathbb{F}_p[\Lambda]} P F p [ Λ ] is determined by its values on the F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -basis x α e i x^\alpha e_i x α e i . Since R R R acts on P ‾ \overline{P} P through the antipode, ( θ ∘ f ) ( x α e i ) = θ ( x − α f ( e i ) ) = f i α (\theta\circ f)(x^\alpha e_i)=\theta(x^{-\alpha}f(e_i))=f_{i\alpha} ( θ ∘ f ) ( x α e i ) = θ ( x − α f ( e i )) = f i α , so the map f ↦ θ ∘ f f\mapsto\theta\circ f f ↦ θ ∘ f matches the two sets of data.
Finally, restricting the resolution (4) term by term gives a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -resolution of M X ∣ F p [ Λ ] M_X|_{\mathbb{F}_p[\Lambda]} M X ∣ F p [ Λ ] , because restriction is exact and sends finite free modules to finite free modules. Since ( H X † ) ∣ F p [ Λ ] = ( H X ∣ F p [ Λ ] ) † (H_X^\dagger)|_{\mathbb{F}_p[\Lambda]}=(H_X|_{\mathbb{F}_p[\Lambda]})^\dagger ( H X † ) ∣ F p [ Λ ] = ( H X ∣ F p [ Λ ] ) † , it begins with the checks of the coarse-grained code, as Eq. (4) does for the original one. Applying the isomorphism above term by term identifies its dual with the restriction of the complex (5) . The identification respects the differentials because the isomorphism is natural. Since restriction is exact, it commutes with truncation and cohomology, so the profile and layers of the coarse-grained code are E X ∣ F p [ Λ ] E_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] and E X j ∣ F p [ Λ ] E_X^j|_{\mathbb{F}_p[\Lambda]} E X j ∣ F p [ Λ ] .
Gluing classes on a superlattice
Sections III A and IV A described a gluing class by its values on unit cells and stated that coarse-graining by a factor of p p p in every direction removes it. We now prove these statements and compute the values on a general superlattice, starting with Lemma 1, which we restate. Throughout this subsection, R = F p [ Λ t r i v ] R=\mathbb{F}_p[\Lambda_{\mathrm{triv}}] R = F p [ Λ triv ] as in § 2 D, and A A A and B B B are R R R -modules that are finite dimensional over F p \mathbb{F}_p F p , with m A = m B = 0 \mathfrak{m}_A=\mathfrak{m}_B=0 m A = m B = 0 .
Lemma 1. Every class κ ∈ Ext R n ( A , B ) \kappa\in\operatorname{Ext}^{n}_{R}(A,B) κ ∈ Ext R n ( A , B ) is represented, on the free resolution K ∙ ⊗ F p A K_\bullet\otimes_{\mathbb{F}_p}A K ∙ ⊗ F p A of A A A , by a unique R R R -linear map f : K n ⊗ F p A → B f:K_n\otimes_{\mathbb{F}_p}A\to B f : K n ⊗ F p A → B , and
Ext R n ( A , B ) ≅ Hom R ( K n ⊗ F p A , B ) ≅ ⨁ ∣ I ∣ = n Hom F p ( A , B ) , \operatorname{Ext}^{n}_{R}(A,B)\cong\operatorname{Hom}_{R}(K_n\otimes_{\mathbb{F}_p}A,B)\cong\bigoplus_{|I|=n}\operatorname{Hom}_{\mathbb{F}_p}(A,B), Ext R n ( A , B ) ≅ Hom R ( K n ⊗ F p A , B ) ≅ ∣ I ∣ = n ⨁ Hom F p ( A , B ) , where the second isomorphism sends f f f to the maps f I : a ↦ f ( e I ⊗ a ) f_I:a\mapsto f(e_I\otimes a) f I : a ↦ f ( e I ⊗ a ) . Since translations act trivially on B B B , the class κ \kappa κ thus assigns the value f I f_I f I to every unit n n n -cell of orientation I I I .
Proof. Since R R R acts on A A A through the augmentation, the Koszul resolution of F p \mathbb{F}_p F p gives the free resolution K ∙ ⊗ F p A K_\bullet\otimes_{\mathbb{F}_p}A K ∙ ⊗ F p A of A A A , with R R R acting on the first factor. Its terms K k ⊗ F p A ≅ K dim F p A K_k\otimes_{\mathbb{F}_p}A\cong K^{\dim_{\mathbb{F}_p}A} K k ⊗ F p A ≅ K d i m F p A have the basis e I ⊗ a e_I\otimes a e I ⊗ a , with a a a running over a basis of A A A , and its augmentation r ⊗ a ↦ ε ( r ) a r\otimes a\mapsto\varepsilon(r)a r ⊗ a ↦ ε ( r ) a is R R R -linear. By Appendix A 1, Ext R n ( A , B ) \operatorname{Ext}^{n}_{R}(A,B) Ext R n ( A , B ) consists of the R R R -linear maps f : K n ⊗ F p A → B f:K_n\otimes_{\mathbb{F}_p}A\to B f : K n ⊗ F p A → B with f ∂ n + 1 = 0 f\partial_{n+1}=0 f ∂ n + 1 = 0 , modulo the maps h ∂ n h\partial_n h ∂ n . Each term of ∂ \partial ∂ in Eq. (3) multiplies by some w i w_i w i , which acts as zero on B B B . Hence f ∂ n + 1 = 0 f\partial_{n+1}=0 f ∂ n + 1 = 0 for every f f f and h ∂ n = 0 h\partial_n=0 h ∂ n = 0 for every h h h , so Ext R n ( A , B ) \operatorname{Ext}^{n}_{R}(A,B) Ext R n ( A , B ) is the group of all R R R -linear maps f f f . Such a map can take arbitrary values on the basis e I ⊗ a e_I\otimes a e I ⊗ a . For each I I I , its values on the e I ⊗ a e_I\otimes a e I ⊗ a form the linear map f I ∈ Hom F p ( A , B ) f_I\in\operatorname{Hom}_{\mathbb{F}_p}(A,B) f I ∈ Hom F p ( A , B ) . □
For a superlattice Λ ⊆ Λ t r i v \Lambda\subseteq\Lambda_{\mathrm{triv}} Λ ⊆ Λ triv , translations in Λ \Lambda Λ still act trivially on A A A and B B B . By Lemma 1 over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , a class restricted to F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is therefore again a table of values, now on the unit cells of Λ \Lambda Λ .
Let κ ∈ Ext R n ( A , B ) \kappa\in\operatorname{Ext}^{n}_{R}(A,B) κ ∈ Ext R n ( A , B ) with n > 0 n>0 n > 0 , and let f I f_I f I be its values from Lemma 1. For v 1 , … , v n ∈ Λ v_1,\ldots,v_n\in\Lambda v 1 , … , v n ∈ Λ , let det I ( v 1 , … , v n ) \det_I(v_1,\ldots,v_n) det I ( v 1 , … , v n ) be the n × n n\times n n × n minor of their coordinates, with respect to β 1 , … , β D \beta_1,\ldots,\beta_D β 1 , … , β D , formed by the directions in I I I . Geometrically, it is the signed volume of the projection of the parallelepiped spanned by the v k v_k v k onto these directions. We define κ ( v 1 , … , v n ) ∈ Hom F p ( A , B ) \kappa(v_1,\ldots,v_n)\in\operatorname{Hom}_{\mathbb{F}_p}(A,B) κ ( v 1 , … , v n ) ∈ Hom F p ( A , B ) by
κ ( v 1 , … , v n ) = ∑ ∣ I ∣ = n det I ( v 1 , … , v n ) f I . (15) \kappa(v_1,\ldots,v_n)=\sum_{|I|=n}\det_I(v_1,\ldots,v_n)f_I. \tag*{(15)} κ ( v 1 , … , v n ) = ∣ I ∣ = n ∑ I det ( v 1 , … , v n ) f I . (15)
The next lemma computes the values of the restricted class in terms of this function.
Lemma 9. Let κ ∈ Ext R n ( A , B ) \kappa\in\operatorname{Ext}^{n}_{R}(A,B) κ ∈ Ext R n ( A , B ) with n > 0 n>0 n > 0 , with values f I f_I f I as in Lemma 1, and let Λ ⊆ Λ t r i v \Lambda\subseteq\Lambda_{\mathrm{triv}} Λ ⊆ Λ triv be a superlattice with basis μ 1 , … , μ D \mu_1,\ldots,\mu_D μ 1 , … , μ D . Let K ∙ ′ K'_\bullet K ∙ ′ be the Koszul complex over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] built from x μ j − 1 x^{\mu_j}-1 x μ j − 1 as in § 2 B, with cells e J ′ e'_J e J ′ . On the free resolution K ∙ ′ ⊗ F p A K'_\bullet\otimes_{\mathbb{F}_p}A K ∙ ′ ⊗ F p A of A ∣ F p [ Λ ] A|_{\mathbb{F}_p[\Lambda]} A ∣ F p [ Λ ] , the restriction of κ \kappa κ to F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] takes the value
κ ( μ j 1 , … , μ j n ) = ∑ ∣ I ∣ = n det I ( μ j 1 , … , μ j n ) f I \kappa(\mu_{j_1},\ldots,\mu_{j_n})=\sum_{|I|=n}\det_I(\mu_{j_1},\ldots,\mu_{j_n})f_I κ ( μ j 1 , … , μ j n ) = ∣ I ∣ = n ∑ I det ( μ j 1 , … , μ j n ) f I on every cell e J ′ e'_J e J ′ , with J = { j 1 < ⋯ < j n } J=\{j_1<\cdots<j_n\} J = { j 1 < ⋯ < j n } . Here det I \det_I det I is the n × n n\times n n × n minor of the coordinates of μ j 1 , … , μ j n \mu_{j_1},\ldots,\mu_{j_n} μ j 1 , … , μ j n with respect to β 1 , … , β D \beta_1,\ldots,\beta_D β 1 , … , β D , formed by the directions in I I I .
Proof. Let f f f represent κ \kappa κ as in Lemma 1. Since R R R is free over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] (proof of Lemma 8), K ∙ ∣ F p [ Λ ] ⊗ F p A K_\bullet|_{\mathbb{F}_p[\Lambda]}\otimes_{\mathbb{F}_p}A K ∙ ∣ F p [ Λ ] ⊗ F p A is a free F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -resolution of A ∣ F p [ Λ ] A|_{\mathbb{F}_p[\Lambda]} A ∣ F p [ Λ ] , on which f f f still represents the restriction of κ \kappa κ . To read off its values on the cells e J ′ e'_J e J ′ , we move it to K ∙ ′ ⊗ F p A K'_\bullet\otimes_{\mathbb{F}_p}A K ∙ ′ ⊗ F p A along a chain map χ : K ∙ ′ → K ∙ ∣ F p [ Λ ] \chi:K'_\bullet\to K_\bullet|_{\mathbb{F}_p[\Lambda]} χ : K ∙ ′ → K ∙ ∣ F p [ Λ ] that lifts the identity of F p \mathbb{F}_p F p . Such a χ \chi χ writes each cell of Λ \Lambda Λ as a chain of unit cells of Λ t r i v \Lambda_{\mathrm{triv}} Λ triv .
We build χ \chi χ degree by degree. In degree zero, χ \chi χ is the inclusion F p [ Λ ] ⊂ R \mathbb{F}_p[\Lambda]\subset R F p [ Λ ] ⊂ R . In degree one, χ \chi χ coarse-grains edges. Let ℓ j ∈ K 1 \ell_j\in K_1 ℓ j ∈ K 1 be the lattice path from the origin to μ j \mu_j μ j that takes μ j , 1 \mu_{j,1} μ j , 1 steps along β 1 \beta_1 β 1 , then μ j , 2 \mu_{j,2} μ j , 2 steps along β 2 \beta_2 β 2 , and so on; a step from α \alpha α to α + β i \alpha+\beta_i α + β i contributes x α e i x^{\alpha}e_i x α e i , and a step from α \alpha α to α − β i \alpha-\beta_i α − β i contributes − x α − β i e i -x^{\alpha-\beta_i}e_i − x α − β i e i . We set χ ( e j ′ ) = ℓ j \chi(e'_j)=\ell_j χ ( e j ′ ) = ℓ j , with e j ′ = e { j } ′ e'_j=e'_{\{j\}} e j ′ = e { j } ′ . In higher degrees, χ \chi χ is the exterior product of these paths,
χ ( e j 1 ′ ∧ ⋯ ∧ e j n ′ ) = ℓ j 1 ∧ ⋯ ∧ ℓ j n , j 1 < ⋯ < j n , \chi(e'_{j_1}\wedge\cdots\wedge e'_{j_n})=\ell_{j_1}\wedge\cdots\wedge\ell_{j_n},\qquad j_1<\cdots<j_n, χ ( e j 1 ′ ∧ ⋯ ∧ e j n ′ ) = ℓ j 1 ∧ ⋯ ∧ ℓ j n , j 1 < ⋯ < j n ,
extended F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] -linearly; geometrically, the right-hand side is the prism spanned by the paths.
The intermediate vertices of ℓ j \ell_j ℓ j cancel in its boundary, so ∂ ℓ j = x μ j − 1 = ∂ ′ e j ′ \partial\ell_j=x^{\mu_j}-1=\partial'e'_j ∂ ℓ j = x μ j − 1 = ∂ ′ e j ′ . The differential (3) is the derivation of the exterior algebra K K K , with ∂ e i = w i \partial e_i=w_i ∂ e i = w i , so it obeys the Leibniz rule ∂ ( u ∧ v ) = ( ∂ u ) ∧ v + ( − 1 ) k u ∧ ∂ v \partial(u\wedge v)=(\partial u)\wedge v+(-1)^k u\wedge\partial v ∂ ( u ∧ v ) = ( ∂ u ) ∧ v + ( − 1 ) k u ∧ ∂ v for u ∈ K k u\in K_k u ∈ K k , and likewise for ∂ ′ \partial' ∂ ′ . Since each ∂ ℓ j \partial\ell_j ∂ ℓ j is a scalar in K 0 = R K_0=R K 0 = R , it follows that ∂ χ ( e J ′ ) = ∑ k ( − 1 ) k − 1 ( x μ j k − 1 ) χ ( e J ∖ { j k } ′ ) = χ ( ∂ ′ e J ′ ) \partial\chi(e'_J)=\sum_k(-1)^{k-1}(x^{\mu_{j_k}}-1)\chi(e'_{J\setminus\{j_k\}})=\chi(\partial'e'_J) ∂ χ ( e J ′ ) = ∑ k ( − 1 ) k − 1 ( x μ j k − 1 ) χ ( e J ∖ { j k } ′ ) = χ ( ∂ ′ e J ′ ) . Thus χ \chi χ is a chain map, and degree zero it lifts the identity of F p \mathbb{F}_p F p . By the comparison theorem [35 Thm. 2.2.6] , the restriction of κ \kappa κ is represented on K ∙ ′ ⊗ F p A K'_{\bullet}\otimes_{\mathbb{F}_p} A K ∙ ′ ⊗ F p A by f ( χ ⊗ I A ) f(\chi\otimes I_A) f ( χ ⊗ I A ) . By Lemma 1 over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , it is the table of the values a ↦ f ( χ ( e J ′ ) ⊗ a ) a\mapsto f(\chi(e'_J)\otimes a) a ↦ f ( χ ( e J ′ ) ⊗ a ) on the cells e J ′ e'_J e J ′ .
It remains to evaluate f f f on χ ( e J ′ ) \chi(e'_J) χ ( e J ′ ) . Since translations act trivially on B B B , f ( x α e I ⊗ a ) = f I ( a ) f(x^\alpha e_I\otimes a)=f_I(a) f ( x α e I ⊗ a ) = f I ( a ) for every α \alpha α , so f f f evaluated on a chain in K n K_n K n depends only on the number of cells of each orientation I I I in it, counted with their coefficients. Setting every x i x_i x i to 1, that is, applying ϵ \epsilon ϵ to the coefficients, computes these numbers, respects the wedge product, and turns each path ℓ j \ell_j ℓ j into its net displacement ∑ i μ j , i e i \sum_i\mu_{j,i}e_i ∑ i μ j , i e i . The numbers for χ ( e J ′ ) \chi(e'_J) χ ( e J ′ ) are the coefficients of
( ∑ i μ j 1 , i e i ) ∧ ⋯ ∧ ( ∑ i μ j n , i e i ) = ∑ ∣ I ∣ = n det I ( μ j 1 , … , μ j n ) e I . \left(\sum_i \mu_{j_1,i}e_i\right)\wedge\cdots\wedge\left(\sum_i \mu_{j_n,i}e_i\right)
= \sum_{|I|=n}\det_I(\mu_{j_1},\ldots,\mu_{j_n})e_I. ( i ∑ μ j 1 , i e i ) ∧ ⋯ ∧ ( i ∑ μ j n , i e i ) = ∣ I ∣ = n ∑ I det ( μ j 1 , … , μ j n ) e I .
The restricted class therefore takes the value ∑ I det I ( μ j 1 , … , μ j n ) f I = κ ( μ j 1 , … , μ j n ) \sum_I\det_I(\mu_{j_1},\ldots,\mu_{j_n})f_I=\kappa(\mu_{j_1},\ldots,\mu_{j_n}) ∑ I det I ( μ j 1 , … , μ j n ) f I = κ ( μ j 1 , … , μ j n ) on e J ′ e'_J e J ′ .
Lemma 2. Let A A A and B B B be R R R -modules that are finite dimensional over F p \mathbb{F}_p F p , with m A = m B = 0 \mathfrak{m}A=\mathfrak{m}B=0 m A = m B = 0 . For every n > 0 n>0 n > 0 , every class in Ext R n ( A , B ) \operatorname{Ext}^n_R(A,B) Ext R n ( A , B ) restricts to zero over F p [ p Λ t r i v ] \mathbb{F}_p[p\Lambda_{\mathrm{triv}}] F p [ p Λ triv ] .
Proof. Apply Lemma 9 with Λ = p Λ t r i v \Lambda=p\Lambda_{\mathrm{triv}} Λ = p Λ triv and the basis μ j = p β j \mu_j=p\beta_j μ j = p β j . For n > 0 n>0 n > 0 , every det I ( μ j 1 , … , μ j n ) = p n det I ( β j 1 , … , β j n ) \det_I(\mu_{j_1},\ldots,\mu_{j_n})=p^n\det_I(\beta_{j_1},\ldots,\beta_{j_n}) det I ( μ j 1 , … , μ j n ) = p n det I ( β j 1 , … , β j n ) vanishes in F p \mathbb{F}_p F p , so every value of the restricted class is zero. By Lemma 1 over F p [ p Λ t r i v ] \mathbb{F}_p[p\Lambda_{\mathrm{triv}}] F p [ p Λ triv ] , the restriction is zero.
Minimizing the coarse-graining
Line 6 of Algorithm 1 coarse-grains by a factor of p p p in every direction once for each layer it detaches, which may be more than necessary. We now determine the superlattices Λ ⊆ Λ t r i v \Lambda\subseteq\Lambda_{\mathrm{triv}} Λ ⊆ Λ triv over which a given gluing class restricts to zero.
Let π : Λ t r i v → F p D \pi:\Lambda_{\mathrm{triv}}\to\mathbb{F}_p^D π : Λ triv → F p D send a lattice vector to its coordinates, with respect to β 1 , … , β D \beta_1,\ldots,\beta_D β 1 , … , β D , modulo p p p ; its kernel is p Λ t r i v p\Lambda_{\mathrm{triv}} p Λ triv . The value κ ( ν 1 , … , ν n ) \kappa(\nu_1,\ldots,\nu_n) κ ( ν 1 , … , ν n ) depends only on π ( ν 1 ) , … , π ( ν n ) \pi(\nu_1),\ldots,\pi(\nu_n) π ( ν 1 ) , … , π ( ν n ) . We say that κ \kappa κ vanishes on a subspace W ⊆ F p D W\subseteq\mathbb{F}_p^D W ⊆ F p D if κ ( ν 1 , … , ν n ) = 0 \kappa(\nu_1,\ldots,\nu_n)=0 κ ( ν 1 , … , ν n ) = 0 whenever π ( ν k ) ∈ W \pi(\nu_k)\in W π ( ν k ) ∈ W for all k k k .
Proposition 2 (Vanishing criterion for gluing). Let A A A and B B B be as above, let κ ∈ Ext R n ( A , B ) \kappa\in\operatorname{Ext}^n_R(A,B) κ ∈ Ext R n ( A , B ) with n > 0 n>0 n > 0 , and let Λ ⊆ Λ t r i v \Lambda\subseteq\Lambda_{\mathrm{triv}} Λ ⊆ Λ triv be a superlattice. The class κ \kappa κ restricts to zero over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] if and only if κ \kappa κ vanishes on π ( Λ ) \pi(\Lambda) π ( Λ ) . Moreover, let finitely many classes κ a ∈ Ext R n a ( A a , B a ) \kappa_a\in\operatorname{Ext}^{n_a}_R(A_a,B_a) κ a ∈ Ext R n a ( A a , B a ) be given, with n a > 0 n_a>0 n a > 0 and R R R -modules A a A_a A a and B a B_a B a that are finite dimensional over F p \mathbb{F}_p F p and annihilated by m \mathfrak{m} m . Then
min Λ [ Λ t r i v : Λ ] = p c , c = min W ( D − dim F p W ) , (16) \min_{\Lambda}[\Lambda_{\mathrm{triv}}:\Lambda]=p^c,\qquad c=\min_W(D-\dim_{\mathbb{F}_p}W), \tag*{(16)} Λ min [ Λ triv : Λ ] = p c , c = W min ( D − dim F p W ) , (16) where Λ \Lambda Λ runs over the superlattices over which every κ a \kappa_a κ a restricts to zero, and W W W over the subspaces of F p D \mathbb{F}_p^D F p D on which every κ a \kappa_a κ a vanishes.
Proof. Let μ 1 , … , μ D \mu_1,\ldots,\mu_D μ 1 , … , μ D be a basis of Λ \Lambda Λ . By Lemma 9, the restriction of κ \kappa κ to F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] takes the values κ ( μ j 1 , … , μ j n ) \kappa(\mu_{j_1},\ldots,\mu_{j_n}) κ ( μ j 1 , … , μ j n ) on the cells e J ′ e'_J e J ′ , and by Lemma 1 over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] , it vanishes exactly when all these values vanish. The value κ ( ν 1 , … , ν n ) \kappa(\nu_1,\ldots,\nu_n) κ ( ν 1 , … , ν n ) depends only on π ( ν 1 ) , … , π ( ν n ) \pi(\nu_1),\ldots,\pi(\nu_n) π ( ν 1 ) , … , π ( ν n ) and is multilinear and alternating in them, because every det I \det_I det I is. Every vector of π ( Λ ) \pi(\Lambda) π ( Λ ) is a linear combination of π ( μ 1 ) , … , π ( μ D ) \pi(\mu_1),\ldots,\pi(\mu_D) π ( μ 1 ) , … , π ( μ D ) . Expanding by multilinearity and alternation, every value κ ( ν 1 , … , ν n ) \kappa(\nu_1,\ldots,\nu_n) κ ( ν 1 , … , ν n ) with all π ( ν k ) ∈ π ( Λ ) \pi(\nu_k)\in\pi(\Lambda) π ( ν k ) ∈ π ( Λ ) is a linear combination of the values κ ( μ j 1 , … , μ j n ) \kappa(\mu_{j_1},\ldots,\mu_{j_n}) κ ( μ j 1 , … , μ j n ) with j 1 < ⋯ < j n j_1<\cdots<j_n j 1 < ⋯ < j n . Hence κ \kappa κ vanishes on π ( Λ ) \pi(\Lambda) π ( Λ ) if and only if κ ( μ j 1 , … , μ j n ) = 0 \kappa(\mu_{j_1},\ldots,\mu_{j_n})=0 κ ( μ j 1 , … , μ j n ) = 0 for all j 1 < ⋯ < j n j_1<\cdots<j_n j 1 < ⋯ < j n .
For the second part, let c c c be as in Eq. (16) . First, let Λ \Lambda Λ be a superlattice over which every κ a \kappa_a κ a restricts to zero. Its image π ( Λ ) \pi(\Lambda) π ( Λ ) is a subgroup, hence a subspace, of F p D \mathbb{F}_p^D F p D . Since π \pi π is surjective, composing it with the quotient map F p D → F p D / π ( Λ ) \mathbb{F}_p^D\to\mathbb{F}_p^D/\pi(\Lambda) F p D → F p D / π ( Λ ) gives a surjection Λ t r i v → F p D / π ( Λ ) \Lambda_{\mathrm{triv}}\to\mathbb{F}_p^D/\pi(\Lambda) Λ triv → F p D / π ( Λ ) whose kernel contains Λ \Lambda Λ . It induces a surjection Λ t r i v / Λ → F p D / π ( Λ ) \Lambda_{\mathrm{triv}}/\Lambda\to\mathbb{F}_p^D/\pi(\Lambda) Λ triv /Λ → F p D / π ( Λ ) , so [ Λ t r i v : Λ ] ≥ p D − dim F p π ( Λ ) [\Lambda_{\mathrm{triv}}:\Lambda]\geq p^{D-\dim_{\mathbb{F}_p}\pi(\Lambda)} [ Λ triv : Λ ] ≥ p D − d i m F p π ( Λ ) . By the first part, every κ a \kappa_a κ a vanishes on π ( Λ ) \pi(\Lambda) π ( Λ ) , so π ( Λ ) \pi(\Lambda) π ( Λ ) is one of the subspaces W W W in Eq. (16) , and D − dim F p π ( Λ ) ≥ c D-\dim_{\mathbb{F}_p}\pi(\Lambda)\geq c D − dim F p π ( Λ ) ≥ c . Hence [ Λ t r i v : Λ ] ≥ p c [\Lambda_{\mathrm{triv}}:\Lambda]\geq p^c [ Λ triv : Λ ] ≥ p c .
Conversely, let W W W be a subspace on which every κ a \kappa_a κ a vanishes, with D − dim F p W = c D-\dim_{\mathbb{F}_p}W=c D − dim F p W = c , and let Λ = π − 1 ( W ) \Lambda=\pi^{-1}(W) Λ = π − 1 ( W ) . It contains ker π = p Λ t r i v \ker\pi=p\Lambda_{\mathrm{triv}} ker π = p Λ triv , so it is a superlattice, and π \pi π induces an isomorphism Λ t r i v / Λ ≅ F p D / W \Lambda_{\mathrm{triv}}/\Lambda\cong\mathbb{F}_p^D/W Λ triv /Λ ≅ F p D / W , so [ Λ t r i v : Λ ] = p D − dim F p W = p c [\Lambda_{\mathrm{triv}}:\Lambda]=p^{D-\dim_{\mathbb{F}_p}W}=p^c [ Λ triv : Λ ] = p D − d i m F p W = p c . Since π \pi π is surjective, π ( Λ ) = W \pi(\Lambda)=W π ( Λ ) = W , so every κ a \kappa_a κ a vanishes on π ( Λ ) \pi(\Lambda) π ( Λ ) and, by the first part, restricts to zero over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] . The minimum in Eq. (16) is therefore p c p^c p c .
For Λ = p Λ t r i v \Lambda=p\Lambda_{\mathrm{triv}} Λ = p Λ triv , π ( Λ ) = 0 \pi(\Lambda)=0 π ( Λ ) = 0 , and the proposition recovers Lemma 2. In contrast, a superlattice of index coprime to p p p has π ( Λ ) = F p D \pi(\Lambda)=\mathbb{F}_p^D π ( Λ ) = F p D , so coarse-graining to it cannot remove a nonzero gluing class. At each step of the layer-by-layer removal of Sec. IV A, one may therefore coarse-grain to any superlattice over which all gluing classes κ j i \kappa_{ji} κ j i of that step restrict to zero, instead of by p p p in every direction, with the current lattice in the role of Λ t r i v \Lambda_{\mathrm{triv}} Λ triv .
Corollary 2 (Minimal coarse-graining). Let the layers E X j E_X^j E X j be finite dimensional over F p \mathbb{F}_p F p , with at most two of them nonzero, as in every three-dimensional code, and let κ \kappa κ be the gluing class (11) between them, with κ = 0 \kappa=0 κ = 0 if fewer than two are nonzero. Then the code can be decoupled on a superlattice Λ \Lambda Λ if and only if Λ ⊆ Λ t r i v \Lambda\subseteq\Lambda_{\mathrm{triv}} Λ ⊆ Λ triv and κ \kappa κ vanishes on π ( Λ ) \pi(\Lambda) π ( Λ ) . In three dimensions, the smallest such index [ Λ t r i v : Λ ] [\Lambda_{\mathrm{triv}}:\Lambda] [ Λ triv : Λ ] is 1 1 1 , p p p , or p 2 p^2 p 2 , depending on whether the plaquette values f 12 , f 13 , f 23 ∈ Hom F p ( E X j , E X ) f_{12},f_{13},f_{23}\in\operatorname{Hom}_{\mathbb{F}_p}(E_X^j,E_X) f 12 , f 13 , f 23 ∈ Hom F p ( E X j , E X ) are all zero, linearly dependent but not all zero, or linearly independent.
Proof. With two nonzero layers, κ \kappa κ is the only gluing class, so the first statement follows from Theorem 1, Sec. III A, and Proposition 2. For D = 3 D=3 D = 3 , κ \kappa κ vanishes on every line and, by Eq. (15) , on the plane spanned by π ( ν 1 ) \pi(\nu_1) π ( ν 1 ) and π ( ν 2 ) \pi(\nu_2) π ( ν 2 ) exactly when ∑ I det I ( ν 1 , ν 2 ) f I = 0 \sum_I\det_I(\nu_1,\nu_2)f_I=0 ∑ I det I ( ν 1 , ν 2 ) f I = 0 . As ν 1 \nu_1 ν 1 and ν 2 \nu_2 ν 2 vary, ( det I ( ν 1 , ν 2 ) ) I (\det_I(\nu_1,\nu_2))_I ( det I ( ν 1 , ν 2 ) ) I takes every nonzero value in F p 3 \mathbb{F}_p^3 F p 3 , so c c c in Eq. (16) is 0 0 0 , 1 1 1 , or 2 2 2 in the three cases.
Construction of the decoupling circuit
Section IV C sketched how to construct a decoupling circuit when, after coarse-graining, the profile of the code is isomorphic to that of a toric-code stack. This appendix carries out that construction and thereby proves Theorem 1, which we restate.
Theorem 1 (Decoupling criterion). Consider a translation-invariant topological p p p -ary CSS code on Z D \mathbb{Z}^D Z D , D ≥ 2 D \ge2 D ≥ 2 , and let Λ ⊆ Z D \Lambda\subseteq\mathbb{Z}^D Λ ⊆ Z D be a superlattice. The code can be decoupled on Λ \Lambda Λ if and only if its profile over F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] is that of a toric-code stack,
E X ∣ F p [ Λ ] ≃ ⨁ j = 1 D − 1 F p [ − j ] ⊕ t j (17) \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} \simeq\bigoplus_{j=1}^{D-1} \mathbb{F}_p[-j]^{\oplus t_j} \tag*{(17)} E X ∣ F p [ Λ ] ≃ j = 1 ⨁ D − 1 F p [ − j ] ⊕ t j (17) in D ( F p [ Λ ] ) D(\mathbb{F}_p[\Lambda]) D ( F p [ Λ ]) , for some nonnegative integers t j t_j t j . In that case, a decoupling onto ⨁ j = 1 D − 1 T C ( D ) ( F p ) ⊕ t j \bigoplus_{j=1}^{D-1} \mathrm{TC}^{(D)}(\mathbb{F}_p)^{\oplus t_j} ⨁ j = 1 D − 1 TC ( D ) ( F p ) ⊕ t j can be realized by a finite-depth local circuit of SUM and SWAP gates, possibly after adding ancillas.
Necessity was shown in Sec. IV B, so we prove sufficiency. After coarse-graining to Λ \Lambda Λ , the code is again topological, with profile E X ∣ F p [ Λ ] \mathcal{E}_X|_{\mathbb{F}_p[\Lambda]} E X ∣ F p [ Λ ] (Lemma 8), and a basis of Λ \Lambda Λ identifies F p [ Λ ] \mathbb{F}_p[\Lambda] F p [ Λ ] with R R R . We may therefore assume that Λ = Z D \Lambda= \mathbb{Z}^D Λ = Z D and that
E X ≃ ⨁ j = 1 D − 1 F p [ − j ] ⊕ t j (18) \mathcal{E}_X \simeq\bigoplus_{j=1}^{D-1} \mathbb{F}_p[-j]^{\oplus t_j} \tag*{(18)} E X ≃ j = 1 ⨁ D − 1 F p [ − j ] ⊕ t j (18)
in D ( R ) D(R) D ( R ) . By the claim in Sec. II A, it then suffices to construct invertible U U U and V V V that make the square (2) commute, with U U U realized by a circuit. Ancillas and identity X X X -type checks may be adjoined to the code and to the stack. Such U U U and V V V induce an isomorphism between the check cokernels of d c o d e 0 = H X d^0_{\mathrm{code}} = H_X d code 0 = H X and d s t a c k 0 = ⨁ j ∂ j ⊕ t j d^0_{\mathrm{stack}} = \bigoplus_j \partial_j^{\oplus t_j} d stack 0 = ⨁ j ∂ j ⊕ t j , since V ( im d c o d e 0 ) = im ( d s t a c k 0 U ) = im d s t a c k 0 V(\operatorname{im} d^0_{\mathrm{code}}) = \operatorname{im}(d^0_{\mathrm{stack}}U) = \operatorname{im}d^0_{\mathrm{stack}} V ( im d code 0 ) = im ( d stack 0 U ) = im d stack 0 . Our construction reverses this, in three steps. First, we match the check cokernels up to free summands (Lemma 10); this is the only step that uses hypothesis (C1). Second, we lift this match to invertible U U U and V V V (Lemma 11). Third, we factor U U U into layers of SUM and SWAP gates (Lemma 12). The proof of Lemma 10, the most technical step, is deferred to Appendix C 4. Appendix C 5 bounds the cost of the construction.
Matching the check cokernels
The check cokernel of the code is coker d c o d e 0 = R s / im H X \operatorname{coker}d^0_{\mathrm{code}} = R^s/\operatorname{im}H_X coker d code 0 = R s / im H X , and that of the stack is the direct sum of those of the toric codes,
coker d s t a c k 0 = ⨁ j = 1 D − 1 ( K j − 1 / im ∂ j ) ⊕ t j ≃ ⨁ j = 1 D − 1 ( im ∂ j − 1 ) ⊕ t j , \begin{aligned}
\operatorname{coker}d^0_{\mathrm{stack}} = \bigoplus_{j=1}^{D-1}\left(K_{j-1}/\operatorname{im}\partial_j\right)^{\oplus t_j} \\
&\simeq\bigoplus_{j=1}^{D-1}\left(\operatorname{im}\partial_{j-1}\right)^{\oplus t_j},
\end{aligned} coker d stack 0 = j = 1 ⨁ D − 1 ( K j − 1 / im ∂ j ) ⊕ t j ≃ j = 1 ⨁ D − 1 ( im ∂ j − 1 ) ⊕ t j ,
where ∂ 0 = ε \partial_0 = \varepsilon ∂ 0 = ε and the isomorphism follows from the exactness of the augmented Koszul complex (Sec. II B). The module coker d c o d e 0 \operatorname{coker}d^0_{\mathrm{code}} coker d code 0 is the degree-one term of the truncation τ ≥ 1 C c o d e \tau_{\geq1}C_{\mathrm{code}} τ ≥ 1 C code , which represents the profile E X \mathcal{E}_X E X (Lemma 4 ). We write π c o d e : C c o d e → coker d c o d e 0 \pi_{\mathrm{code}} : C_{\mathrm{code}} \to\operatorname{coker}d^0_{\mathrm{code}} π code : C code → coker d code 0 and π s t a c k : C s t a c k → coker d s t a c k 0 \pi_{\mathrm{stack}} : C_{\mathrm{stack}} \to\operatorname{coker}d^0_{\mathrm{stack}} π stack : C stack → coker d stack 0 for the quotient maps.
Lemma 10. Under hypothesis (C1), there exist nonnegative integers a , b a,b a , b and an isomorphism
ϕ 2 : coker d s t a c k 0 ⊕ R b → ∼ coker d c o d e 0 ⊕ R a . \phi^2 : \operatorname{coker}d^0_{\mathrm{stack}} \oplus R^b \xrightarrow{\sim} \operatorname{coker}d^0_{\mathrm{code}} \oplus R^a. ϕ 2 : coker d stack 0 ⊕ R b ∼ coker d code 0 ⊕ R a .
We outline the proof, which is given in Appendix C 4. By Lemma 4 and hypothesis (C1), C c o d e C_{\mathrm{code}} C code and C s t a c k C_{\mathrm{stack}} C stack are quasi-isomorphic bounded complexes of finite free modules. The quasi-isomorphism C s t a c k → C c o d e C_{\mathrm{stack}} \to C_{\mathrm{code}} C stack → C code can be represented by cochain maps Γ : C s t a c k → C c o d e \Gamma: C_{\mathrm{stack}} \to C_{\mathrm{code}} Γ : C stack → C code and Δ : C c o d e → C s t a c k \Delta: C_{\mathrm{code}} \to C_{\mathrm{stack}} Δ : C code → C stack that are mutually inverse up to homotopy [[35 Cor. 10.4.7] ]. As cochain maps, Γ \Gamma Γ and Δ \Delta Δ induce maps Γ ∗ \Gamma_* Γ ∗ and Δ ∗ \Delta_* Δ ∗ between the check cokernels. The composites Γ ∗ Δ ∗ \Gamma_*\Delta_* Γ ∗ Δ ∗ and Δ ∗ Γ ∗ \Delta_*\Gamma_* Δ ∗ Γ ∗ differ from the identity because of the homotopy, but only by maps that pass through the free modules C c o d e 2 C^2_{\mathrm{code}} C code 2 and C s t a c k 2 C^2_{\mathrm{stack}} C stack 2 , respectively. Adjoining C c o d e 2 C^2_{\mathrm{code}} C code 2 to coker d c o d e 0 \operatorname{coker}d^0_{\mathrm{code}} coker d code 0 absorbs the first of these corrections: coker d c o d e 0 \operatorname{coker}d^0_{\mathrm{code}} coker d code 0 becomes a direct summand of coker d c o d e 0 ⊕ C c o d e 2 \operatorname{coker}d^0_{\mathrm{code}} \oplus C^2_{\mathrm{code}} coker d code 0 ⊕ C code 2 . The second correction shows that the complementary summand is stably free, which suffices. A similar argument appears in Ref. [29 ] for codes with a single nonzero layer.
Note that the free summands in Lemma 10 cannot be avoided: adjoining an identity X X X -type check adds a summand R R R to the check cokernel but leaves the profile unchanged (Lemma 7). We absorb them with disk complexes. For a finite free R R R -module P P P , the disk complex D j ( P ) D^j(P) D j ( P ) has P P P in degrees j j j and j + 1 j+1 j + 1 , joined by the identity I P I_P I P . Adjoining D − 1 ( P ) D^{-1}(P) D − 1 ( P ) or D 0 ( P ) D^0(P) D 0 ( P ) to a code adds ancillas in the state ∣ 0 ⟩ \lvert0\rangle ∣ 0 ⟩ or ∣ + ⟩ \lvert+\rangle ∣ + ⟩ , respectively, one for each basis element of P P P per unit cell. Adjoining D 1 ( P ) D^1(P) D 1 ( P ) adds identity X X X -type checks. We adjoin D 1 ( R a ) D^1(R^a) D 1 ( R a ) to C c o d e C_{\mathrm{code}} C code and D 1 ( R b ) D^1(R^b) D 1 ( R b ) to C s t a c k C_{\mathrm{stack}} C stack . This replaces d c o d e 0 d^0_{\mathrm{code}} d code 0 by ( H X 0 ) : R q → R s ⊕ R a \begin{pmatrix}H_X\\0\end{pmatrix}:R^q \to R^s \oplus R^a ( H X 0 ) : R q → R s ⊕ R a and d s t a c k 0 d^0_{\mathrm{stack}} d stack 0 likewise, so the two check cokernels gain the free summands R a R^a R a and R b R^b R b , respectively. We keep the notation C c o d e C_{\mathrm{code}} C code and C s t a c k C_{\mathrm{stack}} C stack for the enlarged complexes, so that ϕ 2 : coker d s t a c k 0 → coker d c o d e 0 \phi^2:\operatorname{coker}d^0_{\mathrm{stack}}\to\operatorname{coker}d^0_{\mathrm{code}} ϕ 2 : coker d stack 0 → coker d code 0 is an isomorphism.
Lifting to invertible maps
The second step lifts the isomorphism of Lemma 10 from the check cokernels to the terms in degrees zero and one, and adjoins ancillas to make the lifts invertible.
Lemma 11. Let ϕ 2 : coker d s t a c k 0 → coker d c o d e 0 \phi^2 : \operatorname{coker}d^0_{\mathrm{stack}} \to\operatorname{coker}d^0_{\mathrm{code}} ϕ 2 : coker d stack 0 → coker d code 0 be an isomorphism, where C c o d e 0 C^0_{\mathrm{code}} C code 0 , C c o d e 1 C^1_{\mathrm{code}} C code 1 , C s t a c k 0 C^0_{\mathrm{stack}} C stack 0 , and C s t a c k 1 C^1_{\mathrm{stack}} C stack 1 are finite free. After ancillas are adjoined to the code and to the stack, there are isomorphisms U U U and V V V between their terms in degrees zero and one that make the square (2) commute.
Proof. We first lift ϕ 2 \phi^2 ϕ 2 and its inverse ψ 2 \psi^2 ψ 2 to the terms in degrees one and zero. Since C c o d e 0 , C c o d e 1 , C s t a c k 0 , C s t a c k 1 C^0_{\mathrm{code}}, C^1_{\mathrm{code}}, C^0_{\mathrm{stack}}, C^1_{\mathrm{stack}} C code 0 , C code 1 , C stack 0 , C stack 1 are finite free and the rows of the diagram below are exact at the degree-one terms and at the cokernels, the comparison theorem gives such lifts, unique up to homotopy [35 Thm. 2.2.6 and Porism 2.2.7] . Writing the lifts as ϕ i : C s t a c k i → C c o d e i \phi^i:C^i_{\mathrm{stack}}\to C^i_{\mathrm{code}} ϕ i : C stack i → C code i and ψ i : C c o d e i → C s t a c k i \psi^i:C^i_{\mathrm{code}}\to C^i_{\mathrm{stack}} ψ i : C code i → C stack i for i = 0 , 1 i=0,1 i = 0 , 1 , we obtain the diagram
C s t a c k 0 → d s t a c k 0 C s t a c k 1 → π s t a c k coker d s t a c k 0 → 0 ↓ ϕ 0 ↓ ϕ 1 ↓ ϕ 2 C c o d e 0 → d c o d e 0 C c o d e 1 → π c o d e coker d c o d e 0 → 0 ↑ ψ 0 ↑ ψ 1 ↑ ψ 2 (19) \begin{array}{ccccc}
C^0_{\mathrm{stack}} & \xrightarrow{d^0_{\mathrm{stack}}} & C^1_{\mathrm{stack}} & \xrightarrow{\pi_{\mathrm{stack}}} & \operatorname{coker}d^0_{\mathrm{stack}} \to0 \\
\downarrow{\phi^0} & & \downarrow{\phi^1} & & \downarrow{\phi^2} \\
C^0_{\mathrm{code}} & \xrightarrow{d^0_{\mathrm{code}}} & C^1_{\mathrm{code}} & \xrightarrow{\pi_{\mathrm{code}}} & \operatorname{coker}d^0_{\mathrm{code}} \to0 \\
\uparrow{\psi^0} & & \uparrow{\psi^1} & & \uparrow{\psi^2} \tag*{(19)}
\end{array} C stack 0 ↓ ϕ 0 C code 0 ↑ ψ 0 d stack 0 d code 0 C stack 1 ↓ ϕ 1 C code 1 ↑ ψ 1 π stack π code coker d stack 0 → 0 ↓ ϕ 2 coker d code 0 → 0 ↑ ψ 2 (19)
in which the downward maps and the upward maps each commute with the horizontal ones. Since ϕ 1 ψ 1 \phi^1\psi^1 ϕ 1 ψ 1 and ψ 1 ϕ 1 \psi^1\phi^1 ψ 1 ϕ 1 lift the identities of coker d c o d e 0 \operatorname{coker}d^0_{\mathrm{code}} coker d code 0 and coker d s t a c k 0 \operatorname{coker}d^0_{\mathrm{stack}} coker d stack 0 , there are homotopies η c o d e : C c o d e 1 → C c o d e 0 \eta_{\mathrm{code}}:C^1_{\mathrm{code}}\to C^0_{\mathrm{code}} η code : C code 1 → C code 0 and η s t a c k : C s t a c k 1 → C s t a c k 0 \eta_{\mathrm{stack}}:C^1_{\mathrm{stack}}\to C^0_{\mathrm{stack}} η stack : C stack 1 → C stack 0 with d c o d e 0 η c o d e = I − ϕ 1 ψ 1 d^0_{\mathrm{code}}\eta_{\mathrm{code}}=I-\phi^1\psi^1 d code 0 η code = I − ϕ 1 ψ 1 and d s t a c k 0 η s t a c k = I − ψ 1 ϕ 1 d^0_{\mathrm{stack}}\eta_{\mathrm{stack}}=I-\psi^1\phi^1 d stack 0 η stack = I − ψ 1 ϕ 1 .
Although ϕ 2 \phi^2 ϕ 2 and ψ 2 \psi^2 ψ 2 are mutually inverse, their lifts ϕ i \phi^i ϕ i and ψ i \psi^i ψ i need not be invertible. A pair of maps can nevertheless be assembled into an isomorphism. For maps f : A → B f:A\to B f : A → B and g : B → A g:B\to A g : B → A , define
Θ ( f , g ) = ( f I B − f g I A − g ) : A ⊕ B ⟶ B ⊕ A . \Theta(f,g)=
\begin{pmatrix}
f & I_B-fg\\
I_A & -g
\end{pmatrix}:A\oplus B\longrightarrow B\oplus A. Θ ( f , g ) = ( f I A I B − f g − g ) : A ⊕ B ⟶ B ⊕ A .
A direct computation shows that Θ ( g , f ) \Theta(g,f) Θ ( g , f ) is its inverse, even when f f f and g g g are not invertible. We will take V = Θ ( ψ 1 , ϕ 1 ) V=\Theta(\psi^1,\phi^1) V = Θ ( ψ 1 , ϕ 1 ) , which needs both C c o d e 1 C^1_{\mathrm{code}} C code 1 and C s t a c k 1 C^1_{\mathrm{stack}} C stack 1 on each side, and build U U U in the same way from maps between C c o d e 0 ⊕ C s t a c k 1 C^0_{\mathrm{code}}\oplus C^1_{\mathrm{stack}} C code 0 ⊕ C stack 1 and C s t a c k 0 ⊕ C c o d e 1 C^0_{\mathrm{stack}}\oplus C^1_{\mathrm{code}} C stack 0 ⊕ C code 1 . We therefore adjoin ancillas,
C ^ c o d e = C c o d e ⊕ D 0 ( C s t a c k 1 ) ⊕ D − 1 ( C s t a c k 0 ⊕ C c o d e 1 ) , \widehat{C}_{\mathrm{code}}=C_{\mathrm{code}}\oplus D^0(C^1_{\mathrm{stack}})\oplus D^{-1}(C^0_{\mathrm{stack}}\oplus C^1_{\mathrm{code}}), C code = C code ⊕ D 0 ( C stack 1 ) ⊕ D − 1 ( C stack 0 ⊕ C code 1 ) ,
C ^ s t a c k = C s t a c k ⊕ D 0 ( C c o d e 1 ) ⊕ D − 1 ( C c o d e 0 ⊕ C s t a c k 1 ) , \widehat{C}_{\mathrm{stack}}=C_{\mathrm{stack}}\oplus D^0(C^1_{\mathrm{code}})\oplus D^{-1}(C^0_{\mathrm{code}}\oplus C^1_{\mathrm{stack}}), C stack = C stack ⊕ D 0 ( C code 1 ) ⊕ D − 1 ( C code 0 ⊕ C stack 1 ) ,
whose terms in degrees zero and one are
C ^ c o d e 0 = ( C c o d e 0 ⊕ C s t a c k 1 ) ⊕ ( C s t a c k 0 ⊕ C c o d e 1 ) , \widehat{C}^0_{\mathrm{code}}=(C^0_{\mathrm{code}}\oplus C^1_{\mathrm{stack}})\oplus(C^0_{\mathrm{stack}}\oplus C^1_{\mathrm{code}}), C code 0 = ( C code 0 ⊕ C stack 1 ) ⊕ ( C stack 0 ⊕ C code 1 ) ,
C ^ s t a c k 0 = ( C s t a c k 0 ⊕ C c o d e 1 ) ⊕ ( C c o d e 0 ⊕ C s t a c k 1 ) , \widehat{C}^0_{\mathrm{stack}}=(C^0_{\mathrm{stack}}\oplus C^1_{\mathrm{code}})\oplus(C^0_{\mathrm{code}}\oplus C^1_{\mathrm{stack}}), C stack 0 = ( C stack 0 ⊕ C code 1 ) ⊕ ( C code 0 ⊕ C stack 1 ) ,
C ^ c o d e 1 = C c o d e 1 ⊕ C s t a c k 1 , C ^ s t a c k 1 = C s t a c k 1 ⊕ C c o d e 1 . \widehat{C}^1_{\mathrm{code}}=C^1_{\mathrm{code}}\oplus C^1_{\mathrm{stack}},\qquad
\widehat{C}^1_{\mathrm{stack}}=C^1_{\mathrm{stack}}\oplus C^1_{\mathrm{code}}. C code 1 = C code 1 ⊕ C stack 1 , C stack 1 = C stack 1 ⊕ C code 1 .
In this order of summands, the degree-zero differentials are d ^ c o d e 0 = ( d c o d e ′ 0 ) \widehat{d}^0_{\mathrm{code}}=(d'_{\mathrm{code}}\ 0) d code 0 = ( d code ′ 0 ) and d ^ s t a c k 0 = ( d s t a c k ′ 0 ) \widehat{d}^0_{\mathrm{stack}}=(d'_{\mathrm{stack}}\ 0) d stack 0 = ( d stack ′ 0 ) , with d c o d e ′ = diag ( d c o d e 0 , I C s t a c k 1 ) d'_{\mathrm{code}}=\operatorname{diag}(d^0_{\mathrm{code}},I_{C^1_{\mathrm{stack}}}) d code ′ = diag ( d code 0 , I C stack 1 ) and d s t a c k ′ = diag ( d s t a c k 0 , I C c o d e 1 ) d'_{\mathrm{stack}}=\operatorname{diag}(d^0_{\mathrm{stack}},I_{C^1_{\mathrm{code}}}) d stack ′ = diag ( d stack 0 , I C code 1 ) .
In degree one, we set
V = Θ ( ψ 1 , ϕ 1 ) : C ^ c o d e 1 → ∼ C ^ s t a c k 1 . V=\Theta(\psi^1,\phi^1):\widehat{C}^1_{\mathrm{code}}\xrightarrow{\sim}\widehat{C}^1_{\mathrm{stack}}. V = Θ ( ψ 1 , ϕ 1 ) : C code 1 ∼ C stack 1 .
In degree zero, we take U = Θ ( ψ ^ 0 , ϕ ^ 0 ) U=\Theta(\widehat{\psi}^0,\widehat{\phi}^0) U = Θ ( ψ 0 , ϕ 0 ) for maps ψ ^ 0 : C c o d e 0 ⊕ C s t a c k 1 → C s t a c k 0 ⊕ C c o d e 1 \widehat{\psi}^0:C^0_{\mathrm{code}}\oplus C^1_{\mathrm{stack}}\to C^0_{\mathrm{stack}}\oplus C^1_{\mathrm{code}} ψ 0 : C code 0 ⊕ C stack 1 → C stack 0 ⊕ C code 1 and ϕ ^ 0 \widehat{\phi}^0 ϕ 0 in the opposite direction. For the square to commute, it suffices that these maps intertwine the degree-zero differentials with V V V and V − 1 V^{-1} V − 1 ,
d s t a c k ′ ψ ^ 0 = V d c o d e ′ , d c o d e ′ ϕ ^ 0 = V − 1 d s t a c k ′ . d'_{\mathrm{stack}}\widehat{\psi}^0=Vd'_{\mathrm{code}},\qquad d'_{\mathrm{code}}\widehat{\phi}^0=V^{-1}d'_{\mathrm{stack}}. d stack ′ ψ 0 = V d code ′ , d code ′ ϕ 0 = V − 1 d stack ′ .
The lifts ψ 0 \psi^0 ψ 0 and ϕ 0 \phi^0 ϕ 0 satisfy d s t a c k 0 ψ 0 = ψ 1 d c o d e 0 d^0_{\mathrm{stack}}\psi^0=\psi^1d^0_{\mathrm{code}} d stack 0 ψ 0 = ψ 1 d code 0 and d c o d e 0 ϕ 0 = ϕ 1 d s t a c k 0 d^0_{\mathrm{code}}\phi^0=\phi^1d^0_{\mathrm{stack}} d code 0 ϕ 0 = ϕ 1 d stack 0 instead, with ψ 1 \psi^1 ψ 1 and ϕ 1 \phi^1 ϕ 1 in place of V V V and V − 1 V^{-1} V − 1 . The homotopies η \eta η correct this:
ϕ ^ 0 = ( ϕ 0 η c o d e d s t a c k 0 − ψ 1 ) , ψ ^ 0 = ( ψ 0 η s t a c k d c o d e 0 − ϕ 1 ) \widehat{\phi}^0=
\begin{pmatrix}
\phi^0 & \eta_{\mathrm{code}}\\
d^0_{\mathrm{stack}} & -\psi^1
\end{pmatrix},
\qquad
\widehat{\psi}^0=
\begin{pmatrix}
\psi^0 & \eta_{\mathrm{stack}}\\
d^0_{\mathrm{code}} & -\phi^1
\end{pmatrix} ϕ 0 = ( ϕ 0 d stack 0 η code − ψ 1 ) , ψ 0 = ( ψ 0 d code 0 η stack − ϕ 1 )
satisfy both identities, by the commutativity of diagram (C2) and the defining identities of η c o d e \eta_{\mathrm{code}} η code and η s t a c k \eta_{\mathrm{stack}} η stack . Then
U = Θ ( ψ ^ 0 , ϕ ^ 0 ) = ( ψ ^ 0 I − ψ ^ 0 ϕ ^ 0 I − ϕ ^ 0 ) : C ^ c o d e 0 → ∼ C ^ s t a c k 0 , U=\Theta(\widehat{\psi}^0,\widehat{\phi}^0)=
\begin{pmatrix}
\widehat{\psi}^0 & I-\widehat{\psi}^0\widehat{\phi}^0\\
I & -\widehat{\phi}^0
\end{pmatrix}:\widehat{C}^0_{\mathrm{code}}\xrightarrow{\sim}\widehat{C}^0_{\mathrm{stack}}, U = Θ ( ψ 0 , ϕ 0 ) = ( ψ 0 I I − ψ 0 ϕ 0 − ϕ 0 ) : C code 0 ∼ C stack 0 ,
and since d s t a c k ′ ψ ^ 0 = V d c o d e ′ ϕ ^ 0 = d s t a c k ′ d'_{\mathrm{stack}}\widehat{\psi}^0=Vd'_{\mathrm{code}}\widehat{\phi}^0=d'_{\mathrm{stack}} d stack ′ ψ 0 = V d code ′ ϕ 0 = d stack ′ ,
d ^ s t a c k 0 U = ( d s t a c k ′ ψ ^ 0 , d s t a c k ′ − d s t a c k ′ ψ ^ 0 ϕ ^ 0 ) = ( V d c o d e ′ , 0 ) = V d ^ c o d e 0 . \widehat{d}^0_{\mathrm{stack}}U=(d'_{\mathrm{stack}}\widehat{\psi}^0,\ d'_{\mathrm{stack}}-d'_{\mathrm{stack}}\widehat{\psi}^0\widehat{\phi}^0)
=(Vd'_{\mathrm{code}},0)=V\widehat{d}^0_{\mathrm{code}}. d stack 0 U = ( d stack ′ ψ 0 , d stack ′ − d stack ′ ψ 0 ϕ 0 ) = ( V d code ′ , 0 ) = V d code 0 .
This is the commuting square (2) for C ^ c o d e \widehat{C}_{\mathrm{code}} C code and C ^ s t a c k \widehat{C}_{\mathrm{stack}} C stack , with U U U and V V V invertible. □
Disk complexes and their duals are exact, so C ^ c o d e \widehat{C}_{\mathrm{code}} C code and C ^ s t a c k \widehat{C}_{\mathrm{stack}} C stack still satisfy the topological condition (1) . By the claim in Sec. II A, a circuit that acts on Z Z Z -type representatives by U U U therefore maps the code, with its ancillas, onto the toric-code stack with its ancillas.
Realizing the circuit
Finally, we turn U U U into a circuit.
Lemma 12. The isomorphism U U U of Lemma 11 is the action on Z Z Z -type representatives of a finite-depth local circuit of SUM and SWAP gates whose layers commute with all translations.
Proof. Like every Θ ( f , g ) \Theta(f,g) Θ ( f , g ) , the map U U U factors into two unitriangular matrices and a block swap,
U = ( I ψ ^ 0 0 I ) ( I 0 − ϕ ^ 0 I ) ( 0 I I 0 ) . U=
\begin{pmatrix}
I & \widehat{\psi}^0\\
0 & I
\end{pmatrix}
\begin{pmatrix}
I & 0\\
-\widehat{\phi}^0 & I
\end{pmatrix}
\begin{pmatrix}
0 & I\\
I & 0
\end{pmatrix}. U = ( I 0 ψ 0 I ) ( I − ϕ 0 0 I ) ( 0 I I 0 ) . Since the entries of ϕ ^ 0 \widehat{\phi}^0 ϕ 0 and ψ ^ 0 \widehat{\psi}^0 ψ 0 are Laurent polynomials, each unitriangular factor is a finite product of elementary matrices. Each of them differs from I I I by a single entry λ x α \lambda x^\alpha λ x α , with λ ∈ F p \lambda\in\mathbb{F}_p λ ∈ F p , in some row i i i and column j ≠ i j\ne i j = i . Each elementary matrix is realized by a single layer of SUM gates [32 ] . Indeed, the SUM gate of weight λ \lambda λ , ∣ a , b ⟩ ↦ ∣ a , b + λ a ⟩ |a,b\rangle\mapsto|a,b+\lambda a\rangle ∣ a , b ⟩ ↦ ∣ a , b + λa ⟩ , sends Z 1 ↦ Z 1 Z_1\mapsto Z_1 Z 1 ↦ Z 1 and Z 2 ↦ Z 1 − λ Z 2 Z_2\mapsto Z_1^{-\lambda}Z_2 Z 2 ↦ Z 1 − λ Z 2 [33 ] . A layer of SUM gates of weight − λ -\lambda − λ , in which each qudit j j j is controlled by qudit i i i in the unit cell displaced by α \alpha α , therefore acts on Z Z Z -type representatives by this elementary matrix. The block swap permutes qudits within each unit cell and is implemented by on-site SWAP gates. The resulting circuit has finite depth and is local, in the sense that each gate acts on qudits within a bounded distance of one another. □
Together with Lemma 10, Lemmas 11 and 12 prove Theorem 1.
Proof of the stable isomorphism
The proof is constructive and has the following steps. We first find a cochain map Γ : C s t a c k → C c o d e \Gamma: C_{\mathrm{stack}} \to C_{\mathrm{code}} Γ : C stack → C code that represents the isomorphism of profiles, and obtain a homotopy inverse Δ \Delta Δ from a contraction of its mapping cone. We then pass to the maps that Γ \Gamma Γ and Δ \Delta Δ induce on the check cokernels and absorb the errors by which these fail to be mutually inverse.
a. Constructing Γ \Gamma Γ . Here C c o d e C_{\mathrm{code}} C code and C s t a c k C_{\mathrm{stack}} C stack are the complexes before any disk complexes are adjoined. By Lemma 4 and hypothesis (C1), C s t a c k ≃ ⨁ j F p [ − j ] ⊕ t j ≃ E X ≃ C c o d e C_{\mathrm{stack}} \simeq\bigoplus_j \mathbb{F}_p[-j]^{\oplus t_j} \simeq\mathcal{E}_X \simeq C_{\mathrm{code}} C stack ≃ ⨁ j F p [ − j ] ⊕ t j ≃ E X ≃ C code in D ( R ) \mathrm{D}(R) D ( R ) . Since C s t a c k C_{\mathrm{stack}} C stack is a bounded complex of projective modules, morphisms from C s t a c k C_{\mathrm{stack}} C stack in D ( R ) \mathrm{D}(R) D ( R ) are homotopy classes of cochain maps [35 Cor. 10.4.7] , so this isomorphism is represented by a cochain map Γ : C s t a c k → C c o d e \Gamma: C_{\mathrm{stack}} \to C_{\mathrm{code}} Γ : C stack → C code , which is a quasi-isomorphism. The map Γ \Gamma Γ can be computed explicitly, one copy of T j T_j T j at a time. Let Γ j , k : T j → C c o d e \Gamma_{j,k}: T_j \to C_{\mathrm{code}} Γ j , k : T j → C code be its restriction to the k k k th copy of T j T_j T j . Its components must make the diagram
T j : ⋯ K 2 → ∂ 2 K 1 → ∂ 1 K 0 → 0 ↓ Γ j , k j − 2 ↓ Γ j , k j − 1 ↓ Γ j , k j ↓ Γ j , k j + 1 C c o d e : ⋯ C c o d e j − 2 → d c o d e j − 2 C c o d e j − 1 → d c o d e j − 1 C c o d e j → d c o d e j C c o d e j + 1 \begin{array}{ccccc}
T_j: & \cdots& K_2 & \xrightarrow{\partial_2} & K_1 \xrightarrow{\partial_1} K_0 \to0 \\
& & \downarrow\Gamma_{j,k}^{j-2} & & \downarrow\Gamma_{j,k}^{j-1} \quad\downarrow\Gamma_{j,k}^{j} \quad\downarrow\Gamma_{j,k}^{j+1} \\
C_{\mathrm{code}}: & \cdots& C_{\mathrm{code}}^{j-2} & \xrightarrow{d_{\mathrm{code}}^{j-2}} & C_{\mathrm{code}}^{j-1} \xrightarrow{d_{\mathrm{code}}^{j-1}} C_{\mathrm{code}}^j \xrightarrow{d_{\mathrm{code}}^j} C_{\mathrm{code}}^{j+1}
\end{array} T j : C code : ⋯ ⋯ K 2 ↓ Γ j , k j − 2 C code j − 2 ∂ 2 d code j − 2 K 1 ∂ 1 K 0 → 0 ↓ Γ j , k j − 1 ↓ Γ j , k j ↓ Γ j , k j + 1 C code j − 1 d code j − 1 C code j d code j C code j + 1
commute. The top component Γ j , k j \Gamma_{j,k}^{j} Γ j , k j is determined by its value on e ∅ e_{\varnothing} e ∅ . For k = 1 , … , t j k=1,\ldots,t_j k = 1 , … , t j , we choose these values to be cocycles of C c o d e C_{\mathrm{code}} C code representing a basis of E X j E_X^j E X j ; this makes Γ \Gamma Γ a quasi-isomorphism. The other components then solve the linear system d c o d e Γ j , k = Γ j , k ∂ d_{\mathrm{code}}\Gamma_{j,k}=\Gamma_{j,k}\partial d code Γ j , k = Γ j , k ∂ over R R R , with the value on e ∅ e_{\varnothing} e ∅ prescribed. A solution exists. A constant change of basis of the copies of T j T_j T j makes the quasi-isomorphism above send the generators e ∅ e_{\varnothing} e ∅ to the chosen cocycles up to coboundaries, and subtracting d c o d e h + h d s t a c k d_{\mathrm{code}}h+hd_{\mathrm{stack}} d code h + h d stack , for a map h h h that is nonzero only on these generators, removes the coboundaries. Appendix C §5 bounds the cost of solving this system. Combined together, the Γ j , k \Gamma_{j,k} Γ j , k give Γ \Gamma Γ with d c o d e Γ = Γ d s t a c k d_{\mathrm{code}}\Gamma=\Gamma d_{\mathrm{stack}} d code Γ = Γ d stack .
b. Inverting Γ \Gamma Γ up to homotopy. To find a homotopy inverse of Γ \Gamma Γ , we contract its mapping cone. The mapping cone G = Cone ( Γ ) G=\operatorname{Cone}(\Gamma) G = Cone ( Γ ) of Appendix A §1 has terms G n = C c o d e n ⊕ C s t a c k n + 1 G^n=C_{\mathrm{code}}^n\oplus C_{\mathrm{stack}}^{n+1} G n = C code n ⊕ C stack n + 1 and differential
d G = ( d c o d e Γ 0 − d s t a c k ) , d_G=\begin{pmatrix}d_{\mathrm{code}}&\Gamma\\0&-d_{\mathrm{stack}}\end{pmatrix}, d G = ( d code 0 Γ − d stack ) ,
d G ( c , t ) = ( d c o d e c + Γ t , − d s t a c k t ) . d_G(c,t)=(d_{\mathrm{code}}c+\Gamma t,-d_{\mathrm{stack}}t). d G ( c , t ) = ( d code c + Γ t , − d stack t ) .
Like C c o d e C_{\mathrm{code}} C code and C s t a c k C_{\mathrm{stack}} C stack , it is bounded with finite free terms, and it is acyclic because Γ \Gamma Γ is a quasi-isomorphism [35 Cor. 1.5.4] . We construct maps h G : G n → G n − 1 h_G:G^n\to G^{n-1} h G : G n → G n − 1 with d G h G + h G d G = I d_Gh_G+h_Gd_G=I d G h G + h G d G = I , that is, a contraction of G G G . Since G G G is acyclic, d G n d_G^n d G n maps G n G^n G n onto ker d G n + 1 \ker d_G^{n+1} ker d G n + 1 for every n n n . We first choose sections σ n : ker d G n + 1 → G n \sigma^n:\ker d_G^{n+1}\to G^n σ n : ker d G n + 1 → G n of these surjections, going down in n n n . A section exists whenever ker d G n + 1 \ker d_G^{n+1} ker d G n + 1 is projective, that is, a direct summand of a free module. This holds when n n n is the highest degree of G G G , since then ker d G n + 1 = 0 \ker d_G^{n+1}=0 ker d G n + 1 = 0 . If it holds for some n n n , we choose σ n \sigma^n σ n and obtain
G n = ker d G n ⊕ σ n ( ker d G n + 1 ) , G^n=\ker d_G^n\oplus\sigma^n(\ker d_G^{n+1}), G n = ker d G n ⊕ σ n ( ker d G n + 1 ) ,
since g = ( g − σ n d G n g ) + σ n d G n g g=(g-\sigma^n d_G^n g)+\sigma^n d_G^n g g = ( g − σ n d G n g ) + σ n d G n g and d G n σ n = I d_G^n\sigma^n=I d G n σ n = I . Thus ker d G n \ker d_G^n ker d G n is a direct summand of the free module G n G^n G n , and the condition holds for n − 1 n-1 n − 1 . By induction, all the sections σ n \sigma^n σ n exist. The maps
h G ( g + σ n g ′ ) = σ n − 1 g , g ∈ ker d G n , g ′ ∈ ker d G n + 1 , h_G(g+\sigma^n g')=\sigma^{n-1}g,\qquad g\in\ker d_G^n,\quad g'\in\ker d_G^{n+1}, h G ( g + σ n g ′ ) = σ n − 1 g , g ∈ ker d G n , g ′ ∈ ker d G n + 1 ,
then satisfy d G h G + h G d G = I d_Gh_G+h_Gd_G=I d G h G + h G d G = I : on g g g , the two terms give g g g and 0 0 0 , on σ n g ′ \sigma^n g' σ n g ′ , they give 0 0 0 and σ n g ′ \sigma^n g' σ n g ′ . In an algorithm, we find the components h G n : G n → G n − 1 h_G^n:G^n\to G^{n-1} h G n : G n → G n − 1 going down in n n n by solving d G n − 1 h G n = I − h G n + 1 d G n d_G^{n-1}h_G^n=I-h_G^{n+1}d_G^n d G n − 1 h G n = I − h G n + 1 d G n ; the right side maps G n G^n G n into ker d G n − 1 = im d G n − 1 \ker d_G^{n-1}=\operatorname{im}d_G^{n-1} ker d G n − 1 = im d G n − 1 , so a solution exists because G n G^n G n is free.
We read off Δ \Delta Δ from the blocks of the contraction,
h G = ( h ∗ Δ − h ′ ) : C c o d e n ⊕ C s t a c k n + 1 → C c o d e n − 1 ⊕ C s t a c k n , h_G=\begin{pmatrix}h&*\\\Delta&-h'\end{pmatrix}:C_{\mathrm{code}}^n\oplus C_{\mathrm{stack}}^{n+1}\to C_{\mathrm{code}}^{n-1}\oplus C_{\mathrm{stack}}^n, h G = ( h Δ ∗ − h ′ ) : C code n ⊕ C stack n + 1 → C code n − 1 ⊕ C stack n ,
where the entries marked ∗ * ∗ are not needed. With the degrees suppressed, d G h G + h G d G d_Gh_G+h_Gd_G d G h G + h G d G has the blocks
( d c o d e h + h d c o d e + Γ Δ ∗ Δ d c o d e − d s t a c k Δ d s t a c k h ′ + h ′ d s t a c k + Δ Γ ) . \begin{pmatrix}
d_{\mathrm{code}}h+hd_{\mathrm{code}}+\Gamma\Delta& *\\
\Delta d_{\mathrm{code}}-d_{\mathrm{stack}}\Delta& d_{\mathrm{stack}}h'+h'd_{\mathrm{stack}}+\Delta\Gamma
\end{pmatrix}. ( d code h + h d code + ΓΔ Δ d code − d stack Δ ∗ d stack h ′ + h ′ d stack + ΔΓ ) .
Comparing with I I I shows that Δ : C c o d e → C s t a c k \Delta:C_{\mathrm{code}}\to C_{\mathrm{stack}} Δ : C code → C stack is a cochain map and that
I − Γ Δ = d c o d e h + h d c o d e , I − Δ Γ = d s t a c k h ′ + h ′ d s t a c k ; (20) I-\Gamma\Delta=d_{\mathrm{code}}h+hd_{\mathrm{code}},\qquad I-\Delta\Gamma=d_{\mathrm{stack}}h'+h'd_{\mathrm{stack}}; \tag*{(20)} I − ΓΔ = d code h + h d code , I − ΔΓ = d stack h ′ + h ′ d stack ; (20)
that is, Δ \Delta Δ is a homotopy inverse of $\Gamma.
c. Passing to the cokernels. As cochain maps, Γ \Gamma Γ and Δ \Delta Δ map im d s t a c k 0 \operatorname{im}d_{\mathrm{stack}}^0 im d stack 0 into im d c o d e 0 \operatorname{im}d_{\mathrm{code}}^0 im d code 0 and im d c o d e 0 \operatorname{im}d_{\mathrm{code}}^0 im d code 0 into im d s t a c k 0 \operatorname{im}d_{\mathrm{stack}}^0 im d stack 0 , respectively, so they induce maps Γ ∗ : coker d s t a c k 0 → coker d c o d e 0 \Gamma_*:\operatorname{coker}d_{\mathrm{stack}}^0\to\operatorname{coker}d_{\mathrm{code}}^0 Γ ∗ : coker d stack 0 → coker d code 0 and Δ ∗ : coker d c o d e 0 → coker d s t a c k 0 \Delta_*:\operatorname{coker}d_{\mathrm{code}}^0\to\operatorname{coker}d_{\mathrm{stack}}^0 Δ ∗ : coker d code 0 → coker d stack 0 .
C s t a c k 0 → d s t a c k 0 C s t a c k 1 → π s t a c k coker d s t a c k 0 ⟶ 0 Γ ↓ Δ ↑ Γ ↓ Δ ↑ Γ ∗ ↓ Δ ∗ ↑ C c o d e 0 → d c o d e 0 C c o d e 1 → π c o d e coker d c o d e 0 ⟶ 0 \begin{array}{ccccccccc}
C_{\mathrm{stack}}^0 & \xrightarrow{d_{\mathrm{stack}}^0} & C_{\mathrm{stack}}^1 & \xrightarrow{\pi_{\mathrm{stack}}} & \operatorname{coker}d_{\mathrm{stack}}^0 & \longrightarrow& 0\\
\Gamma\downarrow\ \ \Delta\uparrow&& \Gamma\downarrow\ \ \Delta\uparrow&& \Gamma_*\downarrow\ \ \Delta_*\uparrow\\
C_{\mathrm{code}}^0 & \xrightarrow{d_{\mathrm{code}}^0} & C_{\mathrm{code}}^1 & \xrightarrow{\pi_{\mathrm{code}}} & \operatorname{coker}d_{\mathrm{code}}^0 & \longrightarrow& 0
\end{array} C stack 0 Γ ↓ Δ ↑ C code 0 d stack 0 d code 0 C stack 1 Γ ↓ Δ ↑ C code 1 π stack π code coker d stack 0 Γ ∗ ↓ Δ ∗ ↑ coker d code 0 ⟶ ⟶ 0 0
with Γ ∗ [ t ] = [ Γ t ] \Gamma_*[t]=[\Gamma t] Γ ∗ [ t ] = [ Γ t ] and Δ ∗ [ c ] = [ Δ c ] \Delta_*[c]=[\Delta c] Δ ∗ [ c ] = [ Δ c ] .
d. Absorbing the errors. If the homotopies vanished, Γ ∗ \Gamma_* Γ ∗ and Δ ∗ \Delta_* Δ ∗ would be mutually inverse. In general, evaluate the first identity in Eq. (20) on c ∈ C c o d e 1 c\in C_{\mathrm{code}}^1 c ∈ C code 1 and pass to classes modulo im d c o d e 0 \operatorname{im}d_{\mathrm{code}}^0 im d code 0 . The term d c o d e 0 h c d_{\mathrm{code}}^0hc d code 0 h c drops out, and we obtain [ c ] − Γ ∗ Δ ∗ [ c ] = [ h d c o d e 1 c ] [c]-\Gamma_* \Delta_*[c]=[h d^1_{\mathrm{code}}c] [ c ] − Γ ∗ Δ ∗ [ c ] = [ h d code 1 c ] . Likewise, the second identity gives [ t ] − Δ ∗ Γ ∗ [ t ] = [ h d s t a c k 1 t ] [t]-\Delta_* \Gamma_*[t]=[h d^1_{\mathrm{stack}}t] [ t ] − Δ ∗ Γ ∗ [ t ] = [ h d stack 1 t ] for t ∈ C s t a c k 1 t\in C^1_{\mathrm{stack}} t ∈ C stack 1 . Thus
I − Γ ∗ Δ ∗ = ζ 1 ξ 1 , I − Δ ∗ Γ ∗ = ζ 2 ξ 2 , (21) I-\Gamma_*\Delta_*=\zeta_1\xi_1,\qquad I-\Delta_*\Gamma_*=\zeta_2\xi_2, \tag*{(21)} I − Γ ∗ Δ ∗ = ζ 1 ξ 1 , I − Δ ∗ Γ ∗ = ζ 2 ξ 2 , (21)
where ξ 1 : coker d c o d e 0 → C c o d e 2 \xi_1:\operatorname{coker}d^0_{\mathrm{code}}\to C^2_{\mathrm{code}} ξ 1 : coker d code 0 → C code 2 and ξ 2 : coker d s t a c k 0 → C s t a c k 2 \xi_2:\operatorname{coker}d^0_{\mathrm{stack}}\to C^2_{\mathrm{stack}} ξ 2 : coker d stack 0 → C stack 2 are induced by d c o d e 1 d^1_{\mathrm{code}} d code 1 and d s t a c k 1 d^1_{\mathrm{stack}} d stack 1 , and ζ 1 = π c o d e h : C c o d e 2 → coker d c o d e 0 \zeta_1=\pi_{\mathrm{code}}h:C^2_{\mathrm{code}}\to\operatorname{coker}d^0_{\mathrm{code}} ζ 1 = π code h : C code 2 → coker d code 0 and ζ 2 = π s t a c k h ′ : C s t a c k 2 → coker d s t a c k 0 \zeta_2=\pi_{\mathrm{stack}}h':C^2_{\mathrm{stack}}\to\operatorname{coker}d^0_{\mathrm{stack}} ζ 2 = π stack h ′ : C stack 2 → coker d stack 0 . The maps ξ 1 \xi_1 ξ 1 and ξ 2 \xi_2 ξ 2 are well defined because the differentials square to zero. The maps Γ ∗ \Gamma_* Γ ∗ and Δ ∗ \Delta_* Δ ∗ are mutually inverse up to maps that factor through the free modules C c o d e 2 C^2_{\mathrm{code}} C code 2 and C s t a c k 2 C^2_{\mathrm{stack}} C stack 2 .
We now absorb these errors by showing that coker d s t a c k 0 ⊕ C c o d e 2 \operatorname{coker}d^0_{\mathrm{stack}}\oplus C^2_{\mathrm{code}} coker d stack 0 ⊕ C code 2 is isomorphic to coker d c o d e 0 \operatorname{coker}d^0_{\mathrm{code}} coker d code 0 plus a finite free module. Define ι : coker d c o d e 0 → coker d s t a c k 0 ⊕ C c o d e 2 \iota:\operatorname{coker}d^0_{\mathrm{code}}\to\operatorname{coker}d^0_{\mathrm{stack}}\oplus C^2_{\mathrm{code}} ι : coker d code 0 → coker d stack 0 ⊕ C code 2 and ρ : coker d s t a c k 0 ⊕ C c o d e 2 → coker d c o d e 0 \rho:\operatorname{coker}d^0_{\mathrm{stack}}\oplus C^2_{\mathrm{code}}\to\operatorname{coker}d^0_{\mathrm{code}} ρ : coker d stack 0 ⊕ C code 2 → coker d code 0 by ι [ c ] = ( Δ ∗ [ c ] , ξ 1 [ c ] ) \iota[c]=(\Delta_*[c],\xi_1[c]) ι [ c ] = ( Δ ∗ [ c ] , ξ 1 [ c ]) and ρ ( [ t ] , c ) = Γ ∗ [ t ] + ζ 1 c \rho([t],c)=\Gamma_*[t]+\zeta_1c ρ ([ t ] , c ) = Γ ∗ [ t ] + ζ 1 c . By the first identity in Eq. (21) , ρ ι = I \rho\iota=I ρ ι = I , so ι \iota ι is a section of ρ \rho ρ . With Q = ker ρ Q=\ker\rho Q = ker ρ , we obtain
coker d s t a c k 0 ⊕ C c o d e 2 = ι ( coker d c o d e 0 ) ⊕ Q ≅ coker d c o d e 0 ⊕ Q . \operatorname{coker}d^0_{\mathrm{stack}}\oplus C^2_{\mathrm{code}}=\iota(\operatorname{coker}d^0_{\mathrm{code}})\oplus Q\cong\operatorname{coker}d^0_{\mathrm{code}}\oplus Q. coker d stack 0 ⊕ C code 2 = ι ( coker d code 0 ) ⊕ Q ≅ coker d code 0 ⊕ Q .
If ( [ t ] , c ) ∈ Q ([t],c)\in Q ([ t ] , c ) ∈ Q , then Γ ∗ [ t ] = − ζ 1 c \Gamma_*[t]=-\zeta_1c Γ ∗ [ t ] = − ζ 1 c , and the second identity in Eq. (21) gives [ t ] = Δ ∗ Γ ∗ [ t ] + ζ 2 ξ 2 [ t ] = ζ 2 ξ 2 [ t ] − Δ ∗ ζ 1 c [t]=\Delta_*\Gamma_*[t]+\zeta_2\xi_2[t]=\zeta_2\xi_2[t]-\Delta_*\zeta_1c [ t ] = Δ ∗ Γ ∗ [ t ] + ζ 2 ξ 2 [ t ] = ζ 2 ξ 2 [ t ] − Δ ∗ ζ 1 c . Hence the map Q → C s t a c k 2 ⊕ C c o d e 2 Q\to C^2_{\mathrm{stack}}\oplus C^2_{\mathrm{code}} Q → C stack 2 ⊕ C code 2 , ( [ t ] , c ) ↦ ( ξ 2 [ t ] , c ) ([t],c)\mapsto(\xi_2[t],c) ([ t ] , c ) ↦ ( ξ 2 [ t ] , c ) , has the left inverse ( t ′ , c ) ↦ ( I − ι ρ ) ( ζ 2 t ′ − Δ ∗ ζ 1 c , c ) (t',c)\mapsto(I-\iota\rho)(\zeta_2t'-\Delta_*\zeta_1c,c) ( t ′ , c ) ↦ ( I − ι ρ ) ( ζ 2 t ′ − Δ ∗ ζ 1 c , c ) , where I − ι ρ I-\iota\rho I − ι ρ is the projection onto Q Q Q . Thus Q Q Q is isomorphic to a direct summand of the finite free module C s t a c k 2 ⊕ C c o d e 2 C^2_{\mathrm{stack}}\oplus C^2_{\mathrm{code}} C stack 2 ⊕ C code 2 , so it is finitely generated and projective. It is even free [53 ] , but we never compute a basis: an explicit isomorphism Q ⊕ R k ≅ R a Q\oplus R^k\cong R^a Q ⊕ R k ≅ R a for some k k k and a a a suffices, and the complexes already provide one. Since C c o d e C_{\mathrm{code}} C code and C s t a c k C_{\mathrm{stack}} C stack are exact in degrees n ≤ 0 n\leq0 n ≤ 0 , their parts in degrees at most one are finite free resolutions of coker d c o d e 0 \operatorname{coker}d^0_{\mathrm{code}} coker d code 0 and coker d s t a c k 0 \operatorname{coker}d^0_{\mathrm{stack}} coker d stack 0 . Lifting ρ \rho ρ to these resolutions, with C c o d e 2 C^2_{\mathrm{code}} C code 2 adjoined in degree one, and taking the mapping cone gives a bounded complex of finite free modules whose only cohomology is Q Q Q , in degree zero. As Q Q Q is projective, this complex splits degree by degree, and each splitting map is a section of a surjection or a retraction of an injection, found by solving a linear system. Comparing the terms in even and odd degrees then gives the isomorphism Q ⊕ R k ≅ R a Q\oplus R^k\cong R^a Q ⊕ R k ≅ R a . This is the generalized Schanuel lemma [54 §5A] , applied to this resolution of Q Q Q and to the resolution 0 → Q → Q → 0 0\to Q\to Q\to0 0 → Q → Q → 0 ; as for the contraction above, its proof only uses sections of surjections onto projective modules. With b = rank C c o d e 2 + k b=\operatorname{rank}C^2_{\mathrm{code}}+k b = rank C code 2 + k , adding R k R^k R k to both sides gives the isomorphism ϕ 2 : coker d s t a c k 0 ⊕ R b → coker d c o d e 0 ⊕ R a \phi^2:\operatorname{coker}d^0_{\mathrm{stack}}\oplus R^b\to\operatorname{coker}d^0_{\mathrm{code}}\oplus R^a ϕ 2 : coker d stack 0 ⊕ R b → coker d code 0 ⊕ R a of Lemma 10.
Cost of the construction
We now bound the cost of Algorithm 2 and prove Proposition 1, which we restate.
Proposition 1 (Polynomial cost). The number of arithmetic operations over F p \mathbb{F}_p F p used by Algorithm 2 is bounded by a polynomial in the number of coefficients of the differentials of its input, counted with all exponents in a common box. The degree of this polynomial depends only on the spatial dimension D D D . The same polynomial bounds the depth of the output circuit and its number of ancillas per unit cell.
Throughout, R R R denotes the ring of the coarse-grained lattice. We write the differentials of the input C c o d e C_{\mathrm{code}} C code as matrices of Laurent polynomials whose exponents lie in a common box { − h , … , h } D \{-h,\ldots,h\}^D { − h , … , h } D . The size in Proposition 1 is the number of their coefficients in this box, so it bounds both the sizes of these matrices and their degrees. Like the complex of Lemma 4 , C c o d e C_{\mathrm{code}} C code vanishes outside degrees ∣ n ∣ ≤ D + 2 |n|\leq D+2 ∣ n ∣ ≤ D + 2 .
a. Linear systems. Every step of the construction finds either generators of the solutions of a homogeneous system A y = 0 Ay=0 A y = 0 over R R R , or one solution of a system A y = b Ay=b A y = b that is known to be solvable. We replace each x i − 1 x_i^{-1} x i − 1 by a new variable y i y_i y i , clear negative exponents by multiplying with monomials, and add unknown multiples of x i y i − 1 x_i y_i-1 x i y i − 1 ; this gives an equivalent system over the polynomial ring in 2 D 2D 2 D variables. If this system has m m m equations and degree d d d , its solutions are generated by solutions of degree at most ( 2 m d ) 2 D (2md)^{2^D} ( 2 m d ) 2 D , and if it is solvable, it has a solution of this degree [38 Thms. 3.2 and 3.4] . Expanding the unknowns up to this degree and comparing coefficients gives a linear system over F p \mathbb{F}_p F p of polynomial size, which Gaussian elimination solves. Each step therefore costs a polynomial in the sizes and degrees of A A A and b b b , and its output has polynomially bounded size and degree.
b. The lines of Algorithm 2. In line 1, for each degree n n n , we compute generators z 1 , … , z g z_1,\ldots,z_g z 1 , … , z g of ker d c o d e n \ker d^n_{\mathrm{code}} ker d code n , and generators u α u_\alpha u α of the module of vectors u ∈ R g u\in R^g u ∈ R g with ∑ i u i z i ∈ im d c o d e n − 1 \sum_i u_i z_i\in\operatorname{im}d^{n-1}_{\mathrm{code}} ∑ i u i z i ∈ im d code n − 1 . Since m m m annihilates H n ( C c o d e ) H^n(C_{\mathrm{code}}) H n ( C code ) , this module contains m R g mR^g m R g , so H n ( C c o d e ) ≅ F p g / span { u α ( 1 ) } H^n(C_{\mathrm{code}})\cong\mathbb{F}_p^g/\operatorname{span}\{u_\alpha(1)\} H n ( C code ) ≅ F p g / span { u α ( 1 )} , where u α ( 1 ) u_\alpha(1) u α ( 1 ) is the value of u α u_\alpha u α at x 1 = ⋯ = x D = 1 x_1=\cdots=x_D=1 x 1 = ⋯ = x D = 1 . Gaussian elimination then gives t n t_n t n and cocycles representing a basis, as in the first step of the algorithm of Ref. [23 ] for D = 2 D=2 D = 2 . In line 2, Γ \Gamma Γ solves the solvable system of Appendix C4, and the components of h G h_G h G solve the solvable systems given there, one degree at a time. In line 3, Γ ∗ \Gamma_* Γ ∗ , Δ ∗ \Delta_* Δ ∗ , ξ i \xi_i ξ i , ζ i \zeta_i ζ i , ι \iota ι , and ρ \rho ρ are products of known matrices, and the isomorphism Q ⊕ R k ≅ R a Q\oplus R^k\cong R^a Q ⊕ R k ≅ R a needs a lift of ρ \rho ρ and the splitting maps, each a solution of a solvable system. In line 4, the lifts ϕ i \phi^i ϕ i and ψ i \psi^i ψ i and the homotopies η \eta η solve solvable systems, and U U U and V V V are block matrices built from them. In line 5, U U U is a block swap times elementary matrices, one for each monomial in the entries of ϕ ^ i \hat{\phi}^i ϕ ^ i and ψ ^ i \hat{\psi}^i ψ ^ i . The depth of the circuit is therefore at most the number of these monomials plus the number of qudits per unit cell, which bounds the SWAP gates of the block swap. The number of ancillas per unit cell is the total rank of the adjoined free modules.
c. Total cost. The number of steps, and the number of times the output of one step enters another, are bounded in terms of D D D . Composing the polynomial bounds a bounded number of times again gives a polynomial... ...mial in the dense size of the input, which proves Proposition 1.
Logical qudits on a torus
We prove Corollary 1, which we restate. Here R = F p [ Z D ] R = \mathbb{F}_p[\mathbb{Z}^D] R = F p [ Z D ] is the ring of the original lattice and L ⊆ Z D L \subseteq\mathbb{Z}^D L ⊆ Z D is the period lattice. As in Ref. [23 ] , periodic boundary conditions are imposed by tensoring with R L = R / ( x α − 1 : α ∈ L ) R_L = R/(x^\alpha- 1 : \alpha\in L) R L = R / ( x α − 1 : α ∈ L ) . For a complex A A A of R R R -modules, we write A L A_L A L for the derived tensor product A ⊗ R R L A \otimes_R R_L A ⊗ R R L , computed after replacing A A A by a quasi-isomorphic bounded complex of free R R R -modules. Since R L = R ⊗ F p [ L ] F p R_L = R \otimes_{\mathbb{F}_p[L]} \mathbb{F}_p R L = R ⊗ F p [ L ] F p and R R R is free over F p [ L ] \mathbb{F}_p[L] F p [ L ] , A L A_L A L is also A ∣ F p [ L ] ⊗ F p [ L ] F p A|_{\mathbb{F}_p[L]} \otimes_{\mathbb{F}_p[L]} \mathbb{F}_p A ∣ F p [ L ] ⊗ F p [ L ] F p , computed in the same way, so it depends only on A ∣ F p [ L ] A|_{\mathbb{F}_p[L]} A ∣ F p [ L ] ; we use the same notation for complexes over F p [ L ] \mathbb{F}_p[L] F p [ L ] .
Corollary 1 (Logical qudits on a torus). Let the layers E X j E_X^j E X j be finite dimensional over F p \mathbb{F}_p F p , with t j = dim F p E X j t_j = \dim_{\mathbb{F}_p} E_X^j t j = dim F p E X j . A torus with period lattice L ⊆ Z D L \subseteq\mathbb{Z}^D L ⊆ Z D encodes at most ∑ j ( D j ) t j \sum_j \binom{D}{j} t_j ∑ j ( j D ) t j logical qudits, with equality if and only if the code can be decoupled on $L.
We first count the contribution of a single layer.
Lemma 13. Let E E E be an F p [ L ] \mathbb{F}_p[L] F p [ L ] -module that is finite dimensional over F p \mathbb{F}_p F p , and let 1 ≤ j ≤ D − 1 1 \leq j \leq D - 1 1 ≤ j ≤ D − 1 . Then
dim F p H 0 ( E [ − j ] L ) ≤ ( D j ) dim F p E , \dim_{\mathbb{F}_p} H^0(E[-j]_L) \leq\binom{D}{j}\dim_{\mathbb{F}_p} E, dim F p H 0 ( E [ − j ] L ) ≤ ( j D ) dim F p E , with equality if and only if L L L acts trivially on $E.
Proof. Let K ∙ ′ K'_\bullet K ∙ ′ be the Koszul complex over F p [ L ] \mathbb{F}_p[L] F p [ L ] built from the x μ a − 1 x^{\mu_a} - 1 x μ a − 1 for a basis μ 1 , … , μ D \mu_1,\ldots,\mu_D μ 1 , … , μ D of L L L , a free resolution of F p \mathbb{F}_p F p . Computing with it, H 0 ( E [ − j ] L ) H^0(E[-j]_L) H 0 ( E [ − j ] L ) is the homology of K ∙ ′ ⊗ F p [ L ] E K'_\bullet\otimes_{\mathbb{F}_p[L]} E K ∙ ′ ⊗ F p [ L ] E at the term K j ′ ⊗ E K'_j \otimes E K j ′ ⊗ E , which has dimension ( D j ) dim F p E \binom{D}{j}\dim_{\mathbb{F}_p} E ( j D ) dim F p E . The differentials multiply by the x μ a − 1 x^{\mu_a} - 1 x μ a − 1 , so they vanish if L L L acts trivially on E E E . Otherwise ( x μ a − 1 ) b ≠ 0 (x^{\mu_a} - 1)b \ne0 ( x μ a − 1 ) b = 0 for some a a a and b ∈ E b \in E b ∈ E . For a ( j + 1 ) (j+1) ( j + 1 ) -cell e J ′ e'_J e J ′ with a ∈ J a \in J a ∈ J , which exists since j ≤ D − 1 j \leq D - 1 j ≤ D − 1 , the image of e J ′ ⊗ b e'_J \otimes b e J ′ ⊗ b in K j ′ ⊗ E K'_j \otimes E K j ′ ⊗ E has the nonzero component ± e J ∖ { a } ′ ⊗ ( x μ a − 1 ) b \pm e'_{J\setminus\{a\}} \otimes(x^{\mu_a} - 1)b ± e J ∖ { a } ′ ⊗ ( x μ a − 1 ) b , and the inequality is strict. □ \square □
Proof of Corollary 1. On the torus, the number of logical qudits is k = dim F p ( ker H X / im H Z † ) k = \dim_{\mathbb{F}_p}(\ker H_X/\operatorname{im} H_Z^\dagger) k = dim F p ( ker H X / im H Z † ) over R L R_L R L , the cohomology in degree zero of ( C c o d e ) L (C_{\mathrm{code}})_L ( C code ) L . Since C c o d e ≃ E X C_{\mathrm{code}} \simeq\mathcal{E}_X C code ≃ E X (Lemma 4), k = dim F p H 0 ( ( E X ) L ) k = \dim_{\mathbb{F}_p} H^0((\mathcal{E}_X)_L) k = dim F p H 0 (( E X ) L ) . Tensoring the truncation triangles (9) with R L R_L R L gives exact sequences
H 0 ( ( τ ≤ j − 1 E X ) L ) ⟶ H 0 ( ( τ ≤ j E X ) L ) ⟶ H 0 ( ( E X j [ − j ] ) L ) → ( δ j ) ∗ H 1 ( ( τ ≤ j − 1 E X ) L ) , H^0((\tau_{\leq j-1}\mathcal{E}_X)_L) \longrightarrow H^0((\tau_{\leq j}\mathcal{E}_X)_L)
\longrightarrow H^0((E_X^j[-j])_L) \xrightarrow{(\delta_j)_*} H^1((\tau_{\leq j-1}\mathcal{E}_X)_L), H 0 (( τ ≤ j − 1 E X ) L ) ⟶ H 0 (( τ ≤ j E X ) L ) ⟶ H 0 (( E X j [ − j ] ) L ) ( δ j ) ∗ H 1 (( τ ≤ j − 1 E X ) L ) ,
so the dimension of the second term is at most the sum of those of its neighbors minus the rank of ( δ j ) ∗ (\delta_j)_* ( δ j ) ∗ . Summing over j j j and applying Lemma 13 to every layer gives k ≤ ∑ j ( D j ) t j k \leq\sum_j \binom{D}{j}t_j k ≤ ∑ j ( j D ) t j , with strict inequality unless L ⊆ Λ t r i v L \subseteq\Lambda_{\mathrm{triv}} L ⊆ Λ triv and every ( δ j ) ∗ (\delta_j)_* ( δ j ) ∗ vanishes.
Now let L ⊆ Λ t r i v L \subseteq\Lambda_{\mathrm{triv}} L ⊆ Λ triv . If the profile does not split over F p [ L ] \mathbb{F}_p[L] F p [ L ] , then for the smallest j j j with δ j ≠ 0 \delta_j \ne0 δ j = 0 , some gluing class κ j i \kappa_j^i κ j i is nonzero, so it has a nonzero value on some cell of L L L (Lemma 1). Since L L L acts trivially on the layers, the differentials in the proof of Lemma 13 vanish, so H 0 ( E X j [ − j ] L ) H^0(E_X^j[-j]_L) H 0 ( E X j [ − j ] L ) has one copy of E X j E_X^j E X j for each orientation J J J of the j j j -cells of L L L . The map ( δ j ) ∗ (\delta_j)_* ( δ j ) ∗ sends the copy at J J J to the copies of E X j + 1 E_X^{j+1} E X j + 1 at the faces J ∖ I J \setminus I J ∖ I , each through the value of κ j i \kappa_j^i κ j i on I I I , so a nonzero value makes it nonzero. Equality therefore requires L ⊆ Λ t r i v L \subseteq\Lambda_{\mathrm{triv}} L ⊆ Λ triv and a split profile over F p [ L ] \mathbb{F}_p[L] F p [ L ] , so the code can be decoupled on L L L by Sec. III A and Theorem 1.
Conversely, if the code can be decoupled on L L L , its profile over F p [ L ] \mathbb{F}_p[L] F p [ L ] is ⨁ j F p [ − j ] ⊕ t j \bigoplus_j \mathbb{F}_p[-j]^{\oplus t_j} ⨁ j F p [ − j ] ⊕ t j (Theorem 1), so Lemma 13 with E = F p E = \mathbb{F}_p E = F p gives k = ∑ j ( D j ) t j k = \sum_j \binom{D}{j}t_j k = ∑ j ( j D ) t j . □ \square □
References