Construction of color codes from polygons

We propose a procedure for constructing new classes of codes, called polygonal color codes. This technique expands the triangular color codes introduced by Bombin and Martin-Delgado in 2007. Triangular color codes, built on a two-dimensional Euclidean surface with three edges, implement the entire Clifford group, but they only encode one qubit. In our case, polygonal color codes are constructed on two-dimensional surfaces with n edges, with n ≥ 3 , increasing the number of encoded qubits. Considering a surface with boundary and evaluating the generators of the first homology group of this surface, we may increase the dimension of the code without losing the transversal implementation of the Clifford group. In addition, we construct two codes, one with 2 and one with 3 encoded qubits, which exemplify the method and show that we can generate codes with better parameters than the known triangular codes. For one of these constructions, we also give general parameters.


Introduction
In 1982, Richard Feynman theoretically proposed a computer based on the principles of quantum mechanics [1]. The concept was modified over the years and, after the description of a quantum computer given by Deutsch [2], there was a great advance in the research of this area.
One of the most famous results was presented by Peter Shor in 1994. The Shor algorithm showed that, using quantum properties, a quantum computer could factor a number with n digits with an amount of steps growing geometrically. In a conventional computer this amount grows exponentially [3].
One of the great difficulties of performing quantum computing is decoherence, as Unruh warned in 1995 [4]. Decoherence is the decay phenomenon of superposition of states, due to the interaction between the system and the surrounding environment. In theory, the problem may be solved using quantum error-correcting codes.
Classic error-correcting codes were introduced by Claude Shannon in 1948 [5] and inspired the creation of quantum error-correcting codes. The first code, introduced by Shor in 1995 [6], was actually a concatenation of two 3-qubit codes, one that protected against bit-flip errors and one that protected against phase-flip errors, the latter without any classic analogue.
In 1996 there was a breakthrough in quantum coding due to the discovery of a class of codes, now known as CSS codes, by Robert Calderbank, Peter Shor and Andrew Steane [7,8]. These codes were generalized in a rich code structure, which are the stabilizer quantum codes [9].
A powerful technique for quantum correction of errors is given by the toric codes, proposed by Kitaev [10], giving origin to the topological quantum error-correcting codes. One of the great advantages of these codes is that their parity check operators are geometrically local, that is, they always act in a small amount of qubits in their neighborhood. Quantum words are therefore intrinsically resilient to local noises, which do not affect the topological properties of the system [11].
All these codes transversely implement the quantum gates CNOT, X and Z . In order to increase the implementable quantum gates and thus increase the number of tasks performed, a different class of codes has been proposed in [19]: the Color Codes. Under appropriate circumstances, color codes can implement transversely the whole Clifford group.
The Clifford group is the second level of the so-called Clifford hierarchy (CH), introduced by Gottesman and Chuang [20] for quantum operations, and defined by where U is a unitary operator acting on n qubits. In this definition, the first level of the hierarchy is n n 1   = , which is the Pauli group defined in the section 3. The second level is the Clifford group, which is the normalizer of the Pauli group. To generate the entire Clifford group we need only three operators, which are H (Hadamard gate), K (phase shift gate, or π/4 gate) and Λ(X) (controlled-not gate or CNOT gate): Although the implementation of the Clifford group does not imply the universality of quantum computation (which we would have at the third level of CH), there are important tasks performed by the operations of this group, such as quantum distillation, quantum teleportation and dense coding, for instance. There are other works that propose different techniques for topological coding that also allow the implementation of the Clifford group, as we may see in [21] and [22].
The strength of the color codes was demonstrated when an example of this code was implemented in 2014 [23]. The authors describe the implementation of a quantum error-correcting code encoding one qubit in entangled states distributed over 7 trapped-ion qubits. They demonstrate the capability of the code to detect one bit flip, phase flip or a combined error of both, regardless on which qubit they occur.
Triangular color codes were introduced in 2007. Kubica, Yoshida and Pastawski [24] proved that color codes on a d-dimensional closed manifold is equivalent to multiple decoupled copies of d-dimensional toric codes, up to local unitary transformations, adding or removing ancilla qubits. Moreover, for a d-dimensional color code with d+1 boundaries of d+1 distinct colors, they obtained that the code is equivalent to multiple copies of ddimensional toric codes which are attached along a (d−1)-dimensional boundary.
Anderson [25] defined the notion of label set equivalencies and showed that under a small set of constraints, the only homological stabilizer codes without local logical operators are equivalent either to Kitaev's toric code or to the topological color codes. He also discuss how many logical operators exist in a code with n boundaries, with or without holes.
In [26], Bravyi and Kitaev discuss the technique of increasing the number of edges for surface codes. Cesare [27] evaluated the increase in the number of qubits encoded in color codes using the introduction of defects on a two-dimensional surface. More recently, several works were generalized by Delfosse, Iyer and Poulin [28], where they consider a notion of relative homology (and cohomology) for surfaces with mixed boundaries, considering a construction which includes both Bravyi and Kitaev's and also Freedman and Meyer's [29] extension of Kitaev's toric code.
In current paper, we propose a construction of color codes on a bidimentional surface with multiple borders, thus obtaining the polygonal color codes P(1, n, m), which are a generalization of the triangular color codes of Bombin and Martin-Delgado. These codes preserve the implementation of the whole Clifford group.
To obtain these codes we increase the number of edges in the boundary of the surface and evaluate the behavior of the strings. We consider both direct strings with a single color, or t-strings, which are strings that are equivalently deformed by combining two colors to obtain a third one.
The main result is that we increase the number of coded qubits, but the elements that generate the homology group are the t-strings, which makes possible to implement the Clifford group as in the triangular color code, and we can still generate codes with better parameters than the triangular ones. We also construct two exemples of codes, one with 2 and one with 3 encoded qubits, which show the method and that we can generate codes with better parameters than the known triangular codes. For one of these constructions, we also give general parameters.

