# Quantum codes on a lattice with boundary. This work has been supported, in part, by the Russian Foundation for Fundamental Research (grant no. 96-01-01113).

## Abstract

A new type of local-check additive quantum code is presented. Qubits are associated with edges of a 2-dimensional lattice whereas the stabilizer operators correspond to the faces and the vertices. The boundary of the lattice consists of alternating pieces with two different types of boundary conditions. Logical operators are described in terms of relative homology groups.

Since Shor’s discovery of the quantum error correcting codes , a large number of examples have been constructed. Most of them belong to the class of additive codes . More specifically, codewords of an additive code form a common eigenspace of several commuting stabilizer operators, each of which is a product of Pauli matrices acting on different qubits. A peculiar property of toric codes  is that the stabilizer operators are local: each of them involves only 4 qubits, each qubit is involved only in 4 stabilizer operators, while the code distance goes to infinity. (The number 4 is not a matter of principle; it could be any constant). Furthermore, this locality is geometric while the codeword subspace and error correction properties are related to the topology of the torus. Operators acting on codewords are associated with 1-dimensional homology and cohomology classes of the torus (with $`𝐙_2`$ coefficients). Similar codes can be defined for lattices on an arbitrary closed 2-D surface. In this paper we extend this definition to surfaces with boundary. A similar construction has been proposed by M. Freedman and D. Meyer .

Let us briefly recall the definition and the properties of the toric codes.

In a toric code, qubits are associated with edges of an $`n\times n`$ square lattice on the torus $`T^2`$. To each vertex $`s`$ and each face $`p`$ we assign a stabilizer operator of the form:

$$A_s=\underset{j\mathrm{star}(s)}{}\sigma _j^x,B_p=\underset{j\mathrm{boundary}(p)}{}\sigma _j^z.$$
(1)   
(Note the dependencies between the stabilizer operators: $`_sA_s=_pB_p=1`$). A codeword is a vector $`|\xi `$ which satisfies the following conditions

$$A_s|\xi =|\xi ,B_p|\xi =|\xi \text{for all}s,p.$$
(2)   
The codeword subspace $`C`$ is 4-dimensional, so it can be identified with the Hilbert space of two logical qubits. This identification goes through the algebra $`𝐋(C)`$ of operators acting on $`C`$ which we call logical operators. (They are also called informational operators ). Any logical operator can be extended to the large Hilbert space $`(𝐂^2)^{2n^2}`$ of the physical qubits (which are associated to the edges of the lattice). Such an extension is not unique but it can be chosen so that to commute with all $`A_s`$ and $`B_p`$. Operators with this property form an algebra $`𝒢`$. In order to get the algebra $`𝐋(C)`$, we take into account that $`A_s`$ and $`B_p`$ act on $`C`$ as the identity operator and thus should be identified with the identity. In a rigorous language, $`𝐋(C)`$ is the quotient of $`𝒢`$ by the ideal generated by $`A_s1`$ and $`B_p1`$. (This applies to any additive code).

To be more particular, consider an operator of the form

$$Y(c,c^{})\stackrel{\mathrm{def}}{=}\underset{ic}{}\sigma _i^z\underset{jc^{}}{}\sigma _j^x,$$
(3)   
where $`c`$ is a 1-cycle with $`𝐙_2`$ coefficients, $`c^{}`$ is a 1-cycle on the dual lattice. (The edges of the original and the dual lattice are in 1-to-1 correspondence, so the two lattices share the qubits). The operator $`Y(c,c^{})`$ commutes with every stabilizer operator and thus maps the codeword subspace $`C`$ to itself. This map depends only upon the homology classes of the cycles $`c`$ and $`c^{}`$, so we can denote it by $`Y([c],[c^{}])`$. (In terms of the general construction from the previous paragraph, the transition from cycles to homology classes corresponds to quotienning by $`A_s1`$ and $`B_p1`$). Thus the operators $`Y(c,c^{})`$ form a linear basis of the algebra $`𝒢`$ whereas $`Y([c],[c^{}])`$ form a linear basis of $`𝐋(C)`$<sup>1</sup><sup>1</sup>1 Note that operators form linear spaces over $`𝐂`$ while the cycles and homology classes have a $`𝐙_2`$ additive structure. There is nothing wrong here because addition of cycles corresponds to operator multiplication. Let $`[c_1]`$, $`[c_2]`$ be some basis elements of the group $`H_1(T^2,𝐙_2)`$, and $`[c_1^{}]`$, $`[c_2^{}]`$ form the dual basis of $`H^1(T^2,𝐙_2)`$. We can represent these homology and cohomology classes by cycles $`c_1`$, $`c_2`$, $`c_1^{}`$, $`c_2^{}`$ on the original and the dual lattice, respectively. The corresponding logical operators $`Y_1^x=Y(0,[c_1^{}])`$, $`Y_2^x=Y(0,[c_2^{}])`$, $`Y_1^z=Y([c_1],0)`$, $`Y_2^z=Y([c_2],0)`$ are generators of the algebra $`𝐋(C)`$. They have the same commutation relations as $`\sigma _1^x`$, $`\sigma _2^x`$, $`\sigma _1^z`$, $`\sigma _2^z`$, so we can map ones to the others. This way we establish an isomorphism between the algebra $`𝐋(C)`$ and the algebra $`𝐋(𝐂^2𝐂^2)`$, whence the correspondence between the codewords and quantum states of two qubits.

