+ All Categories
Home > Documents > Degenerate Quantum LDPC Codes With Good Finite Length ...

Degenerate Quantum LDPC Codes With Good Finite Length ...

Date post: 20-Jan-2022
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
21
Degenerate Quantum LDPC Codes With Good Finite Length Performance Pavel Panteleev and Gleb Kalachev Faculty of Mechanics and Mathematics, Moscow State University, GSP-1, Leninskie Gory, Moscow, 119991, Russian Federation We study the performance of medium-length quantum LDPC (QLDPC) codes in the depo- larizing channel. Only degenerate codes with the maximal stabilizer weight much smaller than their minimum distance are considered. It is shown that with the help of OSD-like post- processing the performance of the standard be- lief propagation (BP) decoder on many QLDPC codes can be improved by several orders of mag- nitude. Using this new BP-OSD decoder we study the performance of several known classes of degenerate QLDPC codes including hyper- graph product codes, hyperbicycle codes, homo- logical product codes, and Haah’s cubic codes. We also construct several interesting examples of short generalized bicycle codes. Some of them have an additional property that their syndromes are protected by small BCH codes, which may be useful for the fault-tolerant syn- drome measurement. We also propose a new large family of QLDPC codes that contains the class of hypergraph product codes, where one of the used parity-check matrices is square. It is shown that in some cases such codes have better performance than hypergraph product codes. Finally, we demonstrate that the performance of the proposed BP-OSD decoder for some of the constructed codes is better than for a relatively large surface code decoded by a near-optimal de- coder. 1 Introduction Quantum error-correcting codes are considered as an essential component in the current architectures of quantum computers due to the inherently faulty na- ture of the quantum hardware. Topological quan- tum codes [1, 2, 3] are among the quantum codes with the highest known noise thresholds. These codes have sparse parity-check matrices and thus belong to the class of quantum LDPC (QLDPC) codes. More- over, they are highly degenerate, which means that the minimum distance is much higher than the weight of the stabilizers. It is important that these codes also have decoding algorithms with near to optimal perfor- mance [1, 4, 5]. Though the thresholds of topological codes are relatively high, their dimensions are usually much smaller than for general QLDPC codes of the same length (it is constant for the surface and color codes). There are also interesting classes of topological quantum codes with very large dimensions (e.g., hyper- bolic codes [6] have a constant rate). However, such codes usually have much smaller minimum distances compared to the surface and color codes. Recently there have been proposed a number of in- teresting families of degenerate QLDPC codes (e.g., hy- pergraph product codes [7] and homological product codes [8]) with very good asymptotic parameters. Nev- ertheless their practical error-correcting performance for relatively small code lengths (n< 1000) is largely unexplored, and it is not clear whether their perfor- mance is competitive to the best known topological codes. From our point of view, the difficulty of con- structing degenerate QLDPC codes with good practical performance is mostly related to the following two is- sues. 1. Asymptotically good constructions may not neces- sarily produce the best QLDPC codes for relatively small code lengths. Indeed, in [9, 10] the construc- tion of hypergraph product codes was further im- proved and generalized. Although the asymptotic characteristics of the improved codes are the same as before, their parameters such as the rate and the minimum distance are much better for smaller lengths. 2. The performance of the known QLDPC codes is far from optimal under the state-of-the-art decoders (including the binary and non-binary BP decoders, and their modifications). The performance degra- dation is usually attributed [11] to the unavoidable 4-cycles in the corresponding Tanner graphs and to a large number of degenerate errors. While the number of 4-cycles can be significantly reduced by using CSS codes [12] without 4-cycles in the parity- check matrices H X and H Z , the number of degen- erate errors can not be easily reduced for highly- degenerate codes. Accepted in Q u a n t u m 2021-11-02, click title to verify. Published under CC-BY 4.0. 1 arXiv:1904.02703v3 [quant-ph] 12 Nov 2021
Transcript
Page 1: Degenerate Quantum LDPC Codes With Good Finite Length ...

Degenerate Quantum LDPC Codes With Good Finite LengthPerformancePavel Panteleev and Gleb Kalachev

Faculty of Mechanics and Mathematics, Moscow State University, GSP-1, Leninskie Gory, Moscow, 119991, Russian Federation

We study the performance of medium-lengthquantum LDPC (QLDPC) codes in the depo-larizing channel. Only degenerate codes withthe maximal stabilizer weight much smaller thantheir minimum distance are considered. It isshown that with the help of OSD-like post-processing the performance of the standard be-lief propagation (BP) decoder on many QLDPCcodes can be improved by several orders of mag-nitude. Using this new BP-OSD decoder westudy the performance of several known classesof degenerate QLDPC codes including hyper-graph product codes, hyperbicycle codes, homo-logical product codes, and Haah’s cubic codes.We also construct several interesting examplesof short generalized bicycle codes. Some ofthem have an additional property that theirsyndromes are protected by small BCH codes,which may be useful for the fault-tolerant syn-drome measurement. We also propose a newlarge family of QLDPC codes that contains theclass of hypergraph product codes, where oneof the used parity-check matrices is square. It isshown that in some cases such codes have betterperformance than hypergraph product codes.Finally, we demonstrate that the performance ofthe proposed BP-OSD decoder for some of theconstructed codes is better than for a relativelylarge surface code decoded by a near-optimal de-coder.

1 IntroductionQuantum error-correcting codes are considered asan essential component in the current architectures ofquantum computers due to the inherently faulty na-ture of the quantum hardware. Topological quan-tum codes [1, 2, 3] are among the quantum codeswith the highest known noise thresholds. These codeshave sparse parity-check matrices and thus belong tothe class of quantum LDPC (QLDPC) codes. More-over, they are highly degenerate, which means that theminimum distance is much higher than the weight ofthe stabilizers. It is important that these codes also

have decoding algorithms with near to optimal perfor-mance [1, 4, 5]. Though the thresholds of topologicalcodes are relatively high, their dimensions are usuallymuch smaller than for general QLDPC codes of thesame length (it is constant for the surface and colorcodes). There are also interesting classes of topologicalquantum codes with very large dimensions (e.g., hyper-bolic codes [6] have a constant rate). However, suchcodes usually have much smaller minimum distancescompared to the surface and color codes.

Recently there have been proposed a number of in-teresting families of degenerate QLDPC codes (e.g., hy-pergraph product codes [7] and homological productcodes [8]) with very good asymptotic parameters. Nev-ertheless their practical error-correcting performancefor relatively small code lengths (n < 1000) is largelyunexplored, and it is not clear whether their perfor-mance is competitive to the best known topologicalcodes. From our point of view, the difficulty of con-structing degenerate QLDPC codes with good practicalperformance is mostly related to the following two is-sues.

1. Asymptotically good constructions may not neces-sarily produce the best QLDPC codes for relativelysmall code lengths. Indeed, in [9, 10] the construc-tion of hypergraph product codes was further im-proved and generalized. Although the asymptoticcharacteristics of the improved codes are the sameas before, their parameters such as the rate andthe minimum distance are much better for smallerlengths.

2. The performance of the known QLDPC codes is farfrom optimal under the state-of-the-art decoders(including the binary and non-binary BP decoders,and their modifications). The performance degra-dation is usually attributed [11] to the unavoidable4-cycles in the corresponding Tanner graphs andto a large number of degenerate errors. While thenumber of 4-cycles can be significantly reduced byusing CSS codes [12] without 4-cycles in the parity-check matrices HX and HZ , the number of degen-erate errors can not be easily reduced for highly-degenerate codes.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 1

arX

iv:1

904.

0270

3v3

[qu

ant-

ph]

12

Nov

202

1

Page 2: Degenerate Quantum LDPC Codes With Good Finite Length ...

In this paper, we try to address both mentioned is-sues. In the first part of the paper, we introduce a newenhancement of the standard BP decoder for QLDPCcodes (both binary and non-binary versions are allowed)using a variant of the well-known decoding algorithm forshort classical codes called the ordered statistics decod-ing (OSD) [13, 14]. This new post-processing algorithmworks only if the BP decoder fails to find a recoveryPauli operator that gives the correct syndrome. Wesuppose here that the QLDPC parity-check matrix His represented in the binary form1. The algorithm startsfrom finding a reliable information set [15] for H basedon the soft decisions obtained by the BP decoder. Thenit makes hard decisions for the bits from this informa-tion set and flips the w most unreliable of them in orderto find the 2w corresponding recovery Pauli operatorsthat return the corrupted quantum state to the cod-ing space. Finally, it selects a recovery operator withthe minimum weight and applies it to the corruptedquantum state. Thus this new combined BP-OSD de-coder, in contrast to the standard BP, always returnsthe recovery operator that moves the corrupted code-word back to the code space. We show that with thehelp of this OSD-like post-processing the performance ofthe standard BP decoder on many degenerate QLDPCcodes can be improved by several orders of magnitude.As we can see from its brief description above, it is notrestricted to CSS codes and can also be used in conjunc-tion with any decoder, different from BP, that providessoft decisions.

In the second part of the paper, we construct a num-ber of new relatively small codes using two families ofdegenerate codes: the generalized bicycle (GB) codesintroduced in [10] and a new large family2 of QLDPCcodes introduced in this paper. We call this new familygeneralized hypergraph product (GHP) codes. It con-tains the GB codes and the class of hypergraph product(HP) codes [7], where one of the two parity-check ma-trices used in the product is square. We also derive newformulas for the dimension of GB and GHP codes andshow how to design codes of high dimension with gooderror correction performance. It is interesting to notethat some of the constructed GB codes have an addi-tional property that their syndromes are protected bysmall BCH codes, which may be useful for the fault-tolerant syndrome measurement.

We also study the performance of the proposed BP-

1For a QLDPC code on n qubits with m stabilizers the matrixH is an m× 2n binary matrix.

2Since the first version of the current work was released, thecodes from this family have been shown to have very large min-imal distances [16, 17, 18] and found interesting applications ingeometry [19]. In [17] they were further generalized and calledlifted product codes.

OSD decoder on many known classes of degenerateQLDPC codes, including the already mentioned hy-pergraph product codes, hyperbicycle codes [9, 10],the homological product codes [8], and Haah’s cubiccodes [20]. We compare their performance with theperformance of the codes, constructed in this work. Weshow that in many cases the new codes with similarperformance have better parameters such as the codelength and the rate. Besides that, we compare thenew BP-OSD decoder with other known modificationsof the BP decoder such as the random perturbation [21],the enhanced feedback [22], and the matrix augmenta-tion [23] algorithms. We compare all the above men-tioned algorithms on the new [[1270, 28]] code from theclass of GHP codes mentioned earlier3. We show thatthe performance of the new decoding algorithm on thiscode is significantly better. Moreover, we also show thatthe performance of this code under the BP-OSD is evenbetter than the performance of the [[1201, 1, 25]] sur-face code under the near-optimal MPS-based decoderproposed in [5]. We also demonstrate that the perfor-mance under BP-OSD of one of Haah’s cubic codes,which have local stabilizers in 3D, is also very good.

The remainder of the paper is organized as follows.Section 2 contains some background material, where wereview standard definitions and fix notations. In Sec-tion 3, we describe the BP-OSD algorithm and compareits performance with other known modifications of BP.In Section 4, we study GB codes and construct somenew codes with good performance. In Section 5, weintroduce and study a new large family of GHP codesand show that it generalizes the class of hypergraphproduct codes in the case when one of the parity-checkmatrices is square. In the last section, we give some fi-nal remarks. The paper also contains three appendixes.Appendix A has some supplementary material on thering of circulants. Appendix B contains a description ofall the codes used in the simulations. Finally, we showsome additional simulations in Appendix C.

2 Basic facts and definitionsIn this section, we fix notations and briefly recall somestandard definitions related to classical and quantumLDPC codes. See [11] for a good review of these topics.

2.1 Classical codesLet n be a natural number. In what follows, we de-note by [n] the set {1, . . . , n}. Consider a finite field Fq

3Since this GHP code is quasi-cyclic, it can also be obtained(up to some qubit permutations) as a special case of the hyper-bicycle code construction.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 2

Page 3: Degenerate Quantum LDPC Codes With Good Finite Length ...

