Unfolding the color code

The topological color code and the toric code are two leading candidates for realizing fault-tolerant quantum computation. Here we show that the color code on a d-dimensional closed manifold is equivalent to multiple decoupled copies of the d-dimensional toric code up to local unitary transformations and adding or removing ancilla qubits. Our result not only generalizes the proven equivalence for d = 2, but also provides an explicit recipe of how to decouple independent components of the color code, highlighting the importance of colorability in the construction of the code. Moreover, for the d-dimensional color code with d + 1 ?> boundaries of d + 1 ?> distinct colors, we find that the code is equivalent to multiple copies of the d-dimensional toric code which are attached along a ( d − 1 ) ?> -dimensional boundary. In particular, for d = 2, we show that the (triangular) color code with boundaries is equivalent to the (folded) toric code with boundaries. We also find that the d-dimensional toric code admits logical non-Pauli gates from the dth level of the Clifford hierarchy, and thus saturates the bound by Bravyi and König. In particular, we show that the logical d-qubit control-Z gate can be fault-tolerantly implemented on the stack of d copies of the toric code by a local unitary transformation.


I. INTRODUCTION
Quantum error-correcting codes [1,2] are vital for fault-tolerant realization of quantum information processing tasks.Of particular importance are topological quantum codes [3,4] where quantum information is stored in non-local degrees of freedom while the codes are characterized by geometrically local generators.An essential feature of such codes is to admit a fault-tolerant implementation of a universal gate set as this would guarantee that the physical errors propagate in a benign and controlled manner.Thus, the search for novel quantum error-correcting codes and the classification of fault-tolerantly implementable logical gates in these codes have been central problems in quantum information science [5][6][7][8][9].
The quest of analyzing topological quantum codes is also closely related to the central problem in quantum many-body physics, namely the classification of quantum phases [10,11].A fruitful approach is to view topological quantum codes as exactly solvable toy models which correspond to representatives of gapped quantum phases.This approach has led to a complete classification of translation symmetric two-dimensional stabilizer Hamiltonians [12,13], as well as to the discovery of a novel three-dimensional topological phase which does not fit into previously known theoretical framework [14,15].Topological color codes [16] are important examples of topological stabilizer codes that admit transversal implementation of a variety of logical gates, which may not be faulttolerantly implementable in other topological stabilizer codes.In two spatial dimensions, the color code admits transversal implementation of all the Clifford logical gates.In three and higher dimensions, the color code admits transversal implementation of non-Clifford logical gates [17].A naturally arising question is to identify the physical properties allowing to extend the set of transversally implementable logical gates with respect to other topological codes.
Given two codes with different sets of fault-tolerantly implementable logical gates, one may naturally expect that they correspond to different topological phases of matter.However, physical properties of color codes and toric codes are known to be very similar.For instance, both of the codes have logical Pauli operators with similar geometric shapes, which leads to essentially identical braiding properties of anyonic excitations from the viewpoint of long-range physics.Furthermore, it has been proven that translation symmetric stabilizer codes, supported on a two-dimensional torus, are equivalent to multiple decoupled copies of the two-dimensional toric code up to local unitary transformations and adding or removing ancilla qubits [12].This result implies that the two-dimensional color code supported on a torus is equivalent to two decoupled copies of the toric code, and thus they belong to the same quantum phase [18].
However, the aforementioned results do not consider the effect of boundaries on the classification of quantum phases [19][20][21].In fact, the color code admits transversal implementation of computationally useful logical gates only if it is supported on a system with appropriately designed boundaries.Perhaps, the presence of boundaries may render additional computational power to topological quantum codes and may result in richer structure of topological phases of matter.Complete understanding of the relation between the color code and the toric code will be the necessary first step to clarify the connection between boundaries and achievable fault-tolerant logical gates, and its implication to the classification of quantum phases.

