Generalized Color Codes Supporting Non-Abelian Anyons

We propose a generalization of the color codes based on finite groups $G$. For non-abelian groups, the resulting model supports non-abelian anyonic quasiparticles and topological order. We examine the properties of these models such as their relationship to Kitaev quantum double models, quasiparticle spectrum, and boundary structure.


I. INTRODUCTION
Topological codes are a promising avenue to achieve robust quantum memories [1] or implement faulttolerant quantum computation [2]. These codes have locality properties that are both advantageous from the perspective of implementation, and give robustness against realistic noise models. Topologically ordered systems can be used for information processing in a number of ways, notably by code deformation [3,4] or by the braiding of quasiparticle excitations [5]. The latter approach is available only for particular types of topologically ordered systems with non-abelian anyonic excitations.
The color codes [6,7] are a family of topological codes with abelian anyonic excitations. They may be used to perform computation by code deformation, but are particularly notable for having a large class of transversal gates [6], giving rise to high fault-tolerance thresholds [8]. They are also related to many other interesting families of codes such as the toric codes [2], topological subsystem codes [9,10], higher-dimensional color codes [11], and gauge color codes [12]. Small examples of color codes have also been demonstrated and manipulated in the laboratory [13].
While the color codes have interesting properties and are related to many other interesting models, the ability to support non-abelian excitations is one feature they lack. Here, we present a generalization of the color code to arbitrary finite group G (such that the standard color code corresponds to the group Z 2 ). This is motivated in analogy to the generalization of the toric code to the quantum double models [2]. These generalized color codes support non-abelian anyons for non-abelian groups G and so may in general be used for topological quantum computation by braiding these quasiparticles.
We also study some notable properties of these generalized color codes. Particularly, we demonstrate an equivalence between the generalized color codes and the quantum double models that allows us to easily determine the quasiparticle content of these color codes. We further discuss the structure of the boundaries of these models among other properties.
The layout of the paper is as follows: in Sec. II, we will review the qubit color code model and introduce the generalized color code. We will prove the relation between these models and the quantum double models in Sec. III. Following this, in section IV we will explore the properties of the generalized color codes, before concluding remarks in Sec. V.