This construction will be our starting point. Instead of dealing with toric lattices, we consider a finite square lattice on the plane. A new feature arising here is a boundary. Generally, the boundary can be of two types, see Fig. 1. We will call them an $`x`$-boundary and a $`z`$-boundary.

The simplest example of a boundary code can be built on the lattice having two pieces of $`x`$-boundary and two pieces of $`z`$-boundary, in alternating order (see Fig. 2). Under a suitable convention, an $`n\times m`$ lattice has $`nm`$ vertical edges and $`(n+1)(m+1)`$ horizontal edges, so the code has $`2nm+n+m+1`$ qubits. The stabilizer operators are very similar to ones in the toric code. The definitions (1), (2) remain essentially the same, but we must specify what are the faces and the vertices. If a face $`p`$ is such that all its boundary edges are present (e. g. the face $`p_2`$ in the Fig. 2) then the operator $`B_p`$ is well defined by (1). There are also incomplete faces lacking one edge, e. g. the face $`p_1`$ in Fig. 2. We still assign a stabilizer operator to such a face according to (1), with boundary($`p`$) containing all existing boundary edges of the face $`p`$. Thus there are $`n(m+1)`$ face stabilizer operators. Similarly, we assign $`(n+1)m`$ stabilizer operators to all vertices with 4 or 3 incoming edges. (Free ends of edges do not bear stabilizer operators). All the stabilizer operators are independent.

Here is a complete list of stabilizer operators for the lattice shown in Fig. 2: $`A_{s_1}=\sigma _{\mathrm{v}_1s_1}^x\sigma _{s_1s_4}^x\sigma _{s_1s_2}^x`$, $`A_{s_2}=\sigma _{s_1s_2}^x\sigma _{s_2s_5}^x\sigma _{s_2s_3}^x`$, $`A_{s_3}=\sigma _{s_2s_3}^x\sigma _{s_3s_6}^x\sigma _{s_3\mathrm{v}_2}^x`$, $`A_{s_4}=\sigma _{\mathrm{v}_1s_4}^x\sigma _{s_1s_4}^x\sigma _{s_4s_5}^x\sigma _{s_4s_7}^x`$, $`A_{s_5}=\sigma _{s_4s_5}^x\sigma _{s_2s_5}^x\sigma _{s_5s_6}^x\sigma _{s_5s_8}^x`$, $`A_{s_6}=\sigma _{s_5s_6}^x\sigma _{s_3s_6}^x\sigma _{s_6\mathrm{v}_2}^x\sigma _{s_6s_9}^x`$, $`A_{s_7}=\sigma _{\mathrm{v}_1s_7}^x\sigma _{s_4s_7}^x\sigma _{s_7s_8}^x`$, $`A_{s_8}=\sigma _{s_7s_8}^x\sigma _{s_5s_8}^x\sigma _{s_8s_9}^x`$, $`A_{s_9}=\sigma _{s_8s_9}^x\sigma _{s_6s_9}^x\sigma _{s_9\mathrm{v}_2}^x`$ and $`B_{p_1}=\sigma _{\mathrm{v}_1s_1}^z\sigma _{s_1s_4}^z\sigma _{\mathrm{v}_1s_4}^z`$, $`B_{p_2}=\sigma _{s_1s_2}^z\sigma _{s_2s_5}^z\sigma _{s_4s_5}^z\sigma _{s_1s_4}^z`$, $`B_{p_3}=\sigma _{s_2s_3}^z\sigma _{s_3s_6}^z\sigma _{s_5s_6}^z\sigma _{s_2s_5}^z`$, $`B_{p_4}=\sigma _{s_3\mathrm{v}_2}^z\sigma _{s_3s_6}^z\sigma _{s_6\mathrm{v}_2}^z`$, $`B_{p_5}=\sigma _{\mathrm{v}_1s_4}^z\sigma _{s_4s_7}^z\sigma _{s_7\mathrm{v}_1}^z`$, $`B_{p_6}=\sigma _{s_4s_5}^z\sigma _{s_5s_8}^z\sigma _{s_7s_8}^z\sigma _{s_4s_7}^z`$, $`B_{p_7}=\sigma _{s_5s_6}^z\sigma _{s_6s_9}^z\sigma _{s_8s_9}^z\sigma _{s_5s_8}^z`$, $`B_{p_8}=\sigma _{s_6\mathrm{v}_2}^z\sigma _{s_6s_9}^z\sigma _{s_9\mathrm{v}_2}^z`$.