and an n-dimensional vector space Fnq over Fq. A lin-ear [n, k]q code is a k-dimensional subspace C ⊆ Fnq ,where the parameters n and k are called the length andthe dimension of C, respectively. We denote the dimen-sion k of the code C by dim C. The rate of the code Cis equal to k/n. The elements of C are called code-words. The Hamming distance d(v, v′) between vectorsv, v′ ∈ Fnq is the number of positions in which they dif-fer. The parameter

d(C) = min{d(c, c′) | c 6= c′; c, c′ ∈ C}

is called the minimal distance of C. By definition, weput d(C) =∞ when k = 0. It is easy to see that d(C) isequal to the minimal weight |c| of non-zero codewords,where the weight |c| is the number of non-zero compo-nents in c. When d(C) = d for a linear [n, k]q code C, wesay that C is an [n, k, d]q code. A linear [n, k, d]q codeis usually defined either as the row space of a matrix Gcalled the generator matrix or as the kernel of a matrixH called the parity-check matrix. It is easy to see thatGHT = 0, rkG = k, and rkH = n− k. In what followswe mostly consider binary linear codes (i.e., q = 2), inwhich case we use a shorter notation: [n, k] or [n, k, d].

2.2 Quantum stabilizer codesThe quantum analogs of classical linear codes are quan-tum stabilizer codes introduced in [24]. To define themwe need a number of supporting definitions. Consideran n-qubit Hilbert space C2n = (C2)⊗n. A Pauli opera-tor on n qubits is an operator P = αP1⊗· · ·⊗Pn on thespace C2n

, where α ∈ {±1,±i}, Pi ∈ {I,X, Y, Z}. HereI is the identity and X,Y, Z are the Pauli 2 × 2 ma-trices. The weight wt (P ) of a Pauli operator P is thenumber of non-identity components in the tensor prod-uct. The set Pn of all Pauli operators P on n qubits isa non-commutative group under the operator multipli-cation called the n-qubit Pauli group. While the groupPn is non-commutative, if we forget about the globalphase factors α of Pauli operators we obtain the quo-tient group Pn/{±I,±iI}, where I is the identity oper-ator on C2n

. This quotient group is isomorphic to thecommutative group Z2n

2 , and the isomorphism is givenby the following map:

αn⊗i=1

XxiZzi 7→ (x1, . . . , xn | z1, . . . , zn). (1)

It is well known that two n-qubit Pauli operators Pand P ′ commute if‌f for their binary representations(x|z), (x′|z′) ∈ F2n

2 we have

〈x, z′〉+ 〈z, x′〉 = 0, (2)

where 〈a, b〉 =∑i aibi is the dot product in Fn2 .

Denote by P∗n the subset of Pauli operators P ∈ Pnwith the global phase factor α = 1. A stabilizer group Sis a commutative subgroup of the Pauli group Pn suchthat −I 6∈ S. The group S is usually generated by mPauli operators S1, . . . , Sm ∈ P∗n called stabilizers gen-erators, i.e., S = 〈S1, . . . , Sm〉. We say that S1, . . . , Smare independent if none of them can be obtained (up toa global phase factor α) from the others by the groupmultiplication.

Let us recall that a quantum stabilizer [[n, k, d]] codeis a 2k-dimensional subspace of the n-qubit space C2n

defined as the common +1-eigenspace for a set of mstabilizers S1, . . . , Sm ∈ P∗n:

C = {|ψ〉 ∈ C2n

| Si|ψ〉 = |ψ〉, i = 1, . . . ,m},

where the group S(C) = 〈S1, . . . , Sm〉 is called the sta-bilizer group of C. It can be shown that m > n−k. Butif the stabilizers are independent, we get m = n − k.Here the parameter d = d(C) is called the minimal dis-tance4 of C and is equal to the minimal possible weightof a Pauli operator P ∈ P∗n that commutes with all thestabilizers S1, . . . , Sm but P 6∈ S(C).

A Pauli operator P ∈ P∗n is usually interpreted asan error operator (called a Pauli error) that can corrupta quantum system and cause it to go from a state |ψ〉to P |ψ〉. However, for every quantum stabilizer code C,it is not hard to show that P |ψ〉 = |ψ〉 for all |ψ〉 ∈ Cif‌f P ∈ S(C). Hence we see that in this case, not allPauli errors P ∈ P∗n can harm the state |ψ〉. We calla Pauli error P ∈ P∗n degenerate for a code C if P |ψ〉 =|ψ〉 for all |ψ〉 ∈ C and non-degenerate otherwise. Wesee that the elements from P ∈ S(C) are precisely thedegenerate Pauli errors and the minimum distance d(C)is the minimal possible weight of a non-degenerate Paulierror. A stabilizer code C is called degenerate if it hasdegenerate Pauli errors P of weight wt (P ) < d(C).

If we apply the binary mapping (1) to the stabilizergenerators S1, . . . , Sm of an [[n, k, d]] code C, we obtainthe m× 2n binary matrix

H = (HX | HZ) (3)

called the parity-check matrix of C, where each row cor-responds to a stabilizer generator. We do not requirefor the matrix H to be full rank (i.e, rkH = n−k 6 m).Using (2) it is not hard to see that the null space of His exactly the set of all vectors (z, x) ∈ F2n

2 such that(x, z) is the binary mapping of a Pauli error P ∈ P∗n thatcommutes with all the stabilizer generators S1, . . . , Sm.

We see that the matrix H = (HX | HZ) is not an ar-bitrary binary m×2n matrix since the stabilizer gener-ators S1, . . . , Sm corresponding to its rows should com-

4We write [[n, k]] if the minimal distance is not known.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 3

Page 4: Degenerate Quantum LDPC Codes With Good Finite Length ...

mute with each other. From equation (2) it easily fol-lows that this restriction can be formulated as the fol-lowing commutativity condition:

HXHTZ +HZH

TX = 0. (4)

A very important subclass of quantum stabilizer codes isCalderbank-Shor-Steane (CSS) codes introduced in [25,26]. A quantum CSS code is a stabilizer code, wherenon-identity components in the tensor product of eachstabilizer generator are either all equal to X or all equalto Z. Hence the parity-check matrix H of a CSS codeof length n can be represented in the following form:

H =(HX 00 HZ

),

where HX , HZ are binary matrices with n columns.

In this special case, commutativity condition (4) canbe rewritten as:

HXHTZ = 0. (5)

We can easily verify that the dimension k of the corre-sponding CSS code of length n is given by the formula:

k = n− rkHX − rkHZ . (6)

2.3 Classical and quantum LDPC codesA classical low density parity check (LDPC) code [27]is a linear code defined by a sparse binary parity-checkmatrix H = (hij)m×n. The sparseness usually meansthat the weights of all rows and columns in H are upperbounded by some universal constant as the code lengthn grows in an infinite family of codes.

When we consider an LDPC code defined by a parity-check matrix H, it is helpful to define the bipartitegraph T = T (H) called the Tanner graph [28]. In thisgraph the first part of nodes v1, . . . , vn (called the v-nodes) corresponds to the columns of H (the variables),the second part of nodes c1, . . . , cm (called the c-nodes)corresponds to the rows of H (the checks), and we con-nect a v-node vi with a c-node cj whenever hij = 1,i ∈ [m], j ∈ [n]. If the parity-check matrix H is(wc, wr)-regular (i.e., each column has weight wc andeach row has weight wr), then the corresponding Tan-ner graph is also (wc, wr)-regular (i.e., each v-node hasdegree wc and each c-node has degree wr). We say thatan LDPC code is w-limited if the degree of each node inits Tanner graph is upper bounded by w. It is obviousthat any LDPC code with (wc, wr)-regular parity-checkmatrix is max(wc, wr)-limited.

There are a number of decoding algorithms for clas-sical LDPC codes, but the most frequently used oneis the belief propagation (BP) decoder [27], also known

as the message passing decoder or the sum-product de-coder [29]. It assigns the a priori probability distribu-tions of individual bits in the codeword (obtained fromthe channel) to the v-nodes of the Tanner graph anditeratively updates the posterior probability distribu-tions for each bit. Once some maximal iteration num-ber limit is reached, the decoder combines the a prioriand the calculated posterior probability distributions(the soft decisions) to produce the optimal binary de-cision (called the hard decision) for each individual bit.

An important property of a parity-check matrix Hdefining an LDPC code is the girth of the correspondingTanner graph T = T (H), which is equal to the lengthof the shortest cycle in T . It is well known that shortcycles in the Tanner graph degrade the performance ofthe BP decoder. At the same time, it was observedthat LDPC codes without 4-cycles (i.e., when the girthis at least 6) perform very well in practice. However,this practical observation is not fully investigated fromtheoretical point of view.

A quantum LDPC (QLDPC) is a stabilizer [[n, k, d]]code with a sparse parity-check matrix H. We can alsointroduce the Tanner graph T = T (S) for any stabilizer[[n, k, d]] code C defined by a set of stabilizer generatorsS = {S1, . . . , Sm}. In the case of stabilizer codes, thev-nodes correspond to n qubits and the c-nodes to thestabilizer generators S1, . . . , Sm, and we connect a c-node with a v-node if the corresponding stabilizer actsnontrivially on the corresponding qubit. As in the caseof classical LDPC codes, we say that a QLDPC code isw-limited if the degree of each node in its Tanner graphis upper bounded by w. This property is much moreimportant in the quantum case due to the faulty natureof the current quantum hardware. It is clear that anyCSS code with (wc, wr)-regular matrices HX and HZ ismax(2wc, wr)-limited.

3 OSD-like post-processing for BPIn this section, we describe a new OSD-like post-processing algorithm that can be used after the BP de-coder for QLDPC codes. Before we give its detaileddescription we consider two simple modifications of theOSD decoder for classical linear codes. These modi-fications will be used as the main components in theOSD-like post-processing algorithm for quantum codes.We should warn the reader that these modifications ofthe standard OSD decoder are not intended to improveits performance for classic LDPC codes. We introducethem because these algorithms eventually will be usedin the OSD post-processing algorithm (called qOSD) forquantum codes described in Section 3.2. For example,one of the main differences between classical and quan-tum codes is that we have to use the syndrome decoder

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 4

Page 5: Degenerate Quantum LDPC Codes With Good Finite Length ...

in the quantum case. Hence we consider only syndromeOSD decoders here since we are going to use them ascomponents of the decoder for quantum codes.

3.1 Syndrome OSD post-processing algorithmStarting from this section we will often use the followingnotations:

• If M is a matrix, then Mi denotes its i-th column.

• If I = {i1, . . . , ik} is some index set, i1 < · · · < ik,and π ∈ Sn is a permutation, then for every vectorv = (v1, . . . , vn) and matrix M = (M1, . . . ,Mn) wedefine:

vI = (vi1 , . . . , vik ),MI = (Mi1 , . . . ,Mik ),π(v) = (vπ(1), . . . , vπ(n)),π(M) = (Mπ(1), . . . ,Mπ(n)).

• If I ⊆ [n] is an index set, then the index set I =[n] \ I is called its complement.

Now let us recall the definition of an informationset [30] of a code, which has an important role inthe OSD decoding. A set of indices I ⊆ [n] is calledan information set of a classical linear [n, k] code C ifCI = {cI | c ∈ C} = Fk2 . Clearly, I is an informationset of C if‌f |I| = k, and for any two codewords c, c′ ∈ Csuch that cI = c′I we always have c = c′. Therefore forany information set I the corresponding k bits can beused to uniquely recover any vector v ∈ Fn2 if we alsoknow its syndrome s = Hv. Hence we can consider thecorresponding encoding map EsI : Fk2 → Fn2 such that forany u, v, and s we have:

vI = u, Hv = s ⇐⇒ v = EsI (u).

It is easy to verify that E0I is the systematic encoding

map for the code C where the information bits u are atthe positions corresponding to I.

Remark. If G is a generator matrix, and H is a parity-check matrix of a linear code C; then it can be shownthat a k-element index set I is an information set of Cif�f rkGI = rkG if �f rkHJ = rkH, where J = I. Thus ifB(M) denotes the family of indices I such that the col-lection of columns {Mi}i∈I is a basis for the columnspace of M ; then the family of all information sets of Ccoincides with B(G), while the family of their comple-ments coincides with B(H). Since the set of all linearlyindependent columns of any matrix gives us a matroid5,

