Partitioning qubits in hypergraph product codes to implement logical gates

The promise of high-rate low-density parity check (LDPC) codes to substantially reduce the overhead of fault-tolerant quantum computation depends on constructing efficient, fault-tolerant implementations of logical gates on such codes. Transversal gates are the simplest type of fault-tolerant gate, but the potential of transversal gates on LDPC codes has hitherto been largely neglected. We investigate the transversal gates that can be implemented in hypergraph product codes, a class of LDPC codes. Our analysis is aided by the construction of a symplectic canonical basis for the logical operators of hypergraph product codes, a result that may be of independent interest. We show that in these codes transversal gates can implement Hadamard (up to logical SWAP gates) and control-Z on all logical qubits. Moreover, we show that sequences of transversal operations, interleaved with error correction, allow implementation of entangling gates between arbitrary pairs of logical qubits in the same code block. We thereby demonstrate that transversal gates can be used as the basis for universal quantum computing on LDPC codes, when supplemented with state injection.


Introduction
In recent years, quantum computing has transitioned from a theoretical idea to a real technology that is competitive with state-of-the-art classical computing on carefully selected tasks [1].However, realising its potential to solve intractable problems of practical importance requires the development of a fault-tolerant quantum computer-a device that can perform long quantum computations to a very high degree of accuracy even in the presence of noise [2].Fault-tolerant quantum computing can be achieved by encoding quantum information into quantum error-correcting codes, but only at the cost of substantial overhead.For standard fault-tolerant quantum architectures based on the surface code this overhead is prohibitively large for the foreseeable future, with approximately 10 6 to 10 8 qubits being required to realise useful applications [3,4].
High-rate quantum LDPC codes offer a promising avenue to significantly reducing this overhead [5].These codes move beyond topological codes such as the surface code [6] by substituting the requirement that stabiliser check operators are geometrically local with a weaker condition that they must be sparse.They thereby preserve the essential benefits of the surface code for error-correction, while allowing much smaller qubit overheads [5,7].
In this work, we focus on hypergraph product codes-a class of high-rate LDPC codes derived from the tensor product of classical LDPC codes.Even when restricted to this highly-structured class of codes, it is not yet clear what is the best strategy to reliably perform logic.The earliest proposal for fault-tolerant logic on LDPC codes relies on state injection protocols that, while achieving a constant overhead per logical qubit in the asymptotic regime, would have substantial finite-size overheads [8].In [9,10], code deformation on hypergraph product codes is used to perform Clifford gates.The protocol proposed preserves the LDPC property of the code throughout the entire computation; however, even if in principle the whole Clifford group is implementable via this framework, there is no promise that this is the case for an arbitrary hypergraph product code nor is there a promise on the time cost of each gate implementation.Another variation of code deformation, via non-destructive measurement of high-weight logical operators, is proposed in [11]; the method there proposed enables the implementation of the full Clifford group on all hypergraph product codes.Nevertheless, this method requires many ancilla qubits if we want to operate in parallel on all of the encoded qubits.
We take a different approach to fault-tolerance and explore transversal gates [12,13,14,15,16,17].Transversal gates on homological codes [18], close cousins of the hypergraph product codes, were studied in [19].Universality is there obtained by combining two quantum codes with complementary transversal gates.Hence in [19] the problem of universality is deferred to the one of finding complementary classes of good quantum codes that are then combined via the homological product; the information is always protected by at least one code whilst leveraging the transversal gates of the other.We relax the constraints on the underlying (classical) codes used as seed codes in the hypergraph product and investigate how the core symmetries that arise from the product structure itself enable transversal gates.
The transversal gates we find are only a small subset of the Clifford group.Nonetheless, we further the knowledge on hypergraph product codes by proving that it is possible to efficiently construct a canonical basis for their logical space.The existence of such a canonical basis is nontrivial and may be of independent interest in the development of other computational frameworks on hypergraph product codes or related families of codes (e.g. higher dimensional homological product codes [18,20,21], or the codes introduced in [22]).Furthermore, we illustrate how pieceably fault-tolerant circuits [23] and state injection can be used on symmetric hypergraph product codes [24] in conjunction with the transversal gates proposed to give a universal gate set.Importantly, our scheme is relevant to small, low-overhead quantum error-correcting codes with practical near-term potential.
After a short introduction to hypergraph product codes in Section 2, we detail the existence of the canonical basis for their logical space in Section 2.1.In Section 3, we illustrate how the idea of unfolding the color code into surface codes relies on more general symmetries of the product structure, symmetries that are inherited by square and symmetric codes.Thanks to this observation and the use of our canonical basis, we showcase the transversal implementation of some Clifford gates on hypergraph product codes.We comment on how pieceable fault tolerance and state injection, in combination with the transversal gates introduced, could be used on 'small' codes to perform arbitrary computations in Section 4.

