Gauge Color Codes: Optimal Transversal Gates and Gauge Fixing in Topological Stabilizer Codes

Color codes are topological stabilizer codes with unusual transversality properties. Here I show that their group of transversal gates is optimal and only depends on the spatial dimension, not the local geometry. I also introduce a generalized, subsystem version of color codes. In 3D they allow the transversal implementation of a universal set of gates by gauge fixing, while error-detecting measurements involve only 4 or 6 qubits.


Introduction
In fault-tolerant quantum computation [1], quantum information is protected from noise by encoding it in somewhat non-local degrees of freedom, thus distributing it among many smaller subsystems, typically qubits. This makes sense under the physically relevant assumption that interactions with the environment have a local nature. The implementation of gates, consequently, must be also as local as possible to preserve the structure of noise. This is naturally achieved with transversal gates, i.e. unitary operators that transform encoded states by acting separately on suitable subsystems, in the simplest case independently on each qubit. Unfortunately, no code admits a universal transversal set of gates, i.e. such that transversal gates can approximate arbitrary gates [2].
Topological quantum error correcting codes [3] introduce a richer notion of locality by considering the spatial location of the physical qubits, which are assumed to be arranged on a lattice. They come in families parametrized with a lattice size, for a fixed spatial dimension. Their defining features are (i) that the measurements needed to recover information about errors only involve a few neighbouring qubits and (ii) that no encoded information can be recovered without access to a number of physical qubits comparable to the system size. Rather than sticking to transversal operations, for topological codes it is natural to consider instead local operations quantum circuits of fixed depth with geometrically local gates [4,5].
Remarkably, spatial dimension constrains the gates that can be implemented by such local means. This is in particular true for topological stabilizer codes, a popular class of codes for which it is often possible to obtain general results, as exemplified by the classification of 2D codes [6,7] 1 . Along this line, it was shown recently [5] that for D-dimensional topological stabilizer codes all local gates belong to the set D  , defined recursively [8] setting 1  to be the Pauli group  of operators and D  to be the set of unitary gates U with codes exist on dimension D that admit the transversal implementation of the gates CNot and R 1 0 [13,14]. Since R D belongs to D  but not to D 1  − , color codes could saturate the geometrical constraint. The difficulty is that it is not obvious that D-colexes with the required local conditions can be constructed for any D. A first aim of this work is to show that actually such local conditions are irrelevant the transversality properties of a color code are independent of the local geometry of the colex. This is interesting at a theoretical level because D-colexes can be easily built for any dimension [12] and thus the geometrical constraint on local gates is saturated 2 . Notice in this regard that gates are not only local but also transversal. On the practical side, with less constraints on the choice of the lattice of physical qubits more efficient codes are possible. In 2D, for example, there exist families of color codes that for error correction only require measurements involving up to 6 physical qubits each. With the constraints enforced, the number of qubits goes up to 8 [10].
Since no code admits a universal set of transversal gates, we are forced to find alternate routes. A popular approach is the distillation of noisy magic states [15] (for which 2D color codes are well suited since the whole Clifford group is transversal). It has the advantage of its quite general applicability, but the disadvantage that most resources end up being used for distillation, rather than the intended computation. More efficient techniques are thus desirable, and in this regard two recent developments have been the gauge fixing technique [16] and the concatenation of different codes [17].
But tricks to recover universal sets of gates have long been known. In [18] a code is considered such that the CNot and R 3 gates are transversal and the initialization and measurement in the computational and Hadamard rotated basis requires only transversal operations and error correction. This suffices to complete the universal gate set with the Hadamard gate, at the price that each Hadamard requires an ancillary encoded qubit. The same technique applies to 3D color codes; indeed, it motivated their introduction. From a practical perspective, however, 3D color codes pose two difficulties. One is the mentioned requirement of ancillas. The other is that the error-detecting measurements can involve each dozens of qubits generally speaking, operations involving more qubits tend to be more unreliable and lengthy.
Both problems are removed in this work by introducing a subsystem form of color codes, gauge color codes. Recall that in a conventional code quantum information is stored in a subspace of the Hilbert space corresponding to the physical qubits. In a subsystem code, instead, this code subspace contains both logical and gauge qubits. The latter are just qubits that we do not care about, and in a topological code they might include local degrees of freedom. This extra degrees of freedom can be put to work at least in two ways. First, error detection measurements are potentially simplified by involving the gauge degrees of freedom [19]. In the case of 3D gauge color codes, this materializes in measurements involving only 4 or 6 physical qubits, just as in 2D. Second, as it was noticed recently [16], it might be possible to perform different transversal gates depending on the state of the gauge qubits. This gauge fixing technique applies to gauge color codes very neatly. In particular for 3D gauge color codes it yields the same universal set of gates described above for conventional 3D color codes but without the need to use ancillary encoded states. An important aspect is that gauge fixing is similar to error correction it only requires local quantum operations supplemented with classical computation.