5A matroid is defined by a non-empty collection I of subsets(called the independent sets) from some set E (called the groundset) such that: (1) I is closed under taking subsets; (2) for anytwo A, B ∈ I if |A| < |B| then A ∪ {b} ∈ I for some b ∈ B \ A.Any maximal (by inclusion) independent set is called a basis.

then for any positive real numbers w1, . . . , wk we canefficiently find

arg maxI∈B(G)

∑i∈I

wi = arg minJ∈B(H)

∑i∈J

wi (7)

in a greedy fashion [31, 32]. Here in the right part weused that I ∈ B(G) if�f J = I ∈ B(H).

The main idea of the syndrome OSD decoder is as fol-lows. Consider a linear [n, k] code C defined by a parity-check matrix H. Let c′ = c + e be a corrupted ver-sion of a codeword c ∈ C, where e ∈ Fn2 is the corre-sponding random error vector. Given the syndromes = Hc′ = He we want to find the error vector e andthus recover the codeword c = c′ − e. Suppose that inaddition we are given an estimate6 of the error prob-ability pi = P(ei = 1) for each i ∈ [n]. From theseestimates our best guess of the error vector e would bethe hard decisions vector e, where ei = 1 when pi > 1/2,and ei = 0 otherwise7. However, when we only use theerror probability estimates, we often have that He 6= s,and thus e 6= e. Nevertheless, even in such cases, somecomponents of e are equal to e, and we can still try touse e to find e if we also take into account that

He = s. (8)

Therefore, to recover e, one may try to traverse throughdifferent information sets I in the hope that for one ofthem we have eI = eI , and thus

e = EsI (eI). (9)

Unfortunately we do not know for which indices i ∈ [n]we have ei = ei. Hence it makes sense to find an infor-mation set I with the indices that are as reliable aspossible, where the reliability of an index i ∈ [n] isthe probability

ρi = P(ei = ei) = max(pi, 1− pi).

If we assume that the components in the random errorvector e are mutually independent, then it follows thatthe probability of successful decoding P(e = EsI (eI)) forI is equal to ρ(I) =

∏i∈I ρi. Thus if we want to maxi-

mize this probability we need the most reliable informa-tion set I, i.e., the one8 with the maximal possible valueof ρ(I). Finding such a set may at first sight look likea prohibitively hard task. However, if instead of ρ(I)we consider ln ρ(I) =

∑i∈I wi, where wi = ln ρi; then

6For example, one can use a syndrome BP decoder for thispurpose (see Section 3.3).

7When pi = 1/2 we can set ei randomly to either 0 or 1 withequal probability.

8If there are several such sets, we can use any of them.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 5

Page 6: Degenerate Quantum LDPC Codes With Good Finite Length ...

Algorithm 1: Syndrome OSD-w algorithmInput: target weight function wt (·),binary parity-check matrix H,syndrome vector s ∈ Fm2 ,vector of hard decisions e ∈ Fn2 ;Output: error vector e ∈ Fn2 such that He = s;

1 J ← ∅;2 for i← 1 to n do3 J ′ ← J ∪ {i};4 if rkHJ′ > rkHJ then5 J ← J ′;6 end7 end8 x← arg min

x∈Fw2

wt(EsI (Rx[w]eI)

), where I = J ;

9 return e = EsI (Rx[w]eI);

we can see that the most reliable information set I isgiven by (7), and, as we mentioned earlier, it is possibleto find I using a greedy algorithm [31, 32].

This greedy algorithm is the main part of the OSDdecoder. Since in our case the code is defined bya parity-check matrix H, it is more convenient to usethe right part of (7), which means that we want tofind the index set J corresponding to the least reli-able basis {Hi}i∈J for the column space of H, i.e.,J ∈ B(H) with the smallest ρ(J). For simplicity, weassume that the columns of H are already rearrangedsuch that the reliability of the corresponding positionsincreases: ρ1 6 · · · 6 ρn. In this case, it is not hardto see that the collection {Hi}i∈J of the first r = rkHlinearly independent columns is the least reliable ba-sis [32]. We can find J by applying Gaussian elimina-tion to equation (8), which gives us, in time O(n3), thefollowing equation:

He = s. (10)Then J is the index set of the first r pivot columns in H,i.e., HJ = (δij)r×r. Moreover, from (7) it follows thatthe index set I = J is the most reliable information set,and we can find the error vector e from (10) in a verystraightforward way since HJ is the identity matrix.

The described above syndrome decoding algorithm isusually called order-0 OSD decoder. As we see, it firstfinds the most reliable information set I and then re-covers the unique vector e ∈ Fn2 subject to the followingconditions:

eI = eI , He = s. (11)In fact, we can further improve the error-correcting per-formance by using order-w OSD decoder (abbreviatedas OSD-w). In this modification, after we find the mostreliable information set I, we look at all error vectors eobtained from equation (10) by setting the first w least

Algorithm 2: Fast syndrome OSD-0 algorithmInput: binary parity-check matrix H,syndrome vector s ∈ Fm2 ,vector of hard decisions e ∈ Fn2 ;Output: error vector e ∈ Fn2 such that He = s;

1 J ← ∅;2 s′ ← s+He;3 for i← 1 to n do4 if rk [HJ , s

′] = rkHJ then5 break;6 end7 J ′ ← J ∪ {i};8 if rkHJ′ > rkHJ then9 J ← J ′;

10 s′ ← s′ + eiHi;11 end12 end13 x← the solution of HJ x = s′;14 return e = RxJ e;

reliable positions from I to all possible values x ∈ Fw2(we can obtain them using the encoding operator EsI ).Finally, we select an error vector e of the minimal weightwt (e) among all the 2w obtained error vectors. Herethe weight function wt (·) depends on the specific chan-nel we use. In the case of depolarizing noise, this weightfunction is just the weight of the corresponding Paulioperator.

A simplified pseudocode of the above OSD-w algo-rithm is shown in Algorithm 1. Here in the two lastlines, we used a shorthand notation RxI v for the resultof the replacement of the subvector vI in the vector v

by x ∈ F|I|2 . Therefore, Rx[w]eI is obtained from eI ifwe replace its first w bits by x ∈ Fw2 . Since we assumethat the columns of H are already sorted according tothe reliabilities, these first w positions in I are the leastreliable ones. We should also note that the main cy-cle of this algorithm, which finds J (lines 1–7), can beefficiently implemented using Gaussian elimination, asalready discussed above.

Remark. There are some differences between the stan-dard order-w OSD decoder from [13, 14] and the pro-posed OSD-w post-processing algorithm. For example,we try all 2w bit flips of the w least reliable informationbits (line 8), while in the standard OSD we try all the∑i6w

(ki

)bit flips of no more than w bits.

As we will see in Section 3.3, if the OSD-w decoderis used as a post-processing algorithm after the BP de-coder for QLDPC codes, then it can radically improvethe error correcting performance. In fact, in many caseseven OSD-0 is enough, and thus the computational costof the decoding is O(n3). Moreover, in the case of the

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 6

Page 7: Degenerate Quantum LDPC Codes With Good Finite Length ...

OSD-0, there is no need to do full Gaussian eliminationfor H. Let I be the most reliable information set foundby the OSD-0 algorithm, then we can stop extending theindex set J in Algorithm 2 when rk [HJ , s

′] = rkHJ ,and put e = RxJ e, where s′ = s + HJ eJ , and x isthe unique9 solution of HJx = s′. Indeed, we get

He = HJx+HJ eJ = s′ +HJ eJ = s.

Since we also have I ⊆ J , then e satisfies conditions (11)and thus is the error vector found by the OSD-0 algo-rithm. This observation gives us a faster version of theOSD-0 algorithm (see Algorithm 2).

3.2 Modified OSD post-processing algorithm forstabilizer codesIn this subsection, we show how to adapt the OSD de-coder from the previous subsection to a scenario whereit is used as a post-processing algorithm after the BPdecoder for QLDPC codes. There are a number of quan-tum noise models. In this paper, we consider the depo-larizing channel only. However many of our ideas maybe used for other memoryless quantum noise models. Inthe depolarizing channel model with error probability p,a quantum state |ψ〉 ∈ C2n

is subject to a random Paulierror

E = E1 ⊗ · · · ⊗ En ∈ P∗n,

where all Ei are i.i.d, and for all i ∈ [n] we have:

P(Ei = X) = P(Ei = Y ) = P(Ei = Z) = p/3.

In what follows, it is convenient for our goals to rep-resent (with a small abuse of notation and terminology)the set of matrices P∗1 = {I,X, Y, Z} by the elementsof the finite field F4, where I is represented by 0 ∈ F4,and the Pauli matrices X,Y, Z by the three non-zeroelements from F4. To distinguish these finite field ele-ments from the corresponding matrices we denote theformer using a different font: i,x,y, z. Further, we rep-resent a Pauli vector from P∗n by the corresponding vec-tor from Fn4 , which we also call a Pauli vector. Usingthis conventions, we represent the binary m×2n parity-check matrix of a stabilizer code C (see equation (3)) bythe corresponding m× n matrix over F4 and call it thestabilizer matrix of C.

Since we consider the depolarizing channel, for thebest performance, it is better to use the non-binary ver-sion of the syndrome BP decoder (see [21], [11, Algo-rithm 1]), which also takes into account the correlationsbetween X and Z errors in qubits. To describe the OSDalgorithm in this case we need some extra notations.

9The solution is unique since rk HJ = |J |.

• If v ∈ Fn4 is a Pauli vector, and vi = vXi x + vZi z,where vXi , v

Zi ∈ F2, i ∈ [n]; then we can define

the binary vectors:

b(v) = (vX1 , vZ1 , vX2 , vZ2 , ..., vXn , vZn ) ∈ F2n2 ,

b∗(v) = (vZ1 , vX1 , vZ2 , vX2 , ..., vZn , vXn ) ∈ F2n

2 .

We also need the inverse mapping b−1(·) for b(·)that maps vectors from F2n

2 back to Fn4 .

• If H is an m × n stabilizer matrix over F4, thenb(H) denote the m × 2n binary matrix obtainedby mapping each row h from H to the row b

∗(h).

The main motivation for these, not very standard,notations is as follows. If e ∈ Fn4 is a Pauli error, thenit is easy to check that

s = b(H)b(v)

is the corresponding syndrome vector, i.e., for everyi ∈ [m] we get si = 0 if‌f the i-th stabilizer from H com-mutes with the Pauli error e. Let us emphasize thatthe binary representations b(v) and b(H) can be alsoobtained from the binary representations (1) and (3) bya permutation of indices and columns, respectively.

Example. Let us illustrate the above notations on thewell-known non-CSS [[5, 1, 3]] code [33] defined by theparity-check matrix

H = (HX |HZ) =( 1 0 0 1 0 0 1 1 0 0

0 1 0 0 1 0 0 1 1 01 0 1 0 0 0 0 0 1 10 1 0 1 0 1 0 0 0 1

),

which corresponds to the matrices

H =( x z z x i

i x z z xx i x z zz x i x z

),b(H) =

(0 1 1 0 1 0 0 1 0 00 0 0 1 1 0 1 0 0 10 1 0 0 0 1 1 0 1 01 0 0 1 0 0 0 1 1 0

).

If we have the Z error in the second qubit, then we getthe error vector e = (i, z, i, i, i) ∈ F5

4, its binary repre-sentation b(e) = (0, 0, 0, 1, 0, 0, 0, 0, 0, 0) ∈ F10

2 , and thecorresponding syndrome vector s = (0, 1, 0, 1).

Since the depolarizing channel is non-binary, we needsome further adjustments in the syndrome OSD decoder(Algorithms 1 and 2) to use it as a post-processor afterthe non-binary BP decoder. We call this modified ver-sion the order-w qOSD algorithm, which is defined viathe order-w OSD algorithm from the previous sectionas follows:

qOSDw(H, s, e) = b−1(OSDw(|·|Sp,b(H), s,b(e))

).

Here we use the symplectic weight10 |·|Sp as the targetweight function wt (·) for the OSD algorithm, which is