Hypergraph Product Codes
Any binary matrix H in F m×n 2 defines a classical code whose codewords are vectors in the kernel of H, ker H.The classical code so defined uses n bits to protect from errors k = n − rank(H) bits and detects all errors of Hamming weight less than d, the minimum weight of a codeword.Briefly, we say that H defines an [n, k, d] code [25].Similarly, any pair of binary matrices [26,27,28].The stabiliser group is S = ⟨S x ∪ S z ⟩, where S x is the set of X operators whose support vector1 is equal to a row of H x , and S z is the set of Z operators whose support vector is equal to a row of H z .Since an X and a Z operator commute if and only if their supports have even overlap, the orthogonality of H x and H z in F 2 ensures that the stabiliser group S is well defined.The quantum code with stabiliser group S uses n physical qubits to encode k = n − rank(H x ) − rank(H z ) logical qubits and detects all errors of weight less than d = min(d x , d z ), where d x is the minimum weight of a vector in ker H z that is not in the image of H T x , Im H T x , and d z is the minimum weight of a vector in ker H x that is not in Im H T z .Briefly, we say that the quantum code is [[n, k, d]].A hypergraph product code [29,18,30] is a CSS code produced from the hypergraph product of two linear codes.Given H a in F ma×na we define: where ⊗ is the tensor product.Since ).The physical qubits of HGP(H a , H b ) can be arranged in two rectangular grids of sizes n a × n b and m a × m b , see fig. 2 and [31].As such, we enumerate the physical qubits of HGP(H a , H b ) by the triplet (i, h, L) and (j, ℓ, R), where The first two coordinates of each triplet refer to the row and column positions of the physical qubit in the grid.The third coordinate L or R, short for left and right respectively, distinguishes the two grids and is referred to as sector of the physical qubit.Via this spacial mapping of physical qubits, each stabiliser generator will have support contained in a row of one sector and a column of the other.Specifically, elements of S x can be indexed by a pair j, h, such that S x (j, h) has support on qubits on row j of the right sector and column h of the left sector.Elements of S z , indexed by a pair i, ℓ are similar, but have support on rows of qubits in the left sector and columns in the right sector.
We say that a hypergraph product code is a square code if it is derived from one classical matrix only.Square codes HGP(H, H) take their name from the shape of the two grids of physical qubits: if H ∈ F m×n 2 , the left and right sectors are square grids of sizes n × n and m × m respectively.A square code HGP(H, H) such that H = H T or, more loosely, such that H ∈ F n×n 2 is square and Im(H) = Im(H T ), is said symmetric and denoted as HGP sy (H).

Logical Pauli Operators
Logical X and Z operators of HGP(H a , H b ) can be chosen to have support on a 'line' of qubits, meaning that each operator acts non-trivially either on the left or right sector, and either on a column or on a row of physical qubits [32,18,31].We build on this and show that such a 'line basis' can, in addition, be chosen to be symplectic.The existence of such canonical basis is the key ingredient in the identification of transversal gates on hypergraph product codes.Formally: Theorem 1.For any hypergraph product code there exist bases B x line and B z line of logical X and Z operators respectively such that: 1. Any operator in B x line or B z line has support on a 'line' of qubits; by line here we intend that the support of the operator is contained in either a column or a row of left or right sector qubits, when qubits are arranged on two grids as explained above.

For any operator in B x
line there exists one and only one operator in B z line that anticommutes with it.More precisely for every pairs of operators, one in B x line and one in B z line , either their support overlaps on exactly one qubit or does not overlap at all.

We refer to any such pair of bases as canonical basis for HGP(H a , H b ).
The proof of Theorem 1 is constructive and relies on a modified version of the Gaussian elimination algorithm over F 2 (Algorithm 1), which yields a special kind of triangular matrices that we call strongly lower triangular matrices.Definition 1.An m × n matrix A is said to be strongly lower triangular if: 1. Any column j has a pivot p such that all the elements below the pivot are zero.

All the pivots are distinct.
3. Reordering if necessary, for any pivot A p,j = 1, the coefficients to its right are zero i.e.