Homology
The topological quantum codes that we are going to work with depend on the homology of the surface. Let us go through the introductory concepts of homology and the first group of homology of a space or a surface. For more details see [30][31][32].
Since we are going to work on a very specific case, we will not deal with definitions of homology on any topological space, but on two-dimensional surfaces.
By embedding a graph G on surface S we say that we are doing a cellulation of the surface. The vertices of G are called 0-cells, the edges are 1-cells and the faces 2-cells.
Definition 1. Given a graph G embedded on a surface S, let P be the set of all p-cells. For each P P ¢ Ì , we define the p-chain in S be the finite sum In particular, if we label the edges of a cellulation of the surface by e i E 1 { } , we may represent the 1-chains defined above by the following formal sum: where E P ¢ Ì is a set of edges of G.
Further, 1-chains may be summed module 2, producing an Abelian additive group C 1 . Similarly, 0-chains and 2-chains of G will determine the additive Abelian groups C 0 and C 2 , respectively.
We relate groups of p-chains using edge operators, which we denote by These operators send an element on their border. For example, if f is a face of G whose boundary is given by edges {e 1 , K, e k }, then ∂ 2 ( f )=e 1 +L+e k . A p-chain c is called a cycle if ∂ p c=0. In figure 1 we have instances of these actions.
According to sequence . Let us define two subgroups of C 1 , which we denote by Z 1 and B 1 . The subgroup Z 1 is the kernel of ∂ 1 , that is, the sets of edges (1-chains) that form a cycle, a closed curve. The subgroup B 1 is the image of ∂ 2 , that is, the set of edges that form the boundary of a 2-chain. Now we may define: Definition 2. The first homology group of a surface S is the quotient In general, the first homology group is a finitely generated Abelian group and, regardless of the graph used in the embedding, the number of generators of the first homology group has much to say about the topological nature of the surface. The number of generators of the first homology group is twice the genus of the surface considered, as may be seen in [31] and [32]. For instance, in a torus let a and b be the generators of the first homology group. We remark that in the torus there are infinitely different closed curves, but they may be deformed continuously for curve a or for curve b, or for a concatenation of a with b, or even for a single point (the neutral element 0 of the group), which we call a homologically trivial curve. In figure 2 is shown these curves.
In this work we need not only the concept of homology of a surface, but also the concept of relative homology. As already mentioned, these concepts have already been introduced and used in several previous works on similar contexts, such as in [19,[26][27][28].

Color codes
A quantum error-correcting code (QECC) is an application of a Hilbert space k  , of dimension 2 k , to a Hilbert The first classes of quantum error-correcting codes were those that dealt with bit-flip and phase-flip errors or a combination of them, such as the Shor code [6], proposed in 1995.
On the other hand, the color codes introduced by Bombin and Martin Delgado in [19] belong to a class of codes called stabilizer quantum codes. Stabilizer codes are the quantum analogue for the classic linear codes [33]. They are defined by the stabilizer group.
}be the set of the Pauli matrices on 1 qubit. The Pauli group on n qubits is the set n  of elements in the form i P P P ...
such that I S -Ï , we call S the stabilizer group.
Thus, the stabilizer code  is defined as the eigenspace associated with the eigenvalue 1 of the operators in S, that is: If a stabilizer code has r generators, then the dimension of the stabilizer subspace is 2 n−r [33], implying that the number of coded qubits is: proposed a particular case of stabilizer codes, the toric codes. To define them, we consider a tessellation by squares in the flat torus l×l. The edges of this tessellation were placed in a one-to-one correspondence with the qubits. Since each edge belongs to two faces of the tessellation, we have E l 2 2 = | | , that is, the length of the code is n l 2 2 = .
The stabilizer operators are associated with the vertices and faces of the tessellation. Operator X v , associated to each vertex v of the tessellation, is given by the tensor product of Pauli matrices X and identity matrices, where we have a Pauli matrix X at each edge adjacent to the vertex, and the identity at all other edges. Each face f of the tessellation is associated with operator Z f , given by the tensor product of Pauli matrices Z and identity matrices, where we have a Pauli matrix Z at each edge on the border of the face, and identity matrices at all other edges of the faces. In short: Two examples of operators is given in figure 3. Kitaev toric code is defined as: , where k=2 is the number of homologically non-trivial cycles and d=l is the number of edges contained in the shortest homologically non-trivial cyle.
This code is one of the most important classes of quantum error-correcting codes. It was generalized to the surface codes and homological codes. In addition, studies of these codes were also done on surfaces with borders, with mixed edges or with holes, in order to modify the group of homology of the considered surface, and thus to generate new families of codes, as can be seen in the works [24,26,28].
As mentioned above, the color codes, introduced by Bombim and Martin-Delgado in [19], are a particular case of stabilizer quantum codes and, similar to the Kitaev code, is a topological code.
To generate a color code on a two-dimensional surface, a trivalent, 3-colorable tessellation is required. Trivalent tessellation means that, at each vertex of the tessellation, exactly 3 edges meet. A tessellation is 3-colorable if it is possible to color all the faces of the tessellation using only 3 colors (we fix red, green and blue), so that two faces sharing an edge do not have the same color. Considering a coloration of faces, we also induce a coloration of the edges, so that an edge of a certain color does not belong to the border of a face with the same color.
In color codes, the qubits are associated one-to-one with the vertices of the tessellation. The generators of the stabilizers are the face operators, with both X and Z operators on each face, acting on the vertices of the face in question. For each face p of the tessellation, we will denote such operators by B p s with σ=X, Z.
Separating the faces according to their color, in the sets R (red), G (green) and B (blue), we have: Equation (2) implies that four of these generators are not independent and, as we have seen in (1), we may calculate the number of encoded qubits. Since the number of generators is r=2 (V+F−2) and the number of physical qubits is double the number of edges n E 2 = ( ), one has [11] k n r 4 2 where  is the Euler characteristic of the surface. Note that the number of encoded qubits k depends only on the surface considered, but not on the tessellation used. It is appropriate to introduce the concept of shrunk lattices, one for each color, which are auxiliary lattices. For instance in the red shrunk lattice we place a vertex on each red face. The edges of the reduced net correspond to two vertices of the original whilst the green and blue faces of the colored tessellation are the faces of that auxiliary lattice.
To be clear on how color codes work, we need to understand how string operators work. As in the toric codes, the homology of these strings is defined on 2  , since we are dealing with two-level quantum systems.
These strings may be green, blue or red, depending on which net we are considering. Regardless of the color, they can be of type X or Z. Let us denote these string operators by S C m s where C is a color, σ is Z or X and μ is a label of the class of homology. Equation (4) shows that there are only two independent colors. A fundamental property of color codes is that, in addition to a string operator of one color being able to be deformed to another homologous string operator, it is also possible to combine two strings of different colors to produce a third equivalent operator of different color from the two original ones. Strings and t-strings are showed in figure 4.
There are good color codes generated on compact surfaces, as we may see in [17] or [18], for example. But on surfaces with bondaries, things take a different direction.
According to the construction in [19], a color code was created on a planar region bounded by a triangle in which each edge of the triangle is one border, each of one color. The code encodes only one qubit, and its nontrivial homology string is a t-string, that is, a string that departs from one edge of a certain color, branches into two other colors, and each part of its branching ends in the border which has its color, see figure 5.
The t-strings in the triangular codes are the key to implement the Clifford group. The difference in relation to the surface codes is that, geometrically, the t-strings X and the t-strings Z are exactly the same. Thus, if we denote two such t-strings by T X and T Z , we have {T X , T Z }=0. . .
, 5  . An example of a t-string (or string-net). Note that the blue string branches into two parts, red and green: the two parts combine and return to a blue string. This string-net may be transformed in an equivalent way into a whole blue string making the product with operators face of the marked faces. may be implemented transversally, since the CNOT gate is always implemented transversally in CSS codes [11,19,33].

