Good Quantum LDPC Codes with Linear Time Decoders

We construct a new explicit family of good quantum low-density parity-check codes which additionally have linear time decoders. Our codes are based on a three-term chain (2m× m)V   →δ0  (2m)E →δ1  2F where V (X-checks) are the vertices, E (qubits) are the edges, and F (Z-checks) are the squares of a left-right Cayley complex, and where the maps are defined based on a pair of constant-size random codes CA,CB:2m→2Δ where Δ is the regularity of the underlying Cayley graphs. One of the main ingredients in the analysis is a proof of an essentially-optimal robustness property for the tensor product of two random codes.


Introduction
Quantum error correction is an essential ingredient to achieve fault-tolerant quantum computation.An important class of quantum codes relevant to fault-tolerance are quantum low-density parity-check (qLDPC) codes [2].These are codes whose checks act only on a constant number of qubits, and further each qubit is acted on only by a constant number of checks.This low connectivity is desirable because it reduces the chance for errors to spread when checks are being measured for error correction.
Several families of qLDPC codes have been studied starting from Kitaev's toric code [3], with increasing rate and distance [4,5,6,7,8,9,10].Recently Panteleev and Kalachev [11] gave the first construction of good qLDPC codes, i.e. qLDPC codes with constant rate and constant relative distance.A subsequent variation on their construction was given in [12]. 1  A natural question left open by the recent constructions of good qLDPC codes is the existence of efficient decoders for them.In this work, we give a new construction of qLDPC, which borrows many of the ingredients from [11] as well as ideas from the recent classical locally testable codes by Dinur, Evra, Livne, Lubotzky, and Mozes [1], and show that our codes have linear time decoders.Theorem 1.1.For every r P p0, 1{2q, there exist constants δ ą 0, w P N and an explicit infinite family of quantum LDPC codes with maximum weight w, rate r, and relative distance δ.Furthermore these codes are equipped with a linear time decoder that decodes up to linear distance.
Our codes are based on a three-term chain The chain is ordered "geometrically" by dimension, so that V are the vertices, E are the edges, and F are the faces (squares) of a left-right Cayley complex.Informally, this complex has vertices labeled by elements g of a finite group G, edges labeled by two sets of generators A, B as pg, agq and pg, gbq for g P G, a P A and b P B, and squares pg, ag, gb, agbq labeled by pairs pa, bq P A ˆB.The maps δ 0 , δ 1 in (1) are defined via a pair of base codes Theorem 1.2 (Random Tensor Codes are Robust (Informal Theorem 2.10)).For every ρ a , ρ b P p0, 1q, there exist constants δ 1 , δ 2 such that for C A , C B sampled from the uniform distribution of linear codes of length n and dimensions ρ a n, ρ b n, for large n, with high probability, C A , C B have distance δ 1 n and pC A , C B q is δ 2 n robust.
Since the theorem is about random linear codes, it follows directly that robustness holds simultaneously for both pC A , C B q as well as pC K A , C K B q, with high probability.The proof follows a counting argument similar to the proof of the Gilbert-Varshamov bound.One defines certain words as 'bad' and then shows that with high probability none of these 'bad' words is a codeword through a union bound.The additional twist is that one organizes the words by rank.See Section 5 for details.