We indicate by π(A) the set of row pivots of A:
π(A) = {p s.t.A p,j is a pivot for some column index j of A} Given a vector space, we say that a set of vectors is strongly lower triangular if its matrix representation is.
An example of a strongly lower triangular matrix is: where π(A) = {3, 5, 6, 7}.Observe in particular the pivot A 3,1 : all the coefficients to its right are zero even if the submatrix on its right is not zero.
As Lemma 1 below shows, strongly lower triangular bases for the classical codes and their transposes used as seed codes in the hypergraph product naturally give a canonical basis for the associated hypergraph product code.Lemma 1.Given strongly lower triangular bases for ker H a , ker H T a , ker H b and ker H T b , it is possible to construct a canonical basis for the associate hypergraph product code HGP(H a , H b ).
Proof.We begin with some notation.Given a vector space V ⊆ F n 2 its complement is any vector space Crucially, V • has same dimension as the orthogonal complement V ⊥ of V : but they are, in general, different spaces.For example, if V = Span (1, 1, 1) T , (0, 1, 0) T then V ⊥ = Span (1, 0, 1) T and a complement of V is V • = Span (0, 0, 1) T .Before detailing the proof of Lemma 1, we remind the reader that the logical Z operators of HGP(H a , H b ) are spanned by: and the logical X operators are spanned by: where for an m×n matrix H, Im H ⊆ F m 2 is the space spanned by the columns of H and Im H T ⊆ F n 2 is the space spanned by the rows of H. See, for instance, [18,31].Thus, the problem of finding a canonical basis for HGP(H a , H b ) can be reduced to the problem of finding suitable bases for the kernels and the complement spaces defined by the classical seed matrices.In the proof below we follow this approach and show that strongly lower triangular bases for the classical seed matrices indeed induce a canonical basis for HGP(H a , H b ).
• and the vectors in A p are clearly linearly independent, we only need to prove that they generate a space that has trivial intersection with Im H T a i.e.Span (A p ) ∩ Im H T a = {0}.The following, is a proof by contradiction.First, we assume that there exists a vector in the set A p that belongs to Im H T a and we reach a contradiction.In particular, this entails that A p ∩ Im H T a = ∅.Second, in order to obtain a contradiction, we assume that there exists a linear combination of vectors in A p that belongs to Im H T a .We reach a contradiction using the definition of the vectors f i in A p and the linearity of the inner product.
Let assume that f i ∈ Im H T a for some f i ∈ A p .Then, f i can be written as a linear combination of a set ρ of rows of H T a : By definition of strongly lower triangular basis A = {a i } of ker H a , row pivots π(A) and unit vectors A p = {f i }, for any i, i ′ ∈ π(A), ⟨f i , a i ′ ⟩ = 1 if and only if i ′ = i and 0 otherwise.Combining this with eq. ( 5), yields: which is a contradiction.In particular, see eq. ( 5), no vector f i in the set A p belongs to Im H T a : • .Moreover, if we assume that some linear combination f of vectors in A p belongs to Im H T a , again we could write f as a sum of vectors in Im H T a as in eq. ( 5), and via the same argument we used for a unit vector f i thanks to the linearity of the inner product, we find a contradiction.In other words, no non-trivial linear combination of vectors in • and vectors in A p are linearly independent, we conclude that A p is a basis of (Im H T a ) • .Similarly, we can prove that Āp , B p and Bp are well defined bases of the corresponding complement spaces.
Because the tensor product of bases is a basis of the tensor product space, the sets: for i ∈ π(A), h ∈ π(B), j ∈ π( Ā), and ℓ ∈ π( B), are sets of linearly independent logical operators.Moreover, it is straightforward to see that operators in B x line and B z line have support on a line of qubits.Thus, in order to verify that B line = B x line ∪ B z line is a canonical basis for HGP(H a , H b ), we only need to show that it is symplectic.
Clearly, left and right operators do not overlap.If instead we take a left Z operator and a left X operator we find: and by strong lower triangularity: Since an equivalent relation holds for pairs of right operators, we have shown that for every operator in B x line there exists a unique operator in B z line that is not orthogonal to it.Furthermore, two overlapping operators of different type overlap on exactly one physical qubit e.g. for the two left operators in eq. ( 8), it is the physical qubit at position (i, h, L) when i = i ′ and h = h ′ .
In conclusion, B line = B x line ∪ B z line is a canonical basis for HGP(H a , H b ) as per Theorem 1.
Theorem 1 is a corollary of Lemma 1, provided that strongly lower triangular bases exist and can be found.We show how this is in fact the case in Appendix A, where we present a modification of the Gaussian reduction algorithm, Algorithm 1, which finds a strongly triangular basis for any n × n binary matrix in time O(n3 ).
Practically, if an arbitrary code has a canonical basis as per Theorem 1, any indexing of the physical qubits of the code naturally yields an indexing of the logical qubits.Namely, if the unique physical qubit in the overlap of a basis logical X operator and a basis logical Z operator has index ι, then the index of the corresponding logical qubit is ι too, and we indicate it as q ι .We call the physical qubit ι the physical pivot of the logical qubit q ι .For a hypergraph product code HGP(H a , H b ), if we display qubits on a grid as explained above and we fix a canonical basis as per Theorem 1, we can uniquely index logical qubits as q L i,h and q R j,ℓ corresponding to the pivots (i, h, L) and (j, ℓ, R).By construction, the sector L or R indicates whether the logical qubit has canonical operators supported on the left or right sector qubits and the first two coordinates specify where the two canonical operators cross.We refer to physical qubits (i, i, σ), σ = L, R, as diagonal qubits and to the others as mirror qubits.The logical qubits inherit the same attribute of their pivots.To sum up, we have found a classification of the logical qubits of HGP(H a , H b ) that depends on the physical position of the crossing of the logical X and Z operators, X and Z, see table 1. , ker H T b indexed over the basis' pivots.We refer to logical qubits whose pivot lies on the diagonal e.g.q L i,i or q R j,j as diagonal logical qubits, and to the others as mirror logical qubits.