Multiple borders
Color codes are error-correcting codes with good parameters when applied to compact surfaces. But when applied to the surfaces with boundary, as the triangular color codes, we have a fundamental property, which is the possibility of implementing the entire Clifford group, allowing to perform several important tasks in the Quantum computation.
The main drawback is that the triangular codes encode only one qubit. Thus, if we increase the number of encoded qubits, we will improve the parameters of the codes, and save resources for their implementation.
Our main objective is to construct color codes with the good properties of the triangular case, but with the implementation of more than one qubit. To attain this goal, we consider polygons with a number of sides greater than three. We consider a proper way to color the edges and we will verify which are the strings of non-trivial homology that generate the others, in each analyzed case.
We fix a color for only one edge and alternately increasing the amount of edges for each one of the other two colors considered. Without loss of generality, we always fix the blue color in only one edge and increase the amount of green and red edges, one by one, and in this order.
The second case is a quadrilateral, where we only have one blue border (always), two green and one red, which we denote by P(1, 2, 1), or Polygonal Code 1-2-1.
Following the rules to strings of a surface with labeled edges, in our case by colors, a cycle can be homologically non-trivial if it initiates and ends in distinct edges of the same color; or, in the case of a t-string it initiates on one edge of a certain color, passes through a bifurcation point and, from that point, each of the two generated strings ends at an edge of its corresponding color. Thus, in the quadrilateral described previously, we may have, except for continuous deformations, three types of cycles with non-trivial homology: a cycle that initiates from one green edge and ends at another green edge, and two t-strings initiating at one of the green edges, branches and ends at the corresponding edges, as in figure 6.
However, we may observe that one of these strings may be generated by the product (concatenation) of the other two, namely, the green string may be generated by the two t-strings, as shown in figure 7. This means that the two t-strings in question generate any homologically non-trivial cycle of this surface. Thus, the code P (1, 2, 1) encodes two qubits maintaining an important property: since both generator cycles are t-strings, the code generated on the surface will still implement the entire Clifford group transversely, since it has the same essential properties of the triangular codes described in section 3.
Following the established technique for growth of the number of sides of the polygons, for the third case consider a polygon with 5 sides of the form P (1, 2, 2). We enumerate the edges in order to facilitate the notation, taking the blue border as base and going through the polygon clockwise, we have the green edges G 1 and G 2 and the red edges R 1 and R 2 . Similar to the quadrilateral, there are six cycles of non-trivial homology: a green cycle (g 12 ) which starts at G 1 and ends at G 2 , a red cycle (r 12 ) which starts at R 1 and ends at R 2 , and the four t-strings (T 11 , T 12 , T 21 , T 22 ), where we denote by T ij the string starting at the blue edge, branches and ends on the sides G i and R j , as shown in figure 8.
Again, although we have six possibilities for non-trivial homology strings, some of these strings can be generated by the others. Observe the following systems :   T  T  g  T  T  g   T  T  r  T  T  r  and   11  21  12   12  22  12   11  12  12   21  22 12 We can observe that, as in the previous case, direct strings of a single color can be generated by t-strings. In addition, we can also generate a t-string in function of others. For instance, from the first system we have that T 11 +T 21 =T 12 +T 22 , which implies that T 11 +T 21 +T 12 =T 22 . The same conclusion can be obtained through the second system. Therefore, from the six non-trivial classes of homology, we have that only three of them generate all the others, in this case T 11 , T 12 , T 21 .
We could have chosen another combination of generators, including some combination that included one or more direct strings, but a choice with only t-strings is the best for our purposes. Generalizing this idea, we have the following result. ) code that encodes m n 1 + -( ) qubits so that the encoded qubits are always represented by t -strings.
The hypothesis that m=n or m=n+1 guarantees that it is possible to construct the polygon without adjacent sides having the same color.
In the case of m=n, we have a polygon with an odd number of sides, so we fix the blue side (the only one). A sequence of n edges, whose colors alternate between green and red, starting with red, leaves from one of the  vertices of this edge. Another sequence of edges, whose colors alternate between red and green, starting with green, starts from the other vertex of the blue side. Since both sequences have the same number of edges and begin with different colors, they end in different colors. The last two sides of each sequence join together by closing the polygon.
On the other hand, if m=n+1, we have a polygon with an even number of sides. Again we fix the blue side. From each one of its vertices we have a sequence of n edges, where both sequences initiate with the green side. If n is even, there is the same number of red and green edges in each sequence, and both end in red. The last green side is used to connect the two red edges to close the polygon. If n is odd, there is one more green edge than the amount of red edge in each sequence of edges, and both sequences end in green. The last red edge connects the last two green edges to close the polygon.
In relation to the number of encoded qubits, we again use the enumeration of the edges as already done previously. So we have m green edges (G 1 , ..., G m ) and n red edges (R 1 , ..., R n ).
For each direct green string, we can generate a system of equations that represent strings equivalences, then we have, starting from the edge G 1 : Starting from the edge G 2 : Taking the t-strings in the first row from each system, we obtain n t-strings from the systems of the green strings, and m t-strings from the systems of red strings, where the t-string T 11 appears in both groups, which results in m+n−1 t-strings (T 11 , T 12 , ..., T 1n , T 21 , T 31 , ..., T m1 ).
It is easy verify that all strings, both direct or t-strings, can be generated from these (m+n−1) t-strings, taking in account all the equations in the systems presented.
The transversal implementation of the Clifford group by these codes comes from the same facts already reported for the first case, the triangular code. The transverse action of the Hadamard gate H is equivalent to a Hadamard gate over the coded qubits, precisely by the nature of the X-strings and Z-strings. When we apply transversally H in a t-string of type X we have H T T , and the resulting t-string, which is of type Z has the same support as X, containing an odd number of qubits, so they anticommute. And for the gate K, the tansversal implementation requires an extra constraint, as we may see in equation (5), which is solved using a convenient tessellation, in the case the {4, 8, 8}.