Stabilizer codes
Stabilizer codes [20,21] are a main object of study due to their balance of flexibility and simplicity. Given a system of n qubits, a stabilizer subgroup   ⊆ , with 1  − ∈ , defines a subspace, or code, of states ψ with sψ ψ = for every s  ∈ . A subsystem stabilizer code [22] is defined by giving in addition a gauge group   ⊆ such that  is the center of  up to phases. The subspace stabilized by  splits in two subsystems the gauge group generates the full algebra of operators on one of them and acts trivially on the other. Logical qubits (those to be protected) inhabit the later, gauge qubits the former. The elements of , i.e. the group of Pauli operators that commute with the elements of , are called bare logical operators they only act on logical qubits. Elements of  are their dressed counterpart they may act on gauge qubits. Both quotients   and   yield the Pauli group on logical qubits.

Transversal gates
Let X q , Z q denote the Pauli operators X, Z acting on the qubit q, and similarly for a set S of qubits. Of interest here are stabilizer codes with (i) a CSS structure [23,24]  has a generating set 0  such that each of its elements takes the form X S or Z S for some S, and (ii) a single encoded qubit with bare logical operators X Q , Z Q , where Q is the set of all physical qubits. For such codes the CNot gate is trivially transversal, and also the Hadamard gate if in addition the code is self-dual, i.e. X S  ∈ if and only if Z S  ∈ .
More interesting is the gate Let S | | denote the cardinality of a set S. As shown in appendix A, R n is transversal if the set Q can be divided into two disjoint sets T and T′, i.e. Q T T = ⊔ ′, such that for every collection of generators X X ,...,