10It is easy to see that the symplectic weight |x|Sp is equal tothe weight wt (E) of the Pauli error E ∈ P∗

n represented in thebinary form by the vector x ∈ F2n

2 .

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 7

Page 8: Degenerate Quantum LDPC Codes With Good Finite Length ...

defined as:

|x|Sp =n∑i=1

(x2i−1 ∨ x2i).

As we see, the input for the qOSD algorithm includesthe m × n stabilizer matrix H over F4, the syndromes ∈ Fm2 , and the error vector e ∈ F4, which is the harddecisions vector for the result of the non-binary BP de-coder (see the next subsection).

Remark. The symplectic weight |·|Sp is used above forthe depolarizing channel. For the variant of the depolar-izing channel, where the X and Z errors are indepen-dent, the standard binary Hamming weight |·| shouldbe used instead. In general, the optimal choice of thetarget weight function wt (·) is the one, where the mostprobable errors are of the least possible weight.

3.3 Main decoding algorithm (BP-OSD)In this subsection, we describe our main decoding al-gorithm (see Algorithm 3) called the BP-OSD or BP-OSD-w (if we want to emphasize the OSD order w).It consists of two stages: the non-binary BP decod-ing (lines 1–4) and the OSD post-processing (lines 6–8).In fact, at the first stage, any decoding algorithm maybe used instead of BP if it can provide soft decisions.The goal of this stage is either to find the error vectore ∈ Fn4 or to obtain the probabilities P(ei = E), i ∈ [n],for each type of the Pauli error E ∈ {i,x,y, z}.

First, we run the BP decoder and obtain the soft de-cisions (line 1), i.e., for ever i ∈ [n] we get the 4 num-bers (pi,i, pi,x, pi,y, pi,z), where pi,E can be interpretedas the probability P(ei = E) of the error E ∈ {i,x,y, z}in the i-th qubit. Next, we find the hard decisions forall qubits by the formula (line 2):

ei = arg maxE∈{i,x,y,z}

pi,E , i ∈ [n].

If the BP decoding is successful (i.e., we have the correctsyndrome vector), then there is no need in the post-processing, and the BP-OSD decoder returns the resultof the BP decoder (line 4).

After the first stage, the probabilities pi,E are alsoused in the BP-OSD algorithm to sort the qubits inthe order of increasing reliability ρ(pi,i, pi,x, pi,y, pi,z),where we can define the reliability of the i-th qubit as

ρ(pi,i, pi,x, pi,y, pi,z) = P(ei = ei) = maxE∈{i,x,y,z}

pi,E .

However, in all our simulations we used the formula

ρ(pi,i, pi,x, pi,y, pi,z) = pi,i,

which gives similar error-correcting performance, butit is a little bit easier to calculate. After we sorted

the qubit positions (line 7), the qOSD algorithm fromthe previous subsection is used to recover the errorsin the least reliable qubits from the hard decisions forthe remaining qubits (line 8).

Algorithm 3: BP with OSD-w post-processingInput: stabilizer matrix H,syndrome vector s ∈ Fm2 ;Output: error vector e ∈ Fn4 ;

1 (pi,i, pi,x, pi,y, pi,z)ni=1 ← BP(s);2 Make hard decisions:

ei ← arg maxE∈{i,x,y,z} pi,E , i ∈ [n];3 if b(H)b(e) = s then4 return e = e;5 else6 Calculate the reliabilities:

ρi ← ρ(pi,i, pi,x, pi,y, pi,z), i ∈ [n];7 Sort the qubits by their reliabilities:

ρσ(1) 6 ρσ(2) 6 ... 6 ρσ(n), σ ∈ Sn;8 return e = σ−1(qOSDw(σ(H), s, σ(e))

);

9 end

In Algorithm 3, we used the qOSD algorithm, whichis a good choice for the standard depolarizing channel.If we have a channel with independent X and Z errors,then for a CSS code defined by a pair of parity-checkmatrices HX , HZ we can also use the standard OSD(Algorithms 1 and 2) for the X and Z components ofthe error vector e separately. In this case, lines 6–8 inAlgorithm 3 can be replaced by the following steps:

1. Calculate the X and Z error probabilities:

pXi = pi,x + pi,y,

pZi = pi,y + pi,z.

2. Sort the qubits in the decreasing order of their Xerror and Z error probabilities and let σX , σZ ∈ Snbe the corresponding permutations such that:

pXσX(1) > pXσX(2) > ... > pXσX(n),

pZσZ(1) > pZσZ(2) > ... > pZσZ(n).

3. Let e = eXx + eZz, sX = HX eZ , and sZ = HZ eX .It is clear that s = [sX , sZ ]. Run the OSD decoderseparately for the X and Z components of e:

eX = σ−1X

(OSDw(| · |, σX(HZ), sZ , σX(eX))

),

eZ = σ−1Z

(OSDw(| · |, σZ(HX), sX , σZ(eZ))

).

4. Return e = eXx + eZz.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 8

Page 9: Degenerate Quantum LDPC Codes With Good Finite Length ...

10−2 10−110−8

10−7

10−6

10−5

10−4

10−3

10−2

10−1

100

Physical error rate

WE

RThe effect of OSD-0 for different QLDPC codes

A1, BP A1, BP-OSDB1, BP B1, BP-OSDC1, BP C1, BP-OSDD, BP D, BP-OSD

Figure 1: The WER performance of several QLDPC codes un-der the BP and BP-OSD-0 decoders, where: A1 is the 10-limited generalized bicycle [[254,28]] code; B1 is the 6-limitedgeneralized hypergraph product [[882,24]] code; C1 is the 10-limited hypergraph product [[7938,578,16]] code; D is the 8-limited Haah’s cubic [[1024,30]] code (see Appendix B).

For all our simulations we used the normalized min-sum (NMS) decoder with the normalization factor0.625, which approximates the non-binary BP decoderfrom [21], [11, Algorithm 1] in log-domain and is morenumerically stable in some cases. The maximal numberof iterations was set to 32. We used the layered schedul-ing in order to increase the convergence speed of the de-coder by approximately two times11. For a good reviewof practical aspects of the BP decoder implementation,see [35, Chapter 4]. The error-correcting performance inour simulations is measured either in terms of the logicalerror rate or the word error rate12 (WER). We shouldalso stress that in many cases we use only the OSD-0algorithm (Algorithm 2), which has complexity O(n3),while the complexity in the general case is O(n3 +n2w).

In Fig. 1 we show the effect of the OSD-0 post-processing after the BP decoder for different QLDPCcodes, including some known and new codes describedin the next sections. As you can see, the gain of the BP-OSD over the BP decoder in terms of WER for some

11Since the first version of the current work was released, thelayered (serial) schedule of the BP decoder for QLDPC codes wasalso studied in [34].

12Recall that the word error rate, also known as the block errorrate or frame error rate, is the rate of codewords where the de-coder does not give a correct answer (i.e., it either fails to decodeor we have at least one logical error after the decoding).

10−110−6

10−5

10−4

10−3

10−2

10−1

100

5 · 10−2

Physical error rate

WE

R

BP-OSD of different order w

no OSD OSD-0OSD-4 OSD-10OSD-15

Figure 2: The impact of the OSD order w on the WER perfor-mance of the 8-limited [[882,48,16]] code B2 in Appendix B.

codes is up to 5 orders of magnitude (code B1). How-ever, for code A1 the difference between BP-OSD andBP is quite small. We think that this is because the col-umn weight of the matrices HX and HZ is quite high(it is equal to 5), and hence the performance of the BPdecoder is very good even without the post-processing.

Remark. It is interesting to note that 8-limited Haah’s[[1024,30]] code, which has local stabilizers in 3D, alsoperforms very well under the BP-OSD decoder. To thebest of our knowledge, this is the first such demonstra-tion on the depolarizing channel. From our point ofview, this observation implicitly suggests that some ofHaah’s cubic codes may have very good minimum dis-tances. In fact, even after very long runs of the BP-OSDdecoder on this [[1024,30]] code, we have not found anynon-degenerate codewords of weight less than 32.

In Fig. 2 we show the impact of the OSD order w onthe WER performance of the 8-limited [[882,48,16]] code(Appendix B, code B2) under the BP-OSD decoder.We see that the WER performance in this case can befurther improved by increasing the OSD order w. At thesame time, from our experiments with the OSD post-processing on different QLDPC codes, we observed thatin many cases the impact of the OSD order on the WERperformance is quite small.

3.4 Different post-processing algorithmsIn this section, the OSD post-processing algorithmis compared against the other known post-processingmethods that also significantly improve the perfor-mance of the BP decoder. We assume that the prob-

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 9

Page 10: Degenerate Quantum LDPC Codes With Good Finite Length ...

ability distributions in the BP decoder are representedin terms of the log-likelihood ratios (LLRs). Below youcan find a brief description of these methods, where eachmethod can be applied repeatedly after the BP decoderuntil all the parity-checks are satisfied or the maximalnumber of attempts na is reached.

• Random perturbation [21]. If the syndrome isnon-zero after the BP decoding, then we randomlychoose an unsatisfied c-node and randomly changethe initial LLRs for all the v-nodes adjacent to thisc-node. The main parameter of this method is thevariance of the perturbation magnitude. After thechanges are done, the BP decoder runs with theperturbed input LLRs.

• Enhanced feedback [22]. It is similar to theprevious approach but the perturbations are notrandom and calculated using the previous BP out-put. If after the BP decoding the parity-checks arenot satisfied, we randomly choose an unsatisfiedc-node. Then for all the v-nodes adjacent to this c-node, we set the initial LLRs using the BP decoderoutput for these nodes. After this is done the BPdecoder runs with the perturbed input LLRs.

• Matrix augmentation [23]. In this method in-stead of modification of the input LLRs, the parity-check matrix itself is modified by random dupli-cation of some rows. The fraction δ of the du-plicated rows is called the augmentation density.Then a new decoding attempt with the augmentedmatrix is performed.

To compare the performance of all the describedmethods with the BP-OSD decoder we use the 6-limited[[1270, 28]] QLDPC code (B3 in Appendix B). Thiscode belongs to the new class of codes described in Sec-tion 5. For all these methods we used na = 100. Wecan see in Fig. 3 that the OSD post-processing outper-forms all the above-mentioned post-processing methodsand also outperforms the 4-limited [[1201, 1, 25]] sur-face code on the MPS decoder from [5], which is almostoptimal for this code. Let us note that all the otherpost-processing methods also have the WER gain thatis more than 103 over the BP decoder for code B3. Infact, we observed a similar WER gain for many othercodes from the class of (3, 6)-regular CSS QLDPC codeswith a sufficiently large minimum distance. We thinkthat this is mainly because the classical (3, 6)-regularLDPC codes defined by the matrices HX and HZ ofsuch CSS codes themselves have many harmful trap-ping sets. Thus these (3, 6)-regular QLDPC codes ad-ditionally have a lot of degenerate codewords of verylow weight starting from 6.

10−1

10−7

10−6

10−5

10−4

10−3

10−2

10−1

5 · 10−2 2 · 10−1

Physical error rate

WE

R

BP post-processing algorithms

Pure BP Pert.EFB Aug.OSD-0 Surf. MWMSurf. MPS

Figure 3: The WER performance of different post-processingalgorithms for the BP decoder on the 6-limited [[1270,28]]QLDPC code (B3 in Appendix B). The red curves are for the4-limited [[1201,1,25]] surface code under the minimum weightmatching (MWM) and the MPS-based decoders [36, 5].

4 New generalized bicycle codes

4.1 Ansatz with commuting matrices

The commutativity conditions such as (4) and (5) area serious obstacle to designing good QLDPC codes usingrandom-like constructions similar to the constructionsused for classical LDPC codes. Thus it makes sense toconsider large families of matrices of some particularform called ansatz, where the commutativity conditionsare always satisfied. One such quite general ansatz forCSS codes was proposed in [10] as a generalization of thebicycle QLDPC codes [37]. Let us briefly remind thisansatz. Consider two commuting binary n×n matricesA and B, i.e., AB = BA. Let

HX = [A,B] and HZ = [BT, AT]. (12)