New families of color codes
We give examples of codes of type P(1, m, n), initially focusing on P (1, 2, 1), which we give a general construction. These codes have the same properties of P(1, 1, 1) (which is the triangular code of Bombin and Martin-Delgado) but present better parameters.
We begin considering a quadrilateral and we use the semiregular tessellation {4, 8, 8}, which is the only one possible in the Euclidean plane with all polygons having the number of sides multiple of four. We note that the minimum distance of the code can be made so great as we want.
In the example of figure 9 we use a rectangle of measurements 2 2 1 2 +´+ ( ) ( ) and the polygons of the tessellation with sides of length 1, thus generating a code with parameters [ [12,2,3]].
Comparing this code to the simpler triangular code in [19], we can see that both have distance 3, but the coding rate of P(1, 2, 1) is 1 6 while in the triangular is 1 7 . By successively increasing both the length and the width of the rectangle by 2 2 + the minimum distance of the code increases by 2 in 2. Then, it is possible to have control of the growth of the number of qubits contained in the codes. Figure 10 exemplifies two of these steps. Thus, by this procedure we can generate a family of codes of type P(1, 2, 1) with parameters m m m m 8 2 2, 2, 2 1 , 1 . Comparing wiht the triangular code [[73, 1,9]] given by Bombin and Martin-Delgado in [33], the P(1, 2, 1) code of the family described above with the same minimum distance is the [[138, 2, 9]], whose coding rate is showing that the use of the polygonal codes can present gains in relation to the triangular ones.
In the example of figure 11 we use a pentagon and generate a code with parameters [[161, 3,9]]. It is worth noting that this code has distance 9, as well as the triangular code [[73, 1,9]] presented by Bombin and Martin-Delgado in [33], but if we observe the coding rate of both, we have that the rate of the P(1, 2, 2) code is 3 161 , while in the triangular case, the rate is 1 73 , which shows a real gain in the use of polygonal code in relation to the triangular code.
We call the attention to the fact that in both cases we do not use regular polygons. As we change the measurements of the external polygon which will be tessellated, we generate new families of codes, with better or worse parameters.  [12,2,3]], generated by tessellation {4, 8, 8} in a quadrilateral. We highlight a t-string with minimum code distance, with the 3 qubits of its support in yellow.

Conclusion
In this work, we have proposed a procedure for obtaining new classes of color codes, called polygonal color codes. This technique expands the triangular color codes introduced by Bombin and Martin-Delgado. Polygonal color codes are constructed on two-dimensional surfaces with n edges, with n3 , increasing the number of encoded qubits. Considering a surface with boundary and evaluating the generators of the first homology group of this surface, we increase the dimension of the code without losing the transversal implementation of the Clifford group.
Future work shall focus on simulating the performance of these codes with respect to different error models.