A. Summary of main results
In this paper, we establish a connection between the color code and the toric code in the presence or absence of boundaries, and study fault-tolerantly implementable logical gates in these two codes.Our first result, presented in Section II, focuses on the equivalence between the color code and the toric code on d-dimensional lattices without boundaries, d ≥ 2.
Result 1 (Closed manifold).The topological color code on a d-dimensional closed manifold (without boundaries) is equivalent to multiple decoupled copies of the d-dimensional toric code up to local unitary transformations and adding or removing ancilla qubits.This extends the known results from [12,13,18] to the family of color codes in arbitrary dimensions.While previous results are limited to either translation symmetric systems or do not provide an explicit method of transformations, we provide an specific construction of how to decouple the color code defined on an arbitrary d-dimensional manifold into multiple decoupled toric code components.The recipe emphasizes the importance of colorability in the construction of the color code.Our result implies that the topological color code and the toric code belong to the same quantum phase according to the definition widely accepted in condensed matter physics community [11].
In Section III, we analyze the d-dimensional topological color code with boundaries.The second result concerns the equivalence for systems with boundaries.In two dimensions, we find that the (triangular) color code with three boundaries is equivalent to the toric code with boundaries (i.e. the surface code) which is folded (see In particular, we find that transversal application of physical R d = diag(1, e 2πi/2 d ) phase gates on the d-dimensional topological color code is equivalent to the logical d-qubit control-Z gate acting on d copies of the toric code.Note that the d-qubit control-Z gate belongs to the d-th level of the Clifford hierarchy, but is outside of the (d − 1)-th level.Thus, a stack of d copies of the d-dimensional toric code saturates the bound by Bravyi and König on fault-tolerant logical gates which are implementable by local unitary transformations [22].
For a definition of the Clifford hierarchy, see [8,22,23] We believe that our findings will shed light on the techniques of code deformation [17] and lattice surgery [24,25], allowing for computation with less physical qubits, higher faulttolerant error suppression and shorter time.The ability to transform and relate different codes may turn out to be crucial in analyzing the available methods of computation with topological codes.In particular, we might be able to improve the decoding scheme for the color code proposed in Ref. [26], and generalize it to any dimensions.Also, our findings may lead to a systematic method of composing known quantum codes to construct new codes with larger set of fault-tolerant logical gates.Finally, an interesting future problem is to apply the disentangling unitary to the gauge color codes [27,28].
While the paper is written in a relatively self-contained manner, we assume some prior exposure to the construction of the topological color code.A pedagogical description of the color code has been given by one of the authors in Ref. [28].Our discussion mostly concerns the d-dimensional topological color code and the toric code with point-like excitations as it is the most interesting case from the viewpoint of transversal non-Clifford gates.For the sake of simplicity, we present proof sketches relying on many figures.Rigorous proofs require the language of algebraic topology [29,30], which might be technically challenging and could obscure the main ideas presented in the paper.Thus, we postpone them until the Appendix.

II. TOPOLOGICAL COLOR CODE WITHOUT BOUNDARIES
In this section, we show that the d-dimensional topological color code supported on a closed manifold is equivalent to multiple decoupled copies of the toric code.

A. Brief introduction to the color code and the toric code
We begin by briefly reviewing the construction of the topological color code and the toric code.The starting point to define either the toric code or the color code is a two-dimensional lattice L. We can think of L as a homogeneous cell 2-complex, i.e. a collection of vertices V , edges E and faces F , glued together in a certain way.In general, L can be defined on a manifold with boundaries, but in this section we restrict our attention to closed manifolds.
The toric code in two dimensions is defined on a lattice L by placing one qubit on every edge, and associating X-and Z-type stabilizer generators with vertices and faces of L, Here, X(e) and Z(e) denote Pauli X and Z operators on the qubit placed on the edge e; see Fig. 2(a) for an example.We denote such a code, as well as its stabilizer group by T C(L).
One can verify that X-and Z-type stabilizer generators commute.
The color code is defined on a lattice L, which satisfies two additional conditions: • valence -each vertex belongs to exactly three edges, • colorability -there is a coloring1 of faces of L with three colors, A, B and C, such that any two adjacent faces have different colors.
For instance, the honeycomb lattice satisfies the valence and colorability conditions; also see Fig. 2(b).In the case of the color code, we place one qubit at every vertex, and associate X-and Z-type stabilizer generators with every face of L, namely To verify that X-and Z-type stabilizers commute, one uses the valence and colorability conditions.We denote such a code, as well as its stabilizer group by CC(L).
We In the main body of the paper, we restrict our attention to the color code and toric code with point-like excitations, which significantly simplifies the discussion.In particular, the color code has X-and Z-type stabilizers associated with d-cells and 2-cells (faces), whereas the toric code has qubits placed on edges.We postpone the discussion of the general case until the Appendix.(b) The color code has qubits placed on vertices, and X-face and Z-face stabilizer generators.Note that the color code can only be defined on a 3-valent and 3-colorable lattice.

B. Equivalence in two dimensions
In this subsection, we prove that the two-dimensional color code supported on a closed manifold (without boundaries) is equivalent to two copies of the toric code.
Moreover, one can choose U to be where C represents the set of all faces in L colored with C, and U f is a Clifford unitary acting only on qubits of the face f .
Here, the tensor product T C(L A ) ⊗ T C(L B ) indicates that the stabilizer group can be factored into two independent stabilizer groups associated with two decoupled copies of the toric code on the lattices L A and L B .We shall refer to L A and L B supporting two decoupled copies of the toric code as shrunk lattices (see Refs. [31,32]).
As described in the theorem, the disentangling unitary transformation U has a tensor product structure, U = f ∈C U f .Thus, U is a local unitary transformation, and two systems belong to the same quantum phase.
The procedure of decoupling two copies of the toric code starting from the color code consists of three steps: Step 1: Let us pick a face f of L colored in C. Since L is 3-colorable and 3-valent, the face f has even number of vertices, 2n.Let us enumerate vertices of f in counter-clockwise order in such a way that the edge (1,2) between vertices 1 and 2 has color AC.We would like to find a unitary transformation U f of the Hilbert space H V of qubits placed on vertices into the Hilbert space H E of qubits placed on edges 2 such that some operators on H V are mapped into certain operators on H E .In particular, we would require the following mappings to hold where X j represents Pauli X operator on a qubit on the vertex j, while X (j,j+1) represents Pauli X operator on a qubit on the edge (j, j + 1) and 2n + 1 ≡ 1; similarly for Z j and Z (j,j+1) .The conditions imposed on U f by Eqs. ( 5)-( 8) for the face f with six vertices are illustrated in Fig. 3.
Transformation of the operators of the color code CC(L) supported on qubits of the face f colored in C under the disentangling unitary transformation U f .We claim that there exists a Clifford unitary U f which satisfies Eqs. ( 5)- (8).The proof of existence of such a unitary transformation is presented later.Note that under the unitary U f the operators on the qubits on vertices of f (up to the stabilizer 2n j=1 X j ) transform into the operators on the qubits placed on edges of f in the following way where parenthesis indicate that operators might be multiplied by the stabilizer 2n j=1 X j .
Step 2: Let us analyze what happens to the stabilizer generators CC(L) of the color code after performing Step 1 for each and every face of color C, i.e. after action of U = f ∈C U f by conjugation.Note that the stabilizer group CC(L) does not have a unique representation in terms of its generators -for instance, CC(L) can be generated by Y -and Z-type stabilizers associated with every face of L.
For a face f colored in C, the unitary U transforms the Z-face stabilizer on qubits on vertices into the Z-type operator on qubits on edges colored in AC.Similarly, the Yface stabilizer on vertices is transformed into the Z-type operator on qubits on edges of f colored in BC.For a face f colored in A (respectively B), the unitary U transforms the Z-face stabilizer on vertices (up to multiplication by X-face stabilizers on faces of color C neighboring f -this depends on the choice of U in Step 1) into the Z-type operator on qubits on edges of f colored in AC (respectively BC).On the other hand, the X-face stabilizer is transformed into the X-type operator on qubits on edges radiating out of f , which are colored in BC (respectively AC).Fig. 4 summarizes how the stabilizers of the color code transform under U described in Fig. 3.The parenthesis to the left indicate that the stabilizer of the color code might be multiplied by the X-face stabilizers on neighboring faces of color C, depending on the disentangling procedure, i.e. the choice of U .
One can observe that after performing U = f ∈C U f , the Z-type stabilizers on faces of color A and C, as well as the X-type stabilizers on faces of color B transform into Z-and X-type stabilizers, respectively, on qubits on AC edges.Similarly, the Y -type stabilizers on faces of color C, the Z-type stabilizers on faces of color B, and the X-type stabilizers on faces of color A transform into stabilizers on qubits on BC edges.
We conclude that after performing U , the stabilizer generators CC(L) transform into two sets of stabilizer generators T C(L A ) and T C(L B ) supported on two disjoint sets of qubits, either placed on BC or AC edges.

( (
The effect of applying the disentangling unitary transformation U to the stabilizer group of the color code CC(L).The parenthesis indicate that the stabilizer of the color code might be multiplied by the X-face stabilizers on neighboring faces of color C, depending on the disentangling procedure.
Step 3: We would like to show that the stabilizer generators T C(L A ) and T C(L B ) define the toric code on two lattices, L A and L B , obtained from L by local deformations.A recipe for the shrunk lattice L A is as follows: • Vertices of L A are centers of A faces in L.
• Edges of L A are BC edges in L.
• Faces of L A are B and C faces in L.
In short, one obtains L A by shrinking A faces to points while expanding B and C faces.[31,32].Similarly, L B is obtained by shrinking B faces.Examples of shrunk lattices are depicted in Fig. 5 for the case of the hexagonal lattice L. In this case, one obtains two copies of the toric code supported on triangular lattices.
The stabilizer generators T C(L A ) and T C(L B ) are supported on either L A or L B lattices.
In particular, Note that the equivalence between the two-dimensional color code and copies of the toric code has been proven for systems with translation symmetries [12,18].Our work not only generalizes the previous results to the color code on an arbitrary lattice L on a closed manifold, but also presents an explicit construction of the local unitary and shrunk lattices.This leads to new observations for topological color codes with boundaries, which are presented in Section III.

C. Isomorphism between Pauli subgroups
In this subsection, we prove the existence of the disentangling unitary transformation U = f ∈C U f .We begin by developing some useful technical tool concerning properties of subgroups of the Pauli operator group.Consider a system of n qubits and two subgroups of where Pauli(n) is the Pauli operator group on n qubits.
We shall neglect complex phases in O 1 , O 2 .We say that O 1 and O 2 are isomorphic to each other iff there exists a Clifford unitary transformation U such that Let Z(O 1 ) and Z(O 2 ) be centers of O 1 and O 2 , respectively.Then, the following lemma holds [33]: where G(O) represents the number of independent generators of O ⊂ Pauli(n).
Let {g j } and {h j } be two sets of independent generators for two isomorphic groups O 1 and O 2 .We say that {g j } and {h j } have the same commutation relations if Note that c i,j = c j,i and c i,i = 0. We have the following lemma.
Lemma 2 (Clifford Transformation).Let O 1 and O 2 be two isomorphic groups generated by two sets of independent generators, {g j } and {h j }.If {g j } and {h j } have the same commutation relations, then there exists a Clifford unitary transformation U such that Proof.Let us find a canonical set of independent generators for O 1 : where n 2 ≥ n 1 , and two Pauli operators A i and A j commute unless they are in the same column, in which case they anti-commute by definition.Note that any canonical generator can be written as a product of generators {g j }.
For a binary vector a = (a 1 , . . ., a n 1 +n 2 ), we define Then, there exists a set of independent n 1 + n 2 binary vectors a (i) such that ).Since commutation relations of {g j } and {h j } are identical, then B j are canonical generators for O 2 : Then, as shown in Ref. [33], there exists a Clifford unitary U such that Such a unitary transformation also satisfies which completes the proof of the (Clifford Transformation) Lemma 2 We are ready to show the existence of a Clifford unitary U f , which satisfies the rules in Eqs. ( 5)- (8).First, let us introduce the notion of the overlap group of the stabilizer group [33].For a given subset of qubits, denoted by Q, the overlap group on Q is defined as the group generated by the restriction of generators of the stabilizer group S onto Q. Namely, where u| Q represents a restriction of u onto Q (see Fig. 6).Note that the overlap group is not necessarily Abelian and is defined up to a global phase.
The key idea in the proof of existence of U is that the overlap groups for the color code and the toric code for the set of C faces are isomorphic.In particular, let us consider a C face f ∈ L with 2n vertices, and two corresponding faces f A ∈ L A and f B ∈ L B derived from f .Then, the overlap group of CC(L) on f is generated by whereas the overlap group of T C(L A ) and T C(L B ) on f A f B is generated by Observe that both O f and O f A f B have 4n − 2 independent generators and their centers are generated by 2 independent operators.Namely, Using the (Isomorphic Groups) Lemma 1, we obtain that O f and Let us choose a set of independent generators for O f as follows We then label a set of independent generators for O f A f B in the following way By direct calculation one can verify that {g j } and {h j } have the same commutation relations.
Thus, from the (Clifford Transformation) Lemma 2, there exists a Clifford unitary U f such that Therefore, the local Clifford unitary , and this concludes the proof of the Theorem 1.
One might find the labelings in Eqs. ( 25)- (29) arbitrary.Yet, once we have chosen g j for j = 1, . . ., 2n, it is not difficult to find the right labeling for j = 2n + 1, . . ., 4n − 2 by checking the commutation relations.Note that the choice of g 2n = 2n j=1 X j Z 2n Z 1 is crucial to ensure that the generators {g j } 2n j=1 are independent.

D. Three (or more) dimensions
A similar equivalence between the topological color code and the toric code holds in any dimensions.It can be summarized in the following theorem.
where S represents the stabilizer group of decoupled ancilla qubits, and T C(L j ) -the stabilizer group of the toric code defined on the shrunk lattice L j derived from L by local deformations, i.e. shrinking d-cells of color C j .Moreover, one can choose the disentangling unitary U to be of the form where C 0 is the set of d-cells of color C 0 in L, and U c is a Clifford unitary acting only on qubits on vertices of the d-cell c.
Note that the color code qubits are placed on vertices, whereas the toric code qubitson edges.Thus, for every d-cell c colored in C 0 , we shall add E − V ancilla qubits, where V and E denote the number of vertices and edges in c.We can assume that ancilla qubits are stabilized by single-qubit Pauli Z operators.Since the lattice L is (d + 1)-valent, then In particular, ancilla qubits are required for the threeor higher-dimensional case.
Since the color code and the toric code in d dimensions support anyonic excitations whose braiding properties are similar (there exists an isomorphism between anyon labels for two codes), the equivalence should not be very surprising.Yet, our result may be of interest from the viewpoint of finding topological invariants to classify topological phases.It has been argued that two topologically ordered systems with isomorphic anyon labels and modular matrices belong to the same topological phase [11,34,35].This hypothesis has been proven for two-dimensional stabilizer Hamiltonians with translation symmetries [12].Also, this hypothesis has been tested for the two-dimensional Levin-Wen model in Ref. [20], where a construction of a transparent domain wall between two Levin-Wen models (with tensor unitary categories satisfying certain equivalence conditions) was presented.
The idea of the mapping is a straightforward generalization of the proof of the Theorem 1 presented in Section IIB.First, we perform a local Clifford unitary, whose existence is guaranteed by the (Clifford Transformation) Lemma 2.Then, we analyze how the stabilizer generators of the color code transform under such a unitary.Finally, we check that the stabilizers can be split into d sets, each of them defining a copy of the toric code on a lattice obtained by deforming the initial lattice L. For the sake of clarity, we focus on d = 3.We also first present the construction of shrunk lattices, before explaining how to construct a local Clifford unitary transforming the color code into d decoupled copies of the toric code.
In three dimensions, the lattice L has volumes colored with four colors, A, B, C and D.
Recall that we can assign colors to faces and edges, too.Namely, a face has two colors of two volumes it belongs to, whereas an edge has three colors (of three volumes it belongs to).
We obtain three shrunk lattices, L A , L B and L C by shrinking volumes of color A, B and C, respectively.In particular, L A consists of • vertices -centers of A volumes in L, • edges -BCD edges in L, • faces -BC, BD and CD faces in L, • volumes -B, C and D volumes in L.
For an example, see Fig.We construct the disentangling unitary U as a tensor product of local Clifford unitaries, Let H V (C 2 ) ⊗V and H E (C 2 ) ⊗E be the Hilbert spaces of qubits placed on vertices and edges, respectively.Since E − V > 0, we need to add E − V ancilla qubits to qubits on vertices to match the dimensionality of Hilbert spaces, H V ⊗ H ancilla H E , where H ancilla is the Hilbert space of ancilla qubits.Let S c = Z i | ∀i ∈ {1, . . ., E − V } be the stabilizer group of the ancilla qubits, where Z i is the Pauli Z operator acting on the ancilla qubit i.
We would like to construct a Clifford unitary U c which maps the group O CC ⊗S c of operators on the Hilbert space H V ⊗ H ancilla into the group of operators on H E according to the rules The parenthesis indicate that the mapping holds up to multiplication by the elements of the , denoted by {g i } V −1 i=1 , supported on edges of a spanning tree T ⊂ E of the graph G = (V, E).In the case of operators of type there are exactly two independent relations between them, namely where the products are taken over all X-face operators associated with faces of c of color AD, BD, and CD, respectively.Thus, there are F − 2 independent X-face operators.We i=V to be X-face operators, associated with all faces of c but three -one of each color AD, BD and CD.We also set g i=V +F −2 for ancilla qubits, there are independent generators of O CC , and thus then In the case of O T C , there are E independent generators of type . Observe that there are only three independent relations between generators of type ( ( There are 2F operators of type as follows i=1 -single qubit Pauli Z operators on qubits placed on edges associated with the spanning tree T , By applying the disentangling unitary transformation U = c∈C 0 U c to the stabilizer group CC(L) of the color code and the stabilizer group S = c∈C 0 S c of ancilla qubits, one obtains the stabilizer groups of the toric code supported on d decoupled lattices L 1 , . . ., L d , namely which concludes the proof of the (Equivalence) Theorem 2.

III. TOPOLOGICAL COLOR CODE WITH BOUNDARIES
Realistic physical systems have boundaries.Moreover, the transversal implementability of logical gates in the topological color code crucially depends on the choice of boundaries.
In this section we show that the color code defined on a d-dimensional lattice with d + 1 boundaries of d+1 distinct colors is equivalent to d copies of the toric code attached together at a (d − 1)-dimensional boundary.We also briefly describe how the choice of boundaries of the color code determines if the copes of the toric code are attached or decoupled.We then discuss such boundaries from the viewpoint of condensation of excitations.

A. Physical intuition behind folding
We begin with presenting some physical intuition why the toric code with two smooth  argument presented in Ref. [9].
We note that if the logical Hadamard is transversal, then both logical X and Z operators must have representations which are supported on overlapping regions.By folding the toric code, both logical X and Z operators can be supported on overlapping regions, as shown in Fig. 8(b).Thus, for the logical Hadamard to be transversal folding of the toric code is indeed necessary.

B. Unfolding in two dimensions
We now return to the analysis of the topological color code CC(L) supported on a (3-valent and 3-colorable) two-dimensional lattice L with the Euler characteristic 5 χ and the boundary ∂L = n i=1 ∂L i , where ∂L i is the (maximum) connected component of the boundary ∂L of certain color.For conciseness, we simply refer to ∂L i as a boundary.We say that the boundary ∂L i is of color C 1 if all the faces adjacent to ∂L i have colors C 2 and C 3 , where {C 1 , C 2 , C 3 } = {A, B, C}.One can show that the color code CC(L) encodes n − 2χ logical qubits.In particular, one important case corresponds to the triangular color code (with three boundaries of color A, B and C as shown in Fig. 9(a); see also Fig. 8(b)), which encodes one logical qubit regardless of the system size, and has transversal logical Hadamard H and the phase gate R 2 .
We would like to understand how the color code CC(L) with boundaries transforms under the disentangling unitary U = f ∈C U f described in Section IIB.In the bulk, the disentangling unitary U transforms the stabilizers of the color code into stabilizers of the toric code supported on two decoupled lattices L A and L B , obtained from L by shrinking faces of color A and B, respectively.On the other hand, the stabilizers of the color code supported on qubits near the boundaries may transform into stabilizers supported on both shrunk lattices L A and L B , depending on the colors of ∂L.In general, we cannot transform the color code CC(L) into the toric code supported on two decoupled lattices, T C(L A ) ⊗ T C(L B ).
Rather, the toric code is defined on a lattice L A #L B obtained by attaching6 L A and L B , i.e. identifying some of their boundaries.Namely, In the rest of this subsection we analyze the triangular color code (see Fig. 9), but the discussion is applicable to the color code on any homogeneous cell 2-complex with boundary, which is 3-colorable and 3-valent.-no open edges (smooth boundary), • on the boundary ∂L C : since the disentangling unitary U does not affect the qubits placed on vertices belonging to ∂L C , both lattices L A and L B share these qubits.

@L
obtained by attaching three shrunk lattices along the boundary ∂L D .We then obtain where S is the stabilizer group of the ancilla qubits.Note that U does not transform qubits on vertices belonging to the boundary ∂L D .
Let us have a closer look at the shrunk lattices and the identified boundary.L i has one rough boundary ∂L i , and two smooth boundaries ∂L j and ∂L k , where {i, j, k} = {A, B, C} The discussion here can be straightforwardly generalized to d dimensions, yielding the equivalence between the color code and the toric code with boundaries.We conclude with the following theorem.
Theorem 4 (Attaching).Let CC(L) be the color code on a d-simplex-like lattice L with d + 1 boundaries ∂L 0 , . . ., ∂L d , where ∂L i has color C i .Then, there exists a local Clifford unitary U = c∈C 0 U c (described in Section IID) such that where S is the stabilizer group of the ancilla qubits.The toric code T C(# d i=1 L i ) is defined on the lattice # d i=1 L i obtained by attaching lattices L 1 , . . ., L d along the boundary ∂L 0 , where L i is derived from L by shrinking d-cells of color C i , and has one rough boundary, ∂L i .

D. Condensation of anyonic excitations
It is instructive to interpret the equivalence between the color code and the toric code with boundaries from the viewpoint of condensation of anyonic excitations.In the twodimensional toric code, the anyonic excitations are: electric e -a single violated X-vertex stabilizer, magnetic m -a single violated Z-face stabilizer, and fermionic = e × m -a composite excitation obtained by fusing e and m.The label 1 corresponds to the vacuum (no excitations).
The gapped boundaries of two-dimensional systems are classified by maximum sets of mutually bosonic excitations which may condense [20,37,38].In the case of a single layer of the toric code, possible sets of anyons which may condense on the boundaries are {1, e} and {1, m}.Note that has fermionic self-statistics and thus cannot condense on the gapped boundaries.The sets {1, e} and {1, m} correspond to rough and smooth boundaries, respectively [19].On the other hand, the folded toric code has three boundaries (see Fig. 8(b)).If we denote by e i , m i and i the excitations in the front (i = 1) and rear (i = 2) layer of the folded toric code, then we can associate the boundaries with the sets of condensing anyons.Namely, As depicted in Fig. 13(a), two electric charges e 1 and e 2 created on boundaries ∂L A and ∂L B can be jointly annihilated (or created) on By associating the boundaries with the sets of condensing anyons we can find the correspondence between anyonic excitations in the toric code and the color code.We can label excitations in the color code by i P , where P ∈ {X, Z} indicates the type of the violated stabilizer, and i ∈ {A, B, C} indicates the color of the face associated with the violated stabilizer.Observe that not all six excitations are independent.For instance, a single qubit Pauli X operator on a vertex v creates excitations, A Z , B Z and C Z , on three neighboring faces sharing v.This implies that in the bulk the following fusion channels exist Note that excitations i X and i Z can only condense on the boundary ∂L i .This leads to the following isomorphism between labels of anyonic excitations of the toric and color codes In d > 2 dimensions, the excitations of the color code are point-like electric charges and (d − 1)-dimensional magnetic fluxes.Let us first focus on condensation of electric charges.
We find that the boundaries of the d-dimensional color code on a d-simplex-like lattice are given by (See Fig. 13 for two-and three-dimensional examples).Yet, none of the magnetic fluxes can individually condense on the boundary ∂L 0 .Rather, any pair of fluxes can condense on ∂L 0 , and thus we might think of the fluxes as being equivalent.To sum up, we find the following condensations of (d − 1)-dimensional magnetic fluxes: One may observe that, as expected, the set of condensing magnetic and electric excitations on every boundary is mutually bosonic.
We would like to emphasize that while the gapped boundaries in (2 + 1)-dimensional TQFTs have been throughly classified [20,21], the understanding of the gapped boundaries in higher-dimensional TQFTs is still incomplete.Characterization of condensing anyonic excitations in the color code may provide instructive examples helping with classification of the gapped boundaries in higher-dimensional TQFTs.Namely, different boundaries of various colors in the color code may lead to a rich variety of gapped boundaries in the corresponding toric code models.Moreover, logical action of the transversal R n operator on the code space crucially depends on the choice of boundaries in the color code.Thus, one may be able to characterize gapped boundaries by analyzing the logical action of transversal operators, and vice versa.

IV. TRANSVERSAL GATES
We have seen that the color code is equivalent to (multiple copies of) the toric code, both in the presence or the absence of boundaries.Our findings hint that there might be Here, we adopt a convention that R d denotes a transversal operator implemented by physical where S is the stabilizer group of the ancilla qubits and the lattice L i is derived from L by shrinking d-cells of color C i .Moreover, L i is a d-hypercube-like lattice with two rough boundaries which are perpendicular to the direction î and all the other boundaries smooth.
Thus, for i = 1, . . ., d, the toric code T C(L i ) encodes one logical qubit, with a string-like logical Z operator in the direction î, and a (d − 1)-dimensional membrane-like logical X operator perpendicular to î.
With the above choice of boundaries, R d does not implement the logical R d gate in the code space.One verifies this by observing that R d 2 = I in the code space of the color code.
Rather, we find that R d implements the logical d-qubit control-Z gate on the stack of d copies of the toric code.(Note that a similar observation holds for the color code supported on a hypercubic lattice with periodic boundary conditions).We devote the rest of this section to describe this finding.

B. Transversal d-qubit control-Z gate in the toric code
We discuss the two-dimensional case first.The topological color code on a square-like lattice L with four boundaries of color C 1 and C 2 encodes two logical qubits (see Fig. 15(a)).
Note that the disentangling unitary U (see Eq. ( 57)) transforming the color code CC(L) Z (1)  rough smooth into two decoupled copies of the toric code, T C(L 1 ) and T C(L 2 ), defines an isomorphism between logical operators of the former and the latter (see Fig. 15).Namely, where P 1 ⊗P 2 denotes an operator which acts as a logical P 1 operator on the first copy T C(L 1 ) of the toric code, and as P 2 on the second copy T C(L 2 ).Thus, one can immediately deduce the effect of U R 2 U † on logical operators of T C(L 1 ) and T C(L 2 ) This implies that the action of R 2 in the color code is equivalent (up to the local Clifford unitary U ) to the logical control-Z gate between two copies of the toric code.
Let us consider d-dimensional case, d ≥ 2. The d-qubit control-Z gate is a generalization of the control-Z gate and is defined in the computational basis as Note that the action of C ⊗d−1 Z does not depend on the choice of control qubits.Moreover, C ⊗d−1 Z belongs to the d-th level of the Clifford hierarchy but is outside the (d − 1)-th level, which can be seen from the following relations where the commutator is defined as K We label logical X and Z operators in the color code by X (i) and Z (i) for i = 1, . . ., d.
Namely, Z (i) is a string-like logical operator parallel to the direction î (i.e.connecting two opposite boundaries of color C i ) and X (i) is a (d − 1)-dimensional membrane-like logical operator perpendicular to the direction î.We define the operator R i recursively for i = d − 1, . . ., 1 as follows . . .(66) Note that the above relations hold for any permutation of colors C 1 , . . ., C d .Let X j and Z j be logical X and Z operators in the toric code T C(L j ).Then, the following correspondence holds where X(σ) is the Pauli X operator on a qubit placed at σ; similarly Z(σ).
The toric code is a stabilizer code with the stabilizer group T C k (L) defined on a homogeneous cell d-complex L, where k ∈ {1, . . ., d − 1}.One qubit is placed at each and every k-cell in L, and X-and Z-type stabilizer generators are associated with (k + 1)-and (k − 1)-cells in the following way In particular (see Eq. (D14) in Ref. [31]), where h i is the i-th Betti number of ∂c.Since ∂c is homomorphic to a (d − 1)-sphere, then

Result 2 (FIG. 1 .
FIG. 1.The topological color code (a) with three boundaries ∂L A , ∂L B and ∂L C viewed as the folded toric code (b) with two smooth and two rough boundaries.The boundary ∂L A of color A is equivalent to a pair of boundaries -smooth in the front and rough in the rear layer; similarly ∂L B .The boundary ∂L C is the fold.

Fig. 1 )
Fig. 1).For d > 2, we find that the color code with d + 1 boundaries of d + 1 distinct colors is equivalent to d copies of the toric code which are attached along a (d − 1)-dimensional boundary.On this (d − 1)-dimensional boundary, a composite electric charge composed of all d electric charges from the different copies of the toric codes may condense.Other boundaries are decoupled and allow condensation of a single electric charge associated with a specific copy.In Section IV, we study non-Clifford logical gates fault-tolerantly implementable in the d-dimensional toric code.Our third result concerns the implementability of the d-qubit control-Z gate, i.e. a gate which applies −1 phase only if all d qubits are in |1 state.Result 3 (Logical gate).A stack of d copies of the d-dimensional toric code with point-like logical excitations admits fault-tolerant implementation of the logical d-qubit control-Z gate by local unitary transformations.
can generalize the definition of the toric code and the color code to d dimensions by considering a d-dimensional lattice (i.e. a homogeneous cell d-complex) L. There are d − 1 different ways of defining the toric code on L -place qubits on m-cells, m = 1, 2, . . ., d − 1, and associate X-and Z-type stabilizer generators with (m−1)-and (m+1)-cells, respectively.In the case of the color code, the additional conditions are that L is (d + 1)-valent and its dcells are (d+1)-colorable.There are d−1 ways of defining the color code on L -place qubits on vertices, and associate X-and Z-type stabilizer generators with m-and (d + 2 − m)-cells, where m = 2, 3, . . ., d.For a rigorous definition of the toric code and the color code in d dimensions see the Appendix.

FIG. 2 .
FIG. 2. (Color online) The toric code and the color code in two dimensions.(a) The toric code has qubits (red dots) placed on edges, and X-vertex (green) and Z-face (blue) stabilizer generators.

Theorem 1 .
Let CC(L) be the two-dimensional topological color code defined on a lattice L without boundaries, colored in A, B and C.There exists a local Clifford unitary U , and two lattices L A and L B obtained from L by shrinking faces of color A and B, respectively, such that

1 .
performing certain local unitary U f at each and every face f of color C in L, 2. checking that the stabilizer generators CC(L) are mapped by U = f ∈C U f into two set of generators T C(L A ) and T C(L B ) supported on disjoint sets of qubits, 3. visualizing two codes T C(L A ) and T C(L B ) as codes defined on lattices L A and L B obtained from L by local deformations.

FIG. 5 .
FIG. 5. (Color online) Fragments of the shrunk lattices: (a) L A and (b) L B , obtained from L by shrinking A and B faces, respectively.Qubits are placed on edges, and the stabilizer generators are X-vertex and Z-face operators.

QFIG. 6 .
FIG.6.The overlap group of the stabilizer group S on the region Q is defined as the group generated by the restriction of the generators of S onto Q. Dotted circles represent the stabilizer generators of S with support intersecting Q.

Theorem 2 (
Equivalence).Let CC(L) be the stabilizer group of the topological color code defined on a d-dimensional lattice L without boundaries, which is (d + 1)-valent and colored with C 0 , . . ., C d .Let X-and Z-type stabilizer generators be supported on d-cells and 2-cells, where d ≥ 2.Then, there exists a local Clifford unitary U such that

7 .
FIG. 7. (Color online) (a) The boundary ∂c of a volume c of color D in the lattice L. Note that ∂c can be viewed as a 3-colorable and 3-valent lattice on a closed manifold (a sphere), with faces colored in AD, BD and CD.(b) A volume in the shrunk lattice L A derived from c after shrinking volumes of color A. Note that qubits are placed on (a) vertices and (b) edges.The figures were created using Robert Webb's Stella software (http://www.software3d.com/Stella.php).
where D is the set of all volumes of color D. Let us consider a volume c of color D. The overlap group O CC of the stabilizer group of the color code on c is generated by Z-edge operators and X-face operators, for each and every edge and face belonging to c. Namely, center Z(O CC ⊗ S c ).Let us analyze what happens to the stabilizer group of the color code and and the stabilizer group of ancilla qubits, CC(L) c∈D S c , after applying the unitary U = c∈D U c .One can verify that • X-vertex stabilizers of T C(L A ), T C(L B ) and T C(L C ) are obtained from X-volume stabilizers 4 in CC(L) of color A, B and C, respectively, • Z-face stabilizers in T C(L A ) are obtained from Z-face stabilizers 4 of color BD, CD and BC; similarly for T C(L B ) and T C(L C ), • the elements in the center Z(O CC ⊗ S c ) are mapped into the center Z(O T C ).Moreover, the generators of the group U CC(L) c∈D S c U † are supported on either L A , or L B , or L C , and thus one obtains three decoupled copies of the toric code.The last thing we need to justify is the existence of U c consistent with the rules in Eq. (35).We start with showing that O CC and O T C are isomorphic.Clearly, O CC , O T C ⊂ Pauli(n = E).First, let us look at the independent generators of O CC .Note that there are V − 1 independent operators of type and thus G(O T C ) = E + F − 3. Since the group O T C has single qubit Pauli Z operators as generators, the center Z(O T C ) can only be generated by Z-type operators, and they satisfy three independent relations, namely a product of all Z-face operators with qubits placed on edges not colored in i, for i ∈ {A, B, C}.Thus G(Z(O T C )) = 2F − 3 and using Euler characteristic for c, V − E + F = 2, generators of Z(O CC ⊗ S c ) and Z(O T C ) to the number of i-cells of c, for i = 0, 1, . . ., d, and the Betti numbers of c, we can prove G(Z(O CC ⊗ S c )) = G(Z(O T C )) (see the Appendix for more details).From the (Isomorphic Groups) Lemma 1 we obtain that O CC ⊗ S c and O T C are isomorphic.We then choose independent generators {g i } and {h i } of O CC ⊗ S c and O T C 1)-cell operators associated with all (d − 1)-cells of c except for d of them, namely one (d − 1)-cell for each colors C 0 C 1 , elements of the center of O T C chosen in such a way that all the operators {h i } are independent.One can verify that {g i } and {h i } have the same commutation relations.From the (Clifford Transformation) Lemma 2, there exists of a local Clifford unitary U c such that and two rough boundaries needs to be folded if one hopes for transversal non-Pauli logical gates such as the Hadamard gate H. Let us recall known results about gapped boundaries of the toric code.In two spatial dimensions, the toric code may have two types of boundaries, smooth and rough[19].The rough boundaries are defined as the boundaries with open edges (see Fig.8).Similarly to the toric code without boundaries, there are X-vertex and Z-face stabilizers, although Z-face stabilizers have to be modified along the rough boundaries.An X-type (Z-type) string-like logical operator can only start from and end on smooth (rough) boundaries.One says that the electric charge e, i.e. the violated X-vertex stabilizer, condenses on the rough boundary and the magnetic flux m, i.e. the violated Zface stabilizer, is confined since single e, unlike m, can be created or absorbed on the rough boundary.Similarly, m condenses and e is confined on the smooth boundary.Consider the two-dimensional toric code with two smooth and two rough boundaries as depicted in Fig.8(a).Since there is only one pair of anti-commuting logical operators, X and Z, the code encodes a single logical qubit.There is one crucial difference between the toric code and the color code (with boundaries) -the latter admits transversal implementation of the Hadamard gate H while the former does not.Recall that the Hadamard gate swaps Pauli X and Z operators.Suppose that the Hadamard gate can be implemented by a local unitary operator U .Let X and X be two equivalent implementations of the logical X operator, supported on string-like horizontal regions (see Fig.8(a)).Then, U XU † implements the logical Z operator, which has to anti-commute with X .On the other hand, since U is a local unitary, then U XU † and X have no overlap, and thus they commute, leading to a contradiction.We conclude that the logical Hadamard gate cannot be implemented by a local unitary operator in the toric code with boundaries.This is a simple version of the

FIG. 8 .
FIG. 8. (Color online) Origami of the toric code with boundaries.(a) Blue line, starting from and ending on rough boundaries, represents the logical Z operator.Green lines, starting from and ending on smooth boundaries, represent the logical X operator.(b) The color code with three boundaries, ∂L A , ∂L B and ∂L C , obtained by folding the toric code with two smooth and two rough boundaries.After folding, two logical operators X and Z are supported on overlapping regions.
Let us describe how to obtain the lattice L A #L B supporting the toric code.Recall that in the bulk, L A and L B are obtained from L by shrinking faces of color A and B. Let ∂L A , ∂L B and ∂L C be the boundaries of color A, B and C, respectively.We find that shrunk lattices L A and L B are decoupled along ∂L A and ∂L B , but are identified along ∂L C .In particular, • on the boundary ∂L A : the lattice L B has open edges (rough boundary), whereas L A -no open edges (smooth boundary), • on the boundary ∂L B : the lattice L A has open edges (rough boundary), whereas L B

FIG. 9 .FIG. 10 .
FIG. 9. (Color online) (a) The (triangular) color code on a two-dimensional lattice L with the boundary ∂L comprising of three components of color A, B and C, namely ∂L = ∂L A ∂L B ∂L C .Qubits are represented by dots.(b) A fragment of the lattice L A derived from L by shrinking faces of color A. The smooth boundary arises in L A on the boundary ∂L B .(c) A fragment of the lattice L B derived from L by shrinking faces of color B. The rough boundary arises in L B on the boundary ∂L B .
FIG. 11.(a) A tetrahedron-like lattice L with boundaries ∂L A , ∂L B , ∂L C and ∂L D .Three shrunk lattices: (b) L A , (c) L B , (d) L C derived from L. The shaded boundary represents the attaching boundary ∂L D .

FIG. 12
FIG. 12. (Color online) The identified boundary ∂L D of three shrunk lattices: (a) L A , (b) L B and (c) L C .The shrunk lattices are attached by identifying qubits on vertices of ∂L D .

FIG. 13 .
FIG. 13. (Color online) Condensation of electric charges in (a) two and (b) three dimensions.Observe that single electric charges can condense on all but one boundary, which is the identified boundary.On the identified boundary, a composite electric charge (a) e 1 e 2 and (b) e 1 e 2 e 3 can be created or annihilated.
non-trivial logical gates from the d-th level of the Clifford hierarchy in the d-dimensional toric code which admit fault-tolerant implementation.In this section, we show that one can implement by local unitary transformations the logical d-qubit control-Z gate on the stack of d copies of the d-dimensional toric code with point-like excitations.A. Transversal R d operator and boundariesLet us start with reviewing the transversal implementation of the physical phase gate R n = diag(1, e 2πi/2 n ) in the color code[28,39].Consider the topological color code CC(L) on a d-dimensional lattice L, which is (d + 1)-valent and (d + 1)-colorable.It is known that the graph G = (V, E) of vertices and edges of L is bipartite, namely the set of vertices V can be split into two subsets, T and T c , such that V = T T c and vertices in T are connected only to vertices in T c , and vice versa.Then, regardless of the lattice L, the following unitary operator preserves the code space

R
d gates or their powers.When the lattice L is d-simplex-like (see Section IIIC and Fig.11), then R d implements the logical R d gate in the code space.For other choices of boundaries, the action of R d in the code space does not necessarily coincide with the logical R d gate.For the sake of simplicity, in the rest of this section we shall consider the d-dimensional color code supported on a d-hypercube-like lattice L colored with C 0 , . . ., C d (see Fig.15(a)and Fig.14(a)).In particular, we choose L to have the opposite boundaries colored in the same color.Namely, we assume that two boundaries perpendicular to the direction ĵ have color C j , where j = 1, . . ., d.One can show that the color code CC(L) encodes d logical qubits.In order to do this, consider the disentangling unitary U = c∈C 0 U c , which is a tensor product of local unitaries supported on d-cells of color C 0 (see Section IID and Section IIIC).Then, U transforms the color code CC(L) into d decoupled copies of the toric code,

FIG. 14
FIG. 14. (Color online) (a) The color code CC(L) on a three-dimensional cube-like lattice L with pairs of boundaries perpendicular to the direction î colored with C i .(b) The toric code T C(L 3 ) on a cube-like lattice L 3 derived from L by shrinking 3-cells of color C 3 .Note that L 3 has two rough boundaries (shaded) and T C(L 3 ) encodes one logical qubit with a string-like logical Z operator (red) connecting two opposite rough boundaries and a membrane-like logical X operator (blue).

2 X 2 FIG. 15 .
FIG. 15. (Color online) (a)The topological color code CC(L) on a square-like lattice L with four boundaries of color C 1 and C 2 encodes two logical qubits, with logical operators X (i) and Z (i) for i = 1, 2. The toric code T C(L i ) (b) for i = 1 and (c) for i = 2 derived from L by shrinking faces of color C i encodes one logical qubit with logical operators X i and Z i .
) of the three-dimensional toric code admit fault-tolerant implementation of a non-Clifford logical gate, which saturates the bound by Bravyi and König in three dimensions.where Z d+1 = {0, 1, . . ., d} is the set of d + 1 colors, and two vertices connected by an edge have different colors.We define color(δ) to be the set of colors assigned to vertices of a simplex δ, namely color(δ) = v∈∆ 0 (δ) color(v).(80) Now, we are ready to define the color code and the toric code in d dimensions.The color code is a stabilizer code with the stabilizer group CC k (L) defined on a (d + 1)-colorable homogeneous simplicial d-complex L, where k ∈ {0, . . ., d − 2}.One qubit is placed at each and every d-simplex in L, and X-and Z-type stabilizer generators are associated with (d − k − 2)-and k-simplices as follows