Then we see that HXHTZ = AB + BA = 0, and the

commutativity condition (5) is always satisfied. It wasproposed in [10] to use binary circulant matrices A andB since they always commute. The corresponding classof codes is called the generalized bicycle (GB) codes,where the bicycle codes [37] are obtained as a specialcase when B = AT.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 10

Page 11: Degenerate Quantum LDPC Codes With Good Finite Length ...

4.2 Ring of circulantsLet us recall that an ` × ` circulant matrix A over Fqtakes the form

A =

a0 al−1 . . . a1a1 a0 . . . a2. . . . . . . . . . . . . . . . . . . .a`−1 a`−2 . . . a0

,

where a0, . . . , a`−1 ∈ Fq. It is readily seen that thematrix A can be represented in the form

A = a0I + a1P + . . . a`−1P`−1,

where I is the `× ` identity matrix and

P =

0 0 . . . 11 0 . . . 00 1 . . . 0. . . . . . . . . . . . .0 0 . . . 0

is the ` × ` permutation matrix representing the rightcyclic shift by one position. Since P ` = I, we see thatthe ring of all `× ` circulant matrices over Fq is isomor-

phic to the ring F〈`〉q = Fq[x]/(x` − 1) of polynomialsover Fq modulo the polynomial x` − 1.

Hence the circulant matrix A can be uniquely rep-resented by the polynomial a(x) = a0 + a1x + · · · +a`−1x

`−1 and the product C = AB of two circulant ma-trices represented by polynomials a(x), b(x) ∈ R` corre-sponds to the polynomial

c(x) = a(x)b(x) modx` − 1 (13)

which is called the cyclic convolution of a(x) and b(x).Likewise, if we want to find a matrix-vector productc = Ab, where b = (b0, . . . , b`−1) and c = (c0, . . . , c`−1)are (column) vectors corresponding to b(x) and c(x), wecan also use the cyclic convolution (13).

4.3 Dimension of generalized bicycle codesAs we saw before, to define two binary circulant ` × `matrices A and B we need to provide two binary poly-

nomials a(x), b(x) ∈ F〈`〉2 . The dimension13 k of thecorresponding CSS [[2`, k]] code is given by the follow-ing proposition.

Proposition 1. The dimension k of the the generalizedbicycle [[2`, k]] code defined by a(x), b(x) ∈ F〈`〉2 is givenby the formula:

k = 2 deg g(x), (14)where g(x) = gcd(a(x), b(x), x` − 1).

13Let us point out that this dimension formula was given in thepaper [10, Theorem 2] in a slightly more complex form. A similarformula was proved only in the special case of single generatorcodes.

To prove this formula we show that rkHX = rkHZ =n− deg g(x) and use CSS dimension formula (6).

Let us first find the rank of the matrix HX = [A,B],which is equal to the dimension of its column space. Itis easy to see that the column space of HX (called itssyndrome space) is equal to the following set:

{Au+Bv | u, v ∈ F`2}.

Using the described above polynomial representation ofcolumn vectors and circulant matrices we can considerthis set as the following set of polynomials from F〈`〉2 :

{a(x)u(x) + b(x)v(x) | u(x), v(x) ∈ F〈`〉2 }.

It is easy to verify that this set is the principal14 ideal

of the ring F〈`〉2 generated by g(x). Hence it is the cycliccode Cg with generator polynomial g(x), and we provedthat rkHX = dim Cg = n−deg g(x). We call this cycliccode Cg the syndrome code of HX since its codewordsare precisely the polynomial representations of the syn-drome space of HX .

To complete the proof we also need to show thatrkHZ = n − deg g(x). Using similar arguments asabove we can consider the syndrome code for HZ andshow that it is generated by the “transposed” polyno-mial g∗(x) = g(x−1). Though the codes generated bythe polynomials g(x) and g∗(x) may differ, they alwayshave the same dimension since the corresponding circu-lant matrices G and GT have the same rank. Hence wealso proved that rkHZ = n−deg g(x), and the proof offormula (14) is complete.

4.4 Construction methodsThe proof of Proposition 1 gives us also some valuableinformation on how to find generalized bicycle codes ofhigh dimension. If we fix the circulant size ` then allpossible dimensions k of the generalized bicycle codeswith this circulant size are characterized by the degreesof all possible factors of the polynomial x` − 1. Indeed,for each factor g(x) of the polynomial x` − 1 we can

always choose polynomials a(x), b(x) ∈ F〈`〉2 such that:

a(x) mod g(x) = b(x) mod g(x) = 0 (15)

since these polynomials are just two codewords from thecyclic code Cg generated by g(x), which we called thesyndrome code of HX . To produce a w-limited QLDPCwe just need to find low weight polynomials a(x) andb(x) that are the codewords of Cg. In practice, thiscan be accomplished by several methods. If the circu-lant size ` is relatively small, we can find a(x), b(x) by

14An ideal I in a ring R is principal if I = {au | u ∈ R} forsome a ∈ R.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 11

Page 12: Degenerate Quantum LDPC Codes With Good Finite Length ...

an exhaustive search over all polynomials of the givenweight.

Another alternative is to generate random polyno-

mials of a given weight from F〈`〉2 until we find a pairof polynomials that satisfies condition (15). Since theprobability that a random polynomial of a given weightbelongs to Cg is equal approximately to 2− deg g(x); thenif we test more then 2deg g(x) random polynomials wewill find a polynomial from Cg with high probability.

When we find a pair of polynomials a(x), b(x) we alsoneed to check that the corresponding code has good er-ror correcting performance. This can be done by a sim-ulation of the corresponding generalized bicycle code.

All the generalized bicycle codes from Appendix Bwere found by the described above methods.

4.5 GB codes with syndrome protectionAnother important observation, made in the proof ofProposition 1, is that the syndrome codes of the parity-check matrices HX and HZ are the cyclic codes withthe generator polynomials g(x) and g∗(x), respectively.Let us mention that the syndrome code of a parity-check matrix is precisely the set of all possible syn-dromes for it. Hence if we use generator polynomi-als g(x) and g∗(x) that define cyclic codes with min-imum distance d, we see that the syndromes for ma-trices HX and HZ are protected by these cyclic codes.Since the syndrome measurements for quantum codesare performed by faulty hardware, some additional pro-tection of the syndromes may be used to improve thereliability of the syndrome measurements [38, 39]. Letus also mention that the polynomials g(x) and g∗(x)always produce cyclic codes Cg and Cg∗ with the sameminimum distance since the “transpose” map

c(x) =`−1∑i=0

cixi 7→ c∗(x) =

`−1∑i=0

cix`−i modx` − 1

is an automorphism of the ring F〈`〉2 that respects theweight of the polynomials, and therefore we have thatCg∗ = {c∗(x) | c(x) ∈ Cg}.

Hence we can use any cyclic code with generator poly-nomial g(x) and minimum distance d to construct a CSScode, where the syndromes for HX and HZ are pro-tected by cyclic codes of minimum distance d. It isimportant to note that since a(x), b(x) ∈ Cg, the weightof the polynomials a(x), b(x) can not be smaller thanthis minimum distance d.

4.6 Comparison with other codesIn this subsection, we consider several new examplesof generalized bicycle codes and compare their perfor-

10−2 10−1

10−5

10−4

10−3

10−2

10−1

100

Physical error rate

WE

R

HMP vs GB (BP-OSD-10)

HMP [[49,1,9]]GB [[48,6,8]]GB [[46,2,9]]

Figure 4: The WER performance of the 8-limited generalizedbicycle (GB) codes (A3 and A4 in Appendix B) and the 8-limited [[49, 1, 9]] homological product (HMP) code from [8]under the BP decoder with the OSD-10 post-processing.

mance under the BP-OSD decoder against some otheralready known QLDPC codes.

Example 1. Let us consider the primitive narrow-senseBCH [127, 14, 5] code Cg with the generator polynomial:

g(x) = (x7 + x+ 1) · (x7 + x5 + x3 + x+ 1).

If we set a(x) = 1+x15 +x20 +x28 +x66 and b(x) = 1+x58+x59+x100+x121, then we obtain the 10-limited gen-eralized bicycle [[254, 28]] code. Its minimum distanceis not available, but the performance of this code (seeFig. 1, code A1) is almost the same as the performanceof the 10-limited hypergraph product [[7938, 578, 16]]code15 obtained from the two identical circulant parity-check matrices H of the cyclic code [63, 17, 16] code de-fined by the polynomial h(x) = 1+x3 +x34 +x41 +x57.This particular code was chosen in order to match thehigh rate of the [[254, 28]] code. It is important to notethat both codes do not have 4-cycles in matrices HX

and HZ , and they have the same weight of stabiliz-ers. It is also interesting that the performance of the[[254, 28]] code is almost the same even under the clas-sical BP decoder without OSD post-processing. Thereason of such good performance with the BP decoderis not fully understood. One of the possible explana-tions is related with the trapping set structure of the[[254, 28]] code. Since its syndrome code has minimumdistance 5, it can not have (a, b) trapping sets16 with

15The definition of these codes is given in Section 5.16An (a, b) trapping set or a near-codeword for a parity-check

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 12

Page 13: Degenerate Quantum LDPC Codes With Good Finite Length ...

10−4 10−3 10−2 10−1

10−6

10−5

10−4

10−3

10−2

10−1

100

Physical error rate

Logi

cale

rror

rate

Bicycle vs Generalized Bicycle (NBP and BP)

[[256,32]] BP (binary)[[256,32]] NBP[[126,28]] BP (binary)[[126,28]] BP

Figure 5: The logical error rate performance of the 16-limited[[256, 32]] bicycle code under the neural BP (NBP) decoderfrom [41] and the 10-limited [[126, 28, 8]] generalized bicyclecode (A2 in Appendix B) under the BP decoder (binary andnon-binary) without the OSD post-processing.

b < 5. It is very well known [40] that (a, b) trappingsets with small a and b may greatly decrease the perfor-mance of the BP decoder. And the [[254, 28]] can nothave the most harmful trapping sets.

Example 2. Let us consider the cyclic [63, 14, 5] codewith the generator polynomial

g(x) = (x2 +x+ 1) · (x6 +x5 + 1) · (x6 +x5 +x4 +x+ 1)

If we set a(x) = 1 + x + x14 + x16 + x22, b(x) =1 +x3 +x13 +x20 +x42 we obtain the 10-limited gener-alized bicycle [[126, 28]] code. Its performance with thestandard BP decoder (binary and non-binary) is shownin Fig. 5, code A2. We compared its performance withthe performance of the neural BP decoder for the bicy-cle [[256, 32]] code constructed in [41]. Such a big differ-ence in the performance is mostly because the QLDPC[[256, 32]] code used in [41] has a small minimum dis-tance compared to the [[126, 28]] code, which minimumdistance is 8. This minimum distance was found byan exhaustive search (see Appendix B). Another possi-ble reason is that the neural BP decoder proposed in [41]was based on the binary BP, which usually has worseperformance than its non-binary version.

Example 3. In this example we constructed two verysmall 8-limited generalized bicycle codes (the [[48, 6, 8]]

matrix H is a vector v of weight a such that the correspondingsyndrome s = Hv has weight b.

10−110−7

10−6

10−5

10−4

10−3

10−2

10−1

100

5 · 10−2

Physical error rate

WE

R

HB vs GB (BP-OSD-10)

HB [[900,50,14]]GB [[180,10, d > 15]]GB [[900,50,15]]

Figure 6: The WER performance of the 8-limited hyperbicycle(HB) [[900,50,14]] code and two 8-limited generalized bicycle(GB) codes (A5 and A6 in Appendix B) under the BP-OSD-10decoder.

code A3 and the [[46, 2, 9]] code A4, see Appendix B).We compared their performance (see Fig. 4) with theperformance of an 8-limited [[49, 1, 9]] homological prod-uct (HMP) code from [8] using the BP with OSD-likepost-processing. As we can see the performance of thenewly constructed codes is similar to the [[49, 1, 9]] code.At the same time, their rates are higher.Example 4. In Fig. 6 we compared the performance ofthe 8-limited hyperbicycle [[900, 50, 14]] code from [9,10] with two new 8-limited generalized bicycle codes(A5 and A6 in Appendix B). We can see that the per-formance of the generalized bicycle [[180, 10, d]] code,15 6 d 6 18, is similar to the hyperbicycle [[900, 50,14]] code. At the same time, it has the same weight ofstabilizers, and its code length is 5 times smaller.

5 Generalization of HP codes5.1 Hypergraph product (HP) codesIn this section, we propose a new generalization of hy-pergraph product codes [7] in the case when one of theparity-check matrices in the product is square. Let usfirst remind the definition of these codes in a matrixform [9]. Suppose we have an [na, ka, da] linear code Caand an [nb, kb, db] linear code Cb defined by parity-checkmatrices17 a ∈ Mma×na(F2) and b ∈ Mmb×nb

(F2) re-spectively. Then the hypergraph product code is the

17The parity-check matrices are not necessary full rank.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 13

Page 14: Degenerate Quantum LDPC Codes With Good Finite Length ...

CSS [[N,K, d]] code with HX = (a⊗ Imb, Ima ⊗ b) and

HZ = (Ina ⊗ bT, aT ⊗ Inb), where N = namb + nbma,

K = 2kakb−ka(nb−mb)−kb(na−ma). As it was shownin [7], the minimum distance d of the hypergraph prod-uct code C satisfies the following lower bound:

d > min(da, db, dTa , d

Tb ),

where dTa and dT

b are the minimal distances of the“transposed” codes CT

a and CTb defined by the parity-

check matrices aT and bT respectively. It is importantto note that if the matrices a and b are w-limited, thenthe corresponding CSS code C is 2w-limited. Hence,using known asymptotically good families of classi-cal LDPC codes with (wc, wr)-limited parity check-matrices, it is possible [7] to construct w-limited CSScodes with asymptotically non-zero rate and d = Θ(

√n)

as n → ∞. In [9] the hypergraph product construc-tion was further improved, and it was shown that onecan construct good hypergraph product codes usingsquare parity-check matrices a and b. In fact, many ofthe best-known small-length hypergraph product codesare constructed using square parity check matrices ofcyclic codes (see [9, 10]). In [10] hyperbicycle CSScodes, which generalize both generalized bicycle andhypergraph product codes, were proposed. Here weconsider another generalization of hypergraph productcodes where the matrix b is square.

5.2 Generalized hypergraph product codesIn what follows by a ring we always mean a ring withidentity. Let R be a ring. We denote the ring of allm × n matrices over R by Mm×n(R) or by Mn(R)when m = n. If R is the ring of `×` matrices over somefield F we identify the elements of Mm×n(R) with thecorresponding block matrices from Mm`×n`(F).

Consider a binary matrix b ∈ M`(F2). We say thatthe matrix b and a ring R ⊆ M`(F2) commute if allmatrices from R commute with b.

Example 5. Consider b ∈ M`(F2) and R = {0, I},where 0 and I are the zero and the identity matricesfrom M`(F2) respectively; then b and R always com-mute.Example 6. Let b be a binary circulant matrix and Rbe the ring of all binary circulant matrices of the samesize; then b and R always commute.

Suppose that a matrix b ∈ M`(F2) and a ring R ⊆M`(F2) commute. Consider a matrix A = (aij)m×n ∈Mm×n(R). We denote by C(A, b) the CSS code calleda generalized hypergraph product (GHP) code with thefollowing parity-check matrices18:

HX = [A, bIm], HZ = [bTIn, A∗], (16)18Let us warn the reader that we understand HX and HZ as

where A∗ = (aTji)n×m, and Im, In are the identity matri-ces over R of size m and n respectively. The correctnessof this definition follows from the following:

HXHTZ = [A, bIm]

[InbA

]= Ab+ bA = 0.

The code length N of the CSS code C(A, b) is givenby N = (m + n)`. We will show later how to find thedimension K of the code C(A, b) in a special case.

One can easily verify that if we take a matrix b ∈M`(F2) and the ring R = {0, I} (as in Example 5)then the CSS code C(A, b) is the hypergraph productcode defined by the binary m× n matrix a = (aij)m×nand the binary ` × ` matrix b, where for all i ∈ [m],j ∈ [n] we have:

aij ={

0, if aij = 0;

1, if aij = I.

We can also see that the ansatz with two commutingmatrices A and B given in (12) is also a special case ofthe new ansatz described in (16), where the matrix Ais a 1× 1 block matrix.

5.3 Quasi-cyclic generalized hypergraph productcodesIn this subsection, we describe quasi-cyclic (QC) GHPcodes. In fact, it can be shown that this particular sub-class of GHP codes is equivalent (up to some permuta-tion of qubits) to a special case of hyperbicycle codesfrom [10, Eq. (19), χ = r2 = n2 = 1]. However, webelieve that the concise language of polynomial matri-ces adopted in the current work is much more suitablefor our examples, which are essentially sparse randomQC GHP codes subject to some additional constrains.

Now, let us take b and R as in Example 6. Henceb is a binary circulant matrix, and R is the ring of allbinary circulant matrices of the same size. In this case,the matrices HX and HZ defined by (16) are block ma-trices, where each block is a binary circulant matrix ofsize `. Such matrices are called quasi-cyclic. Let usnote that quasi-cyclic (QC) matrices are well known inclassical coding theory. In fact, most of the best-knownpractical classical LDPC codes have QC parity-checkmatrices. We will show in this section how to find thedimension of generalized hypergraph product codes de-fined by (16). For simplicity, we consider here only thecase when the circulant size ` is odd. Before we canprovide the formula for the dimension we need somesupplementary definitions from algebra.

the corresponding binary block matrices (not as matrices overM`(F2)).

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 14

Page 15: Degenerate Quantum LDPC Codes With Good Finite Length ...

Here we adopt the polynomial representation of QCmatrices used in [42, 43]. For any polynomial p(x) ∈Fq[x] of degree d we consider the ring Fq[x]/(p(x))of polynomials f0 + f1x+ · · ·+ fd−1x

d−1 ∈ Fq[x] withaddition and multiplication modulo p(x). By Fdq wedenote the d-dimensional space of the d × 1 columnvectors over Fq. We also identify an element f(x) ∈Fq[x]/(p(x)) with the corresponding column vector f =(f0, . . . , fd−1) ∈ Fdq .

Let us recall that by F〈`〉2 we denote the ring of circu-lants F2[x]/(x`− 1). We use the standard identificationof the circulant `×` matrices over F2 with the elementsof the ring F〈`〉2 (see Subsection 4.2), where a column

vector a ∈ F〈`〉2 corresponds to the circulant matrix withthe first column equal to a. Using this identification wecan consider an m` × n` QC matrix over F2 of circu-