Transversal Clifford gates
Transversal logical operators offer the most straightforward approach to realising fault-tolerant quantum computation since they naturally limit the spread of errors.A unitary operator U is transversal with respect to a partition2 {Q i } of the physical qubits of an [[n, k, d]] code if it can be expressed as U = i U i , where each U i acts non-trivially only on qubits in Q i [16].The usual notion of transversal gates [13] is found choosing the singleton partition {{i}}.By construction transversal gates do not spread errors between qubits in different subsets and are therefore inherently faulttolerant, provided that all the subsets in the partition are correctable 3 .We say that a partition {Q i } is m-local if all its subsets have size at most m: |Q i | ≤ m.The partition-distance δ {Qi} is the minimum number of subsets in the partition that supports a logical operator.Equivalently, the code can detect all errors that are supported on at most δ {Qi} − 1 subsets.The partition-distance is a measure of how many faulty factors U i the code can tolerate without corrupting the logical information.In the same way, we can think of the distance of a code as a measure of how many faulty 'identity factors' a code can deal with.As an example, for any [[n, k, d]] stabiliser code, the singleton partition {{i}} is 1-local, has partition distance δ {{i}} = d and the logical Pauli operators are transversal with respect to it.
In this Section we propose a partition for square codes of partition-distance ⌊d/2⌋ and one for symmetric codes of partition-distance d; for both partitions, we report some examples of transversal operators.Importantly, as suggested in [16,33], we expect transversal operators on (2-dimensional) hypergraph product codes to be restricted to be either Pauli or Clifford operators, hence we here focus on Clifford operators.
Clifford operators permute the Pauli operators by mapping the Pauli group on n qubits P n into itself.The set of Clifford gates on n qubits, C n , is a group, that can be generated by: (i) The Hadamard gate H, that maps X operators into Z operators and vice-versa, X ↔ Z.
(ii) The phase gate S, that maps X operators into Y operators and fixes Z operators, X → Y .
(iii) The CZ gate, a two qubit gate that maps X ⊗ I → X ⊗ Z, I ⊗ X → Z ⊗ X and acts trivially on Z operators.

Gates on square codes
The first partition we propose builds on the unfolding technique for the color code proposed in [34] and further studied in [35,36,37].In [34,35], the equivalence between color codes and folded planar codes is leveraged to construct transversal Clifford gates on the planar code.Here we build on that same idea to investigate Clifford gates on square hypergraph product codes.
Hypergraph product codes can be seen as a generalisation of the planar code, which indeed is the hypergraph product code HGP(H rep , H rep ), where H rep is the full-rank parity check matrix of the repetition code, e.g.
for parameters [3,1,3].By exploiting the symmetries of the canonical basis of hypergraph product codes (Theorem 1), we are able to generalise the folding of [34] to all square hypergraph product codes HGP(H, H).We can fold the left and right grid of qubits along the principal diagonal and pair the physical qubits whose sites overlap upon folding, see fig. 1. Upon folding, mirror physical qubits are twinned: (i, h, L) twins with (h, i, L) and (j, ℓ, R) with (ℓ, j, R).We call the partition given by singletons of diagonal qubits and two-qubit sets of twin qubits, diagonal-twin partition.More precisely, if code, the diagonal-twin partition of its physical qubits is given by {(i, h, L), (h, i, L)}, {(j, ℓ, R), (ℓ, j, R)} where 1 ≤ i, h ≤ n and i ̸ = h; 1 ≤ j, ℓ ≤ m and j ̸ = ℓ.The diagonal-twin partition is 2-local and has partition-distance δ dt = ⌊d/2⌋.In fact, as proven in [31], a non-trivial logical operator for an [[n, k, d]] hypergraph product code has support on at least d rows or columns of qubits in the same sector.Because the diagonal-twin partition is 2-local, the union of any choice of µ subsets from it has size at most 2µ.Thus, in order to fill at least d rows or d columns of physical qubits, we need to pick at least µ ≥ d/2 subsets in the diagonal-twin partition.
The nomenclature of physical qubits as diagonal and twins is naturally inherited by the logical qubits via the correspondence of logical qubits and their physical pivots, see table 1.This labelling is key in understanding the logical actions of transversal operations for the diagonal-twin partition and therefore we summarize it here: diagonal logical qubits are indexed as q L i,i and q R j,j ; twin logical qubits as (q L i,h , q L h,i ) and (q R j,ℓ , q R ℓ,j ) for i ̸ = h and j ̸ = ℓ, see fig. 2. Similarly to the planar code case, both the Hadamard-SWAP and the CZ-S gates detailed below are valid logical operators on HGP(H, H).Whilst it is immediate to verify that the stabilisers group is preserved by these two operators, less immediate is the identification of the logical operation performed.Crucially, this task becomes trivial when we look at the action induced on a canonical basis derived by strongly lower triangular reduction as per Lemma 1.
On the physical level, Hadamard-SWAP consist of (i) Hadamard on every physical qubit; (ii) physical SWAP between twin qubits.Hadamard-SWAP is a valid logical operator as it preserves the stabiliser group mapping S x (j, h) ↔ S z (h, j) and (i) swaps the logical X and the logical Z operators of twin qubits: on the left q L i,h and q L h,i , on the right q R j,ℓ and q R ℓ,j ; (ii) acts as logical Hadamard on the diagonal qubits.
The operator CZ-S is defined on the physical level as: (i) S gate on left diagonal qubits; (ii) S † on right diagonal qubits; (iii) CZ between twin qubits.CZ-S preserves the Z stabilisers and maps the X stabiliser S x (j, h) into S x (j, h)S z (h, j).Importantly, the phase factor in the product  [34,35].The two grids of physical qubits are folded separately along the principal diagonal and qubits that share the same sites upon folding are paired together.The grey circles represent physical diagonal qubits while all the other circles represent mirror qubits.The yellow circles (two on the left, and two on the right) are twin qubits.
Figure 2: Graphical representation of the physical qubits of the square code HGP( H, H), where H is as in eq. ( 11).The physical qubits (white circles) are arranged on a left and right grid.The black circles highlight the position of the physical pivots associated to the logical qubits, see table 1.The canonical basis pictured is derived as explained in Lemma 1 from the matrix A of eq. ( 4), whose columns are a strongly lower triangular basis of ker H. S x (j, h)S z (h, j) is correctly preserved since, by construction, an X-stabiliser S x (j, h) has a diagonal left qubit (h, h) in its support if and only if H a [j, h] = 1, if an only if it has a diagonal right qubit (j, j) in its support too.As such, if an S gate is applied, an S † gate is applied too and the global phase cancels out.Again by looking at the action of the operator CZ-S on a canonical basis, since twin logical operators have support on mirror qubits only and each diagonal logical operator has support on exactly one diagonal qubit, we find that the logical action of the operator CZ-S is (i) S on left diagonal qubits; (ii) S † on right diagonal qubits; (iii) CZ between twin qubits.