Gauge fixing
The idea of the gauge fixing technique [16] is that by fixing some of the gauge degrees of freedom to certain values it might be possible to recover transversal gates that would otherwise be forbidden. A code , 2 2   is a gauge fixed version of , 1 1 , .
The relations (4) become most transparent by choosing canonical generators X Z , where r s t n ⩽ ⩽ ⩽ . Computing centralizers is a trivial task, e.g.
This is indeed a valid choice 2  is the center of 2  up to phases. Moreover, the operators (9) are clearly also canonical generators of the logical Pauli group for the code , 2 2   . Since 1 2   ⊆ and the two codes share logical operators, encoded states of the second code can be regarded as being encoded states of the first. Conversely, given an encoded state of the first code it is possible to make it into an encoded state of the second code without affecting the logical operators. This amounts to fix the eigenvalues of Z Z ,..., r s 1 + to +1, which can be done in two steps. First the Z Z ,..., r s 1 + need to be measured, or equivalently any other generators of 2 1   . Then a product of a subset of the operators X X ,..., r s 1 + is applied, or equivalently any other generators of 1 2   . In particular, X i is applied if the measurement yields Z 1 i = − . All the operations involved commute with the logical operators (9), and therefore are safe to perform.
An alternative characterization of (4) is possible in terms of logical operators. Suppose that the two codes share a set  of representatives of bare logical operators. Then To check the statements (11), (12), notice first that for any code ,   a set  of representatives of bare logical operators satisfies , . ( The equivalence of (11) and (12) under the assumption that the two codes share such a set  follows from the basic properties (13). Indeed, (12) implies that , which used (12) and completes the first part of (4), and , which is the second part of (4).

Simplicial lattice
Color codes require lattices called colexes [12], but here the focus is shifted to their dual lattices. For those readers already familiar with colexes, the correspondence is clarified in appendix B. For simplicity we focus on the 2D case. The key to the construction are triangles (2-simplices) with the vertices (0-simplices) labeled with 3 given colors (thus each side or 1-simplex is labeled by 2 colors). We are interested in simplicial lattices (triangulations) with the overall shape of such a colored triangle M. The lattices must have 3-colored 0-simplices such that (i) each 2-simplex is properly colored and (ii) the sides of M have the same coloring as the 1-simplices that lie on them. In figure 1 the first examples of an infinite sequence of such lattices is given: they are obtained by cutting triangles of different sizes out of the same infinite triangular lattice.
From every such triangulation one can get a 3-colored triangulation of a sphere just by adding 3 extra 0-simplices as shown in   The general D-dimensional case is entirely analogous, with D-simplices instead of triangles and D 1 + colors instead of 3. In particular, every d-simplex is labeled by d 1 + colors. For a formal exposition see appendix B.
The 3D case is the most important, so here is a construction where a tetrahedron is carved out of a suitably colored BCC lattice. Vertices are placed at points x or x l 0 + , where x has integer coordinates and l ( , , ) ≔ . Red, green, blue and yellow vertices have positions x such that x l · 0 is 0, 1 2 , 3 4 and 1 4 modulo 1, respectively. Any 3-simplex has vertices of the form where s 1 = ± and the triad a b c ( , , )is a permutation of the triad i j k ( , , ) of canonical vectors. Given a positive integer n, retain those simplices with vertices x such that This gives a tetrahedron: each constraint produces a face with coloring dictated by k, see figure 3.

Gauge color codes
Consider sets of d-simplices d Δ from a D-dimensional construction as above, D 2 ⩾ . Attach a physical qubit to each D-simplex in D Δ , also denoted Q, and define the groups of operators where e d , are positive integers, d e D , < , S δ is the set of D-simplices that contain δ, and A 〈 〉 denotes a group with generators A. The groups (20) satisfy and their centralizer takes the form where ∝ denotes equality up to global phase [14]. Moreover, Q | |is odd and the group X Z ,  C (1, 1) have support on at most 6 qubits, and the same holds for C (2, 2) in 3D.

Transversality
For gauge color codes the CNot gate is transversal. For self-dual codes, d = e, the Hadamard gate is transversal. What about the gate R n ? As shown in appendix D, a set T as in (3) exists if D nē.
(24) ⩾ In particular, R D can be implemented by taking ē 1 = . The result (24) was obtained for T = ∅ and d ē = in [14], but an important limitation there was the lack of a general recipe to construct lattices satisfying (3).
As it turns out the set T only depends on the lattice, not the specific (d, e) parameters of the code. It must be such that the operator X T , regarded as an error in the corresponding D (1, 1) − color code, commutes with a Z stabilizer generator if and only if the generator has support on a number of qubits that is a multiple of 4.
For the above 2D and 3D families of color codes we can give T explicitly. In the 2D case it is simplest to depict it, see figure 1. As for the 3D case, first notice that qubits correspond to the following elements of the triangulation of a colored tetrahedron M: all 3-simplices, the 2-simplices on the faces of M, the 1-simplices on the edges of M, and the 0-simplices that are the vertices of M. A valid choice for the set T is the union of (i) the set T 3 of all 3-simplices with a b c ( , , )as in (18) an even permutation of the triad i j k ( , , ), (ii) the set T 2 of all 2-simplices that are not a subsimplex of any element of T 3 , see figure 3, and (iii) the set T 1 containing all 1-simplices that are not a subsimplex of any element of T 2 .

Gauge fixing
The different gauge color codes that can be defined on a given, fixed lattice are related by gauge fixing, either directly or via some other code in the family. Indeed, all the codes have a shared group  of bare logical operators (namely, those with support in all qubits) and the condition (12) is satisfied when d d 1 2 ⩽ , e e 1 2 ⩽ . Take e.g. D = 3. For a given geometry we might consider both the code (1, 1) or the gauge fixed version (1, 2). Within (1, 1) CNot and Hadamard gates are transversal. Fixing the gauge we can move into (1, 2) to apply transversal R 3 gates, completing a universal set of transversal gates. The ideal strategy is to transition to (1, 2) only momentarily. This way there is no need to ever measure directly the large stabilizer generators of the (1, 2) code. Instead, it is enough to measure the gauge generators in C (2, 2), which only involve up to 6 qubits. Notice that the only non-transversal element of the procedure is the classical computation to find the gauge operator that will fix the gauge as desired. This is entirely analogous to error correction.

Measurements in error correction
In order to perform error correction on a stabilizer code the first step is to recover the error syndrome by measuring a collection of stabilizer operators that generate . This can be done either directly or indirectly by performing a sequence of measurements of gauge operators from which the syndrome can be recovered [19]. In the case of CSS codes the later approach is particularly straightforward. It suffices to first measure a generating set of X-type gauge operators (which commute with each other), and then do the same with Z-type operators. The eigenvalues of X-type stabilizers can be recovered from the first set of measurements, and similarly for the Z-type and the second set.
Consider now the specific case of a (d, e) gauge color code. From the D-colex perspective in order to measure the syndrome for Z-type stabilizers we have to either measure directly stabilizer operators attached to e (¯1) + -cells or measure instead gauge generators attached to d ( 1) + -cells. In fact, it is possible to choose to measure operators attached to d′-cells for any d d e 1¯1 + ⩽ ′ ⩽ + ). Whenever d ē 1 ′ < + , it is worth noting that it is not necessary to measure all the d′-cell operators. Instead, the stabilizer generator Z c on a e (¯1) + -cell c can be recovered in different ways from the operators Z c′ , where c′ stands for a d′-cell. In particular, if κ is a subset with d′ elements from the set of ē 1 + colors of c, and c κ the set of κ-cells contained in c, then [12] Z Z (25) c c c c ∏ = ′∈ ′ κ which is just a general form of (C9). It follows that it is enough to measure at a subset of d′-cells with enough color combinations κ so that every collection of ē 1 + colors has to contain one of the color combinations. E.g. for (1, 1) gauge color codes in 3D it suffices to choose two disjoint pair of colors, as opposed to the six possible pairs of colors.
Consider more particularly the specific 3D lattice given in the main text. In its bulk, the 3-cells of the corresponding 3-colex have 24 qubits (0-cells) each. For a specific pair of colors, each cell has either 6 2-cells with 4 qubits each or 4 2-cells with 6 qubits each. Measuring any of the corresponding sets of 2-cell operators is enough, but measuring all of them gives redundant information that can be put to good use [25].
Coloring can be used, whatever the spatial dimension D, to organize the measurements. The idea is that cells with the same coloring have disjoint sets of vertices, and thus the related operators act on disjoint set of qubits.
Then one can measure in parallel all the generators related to a color combination. Naturally, other approaches might be more optimal.
Finally, a note on error-correction itself. In CSS codes it is natural (but again not optimal) to deal separately with X and Z errors. In the case of gauge color codes this has the advantage of mapping the problem back to conventional color codes. Namely, consider a (1, 1) gauge color code in 3D. The error syndrome for X errors is the same as in the corresponding (2, 1) conventional color code, and the error syndrome for Z errors is the same as in the corresponding (1, 2) conventional color code. In the presence of measurements error, however, new scenarios open if gauge generators are measured [25].