lant size ` as an m × n matrix over the ring F〈`〉2 . We

also consider n × 1 column vectors over F〈`〉2 as n` × 1column vectors over F2. Given the above identificationwe consider multiplication of an m`×n` QC matrix byan n`× 1 column vector over F2 as multiplication of an

m× n matrix by an n× 1 column vector over F〈`〉2 .

The algebraic structure of the ring F〈`〉2 is very wellstudied in the literature (see Appendix A for furtherdetails). Since we consider the case when ` is odd, thepolynomial x` − 1 factors into a product of irreduciblepolynomials over F2:

x` − 1 = f1(x) · · · fs(x). (17)

Hence the ring F〈`〉2 is isomorphic to the direct productof finite fields:

F〈`〉2∼= F1 × · · · × Fs, (18)

where the field Fi = F2[x]/(fi(x)

)has the size 2di ;

di = deg fi(x), i ∈ [s]. Let us consider the maps

ϕi : F〈`〉2 → Fi given by the formula:

ϕi : u(x) 7→ u(x) mod fi(x), i ∈ [s].

We also naturally extend this map to any vectors and

matrices over F〈`〉2 . The following lemma is the key tothe dimension formula for the QC generalized hyper-graph product codes.

Lemma 1. Let A ∈ Mm×n(F〈`〉2 ) be a binary QC ma-trix. Then its rank (over F2) is given by:

rkF2 A =s∑i=1

di rkFiϕi(A)

Proof. The lemma easily follows from the isomorphismshown in (18) between F〈`〉2 and the direct product of

the fields F1, . . . , Fs. Indeed, let ri = rkFiϕi(A), i ∈ [s].

If A1, . . . , An are the columns of A, then each vector vthat belongs to the column space of the matrix A canbe represented as follows:

v = u1A1 + · · ·+ unAn,

where u1, . . . , un ∈ F〈`〉2 . Therefore we see that the car-dinality of the column space of the non-binary matrixϕi(A) over the field Fi is equal to (2di)ri = 2diri . Henceusing isomorphism (18) we conclude that the number ofdifferent vectors in the column space of the matrix A isequal to

s∏i=1

2diri = 2∑s

i=1diri ,

and we proved that rkF2 A =∑si=1 diri.

The following proposition provides the formula forthe dimension of the QC CSS code C(A, b) if ` is odd.

Proposition 2. Let b(x) ∈ F〈`〉2 , A ∈ Mm×n(F〈`〉2 ),where ` is odd. Let g(x) = gcd(b(x), x` − 1) =∏i∈S fi(x), S ⊆ [s], where fi(x) are some irreducible

polynomials from (17), and Fi = F2[x]/(fi(x)), i ∈ S,are the corresponding finite fields. Then C(A, b) isa CSS [[N,K]] code, where N = (m+ n)` and

K =∑i∈S

deg fi(x)(m+ n− 2 rkFi ϕi(A)).

Proof. The proof idea is the following. Let us mentionthat ϕi(HX) = [ϕi(A),0] for all i ∈ S. Hence we haverkFi

ϕi(HX) = rkFiϕi(A), for all i ∈ S. At the same

time for i ∈ [s] \ S, we obtain

rkFiϕi(HX) = rkFi

[ϕi(A), ϕi(b)Im] = m,

since for all i ∈ [s] \ S we have that ϕi(b) 6= 0 and there-fore the non-binary matrix ϕi(HX) is full rank. Henceby applying Lemma 1 to the matrix HX we have:

m`− rkHX =s∑i=1

deg fi(x)(m− rkFi ϕi(HX))

=∑i∈S

deg fi(x)(m− rkFiϕi(A)).

To complete the proof we need also to find the rankof the matrix HZ . It is easier to find the rank of thematrix H ′Z obtained from HZ by the application of the“transpose” map u 7→ u∗ to each element. Since thetranspose map is an automorphism on the ring F〈`〉2 wesee that the number of vectors in the row space of HZ

and the row space of H ′Z is the same. Hence rkHZ =rkH ′Z . The rank of the matrix H ′Z = [bIn, AT ], can befound in the same way as for the matrix HX :

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 15

Page 16: Degenerate Quantum LDPC Codes With Good Finite Length ...

10−2 10−1

10−7

10−6

10−5

10−4

10−3

10−2

10−1

Physical error rate

WE

RGHP vs HP (BP and BP-OSD-10)

HP [[1922,50,16]]HP, OSD [[1922,50,16]]GHP [[882,24]]GHP, OSD [[882,24]]

Figure 7: The WER performance of the 6-limited[[1922, 50, 16]] hypergraph product (HP) code and the 6-limited [[882, 24]] generalized hypergraph product (GHP) code(C2 and B1 in Appendix B). The HP code has an error flooreven under the BP-OSD-10 decoder.

n`− rkH ′Z =s∑i=1

deg fi(x)(n− rkFi ϕi(H ′Z))

=∑i∈S

deg fi(x)(n− rkFiϕi(AT))

=∑i∈S

deg fi(x)(n− rkFi ϕi(A)).

Now we apply formula (6) for the CSS dimension andobtain:

K = N − rkHX − rkHZ

= (m`− rkHX) + (n`− rkH ′Z)

=∑i∈S

deg fi(x)(m+ n− 2 rkFiϕi(A)).

This concludes the proof.