The dimensionality of the codeword subspace can be found by a simple counting argument. There are $`2nm+n+m+1`$ qubits and $`2nm+n+m`$ independent stabilizer operators which leave us with $`(2nm+n+m+1)(2nm+n+m)=1`$ degrees of freedom, i. e. only one logical qubit can be encoded. Thus the codeword subspace $`C`$ is 2-dimensional. Let us find the logical operators acting on it. Firstly, we are to characterize the algebra $`𝒢`$ of operators commuting with all the stabilizer operators. Then we will find $`𝐋(C)`$ by taking a quotient.

Let us denote the lattice and the dual lattice by $`L`$ and $`L^{}`$, respectively. Both lattices have boundaries which are, by definition, formed, by free ends of edges. (Recall that the free ends are exactly the vertices which do not bear stabilizer operators). Note that the $`x`$-boundary belongs to the lattice $`L`$ while the $`z`$-boundary belongs to $`L^{}`$. From now on, we denote these two boundaries by $`V`$ and $`V^{}`$, correspondingly. In Fig. 2, $`V`$ includes the free ends denoted by $`V_1`$ and $`V_2`$, whereas $`V^{}`$ is represented by $`V_1^{}`$ and $`V_2^{}`$. (It does not matter whether we identify the free ends or consider them as distinct vertices).

A linear basis of $`𝒢`$ is given by eq. (3), where $`c`$ is a relative 1-cycle (with $`𝐙_2`$ coefficients) on the lattice $`L`$, and $`c^{}`$ is a relative 1-cycle on the lattice $`L^{}`$. By definition, a relative 1-cycle on a lattice is a 1-chain $`c`$ whose boundary $`c`$ is contained in the boundary of the lattice. Equivalently, a relative 1-cycle is an ordinary (or absolute) 1-cycle on a lattice obtained from the original one by gluing all the free ends together. (To prove that the operators $`Y(c,c^{})`$ actually make up a linear basis of $`𝒢`$, expand a generic linear operator into products of Pauli matrices and try to commute with $`A_s`$ and $`B_p`$).

The action of $`Y(c,c^{})`$ on the codeword subspace $`C`$ depends only upon the relative homology classes $`[c]H_1(L,V,𝐙_2)`$ and $`[c^{}]H_1(L^{},V^{},𝐙_2)=H^1(L,V,𝐙_2)`$. Thus we arrive to the group $`E=H_1(L,V,𝐙_2)H_1(L^{},V^{},𝐙_2)`$. The operators $`Y([c],[c^{}])`$ (where $`([c],[c^{}])E`$) form a linear basis of the algebra $`𝐋(C)`$.

Consider some relative cycle $`c_{12}`$ starting at $`V_1`$ and ending at $`V_2`$, and some relative cycle $`c_{12}^{}`$ starting at $`V_1^{}`$ and ending at $`V_2^{}`$, see Fig. 3. The operators $`Y^z=Y([c_{12}],0)`$ and $`Y^x=Y(0,[c_{12}^{}])`$ generate the algebra of logical operators. Since these two generators anti-commute, we can interpret them as the action of $`\sigma ^z`$ and $`\sigma ^x`$ on the logical qubit.

Let us find the distance of the code we have constructed. By definition, the distance of a code is the minimal size of an error which can not be detected by syndrome measurement but still affects the codeword subspace $`C`$. A general error is just an operator on the Hilbert space of physical qubits. An error $`X`$ is undetectable if it commutes with the stabilizer operators, i.e. belongs to $`𝒢`$. As we know, such operators $`X`$ are linear combinations of $`Y(c,c^{})`$. An operator $`Y(c,c^{})`$ affects the codeword subspace if at least one of the relative cycles $`c`$ and $`c^{}`$ is nontrivial. Thus, the code distance is the length of a shortest path which connects two pieces of boundary of the same type. For an $`n\times m`$ lattice, this number equals $`d=\mathrm{min}\{n+1,m+1\}`$. The code protects against $`\frac{d1}{2}`$ errors.