An example of a square code
As a guiding example, we consider the square code HGP( H, H), where H a is non-full-rank parity check matrix of the classical [7,4,3] Hamming code: The matrix H defines an equivalent [7,4,3] classical code and HT defines a [4, 1, 3] code.By eq. ( 3), HGP( H, H) is a [[65, 17,3]] CSS code.The columns of A in eq. ( 4) are a strongly triangular basis of ker H and ṽ = 1 0 1 1 T generates ker HT .Trivially, {ṽ} is a strongly lower triangular basis of ker HT , with pivot π(ṽ) = 4.In fig. 2 qubits are represented as circles.We note how these are divided into a 7 × 7 grid of left physical qubits and a 4 × 4 grid of right physical qubits.The characteristic square shape of these two grids makes HGP( H, H) a square code.The physical diagonal qubits are the ones that lie across the principal diagonals of the squares (the two black lines in fig.2).The black circles correspond to physical pivots, one for each logical qubit of the code.As for any other square hypergraph product code derived from a classical [n, k, d] code whose transpose is a [m, k T , d T ] code, there are k 2 = 16 left logical qubits, k = 4 of which diagonal, and (k T ) 2 = 1 right logical qubits, k T = 1 of which diagonal.

Gates on symmetric codes
The second partition we propose improves on the diagonal-twin partition, having partition-distance d against ⌊d/2⌋ for a [[n, k, d]] code.The price paid is the validity of this partition only on a small class of square codes, the symmetric codes: HGP sy (H) = HGP(H, H) for some H such that Im H = Im H T .Notably, the toric code is a symmetric hypergraph product code HGP sy (H toric ) where e.g. for d = 3, For our purposes, the key feature of symmetric hypergraph product codes is that their physical qubits can be arranged in two square grids of the same size.This fact suggests that we can pair physical qubits by superimposing the left grid of physical qubits on the right one, and pairing qubits that sit at the same coordinate.In this way, every physical qubit (i, h, L) is paired with its sibling qubit (i, h, R).Explicitly, given a symmetric code HGP sy (H), with H ∈ F n×n 2 , we define its sibling partition as: where 1 ≤ i, h, ≤ n.See fig. 3 for a graphical representation of the sibling partition.The sibling partition has partition-distance δ s = d.In fact, as said above and proven in [31], every non-trivial logical operator of a hypergraph product has support on at least d rows or columns in the same sector.As such, even if the sibling partition is 2-local, every subsets in it can give a contribution of at most 1 towards the covering of an arbitrary logical operator.This observation is more general: any partition whose subsets Q i contain at most one qubit in each sector has maximum partition-distance d.We call any such partition sector-transversal.The Hadamard-SWAP operation defined above for the square codes on the diagonal-twin partition is similarly defined on the sibling partition too: physical Hadamard on all qubits and SWAP between siblings qubits yields Hadamard on all the logical qubits composed with logical SWAPs between sibling logical qubits.
Via the sibling partition is naturally defined a transversal CZ operator.In fact, applying physical CZ gates on all pairs of sibling qubits preserves the Z stabilisers and maps the X stabilisers S x (j, h) into S x (j, h)S z (h, j).On the logical level, the CZ operator yields a CZ between pairs of sibling logical qubits q L i,h and q R i,h .