II. QUBIT COLOR CODES AND G-COLOR CODES
The qubit color code [6] is defined on a trivalent lattice whose plaquettes are 3-colorable (see for example Fig. 1). Such lattices are called 2-colexes [11]. Qubits are placed on vertices of the 2-colex, and each plaquette has two associated projectors, defined as such that i ∈ p runs over vertices bounding the plaquette p, and where X(i) and Z(i) are the Pauli matrices acting on vertex i. 2-colexes are always bipartite, which means that all cycles of the lattice are even in length, and so S X p and S Z p commute with each other for the same p. It can also be seen that [S X p , S Z p ] = 0 ∀p, p . The model is then defined by the Hamiltonian such that the ground space of the code is the common +1 eigenspace of each of the S p operators. We will therefore refer to the S X and S Z as X-and Z-type stabilizers. Plaquettes of the 2-colex are colored red, green, and blue, and similarly each link has an associated color, such that it connects two plaquettes of its own color. The elementary excitations of this model can be thought of as (abelian) anyonic quasiparticles, corresponding to stabilizer operators that are frustrated. Anyon species can be labelled by the color of the plaquette on which they live and the type of stabilizer they frustrate (i.e. X or Z), or can be a composite of these generating anyons.
On a torus the qubit color codes are 2 4 -fold degenerate, and alternative boundary conditions for these codes are discussed further in Sec. IV C. Logical operators in these codes consist of homologically nontrivial strings of X or Z operators running along edges of a particular color, and can branch if strings along edges of all three colors meet. A X string running along red links will anticommute with a Z string running along blue links, for example, and these string operators will form a Pauli algebra acting on the degenerate codespace.
We can think of the qubit color code as being based on the group Z 2 . The qubits on each link have a natural basis labelled by elements of Z 2 = {0, 1} (with 0 the identity element) and we can consider the X operator to act on these states as group multiplication by the 1 element, i.e.
where of course addition modulo 2 is the relevant group multiplication operation for this group. The X operator can also be labelled with a group element superscript such that and see that X 1 = X, X 0 = I.
Let us also introduce operators T g = |g g| for each g ∈ Z 2 . This allows us to write In particular, this allows us to rewrite where we use notation such that g i = 0 runs over all sets of g 1 , g 2 , . . . , g n such that g 1 ⊕g 2 ⊕· · ·⊕g n = 0. When written in this form, these operators bear a close resemblance to the A v and B p projectors used to define the quantum double models [2] (in this case for the group Z 2 ).
A. G-color codes Given our interpretation of the qubit color code in terms of the group structure of Z 2 , we now define a generalized color code. The desirable characteristics of this code are that its Hamiltonian can be expressed as a (negative) sum of commuting local projectors, and that its excitation spectra includes non-abelian anyons for sufficiently complicated group G. The models we present will satisfy both of these conditions. It is worth noting that our models defined for the (abelian) cyclic groups Z d will correspond precisely to the known generalizations of color codes to higher-dimensional spins [14].
A G-color code is defined uniquely by the following set of data: • A choice of privileged color (conventionally red), and a choice of "clockwise" and "anti-clockwise" for the remaining colors (conventionally green and blue respectively) Here we will begin by defining the model for the special case s i = +1 ∀i, and subsequently describe how to relate models with different parity functions s i . To each vertex of the 2-colex L, we associate a qudit with dimension |G| and an orthonormal basis labelled by elements g ∈ G. Define operators corresponding to group multiplication and projection that act at a site as follows T h |g = δ h=g |g As compared to the qubit case, a general group requires a distinction between left and right multiplication, hence we have introduced both X + and X − to distinguish these two operations. Note that This subgroup is normal, and the quotient group G/[G, G] is the abelianization of G. A particularly useful property of [G, G] is that it can alternatively be defined as the set of elements in G which can be written as some product g 1 g 2 g 3 · · · g n that may be reordered such that it evaluates to identity.
In analogy to the qubit color code, the G-color codes are specified by a number of stabilizer operators. As in the qubit case, each plaquette will have an associated X-and Z-type stabilizer. However, in general, the form of these stabilizers will depend on the color of the plaquette under consideration. With this in mind, we can define X-type stabilizers for a plaquette as follows where in Eq. (13) the X g operator acts either as left (X g + ) or right (X g − ) multiplication depending on the relative orientation of the three colors at a given site. Explicitly, when considering the X-type stabilizer corresponding to a blue or green plaquette, if the colors of plaquettes around a vertex are ordered {r, g, b} when traversed clockwise, then the operator appearing at that vertex will be of the form X + . Similarly, if the plaquette colors around the vertex are ordered {r, b, g} when traversed clockwise, then the operator appearing at that vertex will take the form X − . When considering red plaquettes, these conventions are reversed, so that {r, g, b} clockwise ordering corresponds to X − and {r, b, g} corresponds to X + . Concrete examples of these conventions are illustrated in Fig. 2.
These conventions are chosen so that the S X operators corresponding to plaquettes of the privileged color (red) commute with the S X for both blue and green plaquettes. Making all three colored X-type stabilizers commute pairwise is impossible, and so the blue and green S X will not generally commute with each other for neighbouring plaquettes. Although this may seem at first glance to be a severe problem, it so happens that there exists a common +1 eigenspace of all S X regardless.
The Z-type stabilizers for each of the three plaquette color are then defined as S Z p,blue = ACW gi=e i∈p where the ACW or CW denotes the product being taken anti-clockwise or clockwise around the plaquette, respectively. The origin of the product can easily be seen not to affect these operators. Additionally, the order of multiplication in S Z red does not affect the outcome. Since [G, G] can be defined as the set of elements that can be decomposed into a product h 1 h 2 h 3 · · · h n such that it can be rearranged to evaluate to identity, whether or not some product of elements g i is in [G, G] will be independent of the order of multiplication.
When considering these Z-type stabilizers, it is clear the sense in which the red plaquettes are privileged. Their structure is not related to the full group G. Rather, we can consider [G, G] as the preimage of the identity element of G/[G, G] under the quotient map. Thus the structure of the red Z-type stabilizer is derived from that of the abelianization of G, as opposed to G itself. For this reason, we will sometimes refer to red plaquettes as "abelianized". It should also be clear why we identified blue and green plaquettes as "anticlockwise" and "clockwise" respectively.
The reason that we have defined the orderings of products in S Z operators as above is that this allows these operators to commute with all the S X , as can easily be verified. That we are unable to preserve this commutativity without abelianizing the red plaquettes can be seen as a consequence of the fact that the blue and green S X fail to commute. It is impossible to preserve the full group structure of the red plaquette and have its S Z commute with both the blue and green S X . In order to avoid this non-commutativity, we have reverted to the simpler structure of the abelianization of G, where no such problems exist, for the red plaquettes.
In abelianizing the red plaquette Z-stabilizers, we have introduced an additional extensive degeneracy to the system. This degeneracy is local in the sense that it can be lifted through the addition of an extra class of local stabilizer operator that has no counterpart in the qubit case (or in fact for any abelian G-color code), where [G, G] = {e}. We call these C-type stabilizers, and they are defined for each red link as where X n ± (l, ↑↓) acts on the upper (↑) or lower (↓) qudit of the red link l after it has been oriented such that the blue plaquette (ACW) is on the left of the link and the green plaquette (CW) on the right. It can be seen that the S C will commute with all S Z and S X . By requiring the ground space to be in the +1 eigenspace of the S C as well as the S Z and S X , the local degeneracies caused by abelianization of the red plaquettes are lifted.
As noted, the S X , S Z , and S C stabilizers as written do not commute (as the S X do not in general commute). They nonetheless can be cast in the monomial stabilizer framework [15], and have an associated frustration free ground space. However, commutativity can be restored by restricting the S X stabilizers for green and blue plaquettes to the +1 eigenspace of the S C . These modified stabilizers take the formS where p ∩ red denotes all red links bounding the plaquette p. This will then give a set of commutative stabilizer operators generated by the S Z ,S X and S C operators, allowing us to write the Hamiltonian of a G-color code as The ground space will be the common +1 eigenspace of all the stabilizer operators, and will be protected from excited states by a constant gap.
This completes the definition of the G-color code for the special case that the parity function is set to s i = 1 at every site i of the lattice. The parity at a given site may be reversed by making the unitary transformation |g → |g −1 at that site. This completely exhausts the freedom we have in choosing the S X , S Z and S C consistently. When viewed in this way, we can see the parity function as being analogous to the edge direction in the quantum double models, where reversing an edge is equivalent to applying the unitary taking g → g −1 on that edge. We will henceforth restrict to the s i = 1 parity case, with the understanding that all results will hold for any possible alternative parity choice.

