Distance bounds for generalized bicycle codes

Generalized bicycle (GB) codes is a class of quantum error-correcting codes constructed from a pair of binary circulant matrices. Unlike for other simple quantum code ans\"atze, unrestricted GB codes may have linear distance scaling. In addition, low-density parity-check GB codes have a naturally overcomplete set of low-weight stabilizer generators, which is expected to improve their performance in the presence of syndrome measurement errors. For such GB codes with a given maximum generator weight $w$, we constructed upper distance bounds by mapping them to codes local in $D\le w-1$ dimensions, and lower existence bounds which give $d\ge {\cal O}({n}^{1/2})$. We have also done an exhaustive enumeration of GB codes for certain prime circulant sizes in a family of two-qubit encoding codes with row weights 4, 6, and 8; the observed distance scaling is consistent with $A(w){n}^{1/2}+B(w)$, where $n$ is the code length and $A(w)$ is increasing with $w$.


I. INTRODUCTION
In the last two years there was an enormous progress in the theory of quantum low-density parity-check (LDPC) codes [1][2][3][4][5].Such code families, with bounded weight of stabilizer generators and distance scaling logarithmically or faster with the block length, generally have a finite threshold to scalable error correction [6][7][8].Unlike in the case of classical LDPC codes [9,10] where sparse random matrices can be used to define the code, due to a commutativity constraint, an algebraic ansatz is required in the case of quantum LDPC codes.For over a decade, no construction was known to give distances larger than a square root of the block size n, up to a polylogarithmic factor [1,6,[11][12][13][14][15][16][17][18].The O √ n polylog n barrier was broken by Hastings, Haah, and O'Donnell [2] who demonstrated a code family with the distance O(n 3/5 / polylog n).Soon followed related constructions [3,4], with Panteleev and Kalachev [5] finally proving the existence of asymptotically good bounded-stabilizer-generator-weight LDPC codes, with both the asymptotic rate and the asymptotic relative distance non-zero.
Unfortunately, the constructions in Refs.1-5 do not come with an estimate for stabilizer generator weights sufficient for getting good quantum codes, or if they do, not one small enough to give practical codes.Further, these anzätse tend to produce rather long codes; shorter codes obtained this way may have parameters not as good as with constructions known earlier.
In comparison, generalized bicycle (GB) codes [14,19], a generalization of the bicycle construction from Ref. 20, are particularly suited for constructing short codes, as a GB code can be constructed from a pair of linear cyclic codes which are only a factor of two shorter.Second, as we show in this work, a subset of codes from several well-studied families, most notably, quantum hypergraph-product (QHP) codes in two and higher dimensions [13,16,17], including the codes with finite asymptotic rates and power-law distance scaling, can be mapped to bicycle codes.At the same time, the distance bound d ≤ n 1/2 which limits the parameters of all QHP codes, does not apply to GB codes; we show in this work that this family includes codes with linear distances.Third, regular structure of GB codes simplifies both their implementation and linear-complexity iterative decoding [19,21].Moreover, GB codes have naturally overcomplete sets of minimum-weight stabilizer generators, which may improve their performance in the faulttolerant (FT) setting.In spite of these advantages and the long history of GB codes, their properties have not been systematically studied.
The goal of this work is to investigate the parameters of GB codes, targeting highly-degenerate codes with distances much larger than the stabilizer generator weight which for practical codes should stay under w max 10.While some of the present distance bounds are an easy consequence of those obtained for related codes, or are obtained with well known methods, we believe a systematic review of available results is necessary.These results include Gilbert-Varshamov-style existence bounds for unrestricted GB codes, upper bounds for parameters of GB codes with row weight w obtained by a map to codes local in D ≤ w − 1 dimensions, and several expicit constructions.Other results include an exact expression for the distance in terms of an associated asymmetric quantum code, a matching set of upper and lower distance bounds for w = 4 bicycle codes, and a lower bound which guarantees the existence of long GB codes with the distance O(n 1/2 ) for any fixed w ≥ 4. We also studied the family of GB codes known to include codes with linear distances numerically, by exhaustively enumerating the corresponding binary GB codes with row weights w = 4, 6 and 8, for circulant sizes ≤ 217 with primitive root 2. Although we are not able to distinguish conclusively between a power-law distance scaling d = O(n α ) with α = 1/2 and α > 1/2, the results are consistent with square root distance scaling and a prefactor an increasing function of w.
The structure of the paper is as follows.First, in Sec.II we give a brief summary of relevant facts from the theory of classical and quantum error-correcting codes, including some information on cyclic and quasi-cyclic codes.Analytical results are collected in Sec.III.Namely, Sec.III A gives general information about GB codes, Sec.III B collects several lower (existence) bounds on distances of unrestricted GB codes based on the CSS map, Sec.III C gives existence bounds based on the map to hypergraph-product and related codes, Sec.III D gives a map of a weight-w GB code to a code local in D ≤ w − 1 dimensions, and Sec.III E gives tight bounds for weightfour GB codes.Numerical results are collected in Sec.IV, followed by a brief Conclusion in Sec.V. Some of the formal proofs are collected in the Appendix A.

II. RELEVANT FACTS AND NOTATIONS
A. Cyclic and quasi-cyclic codes An [n, k, d] q code C linear over a finite (Galois) field F q , with q a power of a prime, is a k-dimensional subspace of F n q , the linear space of all q-ary strings of length n.The distance d is the minimum Hamming weight of a non-zero vector in the code, or infinity for a trivial k = 0 code which only contains the zero vector.A code C G ≡ C ⊥ H can be specified in terms of a generating matrix G whose rows form a basis of the code, or a parity check matrix H whose rows generate the space orthogonal to the code.
A cyclic code satisfies the additional condition that for every codeword c ≡ (c 0 , c 1 , . . ., c n−1 ) ∈ C, its cyclic shift T n c ≡ (c n−1 , c 0 , . . ., c n−2 ) also gives a codeword, T n c ∈ C. Shuch a shift is conveniently represented as multiplication in the quotient polynomial ring R ≡ R n,q = F q [x]/(x n −1), namely, A cyclic code is an ideal of R. In particular, this implies that any cyclic code can be generated as the set of all multiples in R of the canonical generator polynomial g(x), where g(x) is a factor of x n − 1, and any such factor generates a cyclic code.
Both a generator and a parity check matrix (with some redundant rows) of a cyclic code can be written as square circulant matrices.Algebra of circulant n × n matrices with coefficients in F q is isomorphic to that of polynomials in R. Indeed, given a polynomial a(x) ∈ R, the corresponding circulant matrix is conveniently written as the polynomial A ≡ a(P ) of the matrix P ≡ P n , the n × n cyclic permutation matrix We will consider vectors in F n q as columns, so that the product Ab of a circulant matrix A = a(P ) and a vector b with the same coefficients as in the polynomial b(x) ∈ R corresponds to the product a(x)b(x) mod x n − 1.In particular, given a canonical generating polynomial g(x), the corresponding check polynomial is h(x) = (x n − 1)/g(x), and the cyclic code generated by g(x) can be written as An index-m quasi-cyclic (QC) code of length n = m is usually defined as a linear code invariant under the mstep shift permutation T m n .Rearranging the positions, we consider the defining permutation as T applied in each of m consecutive blocks.As a result, a generator matrix of such a code can be written as an r × n block matrix formed by × circulant matrices.Generally, such block matrices will be written as matrices formed by the corresponding polynomials in R ,q .The same applies to vectors, which will be written as columns of polynomials, with the exception of inline equations, where, e.g., a twoblock vector in an index-2 QC code may be written as [u(x), v(x)].

B. Quantum CSS codes
A quantum Calderbank-Shor-Steane [22,23] (CSS) code Q with parameters [[n, k, d]] q over a Galois field F q is isomorphic to a direct sum of an X-and a Z-like codes, where each term in the right-hand side (r.h.s.) is a quotient of two linear spaces in F n q , and rows of the matrices H X and H Z must be orthogonal, Explicitly, e.g., elements of Q X are equivalence classes of vectors orthogonal to the rows of the matrix H Z , with any two vectors whose difference is a linear combination of the rows of H X identified.Vectors in the same class are called mutually degenerate, while vectors in the class of the zero vector are called trivial.The codes Q X and Q Z have q k degeneracy classes each, where is the quantum code dimension.The distance of the code is d ≡ min(d X , d Z ), where the two CSS distances, are the minimum weights of non-trivial vectors (any representative) in C ⊥ H Z and C ⊥ H X , respectively.Physically, a quantum code operates in a Hilbert space H ⊗n q associated with n quantum-mechanical systems, qudits, with q states each, and a well defined basis of X and Z operators acting in H ⊗n q [24].Elements of the codes C H X and C H Z correspond to X-and Z-operators in the stabilizer group whose generators must be measured frequently during the operation of the code; generating matrices H X and H Z with smaller row weights result in codes which are easier to implement in practice.Orthogonality condition (5) ensures that the stabilizer group is abelian.Non-trivial vectors in Q X and Q Z correspond to X and Z logical operators, respectively.Codes with larger distances have logical operators which involve more qudits; such codes typically give better protection.

III. GENERALIZED BICYCLE CODES A. Definition and general properties
Generalized bicycle (GB) code [14,19] is a version of the bicycle ansatz [20], a quantum CSS code constructed from a pair of equivalent index-two quasi-cyclic linear codes.Namely, given any pair of polynomials a(x), b(x) ∈ F [x] with coefficients in a finite field F ≡ F q and of degrees smaller than , the generalized bicycle code GB(a, b) of length n = 2 has CSS generator matrices specified in the block form, Here A = a(P ) and B = b(P ) are q-ary × circulant matrices.Circulant matrices necessarily commute, which guarantees the CSS orthogonality condition (5).For notational convenience, we will use [u(x), v(x)] to represent a Z-codeword c, a column vector whose components in the two blocks coincide with the coefficients of the two polynomials.The corresponding equation With any code GB(a, b), there is an associated q-ary cyclic code C ⊥ h(x) ≡ C g(x) of length , with the check and generating polynomials respectively.The number of qudits encoded in such a GB code is [19] twice the dimension of the code It is easy to see that column and row permutations can be used to obtain the matrix H Z from H X , up to a sign of some columns.Thus, the CSS distances (7) of any GB code are equal to each other and, respectively, to the code distance d.The calculation of the distance is simplified somewhat with the help of an auxiliary asymmetric bicycle (AB) code Q ≡ CSS(H X , H Z ) where (11) where a 1 (x) ≡ a(x)/ gcd(a, b), b 1 (x) ≡ b(x)/ gcd(a, b) are obtained by dividing the two polynomials by the common factor, and the matrix H Z is the same as in the original GB code, see Eq. ( 8).The AB code encodes half as many qudits as the original GB code, k = deg h(x).The relation between the two codes follows from an explicit expression for the Z-codewords in the original code, where r 1 (x) and s 1 (x) are Bézout coefficients such that a 1 (x)r 1 (x) + b 1 (x)s 1 (x) = 1 whose existence follows from gcd(a 1 , b 1 ) = 1, and, for a non-trivial codeword, at least one of α(x) and β(x) should not be divisible by h(x).Taken separately, these two conditions yield the sets of X-and Z-codewords of the AB code, respectively.This results in the following Statement whose formal proof is given in Sec.A 2.
In addition, the CSS distance d Z (and thus the distance d of the GB code) is bounded by the distance d g of the linear cyclic code C g(x) .
Statement 2. Let d g denote the distance of the F qlinear cyclic code with the generating polynomial g(x), see Eq. ( 9).Then the Z-distance of the q-ary AB code The formal proof in Sec.A 3 amounts to a demonstration that for any non-zero code word e(x) ∈ C g(x) , either [e(x), 0] or [0, e(x)] is a non-trivial Z-vector in the AB code.
We end this section with a short list of polynomial transformations which generate equivalent GB codes: The first four transformations correspond to permutations preserving the circulant symmetry [25], while the last one may be useful for constructing LDPC codes, since minimum row weight does not necessarily correspond to minimum polynomial degrees.
While technically not an equivalence transformation, we should also mention here the case of polynomials commensurate with the circulant size , i.e., such that h(x) = h 0 (x ∆ ), where ∆ > 1 is a factor of .A cyclic code whose check polynomial h(x) is commensurate with is merely a direct sum of ∆ disconnected cyclic codes, each equivalent to the code of length 0 ≡ /∆ with the check polynomial h 0 (x).Same is true in the case of a code GB(a, b) whose defining polynomials have the same commensurability factor ∆: A cyclic or GB code that is not commensurate is called incommensurate.

B. Bounds for GB codes of unrestricted weight
Here we give several existence bounds for general (non-LDPC) GB codes, using the standard map [22][23][24] relating the parameters of a CSS code to those of the associated pair of classical F q -linear mutually dual-containing codes.In the case of the code GB(a, b), the two codes have double-circulant parity check matrices H X and H Z given in Eq. (8).To be specific, we focus on the indextwo QC code with the check matrix H = H X , and denote such a code QC(a, b).
Statement 5 (CSS map for GB codes [22][23][24]).Given the parameters It is a classical result [26,27] that index-two QC codes include good codes with rate 1/2 and asymptotically finite relative distances d 0 /n 0 → δ 0 > 0. However, the codes used in the proof have parity-check matrices in a systematic form with A = I; for such a self-dual (up to a permutation) index-two QC code Statement 5 gives a quantum code which encodes no qudits.A number of other lower bounds on the distances of QC codes have been constructed, in particular, a version [28] of the BCH bound (for a recent review, see Ref. 29).However, none of these bounds gives a family of QC codes with k 0 − = O( ) and d 0 = O(n).Indeed, by Statements 1 and 2, such a family of QC codes would imply that linear cyclic codes must be asymptotically good, a question which remains unresolved [30,31].
For these reasons here we list several partial results, which demonstrate the existence of QC codes with sublinear k 0 − and distances scaling linearly, and of finite-rate QC codes with sublinear (power law) distances.The following bound is constructed using elementary arguments similar to those used in Ref. 32: , where for some polynomial r(x), gcd f (x) − r(x), x − 1 = p(x) is a factor of the generating polynomial, g(x) = p(x)q(x).Then the distance of the QC code satisfies the bounds: Here h(x) and g(x) are given by Eq. ( 9), and d [q] is the distance of the linear cyclic code generated by q(x).
Unfortunately, the codes generated by p(x) and q(x) = g(x)/p(x), respectively, form a pair of dual-containing cyclic codes; it is well known [33] that the minimum of the two distances is bounded by O( √ ), which limits the usability of the bound in Statement 6.
The following bound obtained with the help of a counting argument is a variant of Lemma 5 from Ref. 34 in application to GB codes: irreducible, and , where d[g] is the distance of the cyclic code generated by g(x).
The counting part of this bound asymptotically approaches from above the Gilbert-Varshamov (GV) bound [35,36] for linear q-ary codes with k = + deg h, which coincides with the GV bound [22] for q-ary CSS codes with k = 2 deg h.Unfortunately, the requirement for g(x) to be irreducible is very restrictive.Generally, since x ab − 1 has both x a − 1 and x b − 1 as factors, codes with prime get higher lower bounds on their relative distances under Statement 7. In particular, two well-known special cases correspond to x − 1 having only two and three factors, respectively: Example 8. [GB codes with linear distance] Let be such that ord (q) = − 1, where ord (q) is the multiplicative order function of q modulo .This ensures that x −1 has only two irreducible factors in where d GV is given by Eq. (13).For q = 2 the corresponding set is [37] {3, 5,11,13,19,29,37,53,59,61,67,83,101,107,131,139,149,163,173,179,181,197, . ..}, and, moreover, according to Artin's primitive root conjecture, a finite fraction of all primes satisfies this condition for any q > 0 which is not a perfect square [38].Asymptotically, at → ∞, this bound on the relative distance coincides with the GV bound for rate-1/2 linear q-ary codes, e.g., δ GV ≈ 0.1100 for q = 2.

Example 9.
[GB codes with asymptotic rate 1/4] For an odd prime let a prime p be a quadratic residue modulo , i.e., p ≡ m 2 mod for some integer m.We would now like to focus on more practical GB codes with bounded-weight stabilizer generators.First, we construct an explicit map between a quantum hypergraphproduct code [13] constructed from a pair of square circulant matrices of mutually prime dimensions n 1 and n 1 , and a GB code with circulant size = n 1 n 2 , see Fig. 1.(b) Same, but with a skewed periodicity vector L 1 = (n1, 1).The corresponding map t = i − n1j mod n1n2 is invertible, but has a different symmetry.As a result, even though the GB code with a (x) = 1 + x + x 2 + x 4 and b (x) = 1 + x 14 has the same parameters [ [42,8,3]], this is coincidental.Indeed, replacing the polynomial h2(x) with h 2 (x) = 1 + x + x 2 gives the QHP code [[42, 16, 2]] and an equivalent code using the map (17), but the present map gives b (x) = h 2 (x 7 ) which is mutually prime with a(x), resulting in an empty GB code.
Specifically, let H 1 = h 1 (P n1 ) and H 2 ≡ h 2 (P n2 ) be a pair of square circulant matrices of size n 1 and n 2 , cor- responding to polynomials h 1 (x) and h 2 (x) in F q [x], respectively.Given the parameters [n i , k i , d i ] q for the two cyclic codes with the check polynomials h i , i ∈ {1, 2}, consider the hypergraph-product code with CSS generators in a block form written as Kronecker products, where I i are the identity matrices of size n i , i ∈ {1, 2}.Such a code has the parameters [13,17] [ and can be put on an n 1 × n 2 square lattice with periodic boundary conditions as illustrated in Fig. 1(a), with the two blocks in Eq. ( 14) corresponding to qubits on horizontal and vertical edges, respectively.In the special case where n 1 and n 2 are mutually prime, gcd(n 1 , n 2 ) = 1, an equivalent GB code with circulant size = n 1 n 2 , can be constructed from the polynomials where the values of the circulant index are in a one-to-one correspondence with the positions (i, j) on the n 1 × n 2 portion of the square lattice with periodic boundary conditions introduced by identifying any pair of points connected by periodicity vectors L 1 = (n 1 , 0) and L 2 = (0, n 2 ).We should emphasize that in addition to being a oneto-one map, Eq. ( 17) has the correct translation symmetry.Different GB codes can be also obtained using skewed periodicity vectors, e.g., L 1 = (n 1 , 1) instead of L 1 , equivalent to the index map t = i − n 1 j mod .This map does not give identity transformation for the translation i → i + n 1 .Thus, we do not expect the corresponding code GB(a , b ), a (x) = h 1 (x), b (x) = h 2 (x n1 ) to be equivalent to the original QHP code, see Fig. 1(b).
Generally, a quantum code on the edges of a square lattice with stabilizer generators similar to those of a QHP code but with periodicity vectors non-collinear with the axes is called a rotated QHP code [14], a code in a more general class of lifted-product codes [3].
Statement 10.An arbitrary GB code of length 2 is equivalent to a rotated QHP code with periodicity vectors Proof.Indeed, given a decomposition = n 1 n 2 +λ, where n 1 and are mutually prime, gcd(n 1 , ) = 1, consider a pair of vectors, If we use these as periodicity vectors (i.e., identify any pair of points on the square lattice connected by one of these vectors), there are exactly = | L 1 × L 2 | inequivalent points with a one-to-one map t = i − n 1 j mod to a cycle Z , see Figs. 1(b) and 2.Then, given the polynomials h 1 (x) and h 2 (x) which define the lattice layout of the stabilizer generators of a rotated QHP code with the chosen periodicity vectors, the polynomials defining the corresponding GB code are a(x) = h 1 (x) and b(x) = h 2 (x n1 ).Conversely, let m 1 be a multiplicative inverse of n 1 modulo , m 1 n 1 = 1 mod ; its existence is guaranteed by the condition gcd(n 1 , ) = 1.Then, given the code GB(a, b), we recover the polynomials for the corresponding rotated-QHP code, h 1 (x) = a(x) and h 2 (x) = b(x m1 ) mod x − 1.
These maps show, in particular, that GB codes can be as good as QHP codes constructed from two square circulant matrices of mutually prime sizes.Given the explicit Eq. ( 15) relating parameters of a QHP code with those of the two cyclic codes with parity-check polynomials h 1 (x) and h 2 (x), we obtain an existence for GB codes of finite rates and a power-law distance scaling as O n 1/2 / polylog(n) or better.Indeed, the question of whether long linear cyclic codes are asymptotically good is still open, with only minor progress made in recent years [31,39,40].In reality, the question is academic, since finite-length performance of cyclic codes is excellent, and already the BCH bound gives codes [41] with rate R > 0 and δ ≥ (2 ln R −1 )/ log n, while linear cyclic codes with δ > (1 − 2R)/ √ 2 log n can also be constructed [42].
From a practical viewpoint, more interesting are the bounds on parameters of LDPC GB codes with stabilizer generators of bounded weight.We construct such (upper) bounds in the next section with the help of general results by Bravyi, Poulin, and Terhal [43,44], by mapping a linear cyclic code with check polynomial of weight w 1 to a code local on a D-dimensional hyper-cubic lattice, with D ≤ w 1 , and a GB code with row weight w to a quantum code local on a D-dimensional lattice, with D ≤ w − 1.

D. A map to a code local in D dimensions
Let us first consider the case of a cyclic code of length with the parity check polynomial h(x) ∈ F q [x] of a fixed weight w.Here we will not require that h(x) be a factor of x − 1, as such factors do not necessarily have minimal weights, but a q-ary polynomial such that the canonical check polynomial h 1 (x) ≡ gcd(h, x − 1) be non-trivial, The following is a generalization of Statement 10: Statement 11.An incommensurate linear cyclic code of length with check polynomial h(x) of weight w is equivalent to a code with all checks local on a hypercubic lattice of dimension D ≤ w, and D ≤ w − 1 if is prime.
Proof.For a polynomial h(x) with monomial degrees 0 = t 0 < t 1 < . . .< t w−1 , consider a set of w integer vectors in Z w , written as the rows of the lower-triangular matrix The determinant of M equals ± , and by the incommensurability condition, there exists a map from the chain 0 ≤ t < to the region in Z w given by the inequalities 0 ≤ x i < i , 0 ≤ i < w, where 0 = t 1 , i = t i+1 /t i for 0 < i < w − 1, and w−1 = /t w−1 .With these notations, the check polynomial becomes a 0 + a t1 x 1 + . . .a tw−1 x w−1 , i.e., the checks are one-local in the bulk of the region (with the structure as in quantum fractal codes [45,46]), and at most two-local near the region's boundary.
When is a prime (or one of the original degrees t i = 0 is mutually prime with ), there exists m ∈ Z such that mt i = 1 mod , and x i → x im mod x − 1 gives an equivalent code, see Statement 3. The modified check polynomial h (x) ≡ h(x m ) mod x − 1 h (x) has a degreeone monomial, and the region defined by the periodicity vectors (19) The dimension can be additionally reduced if there is a simple relation between the monomial degrees, e.g., t 3 = t 1 + t 2 , in which case the third axis can be skipped and the corresponding monomial written as a t3 x 1 x 2 .
Given such a map to a code local in D dimensions, with the help of the general result in the appendix of Ref. 44, we immediately obtain: Corollary 12. Parameters [ , k 1 , d 1 ] q of any F q -linear cyclic code of length with the check polynomial of weight w 1 which is equivalent to a code local in The case of a GB code with polynomials a(x) and b(x) with the total weight w is considered similarly, except that each vertex of the hypercubic lattice must now contain two qudits, one from each block, and the maximum dimension is additionally reduced by one since both polynomials have zero-degree monomials.It is also easy to check that a local map for H X to Z D automatically implies the locality of the corresponding H Z .We have, combining the results from Refs.43 and 44: Statement 13.An incommensurate GB code with row weight w and parameters is prime).Its parameters satisfy the inequalities Notice that the last equation implies that any GB code family with a fixed weight w has an asymptotically zero rate, since k/n → 0 when the distance d becomes infinite.

E. Exact bound for GB codes of weight four
Here we consider in detail the special case of codes with w = 4.According to Statement 13, any such code is equivalent to a code local in two dimensions.The case of D = 2 is special, since Refs.43 and 44 give asymptotically exact bounds for such codes.
A non-trivial GB code of weight w = 4 can only be constructed when both a(x) and b(x) have equal weights.Moreover, weight-two polynomials of equal degrees, or a polynomial of degree /2 with even, always give an empty code or a distance-two code.Therefore, for a nontrivial incommensurate GB code with distance d ≥ 3, with the help of Statement 3, without restricting generality, we can request that the degrees α = deg a(x) and β = deg b(x) satisfy α < β < /2, with gcd(α, β, ) = 1.
These additional properties guarantee that any pair of rows of a generator matrix H X (or H Z ) in Eq. ( 8) intersect in at most one column, and any column has exactly two non-zero elements, as in a vertex-edge incidence matrix of a simple graph.The analogy can be made exact by considering a pair of binary matrices J, F constructed from H X and H Z , respectively, by replacing any non-zero element with 1.The rows of the two matrices are necessarily orthogonal, JF T = 0 (over Z 2 ).Thus, these matrices can be readily identified as a vertex-edge and a face-edge incidence matrices of a locally planar (4, 4) graph G, i.e., with each vertex of G and the corresponding dual graph G of equal degree 4. Finally, it is also easy to see that the graph G is locally (i.e., as long as the current position does not close a circle t → t + ) isomorphic to a square lattice, with the two blocks, respectively, corresponding to horizontal and vertical edges, and oriented in the direction of increasing index.Namely, any (local) sequence of horizontal x i = ±1 and vertical y j = ±1 steps, where the signs indicate the direction, arrives at the same final position as long as the total displacements x i and y j coincide.That is, the graph G is covered by the infinite square lattice graph H, with the covering function f : H → G such that a path between a pair of vertices on H with the same covering map image corresponds to a non-trivial cycle on G, or one or more "large" displacements t → t ± of the circulant index.
With such a map, it is evident that a non-trivial GB code of weight-four and distance d ≥ 3 is a square-lattice surface code, with Z-codewords corresponding to homologically non-trivial cycles, with the homology fixed by the covering map f (see, e.g., Ref. 47).Then, the distance d Z is the length of a shortest path connecting a pair of distinct vertices on H whose covering-map images coincide on G.
To construct an actual distance bound, start with an arbitrary vertex i ∈ V H (where V H is the vertex set of H), and consider a vertex-centered ball B r (i) on H, a set of all vertices j ∈ V H such that the graph distance d(i, j) ≤ r, see Fig. 3 (left).With the circulant size , the graph G has exactly vertices.Thus, if the size of the ball satisfies |B r (i)| > , the ball must include at least two equivalent vertices, which gives for the code distance, d Z ≤ 2r, the diameter of the ball.The size of a ball on the square lattice is computed easily by summing the arithmetic sequence, |B r (i)| − 1 = 4 + 8 + . . .+ 4r = 2r(r + 1), which gives the upper bound d Z ≤ 2r for any circulant size < 1 + 2r(r + 1).A similar calculation for an edge-centered ball on H gives an odd-valued upper bound d Z ≤ 2r + 1 for any < 2(r + 1) 2 , see Fig. 3 (right).We rewrite these inequalities equivalently as lower bounds on the code length n = 2 for a given value of the distance d = d Z : Statement 14.Consider a weight-four GB code of an odd distance d = 2r + 1, then its length n ≥ 1 + d 2 .For an even distance d = 2r, the length n ≥ d 2 .
The argument above is valid for d ≥ 3. We verified by exhaustive search that these inequalities are also valid for d ∈ {1, 2}.We notice that the inequalities in Statement 14 are sharp for surface codes.Namely, the odd-distance bound is reached by a family [48] of square lattice surface codes with periodicity vectors (r + 1, r) and (−r, r + 1) and parameters [[(2r+1) 2 +1, 2, 2r+1]] q , while the even-distance bound is achived by the 45 • -rotated surface codes [49].These latter codes have periodicity vectors (±r, ±r) and parameters [[4r 2 , 2, 2r]] q .However, the corresponding translation group x, y | xyx −1 y −1 = x r y r = x r y −r = 1 is not cyclic for any r > 1, which proves that there are no corresponding GB codes except for r = 1, with parameters [[4, 2, 2]] q .
The next-shortest family of even-distance surface codes has periodicity vectors (r ± 1, 1 ± r) and parameters [[4r 2 + 4, 2, 2r]] q , r ∈ N; these have GB code representations when r is even, which requires the distance 2r be a multiple of four.

IV. NUMERICAL RESULTS
To summarize our results so far, we expect the highest distances for GB codes encoding k = 2 qudits, with b(x) = 1 + x and a(x) of even weight, which ensures the corresponding check polynomial (9) to be h(x) = 1 + x for any ≥ 2. For the qubits (quantum codes over the binary field Z 2 ), Example 8 based on Statement 7 shows that for prime circulant sizes with a primitive root 2, GB codes in this family exist with relative distance d/n > δ GV ≈ 0.11.However, the upper and lower bounds for the codes of row weight w (which corresponds to wgt(a) = w − 2) differ strongly for w > 4. Namely, Statement 6, the map to QHP codes in Sec.III C, and several explicit w = 4 code families in Sec.III E agree that such codes with the distances d > O(n 1/2 ) scaling as a square root of the block size exist.On the other hand, the upper bound in Statement 13 for such codes suggests a power-law distance scaling with the exponent that may change with w, d < O(n γ ), where γ = 1 − 1/D, with the effective dimension D(w) ≤ w − 2 for a prime .The two bounds give the same exponent γ = 1/2 only for w = 4, while there is an interval of possible exponent values for w > 4. Notice that any exponent, including γ min = 1/2, may be consistent with the linear distance scaling at large w, if the corresponding prefactor A(w) in the power-law d ∝ A(w)n γ diverges at w → ∞.
To address this issue, we set up to find largest-distance GB codes based on qubits and row weights w ∈ {4, 6, 8}, fixing b(x) = 1 + x.Namely, for every prime ≤ 227 such that 2 is a primitive root, we calculated the maximum distance of GB codes over inequivalent polynomials a(x) of weights 2, 4, and 6 (also, for every prime ≤ 127 in the case of wgt a = 4, which did not substantially modify the results).We used equivalence maps (iii) and (v) [with f (x) = x s , s < ] in Statement 3 to define a canonical form of a(x) ∈ F 2 [x] of degree ∆, with a 0 = a ∆ = 1, and smallest alphabetically.In particular, this implies a smallest-degree polynomial in each equivalence class.When enumerating polynomials, we discarded any which did not coincide with the corresponding canonical form.Actual distance calculation were done using the GAP package QDistRnd [50], with the help of the auxiliary AB code as in Statement 1, and only for those polynomials a(x) = f (x)(1 + x) with a sufficiently large 1 + wgt f (such an upper bound on the distance is a trivial consequence of Statement 3).The resulting data and the actual codes are available for download at the GitHub repository QEC-pages/GB-codes [51].
The computed distances d are plotted in Fig. 4 as a function of the square root of the code length n, with different symbols and colors for GB codes of row weight 4, 6, and 8, as indicated in the figure caption.For clarity, for each w, only the codes with the smallest n giving the particular distance are shown on the plots.As expected, for each value of n, optimal codes with larger w show larger distances, with the w = 8 codes giving approximately a factor of two distance improvement compared to codes with w = 4 (equivalent to square lattice surface codes), e.g.,  Visually, the data in Fig. 4 do not show much curvature, indicating distance scaling close to a square root.This is confirmed by fitting the data to a general threeparameter power-law form d = an b + c (thick long dashes), and a similar two-parameter fit with a fixed power b = 1/2 (thin lines): the corresponding lines lie more or less on top of each other, even though there is some upward curvature as indicated by the fitted exponents b whose values exceed 1/2 for all three sets of data.
We should also notice that in an attempt to capture the large-n features, only the data in the range n > 100 was used in the fits.In fact, the three fitted values of the exponent b remain the same to three decimal places when the distance data for codes with n ≥ 25 are included, while the square-root slope coefficients f show a minor reduction by around 5%.

V. CONCLUSION
To summarize, we have constructed several bounds on distances of generalized bicycle codes.Without a weight restriction, GB codes with linear in the block length n distances and encoding a sublinear number of qubits, GB codes of rate 1/4 with the distance scaling as a square root of n, as well as codes with other rates and the distances O(n/ log n) 1/2 are known to exist.
More important practically are LDPC GB codes with a finite row weight w.Technically, these are zero-rate codes, since any such code is equivalent to a code local in a finite dimension D, see Statement 13.On the other hand, compared to the QHP and conventional toric codes, GB codes with row weights w ≤ 8 may have a factor-of-two larger distances with the same block sizes.It remains to be seen whether the improved distances would be sufficient to offset the increased measurement complexity (compared to the surface codes) due to higher stabilizer generator weights and their non-locality.
The questions remaining for future studies include further numerical and analytical studies of GB codes encoding k > 2 qubits.In addition to studying their parameters, of interest is the analysis of their performance in the fault-tolerant setting, as larger k values also increase the redundancy for minimum-weight stabilizer generators.
Second, remains open the question of the distance scaling for GB codes with a bounded generator weight.More generally, while quantum LDPC codes with powerlaw distance scaling higher than a square root of the block length have been constructed, it remains unknown whether local in a finite dimension D > 2 codes can beat the square root distance bound (ignoring any logarithmic corrections).
Finally, it is the regular structure of finite-weight GB codes that makes it possible to represent them as codes local in a D-dimensional space.Perhaps other classes of matrices in the same CSS ansatz (8) based on two commuting square matrices would produce LDPC codes with better parameters?Indeed, if we denote χ(x) ≡ gcd(a, b), according to Eq. ( 9), gcd(x − 1, χ) = h(x), so that χ(x) must contain h(x) as a factor, χ(x) = χ 1 (x)h(x), where χ 1 (x) is relatively prime with g(x) and, therefore, must be invertible modulo g(x).
Eq. (A4) has a general solution ) where ξ(x), i 1 (x), and i 2 (x) are arbitrary polynomials in F [x]/(x − 1).Now, if we take i 1 (x) = i 2 (x) = 0 with ξ(x) = 0 and deg ξ(x) < deg g(x), we obtain exactly the set of pairs [u(x), v(x)] which define the distance d Z of the AB code.The condition on the degree of ξ(x) follows from the equivalent form of the orthogonality condition (A4), Similarly, if we compare Eq. (A5) with the set of pairs which define the distance d X of the AB code, the codewords are generated by the polynomials i 1 (x), i 2 (x); for a non-trivial vector in the AB code we must ensure that it remains non-zero zero with any ξ(x).Finally, notice that all vectors (A5) that can be made zero by choosing ξ(x) but satisfy the condition (A2) contribute to the distance d X ; the distance d X is given by the minimum of the union of the two sets, or, equivalently, d ≡ min(d X , d Z ).where gcd(a 2 , b 2 ) = 1 since gcd(a 1 , b 1 ) = 1.The degeneracy condition (A6) then implies that i(x) must contain a factor h(x)/ gcd h(x), a 2 (x) .A similar condition for the other vector to be trivial gives that i(x) must contain a factor h(x)/ gcd h(x), b 2 (x) .These conditions cannot be simultanelously satisfied, as in this case i(x) would be divisible by h(x), which contradicts the assumption.