Related work
Quantum LDPC Codes and LTCs.Our work fits into a line of recent works on quantum LDPC codes and LTCs [1,11,14,12].The constructions for qLDPC codes and LTCs turn out to be quite similar because both problems utilize 3-term chain complexes with expansion properties.We focus on the history of quantum LDPC codes.The historical development of LTCs can be found in [15] and a more recent development can be found in [1].More discussion of qLDPC can be found in [16].
The earliest family of qLDPC codes are Kitaev's toric codes and surface codes [3] with dimension k " Θp1q and distance d " Θp ?nq.Over time, better codes with increasing rate [4] k " Θpnq and distance [5,6,7] d " Θppolylogpnq ?nq have been discovered.Only recently did [8] and following works [9,10] significantly break the square root barrier and achieve d " Θpn{ log nq.Finally, [11] showed the existence of good quantum LDPC codes with k " Θpnq and d " Θpnq.More recently, [12] provide another construction of good quantum LDPC codes.
Decoders for Quantum LDPC Codes.Finding an efficient decoder is often the next question after knowing the distance of a code.If one does not worry about the efficiency, in exponential time, it is known that one can decode up to pd ´1q{2 errors by finding the closest codeword.Practically, it is more desirable to have a polynomial time or even a linear time decoder.
Existing decoders can be broadly separated into two families that focus on different type of qLDPC codes.The first family mainly decodes the surface codes, while the second family mainly decodes expander codes.Because the code structure is different, the corresponding decoding strategy is also very different.The first family includes minimum-weight perfect matching [17], union-find [18], and variants of belief propagation decoders [19,20].A more complete discussion can be found in [16].
We now focus on the second family, which the decoder of this paper belongs to.When the underlying graph has good expansion properties, often the greedy algorithm that flips the bits locally will work.This includes the classical expander codes [21] and the corresponding small set flip decoder in [22] for quantum codes.The same decoder was also applied to [6,23].In this work, we use the small set flip decoder to decode the direction of the co-chain complex (i.e.decode Z errors), and additionally use a "reconstruction" procedure to decode the direction of the chain complex (i.e.decode X errors).
High Dimensional Expanders.Our work can be case as a study of notions of expansion in chain complexes.This relates to the study of high dimensional expanders (HDX), which is about notions of expansion for high-dimensional objects.The study of the HDX was introduced by Linial and Meshulam [24] to study random simplicial complexes and independently by Gromov [25] to study the topological overlapping principle.These natural questions have led to impressive results across areas including coding theory [26,1,11,14], approximate sampling [27,28,29,30], analysis of Boolean functions [31,32,33], agreement testing [34,35], and sum-of-square lower bounds [36,37].
The most studied type of HDX are called simplicial complexes.On the other hand, the recent development of qLDPC codes is more related to the cubical complexes.It would be interesting to see if one can translate the results from one to the other.One recent success is the application of qLDPC codes to sum-of-square lower bounds [37].

Further directions
Decoders for Other Quantum LDPC Codes.Our code construction has rate up to 1{2, whereas the code construction in [11,12] have rate up to 1.It would be interesting to see if these constructions with rate up to 1 have linear time decoders, potentially using the robust code with better parameter constructed in this paper.
Towards Quantum LTCs.Related to qLDPC codes and LTCs are quantum locally testable codes (qLTCs) [38].Our proof technique may extend to the analysis of higher-length chain complexes, on which such qLTCs could be built.The main challenge towards this seems to be the absence of higher dimensional robust codes.On the topic of robustness, even for two-dimensional robustness we note that the current proofs only provide existence of robust codes via a probabilistic argument.It could be useful to have a direct, explicit construction as this may generalize more easily to higher dimensions than the probabilistic argument.
PCPs and Quantum PCPs.Probabilistic checkable proofs (PCPs) and locally testable codes are closely, though not formally, related.(See [15] for a survey.)In the quantum complexity literature there is a quantum version of PCPs [39], the existence of which remains open.It would be interesting to see if one can make progress on this question by leveraging the recent works on qLDPCs.
Because F Xpiq 2 has a canonical choice of basis corresponding to the elements of Xpiq, one can define the associated co-boundary operators δ i :" B T i´1 : , where p¨q T denotes the matrix transpose.The co-boundary operators automatically satisfy δ i`1 δ i " 0 .
We introduce some standard terminology.Elements of the kernel of the (co)-boundary operators are called (co)-cycles Elements of the image of the (co)-boundary operators are called (co)-boundaries Since B i B i`1 " 0 it follows that B i Ă Z i .When B i " Z i the chain complex is said to be exact at i.

Classical and quantum error correcting codes
A classical linear code is specified by a k-dimensional linear subspace C Ă F n 2 .Here, n is called the length, k is called the dimension, and d :" min cPC |c| is called the distance, where |¨| is the Hamming weight, i.e. the number of non-zero entries.We call r " k{n the rate and δ " d{n the relative distance of the code.A more explicit way of describing a classical linear code is by specifying a parity-check matrix H : F n 2 Ñ F m 2 where m " n ´k and C " ker H is the kernel of the matrix.
A quantum CSS code is specified by two classical codes This condition allows us to associate a 3-term chain complex to the quantum code, Here are the relevant quantities associated with the quantum code.Elements of and d x , d z are called the X-distance and Z-distance of the code respectively.The code is called a quantum low-density parity-check code (qLDPC) if H x and H z have a bounded number of nonzero entries in each column and row.
Having defined a quantum code, we now describe the task of decoding.The goal of the decoder is to recover the error pattern from the syndrome.Under the stabilizer formalism, one can express any error pattern as a pair pc 1 , c 1 q where c 1 P F n 2 indicates coordinates with an X-error and c 1 P F n 2 indicates coordinates with a Z-error.The decoder is given the syndrome pδ 1 c 1 , B 1 c 1 q and is required to return a correction pc 1 , c1 q such that the difference from the actual error is a stabilizer, i.e. c1 ´c1 P B 1 and c1 ´c1 P B 1 .This task can be divided into two independent tasks where one recovers c1 from δ 1 c 1 (X-error decoding) and the other recovers c1 from B 1 c 1 (Z-error decoding).

Expander graphs
Expander graphs are used to obtain various important results in theoretical computer science.The most important one in our context is the expander codes [21].We refer the reader to [40] for other applications of expander graphs.Definition 2.2 (Spectral Expander Graphs and Ramanujan Graphs).Let G " pV, Eq be an undirected, ∆-regular graph on n vertices, and define λpGq :" maxt|λ 2 |, |λ n |u where ∆ " λ 1 ě λ 2 ě ... ě λ n are the eigenvalues of the adjacency matrix of G.We say that G is a λ-spectral expander if λpGq ď λ.
We use spectral expanders for two reasons.First, there are known explicit infinite families of spectral expanders [41].Second, spectral expansion implies edge expansion which is a key ingredient to obtain our results.This property is captured in the following expander mixing lemma which first appeared in [42].
Lemma 2.3 (Expander Mixing Lemma).Let G be a ∆-regular graph with λ-spectral expansion.Then for any subset S, T Ă V , we have Moreover, for any vectors x, y P R V we have where M is the adjacency matrix of G and for z P R n , z 1 "

Left-right Cayley complexes
Our code construction is based on the left-right Cayley complex introduced in [1].A similar structure also appeared in [10,11].The 4-fold left-right Cayley complex G 2 pG, A, Bq is specified by a finite group G and two sets of generators A and B which are closed under inverse.The complex is illustrated in Figure 1.It consists of vertices, edges, and faces as follows: • The faces are F " tpg, ag, gb, agbq : g P G, a P A, b P Bu Ă V 00 ˆV10 ˆV01 ˆV11 .
To clarify which vertex set, V 00 , V 01 , etc. a given vertex g belongs to, we sometimes write the vertex as pg, 00q or pg, 01q, etc.The same convention applies to edges.For example, ppg, agq, ˚0q is an edge in E ˚0.Note that the edges and faces are labeled by ordered tuples instead of sets.Elements of E | are referred to as vertical edges, and elements of E ´as horizontal edges.The appearance of faces crucially relies on the fact that the left action commutes with the right action, e.g.apgbq " pagqb.
We introduce the following important notation to describe the neighborhood relation between the vertices, edges and faces.For v 00 P V 00 we define V 10 pv 00 q as the set of vertices in V 10 neighbor to v 00 and V 11 pv 00 q as the set of vertices in V 11 "neighbor" to v 00 by going through a horizontal edge and a vertical edge.Similarly we define E ˚0pv 00 q as the set of edges in E ˚0 incident to v 00 and E 1˚p v 00 q as the set of edges accessible by v 00 by first going through a vertical edge then choosing an adjacent horizontal edge.
More precisely, given v 00 " pg, 00q we define the following neighborhoods.
v 00 V 10 pv 00 q V 01 pv 00 q V 11 pv 00 q E ˚0pv 00 q F pe ˚0q Finally we introduce subgraphs of the complex that will be used to define Tanner codes in Section 2.6.GpE | , F q is the bipartite graph that has E | " E ˚0 Y E ˚1 as vertices and F as the edges between them.More precisely, the edges are F -tppg, agq, pgb, agbqq : g P G, a P A, b P Bu Ă E ˚0 ˆE˚1 .The bipartite graph GpE ´, F q is defined similarly.GpV, E | q is the bipartite graph that has V " pV 00 Y V 01 q Y pV 10 Y V 11 q as vertices and E | as the edges between them.More precisely, the edges are E | " E ˚0 Y E ˚1 where E ˚0 -tpg, agq : g P G, a P Au Ă V 00 ˆV10 and E ˚1 -tpg, agq : g P G, a P Au Ă V 01 ˆV11 .One defines the bipartite graph GpV, E ´q similarly.
We conclude by discussing an explicit instance that is used in our construction.We use the Ramanujan graph constructed in [41].Let p and q be unequal primes " 1 mod 4 and `q p ˘" 1 where `q p ˘is the Legendre symbol.Let G " PSLp2, Z{qZq and S " S ´1 be the set of size ∆ " p `1 as defined in the paper.The paper above shows that the Cayley graph CaypG, Sq with vertex set G and edge set ttg, agu : g P G, a P Su is a Ramanujan graph.Finally, the 4-fold left-right Cayley complex we consider is G 2 pG, A " S, B " Sq.

Expansion properties of left-right Cayley complexes
We give three lemma that state expansion properties of operators defined on graphs obtained from the left-right Cayley complex.The first two lemma show expansion properties of two different random walks on the edges of G 2 pG, A, Bq.Lemma 2.4.Let M 1 P R EˆE be the adjacency matrix between opposing edges of the same face in G 2 pG, A, Bq, i.e. the adjacency matrix of the graph ppg, agq, ˚0q " ppgb, agbq, ˚1q , ppg, gbq, 0˚q " ppag, agbq, 1˚q @g P G, a P A, b P B .
Suppose that CaypG, Aq and CaypG, Bq are λ-spectral expanders.Then for any subset S Ď E it holds that Proof.M 1 is the disjoint union of |G| copies of Cay b pG, Aq and |G| copies of Cay b pG, Bq where Cay b pG, Aq and Cay b pG, Bq are the double covers of the λ-spectral expander graphs CaypG, Aq and CaypG, Bq.Let S " Y i pS 0 i YS 1 i q be a partition of S according to each disjoint graph and their two vertex sets.Each disjoint graph satisfies, Lemma 2.5.Let M 0 P R EˆE be the adjacency matrix where two edges of G 2 pG, A, Bq are connected if one of their endpoints are connected through an edge, i.e.M 0 " U M 1 0 D where D P R V ˆE and U P R EˆV are the incidence matrices between the edges and the vertices and M 1 0 is the adjacency matrix of the graph pg, 00q " pag, 10q, pg, 00q " pgb, 01q, pag, 10q " pagb, 11q, pgb, 01q " pagb, 11q @g P G, a P A, b P B .
Suppose that CaypG, Aq and CaypG, Bq are λ-spectral expanders.Then for any subset S Ď E it holds that Note that we allow multi-edges, so some entries of M 0 could be greater than 1 when there are degeneracies.
Proof.M 1 0 is the union of two copies of Cay b pG, Aq and two copies of Cay b pG, Bq.Let V 00 P V 00 , V 10 P V 10 , V 10 P V 10 and V 11 P V 11 be the vertices incident on E. Because each edge is connected to two vertices, Because each vertex is connected by at most 2∆ edges, V 00 8 ď 2∆, so The expander subgraph Cay b pG, Aq between V 00 and V 10 gives By combining with other expander subgraphs, we have The third lemma shows co-expansion of an associated graph.).Given ∆-regular λ-spectral expander graphs CaypG, Aq, CaypG, Bq and linear codes Proof.To show the expansion, one consider each component c 1 pE ˚0q " δ 0 c 0 pV 00 q `δ0 c 0 pV 10 q separately.Because of code distance, each non-zero vertices in V 00 contribute to at least d 1 distinct non-zero edges in δ 0 c 0 pV 00 q.Same for δ 0 c 0 pV 10 q.What is left is to bound the number of cancellations in δ 0 c 0 pV 00 q `δ0 c 0 pV 10 q.Because pV 00 , V 10 , E ˚0q is the double cover of the λ-spectral expander CaypG, Aq, the number of cancellation is at most λ a c 0 pV 00 q V c 0 pV 10 q V `∆ |G| c 0 pV 00 q V c 0 pV 10 q V .So c 1 pE ˚0q E ě d 1 p c 0 pV 00 q V ` c 0 pV 10 q V q ´2pλ a c 0 pV 00 q V c 0 pV 10 q V `∆ |G| c 0 pV 00 q V c 0 pV 10 q V q ě pd 1 ´λqp c 0 pV 00 q V ` c 0 pV 10 q V q ´2∆ |G| c 0 pV 00 q V c 0 pV 10 q V .Now we combine the four contributions and use AM-GM inequality to obtain

Tensor codes and robustness
Robust codes were first studied in [43] and [44] in the context of locally testable codes (LTC).Similar variants are applied to the construction LTC and qLDPC in [1,11,12].In this paper, the definition of robustness is identical to agreement testability up to a normalization constant.We first give the definition, then discuss its equivalence to agreement testability, and finally state our result stating robustness of the tensor product of random tensor codes.Given 2 linear codes C A , C B of length n a , n b let C A b C B be the set of n a ˆnb matrices where each column vector belongs to C A and each row vector belongs to 2 b C B be the set of matrices that can be expressed as a sum of two n a ˆnb matrices, where the first has each column in C A and the second has each row in C B .We introduce convenient notation for measuring different variations on the Hamming weight of a matrix: by entries, by rows, or by columns.
This definition allows us to introduce the notion of robustness we make use of.The notion of robustness can be understood as boundary expansion for a chain complex naturally associated with the pair of codes pC A , C B q. To see this define a 3-term chain complex

We say that pC
through the maps where for an integer k ě 1, I rks denotes the identity map of F k 2 .Then it follows easily from the Künneth formula (see e.g.[45, Section 3.B]) that Y pH A , H B q is exact, i.e. any element in the kernel of B 1 is in the image of B 2 .Now consider the co-chain where H K A : F na 2 Ñ F ka 2 is the parity check matrix of the dual code C K A .Using this complex, Definition 2.8 can be reformulated as saying that for all c 2 P ΣpC A , C B q " im δ 1 , there exists where the variables c, c a , c b from Definition 2.8 correspond to the new variables Here we used the fact that c 1 a rn b s " ppH K A q T b I rn b s qc 1 a rn b s because pH K A q T is injective.The perspective through chain complexes allows us to make the connection with agreement testability.Note that the definition below differs from [1, Definition 2.8] by a normalization factor.Definition 2.9 (Agreement Testability).Let C A , C B be linear codes of length n a , n b respectively and Using the same notation as above, Definition 2.9 is saying that for all , where now c in Definition 2.9 corresponds to ppH K A q T bpH K B q T qc 0 and c a , c b are as before.Because the chain complex Y is exact, the two definitions are identical with d 2 " d 1 2 .Finally, we state our result on the robustness of random tensor codes.We consider the case when n a and n b are equal, n a " n b " ∆.In [12] it is shown that for for arbitrary ǫ ą 0 and C A and C B chosen uniformly at random, the pair pC A , C B q is Ωp∆ 1{2´ǫ q-robust with high probability.Using a different counting argument we show that a uniformly random pair of codes is Θp∆q-robust with high probability.
Theorem 2.10 (Random codes are robust).Fix ρ a , ρ b P p0, 1q, let δ 1 P p0, 1{2q, δ 2 P p0, δ 1 p1 ´δ1 {2q{8q satisfy where hppq " ´p log 2 ppq ´p1 ´pq log 2 p1 ´pq. 3 Let C A , C B be random codes sampled from the uniform distribution with length ∆ and dimensions ρ a ∆, ρ b ∆.Then as ∆ goes to infinity, with probability tending to 1, The theorem is shown in Section 5. When C A is sampled uniformly among codes of dimension ρ a ∆, C K A is sampled uniformly among codes of dimension p1 ´ρa q∆.So the same theorem applies to C K A and C K B and through a union bound we obtain the following corollary.
Corollary 2.11.Fix ρ a , ρ b P p0, 1q.There exist constants δ 1 and δ 2 such that for large enough ∆ there exist codes C A and C B of length ∆ where

Tanner codes
The Tanner construction [46] is a method to obtain 'large' code by combining a 'large' graph and a 'small' local code.This allows one to find an infinite family of codes by combining an infinite family of graphs with a fixed local code.
As long as the graphs are explicit, the Tanner codes are also explicit, even if finding the desired local code requires brute force search.When the underlying graph is an expander, the Tanner code often inherits desireable properties from the small code.Later, we will not only be interested in the code but also in the parity-check matrix that generates the code, since the LDPC property is defined on the parity-check matrix.Therefore, we sometimes abuse language and refer to the code and the linear map (parity-check matrix) interchangeably.
We consider a ∆-regular bipartite graph G " pV 0 , V 1 , Eq with the 1 ´1 identification E ˆr2s -V ˆr∆s, where the additional index on the edge indicates whether it is asking for the vertex on the side of V 0 or V 1 , and the additional index on the vertex gives an ordering to the edges incident to the vertex.For example, for the double cover of the Cayley graph with V 0 -V 1 -G and E " tpg, agq : g P G, a P Au, a choice of the identification is pe " pg, agq, 0q Ø pv 0 " pg, 0q, aq and pe " pg, agq, 1q Ø pv 1 " pag, 1q, aq.
Given a ∆-regular bipartite graph G and a local code C with parity-check matrix H : where the first map copies the value on the edge to the vertices incident to the edge and the second map applies H to for each vertex v. Another way to think about the map is though its submatrices.This description will be helpful to prove that the construction in Section 3 is a chain complex.Given an edge e P E and a vertex v P V , consider the submatrix T pG, Hq v e : F 2 Ñ F m 2 which is the restriction where the input vector is supported on e and the output vector is restricted to v. Describing T pG, Hq is the same as describing T pG, Hq v e for each e P E and v P V .When v and e are not incident, T pG, Hq v e is simply 0. When v and e are incident, and suppose pe, iq Ø pv, aq, then T pG, Hq v e " Hpāq : F 2 Ñ F m 2 , where ā is the basis vector of F ∆ 2 corresponding to the element a P r∆s.

Expansion properties of chain complexes
The distance of a quantum code falls into a broader category of expansion properties of chain complexes.This includes (co)-systolic distance (the one equivalent to quantum code distance), small set (co)-boundary expansion [37], and (co)locally minimal expansion [47,48].We discuss them together because heuristically they are of similar difficulty, that is a proof that works for one often implies the other.On the other hand, in certain scenario they can be distinguished.For example, locally testable code does not follow directly from systolic distance, but does follow from small set boundary expansion.This is one of the motivations for considering small set boundary expansion.See [49] for the history and more discussions on the study of these expansion properties.We first define the different notions of expansion, then we discuss relations between them and with code properties.As we will discuss more precisely in Section 3, we consider a weight on elements of a complex that is different from the Hamming weight, and which counts the number of non-zero geometric objects instead of non-zero bits.This weight is denoted as ¨ and differs from the usual Hamming weight by a constant factor, i.e. ¨ " Θp|¨|q (because the chain complex we consider has bounded degree).Definition 2.12 ((Co)-Systolic Distance).We say that X : It is not hard to see and well-known that constant (co)-systolic distance of a chain complex is equivalent to linear X-distance and Z-distance of the corresponding quantum CSS code.Definition 2.13 (Small-Set (Co)-Boundary Expansion).We say that X : Similarly, X is a pα, β, γq-small-set co-boundary expander if We made a modification from [37] by including a bound on c 2 and c 0 .This additional bound is needed to show local testability.Definition 2.14 ((Co)-Locally Minimal).We say that Similarly, we say Definition 2.15 (Small-Set (Co)-Locally-Minimal Expansion).We say that X : Similarly, X is an pα, βq-small-set co-locally-minimal expander if For our construction in Section 3 we will show that the chain complex has small-set co-locally-minimal expansion but not small-set locally-minimal expansion.This is roughly because in our construction Xp2q, Xp1q, and Xp0q correspond to the faces, edges, and vertices.So e 2 corresponds to a face and e 0 corresponds to a vertex.Flipping B 2 e 2 only affects the four edges incident to the face, whereas δ 0 e 0 affects the 2∆ edges incident to the vertex.Roughly, this means there are more freedom when flipping using δ 0 e 0 than B 2 e 2 .This is the rationale for why the chain complex does not (seem to) have small-set locally-minimal expansion.
Given the definitions, we now discuss their relations.The first lemma is between the expanders.The second and third lemma show that small-set boundary expansion implies systolic distance and local testability.be such that B 2 c 2 ď µ c 2 .Assume the gap between the possible values that c 1 can take, for ) If X has pα, βq-small-set locally-minimal expansion, then X has pα{p1 `µ{νq, β, 1{νq-small-set boundary expansion.
The assumptions in the lemma often hold when the chain complex has bounded degree.
Proof.Given c 1 , consider the local flipping process of the decoder of the expander code [21] which outputs c 2 .
Algorithm 1: Local flip decoder.(Input: We show that c 2 satisfies the desired properties: bounded by the number of iterations, and each iteration reduces c i 1 by at least ν, we have c 2 ď 1{ν c 1 .We now show B 1 c 1 ě β c 1 `B2 c 2 Because the decoder cannot find e 2 and stops at c 1 `B2 c 2 , that means c 1 `B2 c 2 is locally minimal.To apply small set locally minimal expansion, we suffice to show c 1 `B2 c 2 has small size. Lemma 2.17 (Small-Set (Co)-Boundary Expansion Ñ (Co)-Systolic Distance).If X has pα, β, γq-small-set boundary expansion, then X has systolic distance α.
When the chain complex has bounded degree, this is equivalent to linear distance.
Proof.Suppose c 1 P Z 1 and c 1 ă α|Xp1q|.Then by small set boundary expansion, there exists c 2 , such that 0 " B 1 c 1 ě β c 1 `B2 c 2 .This means c 1 " B 2 c 2 P B 1 .Therefore, for c 1 P Z 1 ´B1 we have c 1 ě α|Xp1q|.Lemma 2.18 (Small-Set (Co)-Boundary Expansion Ñ (Co)-Locally Testable Code).If X has pα, β, γq-small-set boundary expansion, then the classical code C with parity check matrix H " B 2 : When the chain complex has bounded degree, this is equivalent to the condition for local testability.

Linear dimension and linear distance
We give our construction of a quantum code and show that it leads to a family of quantum LDPC codes with linear rate an distance.Additionally, we show that the associated chain complexes have various kinds of good expansion properties.

Construction
Let G be a finite group and A and B sets of generators for G that are closed under inverse and have cardinality |A| " n a , |B| " n B .Throughout we assume that n A " n B and write ∆ " n A " n B .The construction uses Tanner codes over the 4-fold left-right Cayley complex G 2 pG, A, Bq with |A| " |B| " ∆ and local tensor codes C A , C B with parity-check matrices The idea is to construct four Tanner codes and then combine them into a chain complex.We use the graphs GpE ´, F q, GpE | , F q, GpV, E ´q, GpV, E | q induced from the left-right Cayley complex defined in Section 2.4 and the Tanner code construction in Section 2.7.The four Tanner codes we make use of are To clarify the notation we explicitly spell out the map T pGpE ´, F q, H A q.By the definition of the Tanner construction, this map is the composition ẃhere the first map copies the value on the face to the horizontal edges incident to the face (each horizontal edge is incident to |A| " ∆ faces, so each horizontal edge is valued in F ∆ 2 ) and the second map applies H A to F ∆ 2 for each horizontal edge.
The resulting chain complex is where The chain complex as a composition of the Tanner codes. and We denote this chain complex as XpG 2 , C A , C B q, where G 2 is a shorthand for G 2 pG, A, Bq. (Later in the analysis we also consider the chain complex XpG 2 , C K A , C K B q with the same graph but a different local code.)We use CpG 2 , C A , C B q to denote the associated quantum CSS code (see Section 2.2), and often write only C for simplicity.
We end this section by commenting on the way to obtain an explicit family of groups and generating sets that satisfy all the expansion properties required for the quantum code C to have linear distance and linear-time decoding, as shown in the following sections.This relies on having an explicit construction of large Ramanujan graphs [41] and the existence of (at least) one good local code pair Corollary 2.11.First, we discuss the graph.The graphs depend on the group G and generators A, B. The group G belongs to an infinite family of groups with generators A, B of fixed size ∆ such that CaypG, Aq, CaypG, Bq are λ " 2 ?∆ ´1-spectral expanders.Second, we discuss the base codes.As shown in Section 3.4, to show constant systolic and co-systolic distance we need pC A , C B q and its dual code pC K A , C K B q to have distance d 1 and robustness d 2 satisfying d 1 d 2 ´λd 2 ´8λ∆ ą 0. From Corollary 2.11 we know that for fixed ρ a , ρ b there exist constants δ 1 , δ 2 such that for large enough ∆, Because of the scaling λ " Θp∆ 1{2 q, d 1 " Θp∆q, d 2 " Θp∆q, for some large but fixed ∆, there exists a good local code pair pC A , C B q.This good code pair can be found by brute forcing all the possible code pairs.Because ∆ is fixed, the family of chain complexes remains explicit.

Notation
The following important notations are used for the analysis.First, we describe the notation that extracts the local structure.Given c 2 P F F 2 , we denote c 2 pf q P F 2 as the value of c 2 at f P F .Similarly, for c 1 P pF ma 2 q E ´' pF m b 2 q E | and c 0 P pF maˆm b 2 q V , one has c 1 pe ´q P F ma 2 for e ´P E ´, c 1 pe | q P F m b 2 for e | P E | , and c 0 pvq P F maˆm b 2 for v P V .We also write c 1 pE ˚0pV 00 qq P F maˆna 2 to denote the entries on E ˚0pV 00 q, where recall that this set is defined in Section 2.4.Notice that E ˚0pV 00 q contains n a edges and each edge gives a vector of size m a .
Second, we describe notation for measuring the size, or norm, of elements of the complex X.The norm is defined as the number of non-zero geometric objects, i.e. c 2 F " | tf P F : We also write c 1 pE ˚0pv 00 qq E " | te P E ˚0pv 00 q : c 1 peq ‰ 0u |.
An element c 2 P F F 2 is usually indexed by F , leading to the norm }c 2 } F as defined above, it can also naturally be indexed by E ˚0 through c 2 pe ˚0q " c 2 pF pe ˚0qq.This allows us to define c 2 E˚0 .The difference between the two norms is analogous to the difference between the different variants of the Hamming norm introduced in Definition 2.7.Similarly, an element s 2 P pF na 2 q E ´ˆpF n b 2 q E | is indexed by E, but notice that for any e ˚0 P E ˚0, s 2 pe ˚0q can be indexed by F pe ˚0q.This allows us to write s 2 pe ˚0, f q P F 2 for f P F pe ˚0q.This leads to the definition EF " E ´F Y E | F " tpe, f q P E ˆF : f P F pequ, where E ´F and E | F specialize to horizontal and vertical edges.So s 2 can be indexed by EF and this leads to the norm s 2 EF " | pe, f q P EF : s 2 pe, f q ‰ 0 ( |.We will also write s 2 pE ˚0q F for s 2 pE ˚0q EF ; this is because when the edges are restricted to E ˚0 we have E ˚0F -F .One can similarly define V E, V F and their corresponding norms.
Finally, the last notation we discuss is with regard to H A and H B .By thinking of F as being indexed by E 0˚, we have H Ò A : F F 2 -pF na 2 q E0˚Ñ pF ma 2 q E0˚.Similarly, by thinking of F as being indexed by E 1˚, we have H Ó A : F F 2 -pF na 2 q E1˚Ñ pF ma 2 q E1˚.We can also define H Ð B and H Ñ B .When the context is clear, we sometime hide the arrows.

Dimension and low density
Before measuring the dimension of the quantum code based on X, we verify that X is a well-defined chain complex.For this it suffices to show that for each f P F and v P V , the restriction To do so, we first recall the submatrices of the Tanner code described in Section 2.7.
Given elements e ´P E ´and f P F , the submatrix T pGpE ´, F q, H A q e f : F 2 Ñ F ma 2 is 0 when e ´and f are not incident.When e ´and f are incident, say e ´" ppg, gbq, 0˚q, f " pg, ag, gb, agbq, we have where ā is the basis vector of F A 2 -F ∆ 2 corresponding to the element a P A. Similarly, given elements v P V and e ´P E ´, the submatrix T pGpV, E ´q, is 0 when v and e ´are not incident.When v and e ´are incident, say v " pg, 00q, e ´" ppg, gbq, 0˚q, we have where b is the basis vector of F B 2 -F ∆ 2 and ´is the placeholder where ´b X is a well-defined chain complex, i.e.
We consider the following two cases.
When v and f are not incident, there is no e ´for both T pGpV, E ´q, H B q e f and T pGpE ´, F q, H A q v e ´to be nonzero, so pT pGpV, f " 0 in the case when v and f are not incident.When v and f are incident, suppose v " pg, 00q and f " pg, ag, gb, agbq.We define e ´" ppg, gbq, 0˚q and e | " ppg, agq, ˚0q.Because e ´is the only edge in E ´that is incident to both v and f , we have Similarly, This implies pB 1 B 2 q v f " 0 and implies X is a chain complex.We now check that the boundary maps B 2 and B 1 have bounded number of non-zero entries in each column and row.
Lemma 3.2.The code C is low density, i.e. the maps B 2 and B 1 have at most 4∆ nonzero entries in each row and column.
Proof.The result follows because the left-right Cayley graph has bounded degree and the non-zero entry appears only when there is an incident relation.We call F , E ´ˆrm a s Y E | ˆrm b s, and V ˆrm a s ˆrm b s the face bits, the edge bits, and the vertex bits.And we say that a face bit is incident to an edge bit if the corresponding entry in the boundary map is non-zero.
We first consider B 2 .Each face is incident to 4 edges and each edge is incident to ∆ faces.Now have ď 1 non-zero entry in each row and ď maxpm a , m b q non-zero entries in each column.So each face bit is incident to ď 4 maxpm a , m b q edge bits and each edge bit is incident to ď ∆ face bits.
We now consider B 1 .Each edge is incident to 2 vertices and each vertex is incident to 2∆ edges.Now T pGpV, E ´q, have ď 1 non-zero entry in each row and ď maxpm a , m b q nonzero entries in each column.So each edge bit is incident to ď 2 maxpm a , m b q vertex bits and each vertex bit is incident to ď 2∆ edge bits.
Note that one can achieve any rate in p0, 1{2q by choosing corresponding ρ a and ρ b .

Distance
A quantum CSS code has linear distance if and only if the chain complex X has constant systolic and co-systolic distance.We start with a general theorem, Theorem 3.4 that shows a certain co-expansion property of the complex XpG 2 , C A , C B q defined in ( 6).The property of having linear X-distance for C, i.e. linear co-systolic distance of X, follows almost immediately and is shown in Corollary 3.5.The argument for showing linear Z-distance for C, i.e. linear systolic distance for X, is more involved and proceeds by reduction to the co-systolic distance.This is shown in Theorem 3.8.After having shown the distance properties, we show that the co-expansion property shown in Theorem 3.4 also implies small-set expansion properties for X.This is shown in Corollary 3.10.

Co-expansion and co-systolic distance
We start with the main theorem on co-expansion.
Proof.When c 1 is a non-zero co-cycle c 1 P Z 1 ´0, (7) implies We now move on to prove the theorem.
Proof of Theorem 3.4.Let c 1 be co-locally minimal and c 2 " δ 1 c 1 .Let E Ă E be the support of c 1 , i.e.E " e P E : c 1 peq ‰ 0 ( .(Recall that c 1 pe ˚0q, c 1 pe ˚1q P F m b 2 and c 1 pe 0˚q , c 1 pe 1˚q P F ma 2 .)The proof strategy is to count the number of "neighbors" between E, for some appropriate neighborhood structure.The expansion of the graph gives an upper bound on the number of "neighbors" and the distance and the robustness of the local code give a lower bound.Comparing the two bounds gives Equation (7).
Step 1: Define "neighbors" M .Recall the adjacency matrices M 0 and M 1 defined in Lemma 2.5 and Lemma 2.4 respectively.We describe the neighborhood structure through the matrix Let 1 E P F E 2 be the indicator vector for E.
Step 2: Upper bound from expansion.Combining Lemma 2.5 and Lemma 2.4, Step 3: Lower bound from distance and robustness.We show a lower bound on 1 T E M 1 E using the distance and the robustness of the local tensor code.We start with two claims.The first claim uses the distance property of C K B .Claim 3.6.For any edge e ˚0 P E ˚0 it holds that Proof.The distance property of C K B immediately implies that Recall that c 2 " s 2 pE ˚0q `s2 pE ˚1q `s2 pE 0˚q `s2 pE 1˚q .
Thus each non-zero entry f " pg, ag, gb, agbq of s 2 pe ˚0q, where e ˚0 " pg, agq, is either a non-zero entry in c 2 or is canceled by a term in s 2 pE ˚1q, s 2 pE 0˚q , or s 2 pE 1˚q that contributes to the entry at f .Such a term, say s 2 pe ˚1q ‰ 0, must have its edge e ˚1 incident to the face f which is incident to e ˚0, i.e. e ˚1 P E ˚1pe ˚0q.Therefore, each cancellation contributes to s 2 pE ˚1pe ˚0qq E , s 2 pE 0˚p e ˚0qq E , or s 2 pE 1˚p e ˚0qq E .Notice that s 2 pe ˚1q ‰ 0 ðñ c 1 pe ˚1q ‰ 0. Thus from (11) we get that c 2 pF pe ˚0qq F ` c 1 pE ˚1pe ˚0qq E ` c 1 pE 0˚p e ˚0qq E ` c 1 pE 1˚p e ˚0qq E ě c 1 pE ˚0pe ˚0qq E .
Combined with (10), this shows the claim.
The second claim uses the robustness property of ΣpC T A , C T B q. Claim 3.7.For any vertex v 00 P V 00 it holds that Similarly, for any vertex v 10 P V 10 it holds that Proof.The proof is similar to the previous claim, using the robustness property of pC K A , C K B q instead of the distance property of C B .
Let e ˚0 P E ˚0 have endpoints v 00 P V 00 and v 10 P V 10 .Using the definition of M " d 2 M 1 `M0 , Here, the first inequality uses ( 12) and ( 13), the second inequality drops non-negative terms, and the last inequality follows from (9).Summing over all edges e ˚0 and analogous inequalities shown for edges e ˚1, e 0˚a nd e 1˚w e obtain where the factor of 4 is because each face is counted 4 times by the 4 edges incident to the face, and the factor of 8∆ because each vertex is summed over 2∆ times by the 2∆ edges incident to the vertex and each face is incident to 4 vertices.
Step 4: Combine the upper and lower bounds.Combining ( 8) and ( 14), which implies This concludes the proof of (7).

Expansion and systolic distance
The second main theorem for this section shows that systolic distance follows from cp-systolic distance.In fact, we will prove a stronger statement which also shows that expansion follows from co-expansion.
To use the second part of this theorem we need to know that X is a small-set co-boundary expander.This will be shown in Corollary 3.10.
We now have all the ingredients to state the property of linear distance for our quantum code.
Proof.The assumptions made in the corollary imply that for large enough ∆, d 1 d 2 ´λd 2 ´8λ∆ ą 0. By Theorem 3.4, XpG 2 , C A , C B q and XpG 2 , C K A , C K B q have linear co-systolic distance.By Theorem 3.8, XpG 2 , C A , C B q has linear systolic distance.Therefore, C has distance d1d2´λd2´8λ∆ ∆ 2 pma`m b qpd2`4q n.Now, we move on to the proof of the second theorem.
Proof of Theorem 3.8.We start with an introductory discussion in which we focus on the simpler case of systolic distance, for which we have B 1 c 1 " 0. For the proof we will show the general case of expansion.
Recall that systolic distance is saying that given c 1 with small weight there exists c 2 such that B 2 c 2 " c 1 .So the task is to find c 2 .We will do so by first making local guesses of c 2 around each vertex.For each vertex v 00 we focus on the local exact chain complex around v 00 , Note that this is isomorphic to the exact chain complex Y pH A , H B q : defined in (4).Because B 2 c 2 " c 1 , when restricted on this local region we have B 2 c 2 pF pv 00 qq " c 1 pE ˚0pv 00 q Y E 0˚p v 00 qq.At this moment we do not know what c 2 pF pv 00 qq is, but we can always write c 2 pF pv 00 qq " s 2 pv 00 q ẁ2 pv 00 q where B 2 s 2 pv 00 q " c 1 pE ˚0 pv 00 q Y E 0˚p v 00 qq and B 2 w 2 pv 00 q " 0. We now fix an arbitrary s 2 pv 00 q then worry about finding w 2 pv 00 q.
We know two things about w 2 .First, they are codewords w 2 pv 00 q P C A b C B .Second, because s 2 pV 00 q ẁ2 pV 00 q " c 2 " s 2 pV 10 q `w2 pV 10 q, the sum is known w 2 pV 00 q `w2 pV 10 q " s 2 pV 00 q `s2 pV 10 q. (s 2 pV 00 q denotes the concatenation of s 2 pv 00 q.) Turns out this task can be interpreted as finding c 0 (related to w 2 ) given c 1 " δ 0 c 0 (related to w 2 pV 00 q `w2 pV 10 q).Therefore, using the hypothesis on co-expansion, we can recover w 2 and find c 2 .
We now comment more on what w 2 is doing.A useful interpretation is that the task of finding w 2 can be interpreted as finding the "corrections" that make s 2 consistent.Notice that s 2 is somewhat like c 2 with the same value after B 2 , B 2 s 2 pv 00 q " B 2 c 2 pF pv 00 qq, except that s 2 is not defined on F .This is because the value of a face is dependent on which vertex it views from.That is each of s 2 pV 00 q, s 2 pV 10 q, s 2 pV 01 q, s 2 pV 11 q defines a bit string on F , but they are not guaranteed to be consistent.In this view point, w 2 is the "correction" that makes s 2 consistent through s 2 pV 00 q `w2 pV 00 q " c 2 " s 2 pV 10 q `w2 pV 10 q.
We now describe the detailed construction in steps.Remember we are now showing boundary expansion and we let c 0 " B 1 c 1 .
Step 1: Construct s 2 by guessing from the vertex.Let V E ´and V E | be the set of vertex, edge pair V E ´" tpv, e ´q : v P e ´, e ´P E ´u and V E | " tpv, e | q : v P e | , e | P E | u.We find s 2 P pF na 2 q V E ´ˆpF n b 2 q V E | (i.e. for each pv, e ´q we assign a value in F na 2 and for each pv, e | q we assign a value in F n b 2 ) such that We further require s 2 to satisfy two more conditions.When c 1 pe ˚0q " 0 we set s 2 pv 00 , e ˚0q " 0 c 1 pe ˚0q " 0 ùñ s 2 pv 00 , e ˚0q " 0.
Step 2: Construct t 2 from the sum of s 2 .t 2 P pF na 2 q E ´ˆpF n b 2 q E | is defined as the "sum" of s 2 viewed from its two endpoints.That is t 2 pe ˚0q " s 2 pv 00 , e ˚0q `s2 pv 10 , e ˚0q.
Step 3: Apply co-expansion assumption.This is the main step where we use the co-expansion assumption and find the "corrections".Let where k a " n a ´ma and k b " n b ´mb .The following chain complex is the one we will apply the co-expansion assumption The overall strategy is to first move to this new chain complex by constructing c 1 .Then, use co-expansion to write c 1 " c 11 `δ0 c 0 .Finally, we move back to the original chain complex.We first construct c 1 .Equation (19) implies that one can find c 1 P pF ka 2 q E ´ˆpF k b 2 q E | such that t 2 pe ˚0q " pH K B q T c 1 pe ˚0q, t 2 pe 0˚q " pH K A q T c 1 pe 0˚q .
To apply the hypothesis of co-boundary expansion we need to check c 1 and c 2 :" δ 1 c 1 have small weight.We need small weight of c 1 to satisfy the small set hypothesis and we need small weight of c 2 for the bound of c 11 E to be meaningful.We first check c 1 has small weight.Because pH K B q T is injective, c 1 pe ˚0q E ď t 2 pe ˚0q E , together with Equation ( 20) implies c 1 E ď c 1 E .Now, we check c 2 has small weight.Because c 2 " t 2 pE ˚0q `t2 pE ˚1q `t2 pE 0˚q `t2 pE 1˚q by Equation ( 21) we have Given that c 1 and c 2 have small weight, we can now use the hypothesis of co-boundary expansion and write c 1 " c 11 `δ0 c 0 where c 11 P pF ka 2 q E ´' pF k b 2 q E | and c 0 P pF kaˆk b 2 q V such that To move back to the original chain complex, we define u 2 P pC A q E ´ˆpC B q E | and w 2 P pC A b C B q V where u 2 pe ˚0q " pH K B q T c 11 pe ˚0q, u 2 pe 0˚q " pH K A q T c 11 pe 0˚q and w 2 pv 00 q " pH K A b H K B q T c 0 pv 00 q.By construction, u 2 and w 2 inherit various properties from c 11 and c 0 .First, u 2 and w 2 are codewords and H Ð B w 2 pv 00 q " 0, H Ò A w 2 pv 00 q " 0.
Second, u 2 and w 2 have small weights.Because u 2 E ď c 11 E and w 2 V ď c 0 V , we have and Finally, u 2 and w 2 form a decomposition of t 2 .Because c 1 " c 11 `δ0 c 0 , t 2 pE ˚0 q " w 2 pV 00 q `u2 pE ˚0q `w2 pV 10 q.
These u 2 and w 2 can be understood as the "corrections" that bridge the inconsistent local guesses, s 2 .And the upper bound implies, one can use a few "corrections" to make the local guesses consistent.22) to (26).
Here, s 2 pV 00 , E ˚0q can be interpreted as the initial guess and w 2 pV 00 q as the "correction".Because we write c 1 " c 1 1 `B2 c 2 , we have c 1 1 :" c 1 `B2 c 2 .This concludes the construction.To show expansion, we suffice to show c 1 1 and c 2 have small weight.This is a straightforward computation using the fact that the number of "corrections" is small.Note that when c 1 P Z 1 , c 1  1 is simply 0. This is why this long computation does not appear in [1].
1 pE 1˚q E and we will bound them individually.The general strategy is to first use the identities A s 2 pV 10 , E 1˚q , then express the difference between the s 2 in the identities and the s 2 in the definition of c 2 " s 2 pV 00 , E ˚0q `w2 pV 00 q as something of small weight.Be aware that some of the arrow directions in H A and H B below may be different from what one might expect, for example H Ñ B s 2 pV 00 , E ˚0q.
Because Equation ( 16), s 2 pV 00 , E ˚0q F ď ∆ c 1 pE ˚0q E .Combine with the inequality from the co-expansion theorem Equation (25), This implies that the chain complex is a pα 1 , β 1 , γ 1 q-small-set boundary expander with ) To show systolic distance, one follows the same argument with a few modifications.In Step 3, from the expansion assumption, we instead have u 2 " 0. In the very end where we show c 1  1 is small, we instead obtain
More generally given any co-chain c 1 it is possible to write c 1 " c 11 `δ0 c 0 in such a way that Proof.We start with (27).The first inequality follows directly from (7).To show the second, let c 1 be any co-chain and let let c 11 be of minimal weight among elements c 1 `B1 .Then c 11 E ď c 1 E , and so by the triangle inequality we have Combined with Lemma 2.6 we obtain the second inequality in Equation (27).
Next, we plug in specific numbers in Equation (7) and Equation ( 27) to obtain small-set co-locally-minimal expansion and small-set co-boundary expansion.
First, small-set co-locally-minimal expansion.For general chain with c 1 E ď 1 2 η|G|, we have the expansion Next, small-set co-boundary expansion.For general chain with c 1 E ď 1 2 η|G|, we here simplify the inequality

Linear time decoder
In this section we construct a linear time decoder for the quantum code C introduced in Section 3.1.As discussed in the introduction, one can separate the task of decoding into two.We call one of them the decoder and the other the co-decoder: the decoder recovers c1 given the syndrome B 1 c 1 such that c1 P c 1 `B1 ; the co-decoder recovers c1 given the syndrome δ 1 c 1 such that c1 P c 1 `B1 .This section parallels the section on distance with similar proof techniques.We first show the existence of a linear time co-decoder.Then we use the linear time co-decoder to obtain a linear time decoder.
has a linear time co-decoder up to distance η 2 |G|, then XpG 2 , C A , C B q has a linear time decoder up to distance Together we obtain a linear time decoder for CpG 2 , C A , C B q up to distance κ 4∆pma`m b qp6`4∆{d2q |Xp1q|.

Co-Decoder
Theorem 4.1 is the main theorem we will show in this subsection.We discuss the construction, the correctness, and the running time of the decoder which together proves the theorem.

Construction:
The co-decoder in the direction of the co-chain complex is the small-setflip decoder introduced in [22].The small-set-flip decoder is a generalization of the local-flip decoder for the expander codes [21] where the decoder observes a local region and make local changes that reduce the weight of the syndrome.
Algorithm 2: Simple small-set-flip decoder.(Input: 2. (Main loop) In the i-th iteration, if there is a vertex v i with e 1 i supported on Epv i q such that |c `δ1 e 1 i and repeat.

(End) Output
Besides these variables, we define other variables not directly known by the decoder.Let c 1 0 be the minimal chain in c 1 `B1 and c 1 i`1 be the minimal chain in c 1 i `e1 i `B1 .One can interpret c 1 i as the error at the i-th iteration and c 2 i as corresponding syndrome.Note that the decoder knows the syndrome c 2 i but not the error c 1 i .Recall that the final syndrome of a local-flip decoder is locally minimal.Similarly, the final syndrome of a smallset-flip decoder satisfies a similar property which we call extended local minimality.
where Epvq Ă E are the edges incident to v.
Correctness: Following the standard proof strategy for local-flip decoder we show two lemmas.The first lemma, Lemma 4.4, shows that whenever there is a non-zero error with small weight the decoder is able to continue running and reduce the weight of the syndrome.The second lemma, Lemma 4.5, shows that as long as the initial error is sufficiently small the error at each iteration remains small.Together the two lemma imply that there is no syndrome when the decoder stops, and that the decoder correctly corrects the error, i.e. c1 " ř e 1 i P c 1 `B1 .Lemma 4.4 (Reducible if Short).Given ∆-regular λ-spectral expander graphs CaypG, Aq, CaypG, Bq and linear codes Then for every co-locally minimal For i ě 1 let c 1 i be as defined below Algorithm 1. Then We first assume the two lemmas and show the correctness.
Proof of Correctness.Suppose the co-decoder stops at the T -th iteration.By Lemma 4.5, because 4∆pma`m b q |Xp1q|.By Lemma 4.4, the co-decoder stops when c 1 T " 0. Notice Because the output differs from the error by a co-boundary, this implies the co-decoder decodes correctly.Now we prove the two lemmas.We first show the second lemma which is simpler.
Proof of Lemma 4.5.Because the number of syndrome strictly decreases, we have Combine the two equations with Equation ( 7) we have Therefore, to have c 1 i E ď η 1 |G|, we suffice to set where the last inequality follows from η 1 ă 1 2 η.We end with the proof of Lemma 4.4, which is very similar to the proof of Theorem 3.4.
Proof of Lemma 4.4.Let c 1 P F Xp1q 2 be co-locally minimal and furthermore such that c 2 " δc 1 is co-locally minimal from Xp0q.Let E Ă E be the support of c 1 .
Step 1: Define "neighbors" M. We define Step 2: Upper bound from expansion.Using Lemma 2.5 and Lemma 2.4, Step 3: Lower bound from distance and robustness.We use two corollaries to Claim 3.6 and 3.7 respectively, which make use of the additional assumption that c 2 " δc 1 is co-locally minimal from Xp0q.First, we show that This inequality is shown as follows.Using (9), On the other hand, by definition of c 2 " δ 1 c 1 , Using that c 2 is co-locally minimal, Thus (28) follows.Similar reasoning shows the following as a consequence of (12).
Combining Equation (28) and Equation ( 29), Step 4: Combine the upper bound and the lower bound.Finally, we combine the upper bound and the lower bound.
This implies that c 1 " 0 whenever the rest of the argument still holds by replacing the corresponding parameters.The final result is that the remaining error after the co-decoder stop is less than the number of measurement errors times a constant.This is the so called error reduction property used in the construction of Spielman code (or cascade code) with linear time encoder and decoder [50].
Linear Time: The decoder presented in Algorithm 2 runs in quadratic time.To get linear time, we perform additional preprocessing.A vertex v is said to be flippable if there exist a small set flip e 1 supported on Epvq which decrease the weight of the current syndrome c 2 i .

(Main loop)
In the i-th iteration, take a vertex v i and its flip e 1 i from the list Q. Set c 2 i`1 :" c 2 i `δ1 e 1 i .Update the list Q by checking the flippability of the vertices neighbor to v i , i.e.V 00 pv i q Y V 10 pv i q Y V 01 pv i q Y V 11 pv i q.Repeat.

(End) Output
Note that this algorithm has a similar behavior from the simple small set flip decoder.Because the syndrome only updates on F pv i q, the updated list contains all the flippable vertices of the current syndrome.
We now compute the time complexity.Checking flippability of a vertex v requires to try 2 ∆pma`m b q possible values of e 1 and each requires Op∆ 2 pm a `mb qq to check if the weight decreases c 2 `δ1 e 1 F ă c 2 F .So the initialization takes time Op∆ 2 pm a `mb q2 ∆pma`m b q |V |q.For the main loop, there are at most c 2 F iterations.Each iteration checks the flippability of p∆ `1q 2 many vertices.So the main loop takes time Op∆ 4 pm a `mb q2 ∆pma`m b q c 2 F q. Overall the complexity is linear Θp|Xp1q|q.

Decoder
Now, for decoder, we want to find c1 P c 1 `B1 given c 0 " B 1 c 1 .Different from the co-decoder, small-set-flip decoder does not work directly.This is roughly because there are too few information around a face to make decisions.Nevertheless, similar to the section on expansion, one can translate the results from co-decoder to decoder.Here is the main theorem for this subsection.Construction: We now describes the decoding process.Similar to the proof of expansion, the main idea is to make local guesses around the vertex, then correct the inconsistencies between the local guesses.It is crucial to keep track of the variables that exist but not known to the decoder.We use ĉ1 to denote such variables and we use c1 to denote a good approximation to ĉ1 .
Step 1: Construct s 1 and ŝ1 2 by guessing from the vertex.Using the local chain complex around v 00 pF 2 q F pv00q B2 Ý Ñ pF m b 2 q E˚0pv00q ' pF ma 2 q E0˚pv00q B1 Ý Ñ F maˆm b 2 we find s 1 P pF ma 2 q V E ´ˆpF m b 2 q V E | where s 1 pv 00 q P pF m b 2 q E˚0pv00q ˆpF ma 2 q E0˚pv00q is the minimal chain such that B 1 ps 1 pv 00 qq " H Ò A s 1 pv 00 , E ˚0pv 00 qq `HÐ B s 1 pv 00 , E 0˚p v 00 qq " c 0 pF pv 00 qq.
Note that s 1 is a guess of ĉ1 with the same local property B 1 pĉ 1 pEpv 00 qqq " c 0 pF pv 00 qq.
Because ĉ1 pEpv 00 qq is a valid candidate for s 1 pv 00 q and s 1 pv 00 q has the minimal weight among them, we have s 1 pv 00 q E ď ĉ1 pEpv 00 qq E , i.e.
The factor 2 appears because each edge for s 1 has two values from the two endpoints.Further, because they have the same local property and because the local chain complex is exact, the difference between s 1 and ĉ1 can be expressed using ŝ1 2 P pF naˆn b 2 q V where B 2 pŝ 1 2 pv 00 qq `s1 pv 00 q " ĉ1 pv 00 q.
Lemma 4.7.Given two linear codes C A , C B with parity-check matrices be the exact chain complex in Equation (4).If pC K A , C K B q is d 2 -robust, then for all c 1 P impB 2 q there exist c 2 P F naˆn b 2 such that B 2 c 2 " c 1 and Proof.The idea is to construct c 2 using c 1 .The construction has a similar flavor as for the proof of expansion where one first guess then correct the inconsistencies.Let c 1 " pc a 1 , c b We pick s a 2 pi a q " 0 when c a i pi a q " 0. .We have Using the robustness of the co-chain complex  , E ˚0pv 00 qq ŝ1 2 pv 00 q " " `Figure 7: Construct s 1 and ŝ1 2 using c 2 and ĉ1 .s 1 and ŝ1 2 satisfy Equations ( 30) to (33).
Step 2: Construct t 1 and t1 2 from the difference of s 1 and ŝ1 2 .t 1 P pF ma 2 q E ´ˆpF m b 2 q E | is defined as the "sum" of s 1 viewed from its two endpoints.That is t 1 pe ˚0q " s 1 pv 00 , e ˚0q `s1 pv 10 , e ˚0q.
Step 3: Construct u 2 by guessing from the edge.We now make a second guess where we guess t1 2 .We find We pick u 2 pe ˚0q to be 0 whenever t 1 pe ˚0q " 0, so we have u 2 E " t 1 E , which together with Equations ( 31) and (34) implies We again track the difference û1 2 P pF na 2 q E ´ˆpF n b 2 q E | where which satisfies and Combining the bound of the weight using Equations ( 33) and (35) and Equation ( 38), we have Step 4: Apply co-decoder assumption.This is the main step where we use the co-decoder assumption and obtain an approximation of û1 2 with ũ1 where k a " n a ´ma and k b " n b ´mb .The following chain complex is the one we will apply the co-decoder assumption The overall strategy is to first move to this new chain complex by constructing ĉ1 and c 2 .Then, use co-decoder to obtain c1 P ĉ1 `B1 from c 2 .Finally, we move back to the original chain complex.We first construct ĉ1 .Equation ( 40) implies one can find ĉ1 P pF ka 2 q E ´ˆpF k b 2 q E | such that û1 2 pe ˚0q " pH K B q T ĉ1 pe ˚0q, û1 2 pe 0˚q " pH K A q T ĉ1 pe 0˚q .
We are almost ready to apply the co-decoder.To apply the co-decoder we need to check ĉ1 has small weight.Because pH K B q T is injective, ĉ1 pe ˚0q E ď û1 2 pe ˚0q E , together with Equation (38) implies Given that ĉ1 has small weight, we can now use the hypothesis of the co-decoder and obtain c1 P ĉ1 `B1 , i.e. there exists c 0 P pF kaˆk b 2 q V such that c1 " ĉ1 `δ0 ĉ0 .To move back to the original chain complex, we define ũ1 2 P pF na 2 q E ´ˆpF n b 2 q E | and ŵ2 P pF naˆn b 2 q V where ũ1 2 pe ˚0q " pH K B q T c1 pe ˚0q, ũ1 2 pe 0˚q " pH K A q T c1 pe 0˚q , ŵ2 pv 00 q " pH K A b H K B q T ĉ0 pv 00 q.Because c1 " ĉ1 `δ0 ĉ0 , we have ũ1 2 pE ˚0q " ŵ2 pV 00 q `û 1 2 pE ˚0q `ŵ 2 pV 10 q.
When c is "structured", one can then find c a supported on the few columns and c b supported on the few rows.This means the cancellation in c a `cb could only happen in the intersection of those columns and rows which is small.Since each column of c a is a codeword, when the distance is large, When c has large weight |c| ě w " Θp∆ 2 q, because c a rn b s ` c b rnas ď 2∆, the inequality for robustness |c| ě d 2 p c a rn b s ` c b rnas q is easily satisfied by setting d 2 " w{p2∆q " Θp∆q.
We now go through the steps carefully below.We first state two lemmas, show the theorem, then prove the lemmas.The first lemma says each non-zero codeword has at least one row or column with large weight (which implies codewords with small weight are "structured").The second lemma says "structured" codewords satisfy robustness.
Let C A , C B be random codes sampled from the uniform distribution with length ∆ and dimensions k a " ρ a ∆, k b " ρ b ∆.Then as ∆ goes to infinity, with probability tending to 1, the following holds: for any s " σ∆-punctured code C 1 A , C 1 B , all non-zero codewords in ΣpC 1 A , C 1 B q have at least one row or one column with weight ě t " τ ∆.In other words, if a codeword in ΣpC 1 A , C 1 B q has all its rows and columns with weight ă t, then the codeword is 0.
Remark 5.2.Previously, we said the robustness parameter can be thought of as the higher dimensional generalization of linear distance.Here, Lemma 5.1 provides an alternative generalization that could also be useful when trying to study higher dimensional tensor codes.Note that in one-dimension, these two definitions coincide.Proof of Theorem 2.10.We first show linear distance.The Equation (5) in the theorem statement implies hpδ 1 q ă 1 ´ρa and hpδ 1 q ă 1 ´ρb because hpδ 1 q ă 2hpδ 1 {2q for δ 1 ă 1{2.By Gilbert-Varshamov bound, we know C A , C B have distance d 1 " δ 1 ∆ with probability tending to 1.
Next, we prove that pC A , C B q is δ 2 ∆-robust when C A , C B have distance d 1 and the condition in Lemma 5.1 holds.More precisely, because the inequality in Lemma 5.1 holds for σ " δ 1 {2 and τ " 4δ 2 {δ 1 , we have that for all s " σ∆-punctured codes C B q has all columns and rows with weight ă t " τ ∆, then the codeword is 0. Note that the same holds for all punctured codes C 1 A , C 1 B with puncture ď s.Given c P ΣpC A , C B q, we consider the following two cases.First, assume that c has small weight |c| ă d 1 t{2.We can remove d 1 {2 ´1 " s ´1 columns I a and s ´1 rows I b such that c prnas´Iaqˆprn b s´I b q has weight less than t for each column and each row.By Lemma 5.1, c prnas´Iaqˆprn b s´I b q has to be 0.So c is supported on at most s ´1 columns and s ´1 rows.Now, because s ´1 ă s " Therefore, the code pair pC A , C B q is minp d1 2 , d1t 4∆ q " d1t 4∆ " δ 2 ∆ robust.
We now prove the first lemma.The proof is similar to the proof of the Gilbert-Varshamov bound where we count the number of bad events and take the union bound.Here, we organize the bad events by the rank of the matrices.We first count the number of bad matrices with rank r.Then, we compute the probability for a rank r matrix to be a codeword.Finally, we take the union bound.
We again first state the two claims, show the lemma, then prove the claims.Proof of Lemma 5.1.To show the lemma, we apply the union bound over the bad events.First, there are `∆ s ˘2 possible s-punctured code pairs C 1 A , C 1 B when puncturing both C A and C B .Next, there are |Mp∆ ´s, r, tq| many rank r matrices where all rows and columns have weight ă t.Finally, each of those rank r matrix is a codeword with probability ď Pp∆ ´s, r, k a , k b q which we explain below.Recall that C A is a uniform distribution over dimension k a , so C 1 A is a mixture of uniform distribution over dimensions k 1 a ď k a .Suppose C 1 A (C 1 B ) has dimension k 1 a (k 1 b ) with probability p k 1 a (q k 1 b ), then a rank r matrix is a codeword with probability ď b "0 p k 1 a q k 1 b Pp∆ ´s, r, k 1 a , k 1 b q.Because smaller dimension leads to smaller probability of becoming a codeword, Pp∆ ´s, r, k 1 a , k 1 b q ď Pp∆ ś, r, k a , k b q, the probability for a rank r matrix to be a codeword ď Pp∆ ´s, r, k a , k b q as claimed.
Therefore, the probability where the main condition fails to hold (there are some s-punctured code pair C 1 A , C 1

B
with non-zero codeword in ΣpC 1 A , C 1 B q where all its rows and columns has weight ă t) is ď ˆ∆ s ˙2 ∆´s ÿ r"1 |Mp∆ ´s, r, tq| Pp∆ ´s, r, k a , k b q ď 2 2∆hp s ∆ q ¨∆´s ÿ r"1 2 2rp∆´sqhp t ∆´s q`2p∆´sqhp r ∆´s q ¨512pr `1q2 ´3 4 p∆´s´kaqp∆´s´k b q ∆´s r where the last inequality uses `∆ s ˘ď 2 ∆hp s ∆ q and the results from Claim 5.4 and Claim 5.5.Finally, we find the requirements for the value to approach 0 as ∆ goes to infinity.This boils down to two conditions.The first is 2 ∆ ´s ∆ hp t ∆ ´s q ă 3 4 p∆ ´s ´ka qp∆ ´s ´kb q ∆p∆ ´sq so that large r has exponentially decaying contribution.The second is ´s q ă 3 4 p∆ ´s ´ka qp∆ ´s ´kb q ∆p∆ ´sq so that the contribution for r " 1 approaches 0. It is clear that we can reduce the two inequalities to just the second one.By rewriting the variables s " σ∆, t " τ ∆, k a " ρ a ∆, k b " ρ b ∆, we see that if 2hpσq `2p1 ´σqhp τ 1 ´σ q ă 3 4 p1 ´σ ´ρa qp1 ´σ ´ρb q 1 ´σ as ∆ goes to infinity, with probability tending to 1, for any s " σ∆-punctured code C 1 A , C 1 B , all non-zero codewords in ΣpC 1 A , C 1 B q have at least one row or one column with weight ě t " τ ∆.
Proof of Claim 5.4.The idea is that knowing the entries of specific r rows and r columns of a rank r matrix c is sufficient to determine rest of the entries.So to upper bound the number of rank r matrices c where each row and each column has weight ă t, we suffice to upper bound the number of configuration supported on r rows and r columns, c Iaˆrn b sYrnasˆI b , such that each row and each column has weight ă t, where I a and I b are the indices of some r rows and r columns.We discuss the details below.Given c P Mp∆, r, tq of rank r matrices where each row and each column has weight ă t.Because c has rank r, there exists a r ˆr submatrix with rank r, i.e. full rank.Let the r rows and r columns be indexed by I a Ă rn a s and I b Ă rn b s.We now claim that knowing the value of c on I a ˆrn b s Y rn a s ˆIb is enough to uniquely determine c through the following identity: where we use the inequality ř t´1 i"0 `∆ i ˘ď 2 ∆hp t ∆ q when t ď ∆{2.Multiply the two, we have |Mp∆, r, tq| ď 2 2r∆hp t ∆ q`2∆hp r ∆ q .
The bound on the Gaussian binomial coefficient implies 6Prrc P ΣpC A , C B qs ď 512 minpr,maq ÿ r 1 "0 2 ´pma´r 1 qpr´r 1 q´m b r 1 .
Finally, we show ´pm a ´r1 qpr ´r1 q ´mb r 1 ď ´3 4 mam b ∆ r for 0 ď r 1 ď m a .We first rewrite ´pm a ´r1 qpr ŕ1 q ´mb r 1 " pm a We now study the second lemma.We first recall the statement.Proof of Lemma 5.3.The intuition is that one can construct c a using c prnas´IaqˆI b by requiring each column to be a codeword in C A .Because each column is only missing |I a | ă d 1 values, which is less than the distance, one can uniquely recover the codeword.This intuition is correct, but requires more steps to make it rigorous as we will do below.
Let H

Figure 2 :
Figure 2: (Left) The neighboring sets of a vertex v 00 .(Right) The neighboring sets of an edge e ˚0.

Definition 2 . 7 .
Given a matrix c P F naˆn b 2 , we let

Definition 2 . 8 (
Robustness of Tensor Codes).Let C A , C B be linear codes of length n a , n b respectively and d 2 P R `.

2 ,
there exists c a P C A b F n b 2 and c b P F na 2 b C B such that c " c a `cb and c rnasˆrn b s ě d 2 p c a rn b s ` c b rnas q .

rnas and c 2 rn b s ď s b 2 rn b s ` u 1 b
rn b s ď p1 `∆ d2 q c 1 rn b s , we have the desired resultc 2 rnasYrn b s ď p1 `∆ d 2 q c 1 rnasYrn b s .

c 2 pv 00 q ĉ1 pE 0˚p v 00 qq ĉ1 pE ˚0pv 00 qq s 1
pv 00 , E 0˚p v 00 qq s 1 pv 00 |c a | ě d 1 c a rn b s " Θp∆q c a rn b s .This implies codewords with small weight satisfy the inequality for robustness |c| " |c a | `|c b | ´small number of cancellations ě Θp∆qp c a rn b s ` c b rnas q.

Lemma 5 . 3 (
Modification of[11, Lemma 8]  or[12, Lemma 30]).Suppose C A and C B have distanced 1 .If c P ΣpC A , C B q is supported on I a ˆrn b s Y rn a sˆIb and |I a |, |I b | ă d 1 , then there exists c a P C A b F n b 2 supported on rn a s ˆIb and c b P F na 2 b C B supported on I a ˆrn b s such that c " c a `cb .Furthermore, if |I a |, |I b | ă d 1 {2, we have |c| ě d 1 2 p c a rn b s ` c b rnas q.

3 |c| ě d 1 2 p
d 1 {2, by Lemma 5.c a rn b s ` c b rnas q.Second, suppose c has large weight |c| ě d 1 t{2.Because c P ΣpC A , C B q, we can always write c " c a `cb .For any choice of c a , c b , we have c a rn b s ` c b rnas ď 2∆.Together with the fact that c has large weight, we have |c| ě d 1 t 4∆ p c a rn b s ` c b rnas q.

Claim 5 . 4 (
Number of bad matrices is small).Let Mp∆, r, tq be the set of matrices in F ∆ˆ∆ 2 with rank r where each row and each column has weight ă t.Assume t ď ∆{2.Then |Mp∆, r, tq| ď 2 2r∆hp t ∆ q`2∆hp r ∆ q .Claim 5.5 (A bad matrix is likely not a codeword).Let c P F ∆ˆ∆ 2 be a matrix of rank r.ThenPp∆, r, k a , k b q :" Prrc P ΣpC A , C B qs ď 512pr `1q2 ´3 4 p∆´kaqp∆´k b q ∆ r ,where C A , C B are uniformly sampled from linear codes of length ∆ and dimension k a , k b .

cFigure 9 :
Figure 9: Given c of rank r.If c IaˆI b has rank r, then c is uniquely determined by the value on the shaded region c Iaˆrn b sYrnasˆI b .So to bound the size of Mp∆, r, tq, we suffice to bound the number of choices of I a and I b and the number of choices of c Iaˆrn b sYrnasˆI b .We first bound the number of choices of I a and I b .I a and I b each has size r and is a subset of r∆s, so the number of choices ď ˆ∆ r ˙2 ď 2 2∆hp r ∆ q ´r1 qpm b ´pr ´r1 qq ´ma m b .Then divide both sides by m a m b .If m b ´pr ´r1 q ě 0 we have Note the first inequality uses m a ´r1 ě 0 and m b ´pr ´r1 q ě 0. If m b ´pr ´r1 q ă 0 we have Prrc P ΣpC A , C B qs ď 512pr `1q2 ´3 4 mam b ∆ r .

Lemma 5 . 3 (
Modification of[11, Lemma 8]  or[12, Lemma 30]).Suppose C A and C B have distance d 1 .If c P ΣpC A , C B q is supported on I a ˆrn b s Y rn a s ˆIb and |I a |, |I b | ă d 1 , then there exists c a P C A b F n b 2 supported on rn a s ˆIb and c b P F na 2 b C B supported on I a ˆrn b s such that c " c a `cb .Furthermore, if |I a |, |I b | ă d 1 {2, we have |c| ě d 1 2 p c a rn b s ` c b rnas q.
Remark 4.6.A similar argument applies even when there are measurement errors in c 2 .Suppose that the co-decoder receives input c 2 `z2 instead of c 2 " δ 1 c 1 where z 2 is the measurement error with small weight.Then by replacing Equation (28) withz 2 pF pe ˚0qq F ` c 1 pE ˚1pe ˚0qq E ` c 1 pE 0˚p e ˚0qq E `c 1 pE 1˚p e ˚0qq E ě d 1 2 c 1 pe ˚0q E and replacing Equation (29) with z 2 pF pv 00 qq F ` c 1 pE ˚1pv 00 qq E ` c 1 pE 1˚p v 00 qq E ě d 2 2 p c 1 pE ˚0pv 00 qq E ` c 1 pE 0˚p v 00 qq E q ) 2 using s 1 and ŝ1 2 .t 1 and t1 2 satisfy Equations ( ˚0q, c1 pE 0˚q " s 1 pV 00 , E 0˚q , c1 pE ˚1q " s 1 pV 01 , E ˚1q `HÑ 1 A " H A | Ia : F Ia 2 Ñ F ma 2 be the restriction of H A .Because C A has distance d 1 and |I a | ă d 1 , H 1 A is injective.Since H 1A is an injective linear map, there exists (not unique) a left inverse linear map J 1 A : F ma Ia where I Ia is the identity for F Ia 2 .Similarly, we can define H 1 B and J 1 B .Using J 1 A we can explicitly write down a recovery map for the erased codeword.Claim 5.7.For any codeword v P C A Ă F na 2 , one can recover v from v rnas´Ia through the following linear map v " pJ 1 A H A | rnas´Ia }I rnas´Ia qv rnas´Ia where } is concatenation.
A H A | rnas´Ia : F