Outlook
The results presented here show that 3D gauge color codes put together some unique features (in fact, they turn out to be surprisingly resilient to errors in the error-detecting measurements, as explained in [25]). Further research would thus be desirable, e.g. regarding noise thresholds.
It is intriguing to consider quantum Hamiltonian models based on 3D gauge color codes, i.e. of the form for some set 0  of local generators of the gauge group and couplings J g . The fact that all the (standard) gauge generators detect fluxes [12] suggests the possibility of a self-correcting phase [26,27].
Topological codes have a rich behavior, but they are just part of the larger class of local codes, where spatial geometry is not relevant. This could be a path to obtain code families with the properties of 3D gauge color codes but requiring less physical qubits.

Appendix A. Transversal gates
The aim is to show that R n is transversal if (3) holds, which can be written more compactly as In particular, the claim is that there exists an integer k such that a logical R n is implemented by applying R n k − to qubits in T and R n k to the rest, i.e. in T′. The resulting gate maps, for any given subset A Q ⊆ , where 0 | 〉is the state with all physical spins up 0 Q | 〉 ⊗| | . In the code subspace the stabilizers have eigenvalue 1 and thus encoded states are superpositions of states X 0 A | 〉with X A a product of several X-type gauge generators and possible X Q . Taking Z Q to be the logical Z operator, an encoded state a | 〉, a = 0, 1, is a superposition of states of the form where X G  ∈ and Q G − is the complement of G in Q. Suppose that, for any X G  ∈ , we had G 0 mod 2 .
T n | | ≡ Then the states (A4) transform as follows according to (A3) Every d-cell is labeled by d colors from a given set of D 1 + colors. Given a cell c with color set κ, the cells with c as a subcell are in one to one correspondence (according to their label) with the color sets with κ as a subset.
E.g. at every vertex D 1 + edges meet, each with a different color. Notice that every two cells with the same color set must be equal or disjoint. This in turn implies that all 2-cells have an even number of edges: the edges along the boundary of the 2-cell must have alternate colors. Another easy property is that the boundary of every The dual of a D-colex is a simplicial lattice with the vertex colorability properties given in the text, in particular, the dual of a d-cell with color set κ is labeled with the color setκ, defined as the complement of κ in the set of D 1 + colors. Recall that under duality d-cells are mapped to d-cells in such a way that the relationship 'is a subcell of' is reverted. It is then easy to check that one indeed gets a simplicial lattice with the right coloring: each of the subsimplices of a given simplex with color set κ is labeled by a nonempty subset of κ.
The above applies to closed D-manifolds, but of interest here are punctured D-colexes. They are obtained by starting from a D-colex on a D-sphere and removing a single vertex, together with all the cells that contain it. In the dual simplicial lattice this means removing a D-simplex together with all of its subsimplices, giving rise to the simplex collections d Δ of the main text. But some of the simplices in d Δ have subsimplices that are not in any of the d Δ . The simplicial lattice M of the main text is recovered by keeping instead only those simplices that still retain all their subsimplices.
All this is illustrated for D = 2 in figure B1, where M (shaded), its closed spherical version and the corresponding punctured colex are compared. It is apparent that the colex picture allows a more easy visualization of the code, with qubits placed at vertices. Notice that in the D-colex perspective the generators of stabilizer and gauge group correspond to the following geometrical objects: for a (d, e) gauge color code X stabilizer generators are d (¯1) + -cells, Z stabilizer generators are e (¯1) + -cells, X gauge generators are e ( 1) + -cells and Z gauge generators are d ( 1) + -cells. Another interesting point is that when we describe color codes by giving M it is obvious what the simplest example is: that in which the triangulation of M is composed of just a single D-simplex that coincides with M itself. From the colex perspective this corresponds to a punctured D-colex that, without the vertex removed, is the boundary of a D ( 1) + -cube. It suffices to color parallel edges of the cube with the same color to get the colex structure, which is thus a D-sphere as required. The dual simplicial picture of this simplest case serves as a pattern for the combinatorial prescription given in the main text for 'closing' a generic triangulation of M by adding extra simplices: it shows that the prescription indeed produces a D-sphere as stated.
Appendix C. Perfect colexes C.1. Motivation The result (24) was already proven in [14] for conventional color codes in the special case T = ∅, i.e. when the same rotation is applied to all physical qubits. Generalizing slightly to the subsystem case, this means that the result hinged on gauge generators X S i satisfying and r is one of the colors in i κ κ − . The left hand side is the total number of such pairs. The right hand side is the maximum number of pairs that we could form with such r, which cannot be shared by the m cells c i and therefore can appear at most m 1 − times. Thus the Figure B1. A punctured 2-colex with faces colored with their complementary/dual color (right) compared to the corresponding triangulation of a sphere (left). Duality is explicit in the central figure. inequality, which can be restated as Going back to (C1), the case m = n will be satisfied if and only if the intersection is composed of cells of dimension at least 1. For this to hold, the right hand side of (C4) hast to be greater or equal than one, i.e. the inequality (24) must hold. Naturally, the conditions (C1) must be satisfied also for m n < , but when (24)  In [14] the problem of the existence of perfect colexes was left open. The rest of this appendix is devoted to show that one can always obtain a perfect colex from a generic one by transforming the lattice in the neighborhood of a collection of vertices T. The next appendix in turn shows that the actual substitution of the generic colex by its perfect counterpart is unnecessary. Rather, a transversal R n is recovered by inverting the rotation at those qubits in the set T.