III. EQUIVALENCE TO COPIES OF THE QUANTUM DOUBLE MODELS
A property of the qubit color code that will be particularly useful to us in understanding the G-color code is that it is locally equivalent to 2 copies of the toric code [16][17][18]. We will now sketch an alternative proof of this fact (for a particular 2-colex) 1 and demonstrate how it generalizes to a general G-color code.
A. Qubit color code ↔ toric code equivalence Before we present the mapping between the color code and the toric code, we first briefly review the toric code [2]. For our purposes, it is sufficient to define the toric code on a square lattice, with qubits on edges. As in the color code, this model is defined by a number of stabilizer operators. Explicitly, for each vertex v and plaquette p of the lattice, we have where we use notation such that i ∼ v runs over all qubits incident to v, and i ∼ p runs over all qubits bordering p. The toric code Hamiltonian is then given by in a very similar fashion to the color code. For simplicity, we present a mapping between the color code and two copies of the toric code on a particular 2-colex. Specifically, we consider the 4.8.8 lattice, where the square plaquettes are colored green and the octagonal plaquettes blue and red in such a way as to satisfy 3-colorability (Fig. 1b). We will show how to interpret a qubit color code on this 2-colex as 2 copies of the toric code. That is, we will find a local unitary map that transforms color code stabilizers to toric code stabilizers or actions on uncoupled ancilla systems. Intuitively, the mapping we present treats each green plaquette as 2 encoded qubits, one belonging to each copy of the toric code. The blue plaquettes will correspond to vertices (plaquettes) of the first (second) copy of the toric code, while the red plaquettes will correspond to plaquettes (vertices) of the first (second) copy of the toric code (see Fig. 3).
Consider the 4 qubits belonging to each green plaquettes as a stabilizer code with a 4-fold degenerate codespace. The stabilizers of this code are simply the green face stabilizers of the color code, i.e.
where we use a graphical notation for the 4 operators acting on the vertices of the green plaquette, so This 4-dimensional codespace corresponding to each green plaquette can be considered as 2 encoded qubits, one for each copy of the toric code. In this way, the qubits of the new toric code lattices have a direct correspondence to the green plaquettes of the color code lattice. It will now be convenient to bipartition these green plaquettes into those with red plaquettes on their right and left (h-type) and those with red plaquettes above and below them (v-type).
On h-type green plaquettes, encoded Pauli algebras can be defined for each of the 2 encoded qubits as where X h enc (2) acts as Pauli X on the 2 nd encoded qubit for the h-type green plaquette under consideration.
For v-type green plaquettes, the encoded operators can be defined by That is, on v-type plaquettes, the definitions of the first and second encoded qubits are exchanged. Note that these definitions are not unique. In particular, because the codespace is the +1 eigenspace of S X green and S Z green , multiplying any operator by is a trivial operation, and so the encoded operators are invariant under 180 • rotations. One could more rigorously define the unitary enacting this encoding as a function from operators on the 4 qubits of each green plaquette to the 2 encoded (toric code) qubits, as well as 2 ancilla qubits. Notably, this transformation would take green color code stabilizers to an action on the ancilla space, and so they become "trivial" in the sense of Ref. [17].
In terms of the encoded toric code qubits, the action of the color code stabilizers for blue and red plaquettes is if we interpret the lattices of the two toric codes as in Fig. 3. Thus the unitary we have described maps all the stabilizers of the original color code model to stabilizers of the toric code model, or operators on uncoupled ancilla qubits. This completes the demonstration of equivalence.
The equivalence between the qubit color code and the toric code on the 4.8.8 lattice shown above can be generalized to an equivalence between the G-color code and 2 quantum double models. However, as compared to the qubit case (which corresponds to G = Z 2 ), the two quantum double models will in general be different. One will be based on the group G, while the other will be based on the abelianization of the group G/[G, G].
Before we continue, we briefly review the quantum double models [2]. Conventionally, these models are defined on a directed lattice, with edge direction playing a similar role to our parity function. We will define a quantum double model for a group G on an particular directed square lattice (Fig. 4), with qudits of dimension |G| placed at every edge, noting that transforming the qudit on an edge by g → g −1 is equivalent to reversing the direction of the edge (qudits have a natural basis labelled by g ∈ G). At each vertex v and plaquette p of the lattice, the stabilizers of the quantum double model can be written as A where the subscript of the X operators in (40) and the T operators in (41) denote whether they act on the qubit U p, Right, Down, or Left from the center of the plaquette or vertex under consideration.
As was the case for the qubit color code ↔ toric code mapping (the Z 2 case), we will explicitly consider only the 4.8.8 lattice, where the square plaquettes are colored green, and the octagonal plaquettes are colored red and blue (Fig. 1b). The intuition for our construction is much the same, in that we will encode the quantum double degrees of freedom in the qudits at the vertices of the green plaquette. However, particularly in the case of non-abelian group G, the mapping will be less straightforward.
As before, green plaquettes are labelled h-or v-type depending on whether red plaquettes are at their sides or above and below them. Given this, define the codespace for h-type green plaquettes via the stabilizers of the plaquette with A h green (g) = C h l2,green (n) = On v-type green plaquettes, the stabilizers can be found by rotating the h-type stabilizers by 90 • . These definitions can be seen to be invariant under 180 • rotations.
Given this codespace at each h-type green plaquette, we can write encoded operators on this space as As in the Z 2 case, we can define logical operators for the encoded qudits in multiple equivalent ways within the codespace. We have written two particularly useful sets of logical operators for each of the encoded qudits here. These encoded operators can be seen to commute with the stabilizers defined above. The encoded operators acting on the v-type green plaquettes can again be found by rotating the h-type operators 90 • clockwise.
In the Z 2 case, the two encoded systems (labelled 1 and 2) were both of the same dimension (they were both encoded qubits). In general, however, this is not the case. Examining the encoded operators on qudit 2 (50) or (52), we can see that states in this space are labelled only by k ∈ G/[G, G], and thus this qudit is |G/[G, G]| dimensional. This can be seen by noting that g[G, G] is the coset of G corresponding to a particular element of G/[G, G], and in particular g[G, G] = ng[G, G] for any n ∈ [G, G]. In contrast, qudit 1 can be seen to have basis labelled by g ∈ G, and is thus |G| dimensional.
In terms of this encoding, it is clear that once again, the X-type stabilizers of the G-color code corresponding to green plaquettes can be thought of as acting only on some ancilla space (they have no action on the encoded space by construction). Similarly, the C-type stabilizers corresponding to red links of the G-color code act only within a green plaquette, and commute with the encoded operators, so they can also be interpreted as acting on an ancilla space. In contrast, the G-color code stabilizers for blue and red plaquettes can be rewritten in terms of the encoded qudits. Their action under the encoding map can be written as where K are defined by Eqs. (39) and (41)