An example of a symmetric code
Building on our guide example in Section 3.1.1,we illustrate a symmetric hypergraph product code derived from the [7,4,3] Hamming code with full-rank parity check matrix H, We define the symmetric Hamming code as the symmetric hypergraph product code HGP sy (H T H), where4 Figure 3: Graphical representation of the symmetric hamming code HGPsy(H T H).In both figures, the left sector qubits sit at the front while the right sector qubits sit at the back.Sibling pair of qubits are superimposed.
In fig.3a the orange filled circles represent the support of the X stabiliser Sx (2,3).In fig.3b the blue filled circles represent the support of the Z stabiliser Sz (4,6).
The symmetric Hamming code HGP sy (H T H) has parameters [[98, 32, 3]] and stabiliser generators of weight 8.It has a rate of k/n = 32/98 ≈ 0.33 which substantially outperforms5 the surface and toric code rates and indeed the optimal rate of k/n = 0.2 for codes with k = 1 and d ≥ 3.
For this reason, we believe that similarly constructed symmetric codes could be promising for low-overhead, near-term quantum computing.In Appendix B we present several more examples of small (n < 1000) symmetric hypergraph product codes with stabiliser generators of weight w ≤ 16 on which all the gates we describe could be implemented.

Completing a universal gate set
Transversal gates enable us to implement a subset of logical Clifford gates on hypergraph product codes, but this is not sufficient for performing universal fault-tolerant quantum computation.In particular, the Clifford gates detailed in Section 3 act equivalently on logical qubits of the same type (diagonal, twin or sibling) and so cannot be used to e.g.entangle arbitrary pairs of logical qubits.
In this Section, we focus on symmetric hypergraph product codes and show how to implement a universal gate set using circuits that consist of sequences of sector-transversal gates 6 .Such circuits are pieceably fault-tolerant, meaning that each gate in the sequence is fault-tolerant, and therefore the overall circuit is fault-tolerant when supplemented with intermediate error correction [23].
In Section 4.1, we show how to implement entangling gates between arbitrary logical qubits by combining pieceably fault-tolerant gates.Then, in Section 4.2, we show how to complete a universal gate via state injection.Lastly, in Section 4.3, we discuss the limitations of our approach.

Pieceably fault-tolerant two-qubit entangling gates
We begin by constructing a pieceably fault-tolerant circuit for implementing a logical CZ gate between logical qubits in different sectors, via the round-robin method presented in [23].By Claim 2 of [39], we can implement a logical CZ between two logical qubits by performing a CZ between each pair of physical qubits in the support of the logical Z operators of the qubits considered.For a symmetric code (using the notation of table 1) we can therefore implement a logical CZ between arbitrary qubits in different sectors, q L i,h and q R j,ℓ , by performing a CZ between each pair of physical qubits in the support of ZL 2 we indicate by supp(v) the ordered set of qubits/indices in the support of the vector v i.e. [39] states that (η,γ)∈supp(ai)×supp(β ℓ ) CZ (η, h, L), (j, γ, R) (14) implements the logical operator (e) t = 3.
Figure 4: Round robin implementation of CZ q L 3,3 q R 6,5 by the circuit of eq. ( 15) on the symmetric Hamming code.(a) shows the supports of the logical Z operators.(b)-(e) illustrate the physical CZ gates acting at each time step t, where qubits highlighted with the same colour have a CZ gate applied to them.
In order to use the round-robin method to make the operation described by ( 14) fault-tolerant, we want to group the physical CZ operations in separate fault-tolerant time steps and perform intermediate error correction between them.For symmetric codes, we can achieve this if we perform physical CZ's in tranches so that each tranche only contains CZ's between left and right sector qubits-as opposed to CZ's between two qubits from the same sector.To this end, we let ∆ = max(| supp(a i )|, | supp(β ℓ |) and, for η ∈ supp(a i ), we denote by η # its index in supp(a i ), meaning η # = ν if η is the νth element in the ordered set supp(a i ); with a slight abuse of notation, we can write η ⊕ ∆ t to indicate the µth element in supp(β ℓ ), where µ = η # + t mod ∆, for any integer t.Combining this notation with eq. ( 14), yields Treating each value of t in eq. ( 15) as a time step, the inner summations, are sequences of non-overlapping sector-transversal operators, as desired.For each time step 0 ≤ t ≤ ∆, first we apply the gates of eq. ( 16) and then perform one round of error correction using the ReShape decoder [31].The use of ReShape at this stage is fundamental because it corrects errors on different sectors independently.Hence, using ReShape to correct errors between time steps, the protocol preserve the partition-distance d of the operator Ω t in eq. ( 16) and can correct up to ⌊d/2⌋ faulty CZ gates.
In conclusion, CZ between arbitrary left and right logical qubits can be implemented in ∼ d ↑ z time steps, where d ↑ z is the maximum weight of a canonical Z operator.An example on the symmetric Hamming code is depicted in fig. 4.
We can also construct a pieceably fault-tolerant circuit for the gate Indeed, combining again Claim 2 of [39] and eq.( 15), we find that where As in the CZ case, we can use the round-robin method in [23] and perform error correction between each sector-transversal time step to obtain a fault-tolerant implementation of XCX.
Given our ability to perform CZ and XCX gates between arbitrary pairs of qubits in different sectors, we can use the circuit identity shown in fig. 5 to implement CNOT gates between arbitrary pairs of qubits in the same sector.To summarize, we can implement entangling gates between arbitrary logical qubits using circuits composed of at most four pieceably fault-tolerant circuits.