Proof of Statement 6
Proof.Notice that the result in case (a) also follows directly from the bound constructed in Proposition 12 of Ref. 32.
In both cases, the components of the codeword [u(x), v(x)] satisfy the equation f (x)u(x) + v(x) = ξ(x)g(x) mod x − 1, where ξ(x) ∈ F q [x] is arbitrary.Thus, in case (a), with u(x) = 0, non-zero v(x) must have wgt v(x) ≥ d[g].Otherwise, with u(x) = 0, in case (a), assuming f (x) = f 1 (x)p(x) with f 1 (x) and x − 1 relatively prime, v(x) = p(x)[ξ(x)q(x) − f 1 (x)u(x)] mod x − 1, where we used the assumption g(x) = p(x)q(x).Then, any v(x) = 0 is in the code generated by p(x) and thus wgt v(x) ≥ d[p], while u(x) is any non-zero, wgt u(x) ≥ 1.Otherwise, if v(x) = 0, a non-zero u(x) must be in the code generated by q(x), which gives wgt u(x) ≥ d[q].The result in case (a) is obtained if we notice d[pq] ≥ d[q] because of the inclusion C pq ⊂ C q .
In case (b), for u(x) = 0 we have, instead, Otherwise, under assumptions we have, both u(x) and v(x) must be non-zero and in the code generated by q(x), which gives d 0 ≥ 2d[q].