IV. PROPERTIES OF GENERALIZED COLOR CODES
The qubit color codes have a number of properties that make them of interest to the topological quantum information community. Here we will take a brief survey of some of the most important properties of the G-color codes. Where relevant, we will discuss the connection to the properties of the qubit color codes. Note that some properties of these models for abelian groups G are explored in some depth in [14].

A. Anyon spectrum
The correspondence between the G-color codes and the quantum double models developed in Sec. III allows us to immediately import results from the study of the quantum double models and interpret them in the context of the G-color codes.
Ref. [16] shows that so-called topological stabilizer groups are equivalent iff they have isomorphic topological charges. This result does not apply directly to the equivalence that we have established between quantum double models and G-color codes because they are not Pauli stabilizer models. However, even without the level of rigor available for Pauli stabilizer models, we can still use the intuition behind this theorem to draw a correspondence between the anyonic content of the quantum double models and the G-color codes.
It is easy to see that all local operations on the qudits of the quantum double models in Sec. III B can be mapped to some local operations on the qudits of the G-color code (though the converse is not so straightforward due to the presence of the ancillae in the mapping). Similarly, anyonic charges of the quantum double models can be mapped to charges living on the red and blue plaquettes of the G-color code. This allows us to state that the G-color code is supporting the anyons of both the G and G/[G, G] quantum double models. Notably, this includes non-abelian anyons for non-abelian G.
In general, since the anyons of a quantum double model for group G are given by the irreducible representations of the Drinfeld double of G, Irrep(D(G)), we would expect from this line of reasoning that the anyonic content of a G-color code is given by Irrep(D(G × G/[G, G])).
Anyonic charges of the quantum double models can be created and moved by ribbon operators [2]. Each of these ribbon operators must have a corresponding ribbon operator creating or moving the analogous charges on the G-color code. Given these operators, we could imagine braiding charges in the G-color code corresponding to any desired braiding in a quantum double model. In particular, we could perform braiding of a non-abelian anyons that implements universal quantum computation in G-color codes for G non-nilpotent [20,21].