A similar code can be defined for any pair of mutually dual lattices with boundary. They need not be square lattices; each vertex can have any number of neighbors, and each face can be of arbitrary size. We omit formal definition here. Topologically, the pair of lattices corresponds to a surface $`Q`$ with boundary split into pieces of two types, $`x`$ and $`z`$. The two parts of the boundary will be denoted by $`V`$ and $`V^{}`$, respectively. If we draw the lattices on this surface, the free ends of the first lattice should be attached to $`V`$ whereas the free ends of the dual lattice should be attached to the $`V^{}`$. The above arguments work perfectly in this general case. The basis logical operators $`Y([c],[c^{}])`$ correspond to relative homology classes $`[c]H_1(Q,V,𝐙_2)`$ and $`[c^{}]H_1(Q,V^{},𝐙_2)=H^1(Q,V,𝐙_2)`$. Hence the number of logical qubits is $`m=dimH_1(Q,V,𝐙_2)=dimH_1(Q,V^{},𝐙_2)`$. The code distance is

$$d=\mathrm{min}\{\underset{[c]0}{\mathrm{min}}|\mathrm{𝑠𝑢𝑝}p(c)|,\underset{[c^{}]0}{\mathrm{min}}|\mathrm{𝑠𝑢𝑝𝑝}(c^{})|\},$$
(4)   
where $`c`$ and $`c^{}`$ consist of edges of the corresponding lattices.

Let us consider the case where the surface $`Q`$ is a disk with $`k`$ pieces of $`x`$-boundary (labeled as $`V_i`$) and $`k`$ pieces of $`z`$-boundary (labeled as $`V_i^{}`$), see Fig. 4. Obviously, $`dimH_1(Q,V,𝐙_2)=k1`$, hence $`k1`$ qubits can be encoded. A particular encoding can be specified if we select a basis of $`H_1(Q,V,𝐙_2)`$ and the dual basis of $`H_1(Q,V^{},𝐙_2)=H^1(Q,V,𝐙_2)`$. For example, we can choose the operators

$$Y_i^z=Y([c_i],0),Y_i^x=Y(0,[c_i^{}]),i=1\mathrm{}k1$$
(5)   
to represent the action of $`\sigma _i^z`$ and $`\sigma _i^x`$ on the logical qubits. (Here $`c_i`$ is a path which connects $`V_i`$ with $`V_{i+1}`$, whereas $`c_i^{}`$ connects $`V_i^{}`$ with $`V_k^{}`$).

Finally, we try to explain the physical meaning of the two types of boundary in terms of the topological quantum order (TQO)<sup>2</sup><sup>2</sup>2 The term “topological quantum order” means nontrivial topological properties of the ground state, nothing more specific. and anyonic excitations in the bulk system . (Now we replace a code by a Hamiltonian). Why only two types of boundary conditions? Can one invent a combination of them? The answer is “No”, provided the boundary is rigid, i.e. does not carry gapless excitations. A proof will be published elsewhere ; now we only want to give the idea.

The TQO in the bulk system is characterized by braiding and fusion properties of anyons. There are four sectors (i.e. fundamental particle types): the vacuum sector (no particle), an “electric charge” (which lives on vertices), a “magnetic charge” (which lives on the faces), and a combination of both . These sectors are stable with respect to weak generic perturbations of the Hamiltonian. The stability can be explained by the the nontrivial braiding properties of anyons. Indeed, an “electric” or “magnetic” charge can not simply disappear because that would change the Berry phase of another particle moving around the charge at large distance. (Note that that there is no non-topological long-range interaction between the particles because all excitations in the system have energy gap). However, an “electric charge” can disappear at the $`x`$-boundary, and a “magnetic charge” can disappear at the $`z`$-boundary. So, the bulk TQO is unstable near the boundary. The two types of rigid boundary are just two possible ways to resolve this instability. That is, there are two types of stable boundary TQO consistent with the bulk TQO. One can prove that these two types are the only possible ones. In particular, the combination of an “electric charge” and a “magnetic charge” can not disappear at a rigid boundary because this particle is a fermion. Note that a single “electric” or “magnetic” charge is a boson (with respect to itself).

Acknowledgements. One of us (A. K.) thanks Michael Freedman and David Meyer for a valuable discussion which has helped to establish an isomorphism between our construction and the construction in ref. .