Let us note that if the polynomial b(x) is such thatg(x) = gcd(b(x), x`−1) is an irreducible factor of x`−1,then we can give a more elegant formula for the dimen-sion of the code C(A, b) in some special cases. Indeed,in this case we have:

K = deg g(x)(m+ n− 2 rkF ϕ(A)), (19)

where F is the finite field F2[x]/(g(x)) and ϕ(A) is theF -image of A under the action of the map ϕ : u(x) 7→u(x) mod g(x). Since ϕ(A) is a matrix over F , it defines,

as a parity-check matrix, a non-binary linear code overF of dimension

kA = n− rkF ϕ(A).

At the same time, b(x) defines the cyclic code

Cb = Cg = {g(x)u(x) | u(x) ∈ F〈`〉2 }

of dimension kb = deg g(x) as a check polynomial. Thusformula (19) gives us the dimension K of C(A, b) interms of the dimensions kA and kb for the two specialcases shown below:

1. if A is a square matrix, i.e. m = n, we have

K = 2kAkb; (20)

2. if A is a full rank matrix, i.e. m = rkF ϕ(A), wehave

K = kAkb = (n−m)kb. (21)

In the current work, we construct only codes thatcorrespond to case 1 above. Such codes are defined byan irreducible factor b(x) of x`− 1 and a square matrix

A over F〈`〉2 . To construct all the examples of QC GHPcodes given in Appendix B (codes B1, B2, and B3),we used the following procedure. First we fix a lowweight irreducible polynomial b(x) ∈ F2[x] such thatb(x) | x` − 1, and then randomly choose a polynomialmatrix A subject to some constraints. Since we wantto obtain sparse parity-check matrices HX and HZ forthe code C(A, b), we restrict each entry of A to be either0 or a monomial xi, 0 6 i < `. When the number ofnon-zero entries in each row and each column of A isbounded above by w, this restriction guaranties thatboth HX and HZ are (w + deg b(x))-limited matrices.Another restriction is related to the girth of the Tan-ner graphs TX , TZ for HX , HZ . As you can see fromTab. 1 in Appendix B, the girth of the Tanner graphsTX , TZ for all the constructed QC GHP codes is equalto 6, which means that TX , TZ do not contain 4-cycles.This restriction helps to improve the error-correctingperformance under the BP decoder.

Example 7. In Fig. 7 you can see the WER perfor-mance (under the BP-OSD decoder) of the two codes:the 6-limited [[1922,50,16]] hypergraph product (HP)code (C2 in Appendix B) and the 6-limited [[882,24]]generalized hypergraph product (GHP) code (B1 inAppendix B). You can see from Fig. 7 that the HP[[1922,50,16]] code has some error floor even under theBP-OSD decoder. We believe that this is due to a largeamount of low-weight non-degenerate codewords in thiscode.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 16

Page 17: Degenerate Quantum LDPC Codes With Good Finite Length ...

0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.1810−10

10−9

10−8

10−7

10−6

10−5

10−4

10−3

10−2

10−1

Physical error rate

WE

RDeep simulations of two GHP codes

GHP [[882,24]]GHP [[1270,28]]Surf. MPS

Figure 8: A deep simulation on the depolarizing channel ofthe 6-limited [[882,24]] and [[1270,28]] QC GHP codes (B1and B3 in Appendix B) under the BP-OSD-0 decoder. Thesecodes do not have error floor down to WER = 10−10. The redcurve is for the [[1201,1,25]] surface code on the MPS-baseddecoder from [5].

In Fig 8 we can see the WER performance of the 6-limited [[882,24]] and [[1270,28]] QC GHP codes (codesB1 and B3 in Appendix B) under the BP-OSD-0 de-coder. We see that these codes do not have the er-ror floor down to WER = 10−10. The red curveshows the corresponding WER performance of the 4-limited [[1201,1,25]] surface code under the almost op-timal MPS-based decoder from [5].

6 ConclusionWe proposed new OSD-like post-processing for the BPdecoder that shows on some codes much better per-formance than all the modifications known to the au-thors. We also constructed several new generalized bi-cycle codes that show very good performance comparedto the other known codes with similar parameters. Weproposed a new ansatz for quantum CSS codes andshowed how to estimate the dimension of such codes insome special cases. Unfortunately, we have not foundany nontrivial general lower bound on the minimum dis-tance of such codes. We think that to find such a boundis an interesting open problem19 since this class contains

19Since the first version of this work appeared in arXiv, somelower bounds on the minimal distance have been obtained in [16,17, 18] for special cases of QC GHP codes C(A, 1 + x).

some of the best known QLDPC codes, and their prac-tical performance under the BP-OSD decoder is alsoquite good. Finally, we compared the performance ofone of our codes from the new family and showed thatit has better performance than a relatively large surfacecode of similar code length even if this code is decodedby a near-optimal decoder.

AcknowledgmentsThe authors would like to thank Dr. Xuecang Zhangfrom Huawei Technologies for the support of this workand for useful discussions. This work was also supportedby the Ministry of Science and Higher Education of theRussian Federation (Grant № 075-15-2020-801).

References[1] Eric Dennis, Alexei Kitaev, Andrew Landahl,

and John Preskill. Topological quantum memory.Journal of Mathematical Physics, 43(9):4452–4505,2002. doi:10.1063/1.1499754.

[2] Michael H. Freedman and David A. Meyer. Projec-tive plane and planar quantum codes. Foundationsof Computational Mathematics, 1(3):325–332, Jul2001. doi:10.1007/s102080010013.

[3] H. Bombin and M. A. Martin-Delgado. Topo-logical quantum distillation. Phys. Rev. Lett.,97:180501, Oct 2006. doi:10.1103/PhysRevLett.97.180501.

[4] David S. Wang, Austin G. Fowler, and Lloyd C. L.Hollenberg. Surface code quantum computing witherror rates over 1%. Phys. Rev. A, 83:020302, Feb2011. doi:10.1103/PhysRevA.83.020302.

[5] Sergey Bravyi, Martin Suchara, and AlexanderVargo. Efficient algorithms for maximum likeli-hood decoding in the surface code. Phys. Rev. A,90:032326, Sep 2014. doi:10.1103/PhysRevA.90.032326.

[6] Nikolas P. Breuckmann and Barbara M. Terhal.Constructions and noise threshold of hyperbolicsurface codes. IEEE Transactions on Informa-tion Theory, 62(6):3731–3744, June 2016. doi:10.1109/TIT.2016.2555700.

[7] J. Tillich and G. Zemor. Quantum LDPC codeswith positive rate and minimum distance propor-tional to n1/2. In 2009 IEEE International Sympo-sium on Information Theory, pages 799–803, June2009. doi:10.1109/ISIT.2009.5205648.

[8] Sergey Bravyi and Matthew B. Hastings. Ho-mological product codes. In Proceedings of the

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 17

Page 18: Degenerate Quantum LDPC Codes With Good Finite Length ...

Forty-sixth Annual ACM Symposium on Theory ofComputing, STOC ’14, pages 273–282, New York,NY, USA, 2014. ACM. doi:10.1145/2591796.2591870.

[9] A. A. Kovalev and L. P. Pryadko. Improvedquantum hypergraph-product LDPC codes. In2012 IEEE International Symposium on Informa-tion Theory Proceedings, pages 348–352, July 2012.doi:10.1109/ISIT.2012.6284206.

[10] Alexey A. Kovalev and Leonid P. Pryadko. Quan-tum kronecker sum-product low-density parity-check codes with finite rate. Phys. Rev. A,88:012311, Jul 2013. doi:10.1103/PhysRevA.88.012311.

[11] Z. Babar, P. Botsinis, D. Alanis, S. X. Ng, andL. Hanzo. Fifteen years of quantum LDPC codingand improved decoding strategies. IEEE Access,3:2492–2519, 2015. doi:10.1109/ACCESS.2015.2503267.

[12] M. Hagiwara and H. Imai. Quantum quasi-cyclicLDPC codes. In 2007 IEEE International Sympo-sium on Information Theory, pages 806–810, June2007. doi:10.1109/ISIT.2007.4557323.

[13] M. P. C. Fossorier and Shu Lin. Soft-decisiondecoding of linear block codes based on orderedstatistics. IEEE Transactions on Information The-ory, 41(5):1379–1396, Sep. 1995. doi:10.1109/18.412683.

[14] M. P. C. Fossorier. Iterative reliability-based de-coding of low-density parity check codes. IEEEJournal on Selected Areas in Communications,19(5):908–917, may 2001. doi:10.1109/49.924874.

[15] B. Dorsch. A decoding algorithm for binary blockcodes and j-ary output channels (corresp.). IEEETransactions on Information Theory, 20(3):391–394, may 1974. doi:10.1109/TIT.1974.1055217.

[16] Matthew B. Hastings, Jeongwan Haah, and RyanO’Donnell. Fiber bundle codes: Breaking the n1/2

polylog(n) barrier for quantum LDPC codes. InProceedings of the 53rd Annual ACM SIGACTSymposium on Theory of Computing, pages 1276–1288. Association for Computing Machinery, NewYork, NY, USA, June 2021. doi:10.1145/3406325.3451005.

[17] Pavel Panteleev and Gleb Kalachev. QuantumLDPC codes with almost linear minimum distance.IEEE Transactions on Information Theory, pages1–1, 2021. doi:10.1109/TIT.2021.3119384.

[18] Nikolas P. Breuckmann and Jens N. Eberhardt.Balanced product quantum codes. IEEE Trans-actions on Information Theory, 67(10):6653–6674,October 2021. doi:10.1109/TIT.2021.3097347.

[19] Michael Freedman and Matthew Hastings. Build-ing manifolds from quantum codes. Geometric andFunctional Analysis, June 2021. doi:10.1007/s00039-021-00567-3.

[20] Jeongwan Haah. Local stabilizer codes in three di-mensions without string logical operators. Phys.Rev. A, 83:042330, Apr 2011. doi:10.1103/PhysRevA.83.042330.

[21] D. Poulin and Yeojin C. On the iterative de-coding of sparse quantum codes. Quantum Info.Comput., 8(10):987–1000, November 2008. doi:10.5555/2016985.2016993.

[22] Y. Wang, B. C. Sanders, B. Bai, and X. Wang.Enhanced feedback iterative decoding of sparsequantum codes. IEEE Transactions on Informa-tion Theory, 58(2):1231–1241, Feb 2012. doi:10.1109/TIT.2011.2169534.

[23] Alex Rigby, J. C. Olivier, and Peter Jarvis.Modified belief propagation decoders for quan-tum low-density parity-check codes. Physical Re-view A, 100(1):012330, July 2019. doi:10.1103/PhysRevA.100.012330.

[24] Daniel Gottesman. Stabilizer Codes and QuantumError Correction. PhD thesis, California Instituteof Technology, 1997. doi:10.7907/rzr7-dt72.

[25] A. R. Calderbank and Peter W. Shor. Good quan-tum error-correcting codes exist. Phys. Rev. A,54:1098–1105, Aug 1996. doi:10.1103/PhysRevA.54.1098.

[26] A. M. Steane. Error correcting codes in quantumtheory. Phys. Rev. Lett., 77:793–797, Jul 1996.doi:10.1103/PhysRevLett.77.793.

[27] R. G. Gallager. Low-Density Parity-Check Codes.M.I.T. Press, Cambridge, MA, 1963. doi:10.7551/mitpress/4347.001.0001.

[28] R. Tanner. A recursive approach to low com-plexity codes. IEEE Transactions on Informa-tion Theory, 27(5):533–547, September 1981. doi:10.1109/TIT.1981.1056404.

[29] F.R. Kschischang, B.J. Frey, and H.-A.Loeliger. Factor graphs and the sum-productalgorithm. IEEE Transactions on Informa-tion Theory, 47(2):498–519, February 2001.doi:10.1109/18.910572.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 18

Page 19: Degenerate Quantum LDPC Codes With Good Finite Length ...

[30] E. Prange. The use of information sets in de-coding cyclic codes. IRE Transactions on Infor-mation Theory, 8(5):5–9, September 1962. doi:10.1109/TIT.1962.1057777.

[31] Jack Edmonds. Matroids and the greedy algo-rithm. Mathematical Programming, 1(1):127–136,December 1971. doi:10.1007/BF01584082.

[32] M.P.C. Fossorier, Shu Lin, and J. Snyders.Reliability-based syndrome decoding of linearblock codes. IEEE Transactions on InformationTheory, 44(1):388–398, January 1998. doi:10.1109/18.651070.

[33] Raymond Laflamme, Cesar Miquel, Juan PabloPaz, and Wojciech Hubert Zurek. Perfect quan-tum error correcting code. Physical Review Let-ters, 77(1):198–201, July 1996. doi:10.1103/PhysRevLett.77.198.

[34] Kao-Yueh Kuo and Ching-Yi Lai. Refined be-lief propagation decoding of sparse-graph quan-tum codes. IEEE Journal on Selected Areas inInformation Theory, 1(2):487–498, August 2020.doi:10.1109/JSAIT.2020.3011758.

[35] Marc Fossorier, David Declercq, and Ezio Biglieri.Channel Coding: Theory, Algorithms, and Appli-cations. Academic Press, July 2014. doi:10.1016/C2011-0-07211-3.

[36] Jack Edmonds. Paths, Trees, and Flowers. Cana-dian Journal of Mathematics, 17:449–467, 1965/ed.doi:10.4153/CJM-1965-045-4.

[37] D. J. C. MacKay, G. Mitchison, and P. L. McFad-den. Sparse-graph codes for quantum error correc-tion. IEEE Transactions on Information Theory,50(10):2315–2330, Oct 2004. doi:10.1109/TIT.2004.834737.

[38] H Bombin, R W Chhajlany, M Horodecki, and M AMartin-Delgado. Self-correcting quantum comput-ers. New Journal of Physics, 15(5):055023, may2013. doi:10.1088/1367-2630/15/5/055023.

[39] Yuichiro Fujiwara. Ability of stabilizer quantumerror correction to protect itself from its own im-perfection. Phys. Rev. A, 90:062304, Dec 2014.doi:10.1103/PhysRevA.90.062304.

[40] Tom Richardson. Error-floors of LDPC codes.In Proceedings of the 41st Annual Conference onCommunication, Control and Computing, pages1426–1435, 2003.

[41] Ye-Hua Liu and David Poulin. Neural belief-propagation decoders for quantum error-correctingcodes. Physical Review Letters, 122(20):200501,May 2019. doi:10.1103/PhysRevLett.122.200501.

[42] Kristine Lally and Patrick Fitzpatrick. Algebraicstructure of quasicyclic codes. Discrete AppliedMathematics, 111(1):157–175, July 2001. doi:10.1016/S0166-218X(00)00350-4.

[43] Roxana Smarandache and Pascal O. Vontobel.Quasi-cyclic LDPC codes: Influence of proto- andtanner-graph structure on minimum hamming dis-tance upper bounds. IEEE Transactions on In-formation Theory, 58(2):585–607, February 2012.doi:10.1109/TIT.2011.2173244.

[44] San Ling, Harald Niederreiter, and PatrickSole. On the algebraic structure of quasi-cycliccodes IV: Repeated roots. Designs, Codes andCryptography, 38:337–361, 2006. doi:10.1007/s10623-005-1431-7.

[45] I. Dumer, A. A. Kovalev, and L. P. Pryadko. Dis-tance verification for classical and quantum LDPCcodes. IEEE Transactions on Information Theory,63(7):4675–4686, 2017. doi:10.1109/TIT.2017.2690381.

A Algebraic structure of the ring F〈`〉qLet Fq be a finite field of characteristics 2. The algebraic

structure of the ring F〈`〉q is well studied in the codingliterature (see, e.g., [44]). Below we briefly review it.

First, let us consider the special case when ` is odd.In this case the polynomial x`−1 factors into a productof different irreducible polynomials over Fq

x` − 1 = f1(x) · · · fs(x). (22)

This is true, since

gcd((x` − 1)′, x` − 1

)= gcd

(`x`−1, x` − 1

)= 1,

and the polynomial x` − 1 is square-free.In the general case, we have ` = 2e`′, where `′ is odd.

Hence it follows that

x` − 1 = x2e`′ − 1 = (x`′− 1)2e

.

Moreover, since `′ is odd, we can apply factoriza-tion (22) to the polynomial x`

′ − 1 and obtain that

x` − 1 =(f1(x)

)2e

· · ·(fs(x)

)2e

. (23)

Since the polynomials (f1(x))2e

, . . . , (fs(x))2e

arepairwise coprime, from the Chinese remainder theorem

it follows that the ring F〈`〉q is isomorphic to the directproduct

R1 × · · · ×Rs (24)

of the rings Ri = Fq[x]/(fi(x)

)2e

, i ∈ [s].When ` is odd we have e = 0 and the rings R1, . . . , Rs

are in fact fields, since the polynomials f1(x), . . . , fs(x)are irreducible over Fq.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 19

Page 20: Degenerate Quantum LDPC Codes With Good Finite Length ...

B Matrices used for simulationsAll matrices for generalized hypergraph product andgeneralized bicycle codes that we used for simulationshave the form HX = [A,B], HZ = [BT , AT ] where Aand B are quasi-cyclic matrices. Thus, to define thecode, we specify matrices A and B in the polynomial

form as matrices over F〈`〉2 .For all codes presented here, we also provide lower

and upper bounds on the minimum distance obtainedeither by methods similar to the ones from [45] or bya straightforward reduction of the minimum distanceproblem to a mixed integer linear program and us-ing the GNU Linear Programming Kit, Version 4.63,http://www.gnu.org/software/glpk/glpk.html.

A. Generalized bicycle (GB) codes. The matricesA and B have form A = (a(x)), B = (b(x)), sohere we specify the polynomials a(x), b(x), and thecirculant size `.

A1) [[254, 28, d]] code (` = 127), 14 6 d 6 20.

a(x) = 1 + x15 + x20 + x28 + x66,

b(x) = 1 + x58 + x59 + x100 + x121.

A2) [[126, 28, 8]] code (` = 63).

a(x) = 1 + x+ x14 + x16 + x22,

b(x) = 1 + x3 + x13 + x20 + x42.

A3) [[48, 6, 8]] code (` = 24).

a(x) = 1 + x2 + x8 + x15,

b(x) = 1 + x2 + x12 + x17.

A4) [[46, 2, 9]] code (` = 23).

a(x) = 1 + x5 + x8 + x12,

b(x) = 1 + x+ x5 + x7.

A5) [[180, 10, d]] code (` = 90), 15 6 d 6 18.