B. Further implications of equivalence
A concrete motivation for demonstrating equivalence between two topological models is that it allows decoding or error correcting routines for one model to apply to a broader class of models [17]. In our case, this amounts to the observation that a G-color code can be decoded if an equivalent procedure for decoding the quantum double model for group G is known. Although decoding for these non-abelian anyon models has yet to be explicitly demonstrated (though related work has been shown [22,23]), by equating our G-color codes to the well established quantum double models, we can exploit any results in terms of decoding that are available for them.
Ref. [16] shows that all Pauli stabilizer codes are equivalent to copies of the toric code. The fact that we are able to demonstrate equivalence between quantum double models and our G-color codes suggests that a more general equivalence may hold whenever the models are constructed from commuting projectors based on the X and T operator algebra for a group G. This may also point to a useful restriction of the monomial stabilizer formalism [15] when the desired algebra structure is related to a particular group.
Note that we have technically not demonstrated equivalence between an arbitrary G-color code and quantum double models, as our mapping is specifically tailored to the 4.8.8 lattice. This was sufficient to prove that the G-color codes are capable in principle of supporting quantum double anyons, but we have not shown that this is true for a general lattice. However, the general principles of topologically ordered systems suggest that the microscopic lattice details should not affect global properties of the system such as its anyon spectrum, and so we feel confident in taking this correspondence to hold in general.