C.2. Construction
Crucial to the construction of perfect colexes are the 'simplest' colexes described in the previous appendix, which are perfect. Recall that the boundary of a D ( 1) + -hypercube is a D-colex, from which the 'simplest' punctured D-colex is obtained by removing a vertex and all the cells containing it. Here instead we consider removing a small neighborhood of a vertex, so that we are left with a D-dimensional ball that contains 2 1 D 1 − + vertices and in which all 'complete' d cells have 2 d vertices, while the 'incomplete' ones are lacking the removed vertex and thus keep only 2 1 d − . The procedure to make a generic colex into a perfect one involves substituting the neighborhood of each of the vertices in a collection T by such D-balls, as in figure C1 (this is actually a connected sum with a neat combinatorial description, see [12]). Therefore, a given d cell c with vertex set V c in the original colex gives rise to a d-cell c′ with vertex set V c′ such that ( ) All the new d-cells added to the colex have 2 d vertices.
The procedure is generically valid only for either spherical D-colexes, which yield trivial codes, or punctured D-colexes, which are the ones of interest here. Notice however that in order for the above to make sense we need to be sure that every vertex has the right kind of neighborhood, which is true in the bulk but not on the boundary for the punctured colex. Fortunately this is not an important issue. Indeed, it suffices to make the colex into an spherical one by adding a 0-cell in the usual way, perform the changes at T vertices, and then remove the added vertex together with all the cells that contain it.
It might be worth describing the dual picture, in which T is a set of D-simplices. Each simplex in T is divided in 2 1 D 1 − + pieces: there are D 1 + new vertices, and for each color set κ with D 0 1 κ < | | < + there is a new Dsimplex that has as vertices (i) the new vertices with labels κ and (ii) the vertices of the removed simplex with colors inκ. Figure C1 illustrates the dual picture for D = 2. Notice that this is nothing but the construction that was already used in the main text to 'close' M to form a sphere.
It is convenient to first consider the D = 2 case. Figure C2 illustrates the procedure in a 2-colex for which T is composed of a single element, i.e. it is enough to substitute the neighborhood of a single vertex. In the original 2-colex there are 3 faces that have 6 vertices. In the transformed one, each of these faces has gained 2 vertices, so that they have 8 0 mod 4 ≡ vertices, as required. First, every such d ( 1) + -cell has a boundary that is a spherical d-colex. From this spherical d-colex one can build a new 'shrunk' d-dimensional lattice by shrinking all the d-cells with a given color set κ to a point [12]: • The 0-cells of the shrunk lattice correspond to d-cells with color set κ, or κ-cells, of the d-colex.
• The 1-cells of the shrunk lattice correspond to 1-cells of color r of the d-colex, or r-cells, where r is the only color with r κ ∈ .
• The 2-cells of the shrunk lattice correspond to 2-cells with color sets κ′ such that r κ ∈ ′. In particular, the shrunk 2-cell has an even number of 1-cells in its boundary because the original 2-cell has 0 mod 4 1-cells and half of them are r-cells.
Since the homology of the sphere is trivial and all the 2-cells have an even number of edges, the graph formed by the 0-cells and 1-cells of the shrunk lattice is bipartite. Indeed, any closed path must have an even number of vertices and edges because (i) as a Z 2 1-chain it has no boundary and thus must be a sum of boundaries of 2-cells and (ii) the sum of 1-chains with an even number of edges must have an even number of edges.
Therefore, the set of κ-cells in the d-colex is the disjoint union of two sets A and B, and every r-cell in the dcolex shares a vertex with exactly one element of the set A. Since every κ-cell in A has 0 mod 2 d vertices, it follows that there are 0 mod 2 d r-cells and therefore 0 mod 2 d 1 + vertices in the d-colex (every vertex belongs exactly to one r-cell, and each r-cell has 2 vertices).