Single-qubit gates via state injection
To complete a universal gate set, it is sufficient to implement the H, S and T gates.The gates S and T can be implemented via state injection [40,41,42].We can use a CSS code as a state factory and then use a pieceably fault-tolerant CZ gate to implement the state injection circuits shown in fig.6.State injections can be performed from an auxiliary [[n ′ , 1, d ′ ]] CSS code C that acts as a state factory by leveraging pieceably fault-tolerant gates to implement the circuits in fig.6 at a logical level.More precisely, let ζ ∈ F n ′ 2 describe the support of the logical Z operator for the logical qubit q C of C and suppose that we number the physical qubits of C as (ι) C .Then, via Claim 2 of [39] and eq.( 15), we obtain that where And similarly for a right qubit q R j,ℓ .The operator of eq. ( 19) consists of CZ operators between different codes so is transversal at each time step and is therefore pieceably fault-tolerant.As C is a CSS code, we can measure the logical X operator destructively by measuring all of the physical qubits in the X basis and performing classical error correction on the measurement outcomes.Therefore, to implement S, and T we only need to fault-tolerantly prepare the states HS |+⟩ and HT |+⟩.For a d = 3 symmetric hypergraph product code, one option would be to produce these states using the [ [15,1,3]] Reed-Muller code [43,44,45].For higher distance symmetric hypergraph product codes, preparing magic states could be accomplished using standard magic state distillation techniques [42,46,47,48].In addition, multiple magic states could also be injected from a CSS code with multiple encoded qubits, using parallel CZ gates (see section 4.3).
For the implementation of the logical H gate on single qubits we propose the use of the Hadamard-Swap operation detailed in Section 3.2 together with three logical S gates.Without loss of generality we here illustrate how to implement the gate H on the left logical qubit q L i,h with sibling qubit q R i,h .The construction for right logical qubits follows easily by switching the roles of siblings.We indicate by U (q) the logical gate U on the logical qubit q, i.e.S(q L i,h ) indicates the logical S gate on the logical qubit q L i,h .The composition of gates: equates:  15).Note that for CSS codes the X basis measurements, represented as the gate H followed by Z basis measurements, can be done transversally. Since the composition of gates in eq. ( 20) implements the logical H gate on qubit q L i,h , up to a global phase factor.Hence, the logical H gate on arbitrary qubits can be implemented at the cost of three S gates and two sector-transversal operations.

Limitations of pieceable fault-tolerance
We conclude this Section by highlighting two important limitations of pieceable fault tolerant techniques: intermediate correction and time cost.To guide our analysis, let us consider the pieceably fault-tolerant CZ gate of Section 4.1.
Since CZ is diagonal in the Z basis, Z stabilisers are left unchanged during the protocol and hence correction for X errors can be done, at each time step, via standard measurement of Z stabilisers.However, the original X stabilizer generators are transformed at each intermediate time step, with no guarantee on their weight-which could scale with the code distance.To avoid measuring high-weight generators, we can neglect to do error correction for Z errors at intermediate time steps, at the cost of allowing Z errors to build up for a constant number of rounds (for codes of a fixed distance).This strategy will only be fault-tolerant for codes of a fixed distance and therefore will not give a threshold without modification 7 .Nevertheless, the asymptotic behaviour encapsulated by a threshold is less important in the short-to medium-term regime where space overhead will likely be the most important constraint.
As regards to time cost, pieceably fault-tolerant circuits necessarily have a time overhead higher than transversal gates because of intermediate error-correction.If the time cost of one cycle of error-correction followed by the application of a transversal gate is τ , then each sector-transversal gate has time cost τ .By contrast, the pieceably fault-tolerant CZ of eq. ( 15), has cost at least τ d for a distance d code.For instance, in the symmetric Hamming code example given in section 3.2.1,CZ or XCX have cost τ 4 because 4 is the maximum weight of a canonical logical operator.
In general, composing m pieceable fault tolerant gates takes time τ d ↑ m, where d ↑ is the maximum weight of a canonical logical operator.However, this overhead can be reduced via parallelization.For instance, CZ q L i,h , q R j,ℓ and CZ q L i ′ ,h ′ , q R j ′ ,ℓ ′ can be performed in parallel via eq.( 15), provided that the logical Z operators of the qubits considered have all disjoint support e.g.whenever h ̸ = h ′ and j ̸ = j ′ ; see fig. 7 for an example.Therefore, if we want to implement m pieceable fault-tolerant gates, we can divide them into subsets of parallelizable gates and, if n p is the minimum number of gates in any of these subsets, we can implement all the gates in time τ d ↑ m/n p , reducing the average time overhead per gate.In the image, magenta: q L 3,3 , q R 6,5 , green q L 7,5 , q R 7,5 , yellow: q L 6,6 , q R 3,7 , blue: q L 5,3 q R 5,7 .Pieceably fault tolerant gates that act on the support of these logical operators (e.g.CZ) can be implemented in parallel.We note that, for any symmetric hypergraph product code of dimension k 2 , we can always find k pairs of logical qubits whose logical operators do not overlap as shown here (one for each left line pivot and one for each right line pivot).
Importantly, performing gates in parallel has no additional space overhead, in contrast to the measurement-based scheme of [11].