C. Degeneracy and Boundaries
As is generic for topological codes, the degeneracy of a particular code is highly dependent on the topology of the surface in which it is embedded, or, in the planar case, the particular choice of boundary conditions. On closed (orientable) manifolds, this degeneracy is independent of the microscopic details and can be derived from the anyon spectrum [5]. This means that the degeneracy of the G-color codes on closed manifold can directly be calculated as the degeneracy of the quantum double model for Similarly, characterization of the possible gapped boundaries for topologically ordered models is based on the anyon spectrum rather than microscopic details. Possible boundary types and their properties can thus be found by appealing to the known results for the quantum double models [24][25][26]. Since this theory is already well established in general, there is no reason to delve into it here. However, before moving on we will briefly discuss some special boundary types that are natural in the context of the color codes, and planar codes that can be constructed from them.
The most common planar qubit color codes are triangular [6] (Fig. 6a). Each side of the triangle is associated with the color not appearing in plaquettes on that boundary. These triangular color codes encode one qubit. Small triangular color codes have been experimentally prepared and manipulated [13]. Another common form of planar color code is rectangular, as in Fig. 6b. In this case, two logical qubits are encoded. More generally, a natural boundary for the color code is labelled by a color according to the color not appearing on plaquettes at that boundary. Degeneracy is introduced to the system when the lattice boundary consists of several different colored segments. Although these boundaries arise naturally in the study of color codes, they are not the only boundary types that can occur. In particular, note that the number of boundary types we have just described is 3 (labelled by colors), while a topologically ordered model equivalent to two copies of the toric code can give rise to 6 types of boundary [24,25,[27][28][29][30]). The reason that the boundaries we described are particularly natural is that they require no special modification to the stabilizer operators (only the 2-colex on which the model is defined).
In the general case of a G-color code, the effect of boundaries is a little more complicated due to the asymmetry between the three colors (and of course the more complicated algebraic structure). As before, degeneracy is introduced to the codespace when more than two distinct boundaries exist, but the counting of this degeneracy depends on the color (or type) of the boundaries. Since the general case can be determined by appealing to results for the quantum double models, we will simply describe the logical operators and degeneracy of three distinct planar G-color codes: the blue-green rectangular codes (i.e. one with alternating blue and green boundaries as shown in Fig. 6b), the blue-red rectangular codes, and the triangular codes. Up to the equivalence between the blue-red rectangular code and a green-red rectangular code, this exhausts all possible rectangular and triangular codes.
In order to describe the logical operators in these codes explicitly, it would be necessary to construct ribbon operators as in the quantum double models [2,31], which is straightforward but tedious. Instead, we will simply state the types of logical operators that arise and their relationships in order to calculate the degeneracy of these codes.

Blue-green rectangular code
Before discussing the logical operators of these codes, we should quickly note a subtlety in their definition. At each corner between a blue and green edge, there is a red plaquette with one qudit that touches neither green nor blue plaquettes. This qudit should be understood to have a C-type stabilizer associated with it, as would be the case if there were an edge emanating from this qudit.
Between the two blue boundaries of this code, it is possible to construct a set of X-type operators labelled by group elements in G that we call X g log,blue . These would (largely) run along blue links of the lattice. However, note that along a green boundary, the distinction between blue links and red links disappears. Thus along this boundary, we can construct a family of operators from C-type stabilizers, each labelled by n ∈ [G, G] that runs along blue links connecting the blue boundaries. After accounting for equivalence up to these operators, only blue X-type logical operators labelled by k ∈ G/[G, G] are independent. Similarly we can construct a set of independent green logical X operators labelled by k ∈ G/[G, G], X k log,green . These operators will commute pairwise. We can also construct Z-(or T )-type logical operators between the blue boundaries. However, if we were to construct an entire set Z g log,blue labelled by each g ∈ G, these would not commute with the stabilizers. Instead, we can only construct independent representatives labelled by each k ∈ G/[G, G]. Similar considerations apply to the Z k log,green . We can then form two pairs of logical qudit algebras generated by X k log,green with Z k log,blue and X k log,blue with Z k log,green for k ∈ G/[G, G]. We thus say the logical qudits associated with each of these sets of operators are abelianized. The total degeneracy is |G/[G, G]| 2 .

Blue-red rectangular code
As in the blue-green rectangular code, we can define X g log,blue . However, since there is no green boundary, these are now independent for all g ∈ G. In contrast, red X-type logical operators are only defined for each k ∈ G/[G, G] (again due to equivalence under C-type stabilizers).
Conversely, the red Z-type operators are defined for each g ∈ G, while the blue Z-type operators are only independently defined for each k ∈ G/[G, G]. This leads to logical qudit algebras generated by X g log,blue with Z g log,red for each g ∈ G and X k log,red with Z k log,blue for each k ∈ G/[G, G]. In this case only one of the logical qudits has been abelianized, and the total degeneracy is |G| · |G/[G, G]|.