Proof of Statement 7
Proof.Consider e = [u(x), v(x)] of weight s < d g with u(x) non-zero.In order for it to be a non-trivial codeword in GB(hf, h), we need hf u + hv = 0 mod x − 1, and The first statement is equivalent to f u + v = 0 mod g.Condition on the weight implies that u cannot be a factor of g; with g irreducible it further implies that gcd(u, g) = 1.In this case we can find unique solution f = v(x)/u(x) mod g(x).Indeed, gcd(u, g) = 1 implies existence of polynomials A, B such that Au + Bg = 1.Thus, starting from f u + v = wg with some w, we have A(f u + v) + Bg = Awg + Bg, u + Av = 0 mod g.
With u = 0, there is exactly one polynomial f with deg f < m − deg h in this class.On the other hand, if u = 0, the condition reads v = 0 mod g, which is impossible since it contradicts the assumption s < d g .Now, the number of errors e = [u(x), v(x)] of weight s and u = 0 is 2m s − m s .Inequality ( 13) is a greedy bound that implies the existence of a polynomial f of degree smaller than − deg h such that the code GB(hf, h) contains no non-trivial codewords of weight up to y.

FIG. 1 .
FIG. 1. (Color online) (a)A map(17) of an n1 × n2 square lattice with periodic boundary conditions along the vectors L1 = (n1, 0) and L2 = (0, n2) to a chain of length = n1n2, with n1 = 7 and n2 = 3. Red digits below and to the left of the axes show the column i and row j indices; the index t is placed above and to the right of the corresponding vertex.The two blocks in Eq. (14) correspond to horizontal and vertical edges, respectively.Thicker red and blue edges, respectively, indicate those in an X and a Z stabilizer generators of the QHP code [[42,8,3]] obtained from polynomials h1(x) = 1 + x + x 2 + x 4 and h2(x) = 1 + x.The equivalent code GB(a, b) has a(x) = 1 + x 3 + x 6 + x 12 and b(x) = 1 + x 7 .(b) Same, but with a skewed periodicity vector L 1 = (n1, 1).The corresponding map t = i − n1j mod n1n2 is invertible, but has a different symmetry.As a result, even though the GB code with a (x) = 1 + x + x 2 + x 4 and b (x) = 1 + x 14 has the same parameters [[42,8,3]], this is coincidental.Indeed, replacing the polynomial h2(x) with h 2 (x) = 1 + x + x 2 gives the QHP code[[42, 16, 2]] and an equivalent code using the map(17), but the present map gives b (x) = h 2 (x 7 ) which is mutually prime with a(x), resulting in an empty GB code.

FIG. 3 .
FIG. 3. Left: squares with progressively ligher shading indicate vertex-centered balls of radius r = 1, 2, 3, and 4 on the square lattice; the numbers of vertices on the boundary are 4, 8, 12, and 16, respectively.Right: same for edge-centered regions where each distance-r boundary has exactly two additional vertices.
d 4 = 13, d 6 = 21, and d 8 = 23 for n = 202; the actual improvement factors are different for different values of n.

wn 1 / 2 FIG. 4 .
FIG. 4. (Color online) Distance d plotted as a function of the square root of the block length n for a family of GB codes encoding k = 2 qubits.Squares, triangles, and circles correspond to row weight w = 4, 6, and 8, respectively.The fits to d = g + f n 1/2 using only the data with n 1/2 > 10 are shown with thin solid lines; the corresponding coefficients are given in the upper-left inset.Thin dashed lines in the range n 1/2 < 10 are the continuation of the same plots outside of the range used for fitting.Thick long dashes show the threeparameter fits to d = an b + c; the corresponding exponents b are shown in the lower-right inset.
C. A map to hypergraph-product and related codes