Conclusion
We have investigated the structure of hypergraph product codes to characterize transveral Clifford gates on them.In fact, we proved that every hypergraph product code has a canonical basis for its logical space whose features suggest qualitative differences between logical qubits (diagonal, twin and sibling).We showcased how to leverage such differences to implement some transversal Clifford gates on square and symmetric hypergraph product codes.The logical transversal gates we have found are limited but we comment on how these could be augmented via pieceable fault tolerance and state injection to achieve universality.
While we have focused on symmetric hypergraph product codes, we believe that the choice of structured seed classical codes in the hypergraph product could be exploited to construct other transversal gates.We also conjecture that a partitioning strategy similar to the ones here presented could be used to implement transversal non-Clifford gates on higher dimensional homological codes [36,21].More generally, it would be interesting to extend the construction of a canonical basis to the more efficient product codes construction such as the ones in [51,52,53,54].independent columns; the matrix of interest, K, which will contain the column vectors forming a basis of the kernel of H is iteratively reduced in triangular form (line 10).We prove that Algorithm 1 is correct in Lemma 2 below.

Algorithm 1 Strong lower triangular Gaussian reduction.
Input: An m × n binary matrix H.
2) The set K is a basis of the kernel of H.
3) The set F is a unit-vector basis of (Im H T ) • .
Proof.Let v be any vector in the column span of H: then there is nothing to prove.Conversely, suppose that there exists j ∈ V such that j ∈ π(K).Then it must be Ĥj = 0 (see line 8).In other words, the jth column can be written as a linear combination of other columns of H, and by substitution if necessary, point 1) is proved.
To prove point 2), observe that for what said on the zero columns of Ĥ, all the vectors in K are in the kernel of H.Moreover, they are linearly independent and lower triangular by construction.Now suppose that the matrix is not strongly lower triangular (e.g. 1 1 0 1 ) so that there exists a row index i such that K i,α = K i,α+τ = 1 for some τ > 0. This means that the αth column K α has been added to the (α + τ )th column K α+τ at step α.However, if α ∈ π(K) is a pivot index, Ĥα is zero at steps α − 1, . . ., n and therefore the if condition at line 11 is not met.
Point 3) follows observing that the vectors in F are linearly independent by construction (they are unit vectors with different pivots) and none of them belongs to the row span of H.In fact by definition, any vector in the kernel of H is orthogonal to vectors in the row span of H, and by strong lower triangularity, ⟨k, f ⟩ = 1 for any k ∈ K and f ∈ F.

B Symmetric hypergraph product codes -Examples
We here provide table 2 with some examples of classical seed matrices to construct symmetric hypergraph product codes with n < 1000 and maximum stabiliser weight w ≤ 16.The classical parity check matrices used in the product were found with assistance from the "Best Known Linear Code" database of MAGMA [55] and guidance from the bounds in [56].For each parity check matrix H in the first column, we have computed the [[n, k, d]] parameters the symmetric hypergraph product code HGP sy (H T H).

2 and
H b in F m b ×n b 2

2
be strongly lower triangular bases for ker H a , ker H T a , ker H b and ker H T b respectively.The indices are the pivots:

Figure 1 :
Figure1: Graphical representation of the diagonal-twin partition for squares hypergraph product codes derived from the color code unfolding into the planar code[34,35].The two grids of physical qubits are folded separately along the principal diagonal and qubits that share the same sites upon folding are paired together.The grey circles represent physical diagonal qubits while all the other circles represent mirror qubits.The yellow circles (two on the left, and two on the right) are twin qubits.

Figure 5 :
Figure 5: Circuit identity showing how to construct CNOT from CZ and XCX gates, where XCX gates are depicted with targets on both qubits.

Figure 6 :
Figure6: State injection gadgets for implementing S and T gates.The top wire in each circuit represents a logical qubit of a a symmetric hypergraph product code and the bottom wire represents a logical qubit of an ancillary CSS code.To implement the CZ gates we use the pieceably fault-tolerant circuit in eq.(15).Note that for CSS codes the X basis measurements, represented as the gate H followed by Z basis measurements, can be done transversally.

Figure 7 :
Figure7: Graphical representation of the parallel implementation of pieceably fault tolerant gates.Columns of left (front) qubits and rows of right qubits (back) filled in the same color represent pairs of logical operators whose supports do not overlap.In the image, magenta: q L 3,3 , q R 6,5 , green q L 7,5 , q R 7,5 , yellow: q L 6,6 , q R 3,7 , blue: q L 5,3 q R 5,7 .Pieceably fault tolerant gates that act on the support of these logical operators (e.g.CZ) can be implemented in parallel.We note that, for any symmetric hypergraph product code of dimension k 2 , we can always find k pairs of logical qubits whose logical operators do not overlap as shown here (one for each left line pivot and one for each right line pivot).

Table 1 :
Classification and indexing of the logical qubits of a hypergraph product code HGP(Ha, H b ) where {ai}, {b h }, {αj}, {β ℓ } are strongly lower triangular bases of ker Ha, ker H b , ker H T a

Table 2 :
Examples of symmetric hypergraph product codes HGPsy(H T H), where H is the binary matrix in the first column.The length n, the dimension k, the rate k/n, the distance d and the maximum stabiliser weight w are reported in the other columns.