a(x) = 1 + x28 + x80 + x89,

b(x) = 1 + x2 + x21 + x25.

A6) [[900, 50, 15]] code (` = 450).

a(x) = 1 + x97 + x372 + x425,

b(x) = 1 + x50 + x265 + x390.

B. Generalized hypergraph product (GHP)codes. Here the matrix B is diagonal; B = b(x)In,where In is the n× n identity matrix over the ring

F〈`〉2 .

B1) [[882, 24, d]] code, 18 6 d 6 24. The matricesHX and HZ are (3,6)-regular (` = 63).

A =

x27 0 0 0 0 1 x54

x54 x27 0 0 0 0 11 x54 x27 0 0 0 00 1 x54 x27 0 0 00 0 1 x54 x27 0 00 0 0 1 x54 x27 00 0 0 0 1 x54 x27

,

B = (1 + x+ x6)I7.

B2) [[882, 48, 16]] code. Half of the columns forboth HX and HZ matrices have weight 3, an-other half have weight 5. All the rows haveweight 8 (` = 63).

A =

x27 0 0 1 x18 x27 11 x27 0 0 1 x18 x27

x27 1 x27 0 0 1 x18

x18 x27 1 x27 0 0 11 x18 x27 1 x27 0 00 1 x18 x27 1 x27 00 0 1 x18 x27 1 x27

,

B = (1 + x+ x6)I7.

B3) [[1270, 28, d]] code, 16 6 d 6 46. The matricesHX and HZ are (3,6)-regular (` = 127).

A =

1 0 x51 x52 00 1 0 x111 x20

1 0 x98 0 x122

1 x80 0 x119 00 1 x5 0 x106

,

B = (1 + x+ x7)I5.

C. Hypergraph product (HP) codes. Each hy-pergraph product code in our simulations is con-structed from a single cyclic code defined by itsparity polynomial h(x) and the length `.

C1) [[7938, 578, 16]] code. The matrices HX andHZ are (5,10)-regular, and we have:

` = 63, h(x) = 1 + x3 + x34 + x41 + x57.

C2) [[1922, 50, 16]] code. The matrices HX andHZ are (3,6)-regular, and we have:

` = 31, h(x) = 1 + x2 + x5.

D. Haah’s cubic codes. We used the [[1024, 30, d]]Haah’s cubic code on the 8× 8× 8 lattice from [20,Code 1], 13 6 d 6 32.

E. Hyperbicycle (HB) codes. We used the[[900, 50, 14]] hyperbicycle code from [9, Exam-ple 8], [10, Example 6].

F. Homological product (HMP) codes. We usedone of the randomly constructed [[49, 1, 9]] homo-logical product codes from [8].

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 20

Page 21: Degenerate Quantum LDPC Codes With Good Finite Length ...

Table 1: Codes parameters

Code N K d rate wr wc girthA1 254 28 14–20 0.110 10 5 6A2 126 28 8 0.222 10 5 4A3 48 6 8 0.125 8 4 4A4 46 2 9 0.043 8 4 4A5 180 10 15–18 0.056 8 4 6A6 900 50 15 0.056 8 4 6B1 882 24 18–24 0.027 6 3 6B2 882 48 16 0.054 8 3,5 6B3 1270 28 16–46 0.022 6 3 6C1 7938 578 16 0.073 10 5 6C2 1922 50 16 0.026 6 3 6D 1024 30 13–32 0.029 8 4 4E 900 50 14 0.056 8 4 4F 49 1 9 0.020 6,8 6,8 4

C Additional SimulationsIn this appendix, we show some additional simulationresults of the BP-OSD decoder on the depolarizingchannel.

In Fig. 9, we demonstrate the WER performance ofseveral 6-limited generalized bicycle (GB) codes withthe parameters [[2s+1 − 2, 2s]], s ∈ N, under the BP-OSD-0 decoder. As one can see from the curves, thesecodes have the threshold pGB ≈ 15%, which is quiteclose to the corresponding threshold pS ≈ 18% of thesurface codes from [5]. The codes from this family wereconstructed in the same way as the GB codes from Sub-section 4.6, where for each s ∈ N the corresponding syn-drome code Cg is the cyclic Hamming [2s − 1, s, 3] codedefined by some irreducible polynomial g(x) ∈ F2[x]of degree s.

In all our previous examples, we considered only CSScodes. In fact, as it is shown in Subsection 3.3, theBP-OSD decoder can be applied to any stabilizer code.In Fig. 10, we demonstrate the WER performance ofthe BP-OSD-0 decoder on the 5-limited cyclic non-CSS[[126,2,12]] code. This code is defined by the parity-check matrix H = [HX | HZ ], where HX and HZ arethe 126×126 circulant matrices represented respectivelyby the polynomials: 1 + x71 + x55 and 1 + x40 + x86.As we can see, the WER gain of OSD-0 post-processingin this case is at least three orders of magnitude.

0.1 0.11 0.12 0.13 0.14 0.15 0.1610−1

100

Physical error rate

WE

R

Threshold for GB codes (BP-OSD-0)

[[126,12]][[254,14]][[510,16]][[1022,18]][[8190,24]]

Figure 9: The WER performance on the depolarizing channelfor five 6-limited GB codes under the BP-OSD-0 decoder. Thethreshold is pGB ≈ 15%. The corresponding threshold of the4-limited surface codes [5] is pS ≈ 18%.

10−110−2

10−7

10−6

10−5

10−4

10−3

10−2

10−1

5 · 10−2

Physical error rate

WE

R

Cyclic non-CSS code (BP-OSD-0)

BPBP-OSD-0

Figure 10: The WER performance of the BP-OSD-0 decoderon the 5-limited cyclic non-CSS [[126,2,12]] code defined bythe parity-check matrix H = [HX | HZ ], where HX and HZ

are the 126 × 126 circulant matrices represented respectivelyby the polynomials: 1 + x71 + x55 and 1 + x40 + x86.

Accepted in Quantum 2021-11-02, click title to verify. Published under CC-BY 4.0. 21


Recommended