Triangular codes
For the triangular code, it is not so straightforward to assign a color type to each logical operator because they may branch. Despite this, by constructing logical operators that run entirely along one side of the triangle, it can be seen that only independent X k log and Z k log for each k ∈ G/[G, G] may be defined, and so determine the degeneracy of these codes to be |G/[G, G]|.

D. Topological defects
Topological defects can play an important role in topological systems. In particular, braiding of certain types of defects can implement quantum computation (through code deformation) in much the same way as braiding of anyons. Particular types of topological defects such as holes [3] and twists [4,32] have been developed for this purpose in simple models such as the toric codes or qubit color codes. As with our discussion of the anyon spectrum of G-color codes, we can import many known results from quantum double models into our study of topological defects in these models, taking the equivalence between quantum doubles and G-color codes to be general (i.e. independent of the details of the lattice).
The theory of topological defects is closely related to the theory of boundaries. The study of domain walls (general boundaries) between two topological phases can be used to explore all the topological defects we will consider here. This theory is developed for the quantum double models in [24] (see also [25] for related work). By making use of the correspondence between the G-color codes and the quantum double models, we can import the characterization of the domain walls possible between two phases of G-color codes.
Twists are topological defects at which domain walls terminate [25]. They induce an automorphism of the set of anyons, such that an anyon braiding around a twist will return as a different species (as dictated by the automorphism). Twists have well-defined fusion and braiding amongst themselves, and can be used for topological quantum computation [4,32]. Possible twists for quantum double models (and hence G-color codes) are studied in Refs. [24,25].
The second type of defects we consider are holes (or punctures). These are closed boundaries between the G-color code and vacuum (the topologically trivial phase) within a planar topological code. They can also have well-defined fusion and braiding relations, and can be used for topological quantum computation [3]. Again, the characterization of such hole types can be imported from the boundary theory of quantum double models, as discussed in Sec. IV C.
Finally, condensation is a mechanism via which the topological order in an anyonic model can be changed. In a condensed phase, the anyon density for a particular species is given a non-trivial value in the ground space, and this can lead to interesting effects, e.g. confinement of other anyon species. Condensation amounts to a deformation in the bulk of the model under consideration and again an analogy can be drawn to equivalent processes in quantum double models as studied in [31] (see also [25,33,34]). These kinds of effects may also be used to perform quantum computation by manipulating the regions of condensed phases [35].

E. Transversality properties
One feature of the qubit color codes that is particularly appealing is its large set of transversal gates [6] (in comparison to the toric code, for example). In fact, this feature is inherited for the color codes based on abelian groups [14]. The most important transversal gate that these abelian color codes possess is the Hadamard gate. However, as discussed in [36], operator algebras based on finite non-abelian groups will not have a counterpart to the Hadamard gate, due to the inequivalence of the group algebra and the corresponding representation algebra.
In a similar vein, logical operators for codes with similar algebraic structure to the G-color codes (significantly the quantum double models) do not generally have large transversal gate sets. The transversal "string"-like logical operators that appear for abelian groups generally become non-transversal "ribbon" operators in this context [2,31] when the topological charges of the model become non-abelian (and thus able to perform quantum computation by braiding). For these reasons, we do not expect the G-color codes to have particularly interesting transversal gate sets.

F. Construction from cluster state
The qubit color code can be constructed in a straightforward way from a suitable cluster state [37]. We can view this relationship (appropriately generalized) as one way to define the G-cluster states.
The qubit color code can be produced by beginning with a cluster state on the lattice shown in Fig. 7, and projecting a subset of the qubits (corresponding to each plaquette of the color code) into the |0 state [37]. This procedure can directly be generalized to produce G-color codes from generalized cluster states [36] based on the group G. Given a suitably prepared generalized cluster state, the analogue of the |0 state projections would naively be expected to be a projection to |e . However, performing these projections would not give rise to the G-cluster states we have defined (the resulting states would not have local stabilizers).
Instead, the projection on the qudits corresponding to red plaquettes must be generalized to projections to n∈[G,G] |n , while those on blue and green plaquettes would remain as projections to |e . This will result in the desired G-color code state. Of course for any abelian group G, [G, G] = {e}, and so we recover the standard qubit procedure for G = Z 2 .
As discussed in Ref. [36] for the similar case of the toric code, if we were to physically use measurements of a suitable basis in lieu of projections to the |e or n∈[G,G] |n states in an attempt to prepare G-color code states from generalized cluster states in the laboratory, the resulting state could be interpreted as an excited state of the G-color code with excitations determined by measurement outcomes.

V. DISCUSSION
We have defined a generalization of the color codes to finite group G, and explored many of their basic properties. Some of the useful features of the qubit color codes do not carry over to the general case, most notably the large set of transversal gates. Nonetheless, we do not have many exactly-solvable models of topologically ordered systems and so this new family may be of interest as a testbed for topological phenomena, or may have properties that are difficult to find in existing models. Furthermore, the relationship between the color codes and many other interesting systems may allow for further extension of this work. We briefly discuss a few of the most obvious extensions below.
A. Extensions of the model

Topological Subsystem Codes
Topological subsystem codes are a family of models that are related to color codes, but whose Hamiltonians require only 2-body interactions [9,10]. They are defined on 2-colexes whose links and sites have been expanded to create a new lattice, as in Fig. 8. Each edge of the expanded lattice carries an operator of the form X ⊗ X, Y ⊗ Y , or Z ⊗ Z.
We will not go into details about these models, but we would not expect them to be generalizable to an arbitrary finite group G as we have done for color codes for the following reason. In our generalization, we have treated the X operator as if it were a group multiplication operator. We could also have generalized the Z operator as Z Γ ij = g [Γ(g)] ij T g , for [Γ(·)] ij the (i, j) th matrix element of a representation Γ. In particular, for the group Z 2 this gives Z triv = I and Z alt = σ z for the trivial and alternating representations, respectively. In this way, we can interpret the Z operators as acting like representations (see Ref. [36] for a more detailed discussion). Given these interpretations of X and Z, we can attempt to generalize a given CSS model. However, when presented with a non-CSS model such as the topological subsystem codes, the immediate problem of how to interpret a Y operator in terms of group structure has no obvious answer. For the Z 2 case (and indeed any cyclic group), there is a natural correspondence between the group elements and the representations of the group. This allows us to unambiguously define products of X g Z g that can serve as a generalization of Y (up to constants). For this reason, we would not expect significant obstacles to generalizing the topological subsystem codes to abelian groups. In contrast, for non-abelian groups we cannot generally rely on a natural correspondence between group elements and representations, and for this reason it seems unlikely that our strategy will provide a sensible generalization of the topological subsystem codes for these groups. We refer the interested reader to Ref. [36] for a more comprehensive discussion of similar issues.

Higher dimensional models and gauge color codes
The 3D qubit color codes are introduced in [7], and D-dimensional qubit color codes can also be defined [38] and generalized to gauge color codes [12]. They are based on the notion of a D-colex in analogy to the 2-colex of the 2D model. We anticipate that the same algebraic structure used here to define the 2-dimensional G-color codes (such as the commutator subgroup) may be used to define generalizations of the higher-dimensional color codes in some cases.
The gauge color codes are the most general setting for these higher-dimensional color codes, and are defined for spatial dimension D by a D-colex and two positive integers d, e such that d+e ≤ D. These two integers specify the geometry of the generators of the stabilizer group (or more generally the gauge group in the language of subsystem codes [39,40]). In particular, the Z-type interactions in the Hamiltonian are associated with (d + 1)-dimensional objects, while the X-type interactions are associated with (e + 1)dimensional objects. When generalizing these models to arbitrary finite group G in the most naive way, it seems necessary to restrict to d = 1, since the definition of the S Z stabilizers (14-16) requires these operators to be associated to an object with a notion of cycles, i.e. a 2-dimensional face. The same considerations restrict the kinds of higher-dimensional generalizations that are possible for e.g. the quantum double models and string net models, though more complex higher dimensional analogues can be defined [41]. However, the fact that the gauge color codes allow more general structures than the quantum double models (the analogous construction for quantum double models would not allow d + e < D) suggests that there may be novel ways to implement non-abelian topological orders in higher dimension with these methods.

Extension to more general algebras
Our model is very similar in construction to the quantum double models, as can be seen by the mapping of Sec. III, which makes this correspondence explicit. Given that more general quantum double models can be defined based on Hopf algebras (and potentially more general algebraic structures) [42,43], a natural question arises whether these models, too, have color code counterparts. We expect that this may be possible using similar methods to those used here, and that the resulting models would have an analogous relationship to the corresponding quantum double models.
It may also be possible to pursue a similar generalization of the color codes based on fusion categories rather than finite groups, in the spirit of the string-net models [44], of which the quantum double models are examples [45].