Self-Correcting Quantum Computers

Is the notion of a quantum computer resilient to thermal noise unphysical? We address this question from a constructive perspective and show that local quantum Hamiltonian models provide self-correcting quantum computers. To this end, we first give a sufficient condition on the connect- edness of excitations for a stabilizer code model to be a self-correcting quantum memory. We then study the two main examples of topological stabilizer codes in arbitrary dimensions and establish their self-correcting capabilities. Also, we address the transversality properties of topological color codes, showing that 6D color codes provide a self-correcting model that allows the transversal and local implementation of a universal set of operations in seven spatial dimensions. Finally, we give a procedure to initialize such quantum memories at finite temperature.


I. INTRODUCTION
The issue of stability of self-correcting quantum memories [1,2] at finite temperature has recently attracted much attention. One reason for this is that they are more physical than the models of fault-tolerant quantum computation based on the quantum circuit model [3]. While the latter is based solely on the naked quantum formalism with no dynamics, the topological memory relies on a suitable Hamiltonian that protects quantum information as a classical information is protected in, e.g., a 2D ferromagnet. The original topological memories are placed on a torus, and it is known that they offer stable qubits only starting from four spatial dimensions [2,4,5,6,7]. This may sound pesimistic, but there is a hope that the 3D Bacon model [8] will work [7]. This model is not topological, but inherits the Hamiltonian approach from topological models. Yet, the Hamiltonian for Bacon model is not analytically diagonalisable, and therefore its analysis is quite challenging.
Both the Bacon and the toric models have some similar drawbacks. They do not support a set of universal gates, and no scheme is known for the initialization of these self-correcting memories in the Hamiltonian spirit. Namely, one would like to have something similar to an Ising model, where the state of definite magnetization is prepared by simply switching on a global magnetic field and then switching it off adiabatically. Thus, disregarding for a while the dimension of the model, an interesting question arises: does it exist a self-correcting quantum computer, allowing universal computation as well as a natural initialization scheme?
In this paper we propose a first such model. To this end we use color codes, a class of topological codes with very special transversality properties [9,10]. Color codes are obtained from colexes, a class of lattices introduced in [11], and their underlying mathematical structure is a simplicial homology that differs from the usual one because it is 'colored'. In the color code Hamiltonian models excitations take the form of branyons [11], punctual or extended objects subject to topological interactions. These models are local but require interactions between many spin-1/2 systems, a difficulty that can be overcome. E.g., in Ref [12] present an experimental proposal to implement the many-body interactions present both in toric and color codes. Alternatively, a local two-body Hamiltonian model that effectively yields a two dimensional color code has been described recently [13].
The main idea of the paper is that in a suitable spatial dimension it is possible to find color codes that support universal quantum computing and, at the same time, provide self-correction (which we prove giving a Peierls argument in the style of [2,5]). We also present a scheme of initialization, analogous to that of a ferromagnetic memory. We believe that this is the first proposal of such an initialization, as opposed to standard methods in fault tolerance (usually based on measuring syndrome on some initial product state). There is a remarkable difference between our initialization scheme and that of a ferromagnetic memory. Namely, we need to switch off at some point part of the protecting Hamiltonian, which is not needed in in the latter case. Interestingly, this is compatible with a recent result of Alicki [14], who claims that if we were able to perform quantum computation with the protecting Hamiltonian always on, then we would violate the Second Law.
The paper is organized as follows. We first recall the previous results regarding thermal stability of selfcorrecting quantum memories (Sec. II). In Sec. III we discuss the subsystem picture, which is natural for our analysis of thermal stability. In Sec. IV we describe general properties of stabilizer codes. We also introduce 'dressed' observables -the ones that define the protected qubit. In Sec. V we present our modeling of the interaction with the environment. We recall an upper bound on the decay rate of the autocorrelation functions, and its relation with fidelity. We then formulate sufficient conditions for self-correction, related to the Peierls argument in Sec. VI. In addition, we prove that the given conditions also ensure that the quantum memory is resilient to a certain amount of noise applied suddenly. Next we turn to the construction of the models, which must satisfy the conditions and at the same time allow a universal set of transversal operations (Sec. VII). We give a unified homological picture for toric codes and color codes, and prove in detail that some color codes possess both properties at the same time. Finally, in Sec. VIII we propose a scheme for initialization, measurement and gate application, arguing heuristically why it should work. The scheme relies on the ability to switch off the protecting Hamiltonian for a short time.

II. PREVIOUS RESULTS
The idea of a thermally stable self-correcting quantum memory goes back to [2]. The authors propose a 4D topological model and use a Peierls argument to provide heuristic basis in favour of its thermal stability. In [5] this was proved rigorously using the formalism of quantum dynamical semigroups. In this paper we generalize the latter proof. We give stability conditions that apply to general stabilizer codes, and then apply them to toric and color codes. It should be noted that in the meantime Bacon [8] constructed a 3D model which may be thermally stable, too. However, our tools cannot be applied, because the Hamiltonian is not diagonalizable in that case. In an independent development, the problem of stability of Bacon model was recently considered [15].
Most likely there is no stable quantum memory in 2D. A full proof has been given in [4] in the case of 2d Kitaev model (see also [16] in this context). The no-go results for stabilizer codes have been provided in [6,7]. Even though these results do not lead to a full proof of instability in the weak coupling limit, they point out quite clearly that there is no hope for stability in such models. Also, the 2D Bacon model was shown instable in [7].
Finally, let us note that many works have studied the existence of topological order in finite temperature (see e.g. [17,18,19]) and the main conclusions were compatible with the results on stability of quantum memories.

III. SUBSYSTEM APPROACH TO FAULT-TOLERANT QUANTUM COMPUTING.
The most basic approach to quantum error correction is the following. One considers a subspace, the code, chosen in such a way that, if the initial state belongs to the subspace, and if not too many errors hit the system, there exists a quantum operation, the recovery map, that restores the initial state.
Such a scheme assumes ideal encoding and decoding, but in reality all operations are exposed to decoherence. The prepared state is already erroneous to a certain extent. Then, in fault-tolerant computing schemes, it is subjected to repetitive error correction that keeps the amount of errors stable. At the end of computation, if the ideal recovery existed, one could map the state back to the code subspace, but this is not really available nor needed. Rather, one wants to measure some observable on the state. The measurement is nonideal, but if the state did not suffer too many errors and the measurement does not produce too many either, then the statistics will be arbitrarily close to those expected in the ideal scenario, where encoding and recovery are perfect operations.
To describe the above situation it is more convenient to consider a virtual subsystem [20] (see also [21] in this context). Then the fact that we cannot apply perfect operations does not exclude that we can prepare the subsystem in a given state with arbitrarily high fidelity. For example, in standard hard drives, the sign of any single spin varies in time. However, the majority of signs of all spins (i.e. magnetization) is preserved with tremendous perfection.
The virtual subsystem is actually strictly related to the recovery procedure (see [22] in this context). Namely, the observables acting on the code are lifted to the full space by subjecting them to an operation dual to recovery map [5] (we shall present this construction in section IV C).
In the subsystem picture, if we were able to start with the state within the code the initial state would be ψ V ⊗ φ 0 Anc , where V denotes the virtual subsystem and the second subsystem is H Anc , where ψ is the wanted state of the subsystem. Now, the errors (if not too many of them occur) affect only the other subsystem, which turns into a mixed state.
In reality the encoding is not error-free, so that the initial state is of the form |ψ ψ| V ⊗ ρ 0 Anc . Then, in faulttolerant schemes, there are two contradictory forces: the environment adds errors (which propagate), while the user tries to correct errors. When these forces are balanced we get a dynamical equilibrium: the system is always in a state of the form |ψ ψ| V ⊗ ρ Anc .
The above formulation is natural not only for traditional fault-tolerant error correction schemes, but also for self-correcting models. In these models there is a self-Hamiltonian that causes the environment to do both jobs: adding and removing errors (the latter due to Boltzmann factor). In such situation, the system is (after initial equilibration) for a long time in the state |ψ ψ| V ⊗ ρ β , where ρ β is thermal equilibrium state of the the second subsystem. The Gibbs state of the whole system would be proportional to I V ⊗ ρ β , and the whole system will eventually relax to this state. However, it may exist a critical temperature below which the state of V will be unaffected for a time that scales exponentially with the size of the total system [2].
In standard fault-tolerant schemes (where there is active error correction), entropy is produced by the environment and reduced by error correction. In the selfcorrecting case both are done by the environment. The fight (as usual in phase transition phenomena) is between entropy and energy -entropy causes errors and energy forces correction via Boltzmann factors.
Let us emphasize, that we do not deal here with the so called 'noiseless subsystem" [20]. The noiseless subsystem is protected against some class of errors for arbitrary state of the rest of the system, while here we have protection only when the rest is in some particular state, e.g. Gibbs state, in the case of self-correcting models. Also an error correcting code usually does not form a noiseless subsystem: assuming that the the code can correct up to k errors, only if we start with initial pure state ψ V ⊗φ Anc the subsystem can indeed tolerate k errors. Indeed to tolerate these errors we need to start from the code, which in subsystem picture is the span of ψ V ⊗ φ Anc for all ψ from subsystem, but for a fixed φ Anc . The sketched subsystem picture is especially useful if we want to analyse the interaction of the quantum memory with the environment. Then there are known tools to work with autocorrelation functions of observables. To estimate stability of the memory it suffices to show that these autocorrelations do not decay in time. The suitable observables are those from the algebra of the virtual subsystem.
In section IV we shall describe, first in the standard picture, the error correction based on stabilizer formalism. Then we shall construct suitable 'dressed' observables which define the virtual subsystem.

A. Stabilizer codes
An error correcting code [23,24] is a subspace C of the Hilbert space H that represents a quantum system. The code subspace C is such that any quantum information stored on it can be recovered after it has suffered errors from a set E of correctable errors. Usually error correcting codes are subpaces of systems of n qubits, that is, H = H ⊗n 2 with H 2 a two-dimensional Hilbert space with orthonormal basis {|0 , |1 }. If C encodes k qubits, that is, has dimension 2 k , and corrects any error with support on less than d/2 qubits, we say that the code is a [[n, k, d]] code. The support of an operator is composed of those qubits in which it acts nontrivially. In this context the size of the support of an operator O is usually called its weight and denoted |O|.
An important class of error correcting codes is that of stabilizer codes [25,26], which are defined in terms of an abelian subgroup S ⊂ P of the Pauli group P of n qubits. This is the group which has as generators the usual Pauli operators X i , Z i on the i-th qubit, where |± := (|0 ± |1 )/ √ 2. The subgroups S is called the stabilizer of the code C because its elements |ψ ∈ C are defined by Note that S cannot contain the element −I. The number of encoded qubits in a stabilizer code is with g the number of independent generators of S. To give an expression for the distance of the code we have to introduce the normalizer group N . This is the normalizer of S in P, which coincides with the centralizer of S in P: its elements n ∈ N ⊂ P commute with all the stabilizers s ∈ S. Then the distance of the code C is given by the minimum weight of the elements of N − S, which indeed implement nontrivial unitary operations on encoded states. In fact, it is possible to choose among them the X and Z Pauli operators for the k encoded qubits:X 1 ,Z 1 , . . . ,X k ,Z k ∈ N − S. These operators must satisfy the usual Pauli algebra, so that we haveX 2

B. Error correction
If we put some quantum information into a given code subspace we know that as long as the system does not suffer too many errors it is in principle possible to recover the information without any losses. But of course we are interested in recovering it in practice, which is not necessarily just as easy.
Stabilizer codes have a particularly simple structure that makes recovery from errors relatively easy. The first step in error correction is the measurement of a set of generators s i of the stabilizer S =< s 1 , . . . , s g > .
Let us denote the eigenvalue of the i-th generator after the measurement as (−1) bi , b i = 0, 1 ∈ Z 2 . The list of eigenvalues b = (b i ) ∈ Z g 2 is called the error syndrome. The second step is then to choose, using the syndrome s, a Pauli operator K ∈ P such that We set synd(K) := b when (6) holds, so that synd defines a group homomorphism with kernel N . If the correction operator K is applied to the system it will return to the code subspace C. Whether it returns to the original state that we had encoded will depend on the errors that occurred and the choice of K. To clarify this point, suppose for simplicity that the action of errors amounts just to the application of a Pauli operator E ∈ P to the system. Then we have by assumption KE ∈ N , and the error correction procedure will succeed if in addition KE ∈ S.
In summary, the whole error correction procedure is encoded in a function that takes syndromes b to correction operators K. This corr is such that One should choose corr in such a way that the probability of success for a given source of errors is maximized. However, in practice it is also important that corr can be computed efficiently (say, in polynomial time in the number n of physical qubits), a requirement that may reduce the success probability with respect to the ideal case.

C. Dressed observables and critical syndromes
Take any nontrivial self-adjoint encoded operator N ∈ N − S. Suppose that we initialize the system in an encoded state and we want to keep track of the value of these encoded operator as errors occur, from a theoretical perspective. In particular, we would like to keep track of the value of N were we to correct the system using the above procedure. We may for this purpose introduce the operator where P b is the projector onto the subspace with syndrome b, that is, Note that for encoded states N dr = N . The operator N dr is a more stable version of N , because as long as the system only suffers correctable errors its expectation value does not change. This is not the case for N , which may change even with an error on a single qubit. Given an encoded operator N it is useful to introduce the notion of critical syndromes as those which are just a single-qubit error apart from changing the value of N dr . Let |ψ b denote a normalized state with P b |ψ b = |ψ b (there are a few of them, but what follows does not depend on which one we will choose).
For any Pauli operator E ∈ P we have In particular, the sign is negative if and only if the encoded operator corr(ψ b ) E corr(ψ b + synd(E)) (14) anticommutes with N . For later convenience we set Notice that for E = E 1 E 2 we have When there exist a single-qubit Pauli operator σ such that S(N, σ, b) = −1, we say that b is N -critical. For each N , we denote by crit N ⊂ Z g 2 the set of N -critical syndromes b. Similarly, we denote by crit ′

D. Transversal gates
An important feature of several classes of stabilizers codes is that they allow the implementation of logical gates transversally, that is, performing unitary gates on individual qubits or in small disjoint sets of them. Usually we are interested in stabilizer codes C that encode a single qubit. Then a one-qubit logical gate G that can be implemented in C through a unitary operation of the form is transversal. Here the index i runs over physical qubits. Frequently one has U i = U j , which means that no specific addressing of the physical qubits is necessary, they are all treated on equal footing. A particularly simple case is that of U belonging to the normalizer of P, usually called the Clifford group. Then U is a tranversal gate if for any s ∈ S because for any |ψ ∈ C we must have sU |ψ = U |ψ . An advantage of such tranversal gates is that, when applied with perfect accuracy, they affect the error syndrome of the code in a definite way. More generally it is enough for U to satisfy In section VII F 3 we will consider such gates, which are essential for universal quantum computation. It is clear that from condition (19) we get no information about how U affects the syndrome. However, (17) is a big constraint in this regard. In particular, errors cannot spread. That is, if |ψ is an encoded state and E an error, then U E|ψ = E ′ U |ψ for some E ′ with the same support as E. A less trivial observation is that, in a certain sense, negative error syndromes also do not spread. Suppose that we choose a possibly overcomplete set of stabilizer generators which are local in a given lattice of a certain dimension where the qubits live. Take a region R of this lattice such that no encoded operator has a support completely contained on it. Then if O is a Pauli operator that commutes with all the local generators that have part of their support in R, it follows as a slight generalization of the cleaning lemma of [7] that O|ψ = O ′ |ψ for some O ′ with support only outside R. This means that, if E|ψ is free of negative error syndromes in a region, then the same will be true for U E|ψ because E|ψ = E ′′ |ψ for some E ′′ with support outside R.
Similarly we can consider transversal two-qubit logical gates, which are typically implemented on a pair of equal stabilizer codes through unitaries of the form (17), where now i runs over pairs of equivalent physical qubits on the two codes, so that the U i are two-qubit gates. Finally, it is also possible to consider transversal measurements, where each physical qubit is measured on a given basis and from the net result a measurement for the encoded qubit is obtained.

E. CSS-like codes
CSS-like codes are those stabilizer codes for which the generators of the stabilizer can be chosen so that S = s X 1 , . . . , s X g1 , s Z 1 , . . . , s Z g2 , g 1 + g 2 = g, s X i ∈ P X , s Z i ∈ P Z , with P X := X 1 , . . . , X n , P Z := Z 1 , . . . , Z n . In such codes, X-type (Z-type) logical operators may be chosen from P X (P Z ), that is, so that Then X-type (Z-type) errors can only change the value of Z-type (X-type) encoded operators, and their correction only involves Z-type (X-type) stabilizers. That is, the error correction procedure can be divided into two, and the relevant functions are Then for any Z-type encoded operator N ⊂ N ∩ P Z the corresponding dressed operator takes the form where P Z b is the projector onto the subspace with Zsyndrome b, that is, The dressed X-type Pauli observables are analogous. An important consequence of the form of the dressed observables (11) is that transversal measurements are possible. Namely, if we measure all physical qubits in the X basis (Z basis) we can recover the value of all encoded X-type (Z-type) operators because error correction commutes with measurements. Indeed, after the measurement correction is entirely classical.
Finally, an analogous transversal initialization is possible. If we initialize a product state of the form |0 ⊗n (|+ ⊗n ) and measure all X-type (Z-type) stabilizer operators, the resulting state has well defined Z-type (Xtype) encoded operators. Namely,Z i = 1 (respectively, X i = 1). The state may have many X-type (Z-type) stabilizers with the wrong sign, but indeed the correction of Z-type (X-type) errors is immaterial because such errors cannot change the encoded state. Of course this is the case when environment is absent. We shall discuss initialization in the presence of noise in section VIII A.

V. MODELING INTERACTION WITH ENVIRONMENT
In this section we shall describe the evolution of an open system in the weak coupling approximation. Next we shall recall the relation between the fidelity criterion and the decay rate of observables, and a useful upper bound for the latter [5] (see also [27] in this context).

A. Evolution in weak coupling limit
We consider a quantum system with discrete energy spectrum is coupled to a collection of heat baths leading to the global Hamiltonian where the S α are system operators and the f α bath operators.
We assume that the baths are independent, which excludes such phenomena as decoherence free subspaces (see e.g. [20,28,29]). The evolution of the system in Heisenberg picture in weak coupling limit is the following Hereĥ α are Fourier transforms of the autocorrelation functions of the f α . They describe the rate at which the coupling is able to transfer an energy ω from the bath to the system. In the case of thermal baths, they satisfŷ which is a consequence of the KMS condition [30]. The dissipative part commutes with Hamiltonian part, i.e.
[Ĥ, L] = 0 (whereĤ(X) = i[H sys , X]). Therefore in analysis of thermal stability, it is enough to consider solely the dissipative part. An important property of the dissipative generator is that −L is positive definite in scalar product Moreover we have L(1) = 0, and if the commutant of the system operators S α and H sys is trivial, then the eigenvalue 0 is nondegenerate. This means, that there are no constants of motion -all other observables eventually decay to identity.

B. Fidelity and autocorrelation functions
Since the generator is hermitian in scalar product (28), a strong tool is spectral analysis of L. Namely, for any observable satisfying A, A β = 1 and A, I β = 0 one easily finds that (29) provided that Thus, to show that an observable A is stable, it is enough to estimate − A, L(A) , which can be therefore called decay rate for the observable A. If this quantity decreases exponentially with size of the system, we obtain stability. However, the criterion of stability of quantum information is measured in a most direct way by fidelity. Yet, in some natural situations, the fidelity criterion is equivalent to stability of two complementary observables in terms of autocorrelation function. Namely suppose that we divide the system into two: H V ⊗ H Anc , where the first system is the qubit to be protected. Let X and Z be two Pauli observables, which act on the memory, i.e. they are of the form X V ⊗ 1 Anc and Z V ⊗ 1 Anc . Suppose further that the Gibbs state is proportional to identity on the system V we have [5] the following bound for average fidelity where ǫ is upper bound for the rates − X, L(X) β and − Z, L(Z) β . Therefore, to prove stability of quantum memory it is enough to bound the above decay rates.
One can actually show, that the first inequality holds for whatever physical operation (trace preserving completely positive map Λ, i.e. we havē C. Upper bound for decay rate In [5] the following useful bound for decay rate was obtained: The advantage of this estimate is that it refers directly to the system operators S α rather to their Fourier transforms.

A. Stabilizer code models
Given a stabilizer code, we may consider a Hamiltonian model of the form where t i > 0 are coupling constants and {s ′ i } is a possibly overcomplete set of r generators of the stabilizer S. The elements of the algebra of encoded Pauli operators generated byX 1 ,Z 1 , . . . ,X k ,Z k commute with H, showing that each energy level is at least 2 k -fold degenerate. For a particular choice of the encoded operators, one may split the Hilbert space in such a way that H enc represents the encoded degrees of freedom and H exc characterizes excitations. Let us emphasize that the above division is not yet the one we considered in section III. Indeed, the subsystem H enc is defined by the bare observables, and it is not protected.
In particular, we may choose a basis |b in H exc with the elements labeled by b ∈ Z g 2 so that setting |ψ, b := |ψ ⊗ |b for any |ψ ∈ H enc we have Recall that s i are generators from the complete set (5). Then the states of the form |ψ, b are eigenvectors of the Hamiltonian (35), namely where c i (b) = 0, 1 are obtained from as c i (b) = j c ij b j , with addition modulo 2. Thus the Gibbs state for the Hamiltonian (35) can be written as

B. A bound in terms of critical syndromes
In this section we shall show that the decay rate for a dressed observable N dr is bounded by the probability of a critical syndrome multiplied by some polynomial in the size of the system. Thus, if the probability of the critical syndrome is exponentially small in the size of the system, the observable is stable.
Suppose that we have a Hamiltonian model (35) that interacts with a bath through a coupling of the form For simplicity, we will write with σ running over the three types of Pauli operators and over all sites. We will suppose that our model enjoys the following two properties. First, the t i couplings take only a finite number of values. Let t max be the maximum of these values and t min the minimum. Second, the number of stabilizers s i (from (35)) that contain in their support a given qubit is bounded. When these conditions hold, it follows that the number of different ω-s is finite and independent of the size of the system. Thereforê h max is finite and (33) applies. Let us go back to the dressed operators introduced in section IV C. It is our aim to check how stable they are under thermal fluctuations. From (33) and (15) we have that for any encoded operator N the decay rate of N dr is bounded as follows Here n is the total number of sites, which we will suppose that grows polynomially with the size of the system L, and P critN is the total probability at a given temperature of finding a syndrome that is critical for N , that is When for a given temperature P critN is exponentially small on the size of the system L we say that N dr is stable: it is self-protected by a free energy barrier produced by the Hamiltonian (35). In the following section we will derive for a wide class of systems a set of sufficient conditions for this stability to happen at some finite temperature.

C. A criterion based in connectedness
Here we present a set of conditions which assures that the probability of critical syndrome is exponentially small in the size of the system. These conditions require the excitations to be connected in a suitable way forming clusters, and also that critical configurations always contain clusters of size comparable to the system size. Thus it is essentially an application of Peierls argument [31,32,33] as first done in [2] in the context of quantum computation.
Suppose that the set {s ′ i } of generators of the stabilizer S that appear in Hamiltonian (35) are the nodes of a graph Γ. Alternatively, the nodes represent excitations. Then any syndrome b ∈ Z g 2 corresponds to a subset nds(b). Namely, the i-th node belongs to the set nds(b) if c i (b) = 1. We may introduce paths in the graph in the usual way. This gives rise to a notion of connectedness: a set of nodes is connected if between any two of its nodes there exists a path such that all its nodes are contained in the set. We say that b and b ′ are connected if nds(b) and nds(b ′ ) are not disjoint or if any of the elements of nds(b) is linked to an element of nds(b ′ ). Also, we say that a site j (or physical qubit) touches a node s ′ Rather than a single Hamiltonian model (35), we consider a family of models H L with increasing system size L, each with a corresponding graph Γ L . We assume that |Γ L |, the number of nodes, is polynomial in L. The graphs Γ L must satisfy the following conditions for certain integers λ, µ, ν and a positive number ξ (all independent of L): (i) The number of nodes touched by a site is at most λ.
(ii) The number of links meeting at a node is at most µ.
such that the b i -s are not mutually connected and have at most ν connected components each.
(iv) If |nds(b)| < ξL then b ∈ crit N for any encoded operator N and given any b ′ not connected to b The goal is to give a bound for the probability P critN . We first want to bound the probability P b 0 to find an excitation configuration nds(b) such that b 0 is one of the components in the decomposition (45). Denoting by {b ′ k } the set of all such configurations we have We now show that, for a given b and a encoded op- If σ is a singlequbit Pauli operator, then (i,ii) imply that at most λµ of the b i -s are connected to nds(synd(σ)), say b 1 , . . . , b k . Using (iv) we get Finally, it is easy to show that the number N (l) of connected collections of nodes of size l that contain a given node is bounded as follows (see appendix A): where τ = µ ln 2. Thus, the total number of collections of l nodes with at most ν connected components is bounded by |Γ L | ν l ν−1 e τ l ≤ |Γ L | 2ν e τ l .
Putting together these results we get 50) with δ = βt min − τ positive below a critical temperature. This shows the stability of N dr under the given assumptions.

D. Resilience to noise
It is natural to expect that a self-protecting quantum memory will also be resilient, to some extent, to suddenly applied noise. This is interesting since it allows us to switch off the protecting Hamiltonian for short times, since the unprotected period is equivalent to a noisy process. As we shall show, as long as the amount of noise is below a threshold, we are safe. This threshold will reduce as we increase the temperature till it vanishes at the critical temperature.
To fix ideas, let us consider a process T p in which each qubit undergoes a depolarizing channel characterized by an 'error' probability p. That is, any given operator N is mapped in the Heisemberg picture to where the sum runs over a set of representants of P/iI. We are under the error threshold when in the L → ∞ limit for any given encoded operator N we have But, setting η := log((1 − p)/p), This expression is similar to (44), and we can use a similar reasoning to show that P crit ′ N → 0 for low enough temperature and noise.
First, we attach to each Pauli operator E the set nds(E) ⊂ Γ L consisting of all nodes touched by any site in the support of E. Notice that nds(synd(E)) ⊂ nds(E) and |nds(E)| ≤ λ|E|. Thus, when λ|E| + |nds(b)| < ξL we have (E, b) ∈ crit ′ N . Secondly, we need a substitute of the decomposition (45) to deal with pairs (E, b). To this end, we set E = j E j in such a way that the sets nds(E j ) form the connected components of nds(E). Then we arrange the b i -s and E j -s in maximal connected collections. That is, if one of these collections is {b a1 , . . . b ar , E a1 , . . . , E as }, then the set nds(b a1 ) ∪ · · · ∪ nds(b ar ) ∪ nds(E a1 ) ∪ · · · ∪ nds(E ar ) is connected and disconnected from any set nds(b i ) or nds(E j ) that is not part of the collection. We denote each collection as (E a , b a ), with b a = i b ai , E a = i E ai , so that b = a b a and E = a E a . This gives the desired decomposition of (E, b).
Finally, we observe that when λ|E a | + |nds(b a )| < ξL for all pairs (E a , b a ) we have (N, E a , b a ). We omit the rest of details.

VII. TOPOLOGICAL STABILIZER CODES
In this section we shall construct codes that allow a universal set of transversal gates and, at the same time, give rise to self-correcting local Hamiltonian models. The codes will belong to the important class of local stabilizer codes, in particular topological codes. These are constructed from manifolds where the physical qubits are placed, and have two main characteristics: • There exists a set of generators of the stabilizer S with a spatially local support.
• The encoded operators in N − S are global, they have a support which is topologically nontrivial.
We will give below a more precise characterization. The quantum Hamiltonian models (35) obtained from topological codes are topologically ordered: their ground spaces have a degeneracy of topological origin and their excitations are gapped and subject only to topological interactions. As we will see, excitations can be either particles or higher dimensional objects. Self-correction will appear in codes with excitations of the latter kind.
The original example of topological stabilizer codes are toric codes, as introduced by Kitaev [1,2]. These codes and their generalizations are based on homology theory [34]. Indeed, the number of encoded qubits in a given manifold is dictated by its Betti numbers, i.e., the dimensions of homology groups, which are topological invariants.
An important drawback of toric codes is that they do not allow the transversal implementation of a sufficiently rich set of gates. There exists however a class of topological stabilizer codes that surmount this difficulty: color codes. In 2D [9] they allow the transversal implementation of the so-called Clifford group, the normalizer of the Pauli group in the group of unitary operations on n qubits. In 3D [10] they allow the transversal implementation of a set of operations that, when measurements are included, gives rise to transversal universal quantum computation. Below we will analyze in detail the transversality properties of general D-dimensional color codes.

A. Local stabilizer codes
A family of codes {C L } is local if there exists integers m and n such that (i) each stabilizer S L has a set of generators {s 1 , . . . , s gL } such that |s j | ≤ α, j = 1, . . . , g L , (ii) each physical qubit is in the support of at most β such generators s j and (iii) for any integer d, there exist a code C L with distance bigger than d.
Given a code C L in the family, it is always possible to construct a local quantum Hamiltonian model such that its ground state is C L . Namely, we may set Topological stabilizer codes are local codes in which locality has a geometrical meaning. Physical qubits are placed in a lattice in a given manifold, in such a way that the generators of the stabilizer have a support contained in a small neighborhood of the lattice. The support of nontrivial encoded operators, in turn, must be global, in such a way that the distance of the codes grows with the size of the lattice [35].
Below we will study in full generality the two main examples of topological stabilizer codes, toric codes and color codes. We will unify the treatment of both types of codes through homology theory.

B. Homology groups
Recall that a homology group is defined from an exact sequence such as where A i are Abelian groups and ∂ i , the boundary operators, are homomorphisms with The elements of the subgroup Z 1 := ker ∂ 1 ⊂ A 1 are called cycles. The elements of the subgroup B 1 := im ∂ 2 ⊂ A 1 are called boundaries. Then the condition (58) states that all boundaries are cycles, B 1 ⊂ Z 1 . Because of this, we can divide cycles in homology classes. Two cycles z, z ′ are homologous, z ∼ z ′ , if z − z ′ is a boundary. The homology group H has as its elements the corresponding homology classes. It is the quotient In our case, the elements of the groups A i will be chains of suitable geometrical objects from a lattice in a given manifold, and the homology group will be a topological invariant of the manifold, independent of the particular lattice considered. We are only interested in Z 2 homology, in which the chains in A i are binary formal sums of geometrical objects in a set S i . That is, if a ∈ A i then When needed, we will regard Z 2 chains as sets in the usual way. That is, we identify the chain a above with the set { s ∈ S i | b s = 1 }.
When working with such Z 2 homology groups we may consider the dual exact sequence The dual boundary operators ∂ * i are defined so that for a ∈ S i−1 , b ∈ S i we have a ∈ ∂ i b if and only if b ∈ ∂ * i a. The dual exact sequence (61) gives rise to a dual homology group H * := Z * 1 /B * 1 which is isomorphic to H. Notice that for a ∈ A 1 , s 2 ∈ S 2 and s 0 ∈ S 0 we have C. Codes from homology groups Given a Z 2 homology group H obtained from a lattice in a manifold, as those discussed in the previous section, we can introduce in a natural way a CSS-like stabilizer code C with a basis labeled by the elements of H. The procedure can be summarized as follows. Recall that the abelian groups A i in the exact sequence (57) are constructed from sets of geometrical objects S i . To define the code, we attach physical qubits to the elements of S 1 , X-type stabilizers to the elements of S 2 and Z-type stabilizers to the elements of S 0 . In what follows, we detail the procedure.
First, we attach a physical qubit to each of the elements of S 1 = {r j }, so that n = |S 1 |. For each a ∈ A 1 with a = j a j r j , a j = 0, 1 we define a X-type and a Z-type Pauli operator setting Note that the definitions (64) describe two group isomorphisms. Moreover, Then using (62) As a consequence of (58), [X b , Z b ′ ] = 0 and we can define the stabilizer group S as the subgroup of P with elements of the form It follows then that the operators of the form form, up to phases ±1, ±i, the normalizer group N . If X 1 , . . . ,X k ∈ P X andZ 1 , . . . ,Z k ∈ P Z form a Pauli basis for encoded operators, then X i = X zi and Z i = Z z ′ i for suitable cycles z i ∈ Z 1 , z ′ i ∈ Z * 1 . The cycles z i (z ′ i ) are representants of classesz i ∈ H (z ′ i ∈ H * ) that form an independent set of generators of H (H * ), and thus we have the desired result.
It is instructive to work out explicitly a basis for the resulting code C. To this end, for any a ∈ A 1 we set |a 0 := X a |0 ⊗n , |a + := Z a |+ ⊗n .
Then {|a 0 } and {|a + } are bases of the Hilbert space, with elements labeled by the chains a ∈ A 1 . For any cycles z ∈ Z 1 , z ′ ∈ Z * 1 we define the states Then, as can be easily checked, {|z 0 } and {|z ′ + } are bases for the topological stabilizer code C with elements labeled by homology classes of H and H * , respectively.

Error correction
We analyze now error correction in the code C just described. First, we need a generating set for the stabilizer group, which can be obtained by attaching an operator to each of the elements of S 2 and S 0 . Set for any a 2 ∈ A 2 , a 0 ∈ A 0 , Then if S 2 = {p 1 , . . . , p l }, S 0 = {q 1 , . . . , q m }, we may write Indeed, the above set may be overcomplete. We can choose in that case suitable subsets S ′ 2 = {p 1 , . . . , p g1 } ⊂ S 2 , S ′ 1 = {q 1 , . . . , q g2 } ⊂ S 1 . We may naturally regard any s 2 ⊂ S ′ 2 as some b ∈ Z g1 2 , setting b i = 1 when p i ∈ s 2 , and similarly for S ′ 1 and Z g2 2 . Then, for a ∈ A 1 , That is, for a given Pauli error X a Z a ′ the error syndrome gives us information about the boundaries of a and a ′ . Error correction amounts to choose an operator X c Z c ′ = corr(synd(X a Z a ′ )) with ∂ 1 c = ∂ 1 a and ∂ * 2 c ′ = ∂ * 2 a ′ . It will succeed if and only if a+c ∈ B 1 and a ′ +c ′ ∈ B * 1 , that is, if and only if the correction operator and the error are equivalent up to homology.

Hamiltonian and excitations
Given the generators of the stabilizer in (73), we can consider the quantum Hamiltonian model The excitations of this model are gapped, with two units of energy per stabilizer violation. We say that the excitations related to X pi (Z qi ) generators are X-type (Z-type) excitations. Then, as follows from the previous analysis of error correction, X-type excitations are arranged in the form of B * 1 boundaries and Z-type excitations are arranged in the form of B 1 boundaries.

D. Generalized toric codes
Consider a lattice in a D-manifold. We call the ndimensional elements of the lattice n-cells: 0-cells are vertices, 1-cells are links, 2-cells are faces, and so on. For n = 0, . . . , D, let S n be the set of all n-cells, and C n the corresponding abelian group of chains. We in addition set C D+1 = C −1 = 0, with 0 the trivial group. For n = 1, . . . D we introduce the boundary operators in the usual way. That is, they are homomorphisms such that if the (n − 1)-cells s i ∈ S n−1 form the geometrical boundary of the n-cell s then ∂s = {s i }. We also define the homomorphisms ∂ D+1 and ∂ 0 in the only possible way.
We can obtain a generalized toric code for each d with d = 0, . . . , D. This is the code that corresponds to the exact sequence as described in the previous section. The corresponding homology group is the standard d-th homology group of the manifold, Thus the number of encoded qubits k is h d , the d-th Betti number of the manifold. For example, for d = 1 we have the homology group of curves, so that the number of encoded qubits is equal to the number of independent non-boundary loops in the manifold. Notice that the 0th and the D-th code are just classical repetition codes, with one encoded qubit per connected component of the manifold. The dual sequence can be visualized more easily in the dual lattice, in which r-cells become (D−r)-cells. Indeed, in the dual lattice the dual exact sequence corresponds to the exact sequence of thed-th homology group, wherē Thus, in a d-th color code the relevant homology groups are Hd and H d . Cycles take the form thus of closedd-and d-branes, which are mapped to operators using (64). The commutation rules of closed brane operators are purely topological. Namely, given a closed d-brane z ∈ Z d and a closedd-brane z ′ ∈ Zd, the operators X z and Z z ′ anticommute if z and z ′ intersect and odd number of times. Otherwise they commute.

Branyons
For d = 1, . . . , D − 1, the Hamiltonian model (75) of a d-th toric code contains two kinds of brane-like excitations, which are created by open d andd-brane operators. Z-type excitations are closed (d − 1)-branes and X-type excitations are closed (d − 1)-branes in the dual lattice. Indeed, both kind of excitations are not only closed but also boundaries. For example, for D = 2 and d = 1 the excitations are 0-branes, that is, particles. They can only be created or destroyed in pairs since they have to be boundaries of strings. These two kinds of particles interact topologically and are thus called anyons. More generally, Z-type (d−1)-branes and X-type (d−1)branes interact topologically and thus deserve the name of branyons [11].
Since (n − 1)-branyons appear at the boundaries of nbrane operators, n = d, D − d, it follows that such operators represent branyon processes. In particular, processes that do not create or destroy excitations are related to closed branes. Then one can derive from the commutation rules for closed brane operators the topological ±1 phases appearing in branyon processes.

Self-correcting models
To fix ideas, let us consider a family of hypercubic latices in a D-dimensional torus. Each lattice has the same lenght L in the D directions. We will show that, for d > 1, the models with Hamiltonian (75) for the d-th code protect Z-type encoded operators in the sense of section VI. Then it follows by duality that for d < D − 1 X-type operators are protected, and thus that for 1 < d < D − 1 we have self-correcting quantum memories, which thus exist for D ≥ 4.
Recall that we have to define a connection scheme for excitations and a correction procedure such that the conditions (i)-(iii) of section VI C are satisified. The notion of connectedness of excitations, that is, of (d − 1)-cells, is naturally given by the lattice. To translate this into the language of section VI C we just construct a graph with (d − 1)-cells as its nodes in which nodes are connected by a link when the corresponding cells meet at a (d − 2)-cell (notice that d ≥ 2). Condition (i) is clearly satisfied. As for condition (ii), we first notice that any connected set of excitations is closed. Some connected sets are boundaries, so that they can be switched off independently and give no further problems. But those which have non-trivial homology cannot be switched independently. Instead, we have to gather several of them together to get a boundary, but only in a finite amount because H d is finite. Indeed, η = |H d | is a trivial bound and condition ii is satisfied.
Finally, we need a correction procedure, that is, the function corr X in (20). We define it in two steps. In the first step we divide the syndrome b in the components b i of (45). In the second step, for each b i we find a suit-able collection c ′ of d-cells such that ∂c ′ = c = nds(b i ). The choice of the collection of d-cells c ′ must be such that it ensures stability. In fact, we only consider those connected sets of (d−1)-cells that can be put inside a hypercube of length l with l ≤ L, and choose any c ′ that is contained in the hypercube. This task that is always possible because c has trivial homology, and it can be easily checked that it can be accomplished in polynomial time in l. We leave the correction of other sets of (d − 1)-cells undefined, because it is not important. Now that we have a correction procedure, we can check condition iii. It suffices to show that no Z-syndrome b ∈ Z g2 2 that only contains connected sets of size at most L/2 − 1 can be critical. To this end, take any d-cell t and let us check whether b is X t -critical. Let s i be the connected components of the set of (d − 1)-cells related to b with which t is in contact. Both t and these sets s i are contained in a hypercube of length L − 1, because each s i is contained in a hypercube of length L/2 − 1. Therefore, using the notation of (74) we have that the operator corr X (b)corr X (b + S ′ 2 ∩ ∂ 1 t) has support in the hypercube of length L − 1 and thus has trivial homology. This implies condition iii and thus the the stability of N dr for any given N ⊂ P Z .

E. Generalized color codes
Color codes are local codes that are constructed in a special kind of lattices called D-colexes that live in Dmanifolds. We will first describe color codes without referring to homology, and then give a homological picture to fit them in the general framework given above. As in the case of toric codes, several color codes labeled with d = 0, . . . , D can be obtained from a given lattice, which again will display d − 1 dimensional and D − d − 1 dimensional excitactions. However, unlike in toric codes these excitation can branch and form nets.

D-colexes
A D-colex Λ is a D-dimensional lattice with certain colorability properties. Such lattices Λ can be described [11] in terms of their 1-skeleton or graph, wich is (D + 1)valent and has D + 1 colorable edges. Here, instead, we choose to define a D-colex Λ in terms of its dual lattice ∆. From now on D is an integer, D > 0.
Definition 1 A lattice Λ is a D-colex if its dual lattice ∆ is a simplicial lattice with (D + 1)-colored vertices that forms a closed D-manifold.
Recall that an n-simplex is the convex hull of a set of (n + 1) affinely independent points. In a simplicial Ddimensional lattice all the n-dimensional cells are homeomorphic to n-simplices. A closed manifold is a compact manifold without boundaries. For example, for D = 1 it must be a circle, and for D = 2 [9] it could be a sphere, a projective plain, a torus, etc. That the vertices of ∆ are (D + 1)-colored means that we have attached labels to vertices from a set Q with D + 1 elements or colors, in such a way that two vertices connected by a link never share the same color. At first sight it may seem unclear whether a D-colex can be constructed in arbitrary manifolds, due to the colorability constraints. However, in [11] a construction is given to obtain D-colexes from arbitrary lattices.
We will denote the set of all n-simplices in ∆ as ∆ n , n = 0, . . . , D. The coloring of vertices induces a coloring of n-simplices. Namely, given a subset of colors q ⊂ Q with n + 1 elements, we define the subset ∆ q ⊂ ∆ n of those n-simplices such that their n+1 vertices are labeled with the elements of q. A coloring for the cells of the Dcolex Λ is also induced. Let us write λ * for the dual (D − n)-simplex of a n-cell λ and δ * for the dual (D − n)cell of a n-simplex δ. Then if δ is a q-cell we say that δ * is aq cell, withq the complement of q in Q. As with simplices, the set of all n-cells of Λ is Λ n and the set of q-cells is Λ q ⊂ Λ n , q ⊂ Q, |q| = n. Note in particular that vertices are colorless. Indeed, the colorability of vertices in Λ has its own content: vertices are bicolorable -that is, the graph of Λ is bipartite -if and only if the manifold is orientable. In general Λ may be composed of m connected components Λ α , α = 1, . . . , m. We will regard each of these components as a '(D+1)-cell', setting Λ Q := Λ D+1 := {Λ α }.
The previous notation for ∆ and Λ can be extended to individual simplices and cells. Namely, δ n ⊂ ∆ n will denote the set of n-simplices that are part of an m-simplex δ ∈ ∆ m , D ≥ m ≥ n ≥ 0. For example, if δ ∈ ∆ 1 is a link then δ 0 = {ǫ, η} with ǫ, η the vertices in the ends of δ. Similarly, λ n ⊂ Λ n denotes the set of n-cells that are part of an m-cell λ ∈ Λ m , m ≥ n, and λ q ⊂ Λ q denotes the set of q-cells that are part of a q ′ -cell λ ∈ Λ q ′ , q ⊂ q ′ ⊂ Q.
An important feature of D-colexes is that all their dcells, 0 < d ≤ D, are (d− 1)-colexes themselves. This can be easily checked in the dual simplicial lattice ∆. To this end, we first choose a vertex δ ∈ ∆ 0 . If we keep only those simplices that meet at δ, and reduce their dimension in one by erasing the vertex δ, it is easy to check that the resulting simplicial lattice ∆ ′ is dual to a (D − 1)-colex Λ ′ with the topology of a (D − 1)-sphere. This is the colex that correspond to the D-cell δ * . The process can then be continued recursively to get the colexes attached to cells of smaller dimension. Thus, there is a one-toone correspondence between subcolexes and cells. Each d-cell λ ∈ Λ d has as its boundary a (d − 1)-subcolex. If λ is q-colored, q = {q i } ⊂ Q, then its (d − 1)-colex is composed of q i -links, i = 1, . . . , d.
Given a coloring r and a cell λ ∈ Λ q , q ⊂ r ⊂ Q, there exists a unique r-cell, denoted λ r ∈ Λ r , such that λ ∈ (λ r ) q . It is natural to define the intersection of two cells µ ∈ Λ q , ν ∈ Λ r , q, r ⊂ Q, as the collection of disjoint (q ∩ r)-cells µ ∩ ν := µ q∩r ∩ ν q∩r . When µ ∩ ν is empty or has a single element for any cells µ and ν, we will say that Λ is nice. In a nice D-colex, if µ ∈ Λ q and λ ∈ µ s with s ⊂ q ⊂ Q, there exists for any r ⊂ Q with s = q ∩ r a unique ν ∈ Λ r with µ ∩ ν = {λ}, namely ν = λ r .

Color codes
From a D-colex Λ we can obtain several color codes, labeled with an integer d such that 0 ≤ d ≤ D. As we will see, the d-th code is dual to thed-th code. The codes with d =d are self-dual, something that turns out to have interesting computational consequences.
To construct the d-th color code from a D-colex Λ, we first attach a qubit to each vertex v ∈ Λ 0 . As generators of the stabilizer S we choose certain (d + 1)-cell and (d + 1)-cell operators, as we explain next. For any n-cell λ ∈ Λ n , 0 ≤ n ≤ D + 1, we introduce the X and Z cell operators An important property of cell operators is that for any integers 1 ≤ n, m ≤ D + 1 with n + m > D + 1, and for any cells µ ∈ Λ n , ν ∈ Λ m we have [11] [X µ , Z ν ] = 0.
Also, for any q-cell λ, q ⊂ Q, and for any coloring q ′ ⊂ q, we have the relations [11] Definition 2 The d-th color code of Λ, 0 ≤ d ≤ D, is the stabilizer code C with stabilizer S generated by the operators of the form X λ , λ ∈ Λ d+1 , and Z λ ′ , λ ′ ∈ Λd +1 .
From this definition it is clear that dual codes are related through the exchange of X and Z operators, and thus are equal up to a change of basis. From the relations (82) it follows [11] that the number of encoded qubits is where h d = hd is the d-th Betti number of the manifold. The origin of this particular value will be clarified in the following sections. Note that color codes with d = 0 or d = D are not interesting quantum codes, as they are repetition 'classical' codes, which only correct either X or Z errors and encode a qubit per connected component of Λ. Because of this, below we will mainly focus on color codes with 0 < d < D.

A simplicial homology
In this section we will work only in the dual lattice ∆, since it is more suited to explain the underlying homological structure of color codes. We attach to each set of n-simplices ∆ n , 0 ≤ n ≤ D, the abelian group C n of Z 2 chains, together with a trivial group C −1 = {0}, and to each n = 0, . . . , D a boundary operator defined for n > 0 by∂ where δ ∈ ∆ D . The exact sequence from which the d-th color code is obtained is where 0 ≤ d ≤ D. It gives rise to the homology group It follows from (83) that the homology groupsĤd,Ĥ d are isomorphic to the the sum of D d h d copies of Z 2 . In other words, we haveĤ The origin of the binomial coeffiecient is related to color and will be explained in the next section.

Brane-nets
We will now give a geometric interpretation to the Dsimplex cycles discussed in the previous section in terms of branes. For any n-cell λ ∈ Λ n we define c λ ∈ C D as For 0 < n < D, we will now introduce boundary operators that take n-cells to (n − 1)-chains in a 'natural' way. For λ ∈ Λ n we set We say that these definitions are natural because ∂λ, as a set of simplices glued together, is homeomorphic to the boundary of λ in the usual sense. Moreover, if λ is a q-cell, q ⊂ Q, then ∂λ only contains q-simplices. Thus, we can regard n-cells as pieces of n-branes. Indeed, coloring is important here, and we should regard a q-cell, q ⊂ Q, as a piece of a q-brane. As we will see next, such pieces can be put together to form closed q-branes, that is, branes without boundaries in the sense of the ∂ just defined, which is just a reinterpretation of∂ n . Let us fix a particular color subset q with |q| = n and introduce the q-colored chain subgroup C q D , the subgroup of C D generated by all c λ chains with λ ∈ Λ q . That is, the chains in C q D represent the q-branes just discussed. We may then set Z q :=Ẑ n ∩ C q D , B q :=B n ∩ C q D and H q := Z q /B q with the net result Thus, the homology of q-branes for a fixed q is just the usual brane homology. This result is shown in [11] by constructing from the colex Λ a q-reduced lattice in which all n-cells correspond to q-cells of Λ.
In summary, the cycles in Z q can be regarded as closed q-branes, which are also cycles inẐ n . In general, cycles inẐ n will combine several pieces of such q-branes of different color, forming n-brane-nets [11]. In this sense,Ĥ n is a n-brane-net homology group, as opposed to the usual H n homology group of n-branes. This discussion already suggests thatĤ n contains several copies of H n , but how many of them? To answer this, let us consider color subsets q i ⊂ Q, i = 1, . . . D + 2 − n, with |q i | = n and |q i ∩ q j | = n − 1 for i = j. It turns out [11] that if z i , i = 1, . . . D + 1 − n, are q i -branes, all of them homologous in the usual sense of H n homology, then up toĤ n homology, which shows that only D n color combinations are independent, which finally explains (87).
In a d-th color code the relevant homology groups arê Hd andĤ d , with the correspondingd-and d-brane-nets, which are mapped to operators using (64). The commutation rules of closed brane-net operators are purely topological. Namely, given a closed q-brane-net z ∈Ẑ q , |q| = d, and a closed q ′ -brane-net z ′ ∈Ẑ q ′ , |q ′ | =d, the operators X z and Z z ′ anticommute if z and z ′ intersect and odd number of times and q ∩ q ′ = ∅. Otherwise they commute.

Branyon-nets
For d = 1, . . . , D, the Hamiltonian model (75) of a d-th color code contains as in toric codes two kinds of brane-like excitations, (d − 1)-branyons and (d − 1)branyons. These are created with the brane-net operators discussed in the previous sections, in particular with open brane-nets since the excitations appear at their boundary. Then, unlike in toric codes, branyons can form nets and we must talk about branyon-nets. As branes in the previous sections, branyons can be labeled with colors. Namely, a q-branyon is the boundary of a q-brane.
We will only discuss (d−1)-branyons, which are related to violations of the stabilizer conditions at (d + 1)-cells.
The case of (d − 1)-branyons is analogous. If λ ∈ Λd +1 is a q-cell, we say that the corresponding excitation is a (Q − q)-branyon excitation. We know that branyon excitation must be arranged in closed structures. This fact is reflected [11] in a 'conservation law' at (d + 2) cells. Namely, for λ a q-cell, |q| =d + 2, and for any r, s ⊂ q, |r| = |s| =d + 1 we have which is just a special case of (82). This implies, for example, that at a given (d + 2) cell there cannot exist a single excited (d + 1)-cell.
In the previous section we have seen that only D d color combinations are enough to label an independent set of d-brane operators. We will now show that we can locally transform a set of branyon excitations into a new set that only contains branyons from D d independent colors. By 'locally' we mean that it is enough to act in the neighborhood of the undesired excitations. We start choosing a color q 0 ∈ Q. We want to show that we can eliminate all q-branyon excitations with q 0 ∈ q or, to put it in a different way, all excitations located at cells λ ∈ Λd +1 of color q with q 0 ∈ q. The total set of excitations corresponds to the boundary of some c ∈ C D , that is, they can be switched off with X c . Notice that all the q-cells with q 0 ∈ q that touch a (Q − q 0 )-subcolex are part of it. Then the restriction of X c to those (Q − q 0 )subcolexes that contain the undesired excitations will do the job.
Once we have reduce the branyonic excitations to the D d color combinations, each color may be treated independently as in the previous section. That is, the branyons of each color form boundary (d − 1)-branes.
Finally, we note that, as in the case of generalized toric codes, one can derive [11] from the commutation rules for closed brane operators the topological ±1 phases appearing in branyon processes.

Self-correcting models
Regarding self-correction, color code models behave very much like toric code models. That is, for d > 1, the models with Hamiltonian (75) for the d-th code protect Z-type encoded operators, and for d < D − 1 they protect X-type operators. Instead of repeating the analysis already done for toric codes, we will just mention the new features that appear in color codes. In particular, we consider the correction of X-type errors.
The first difference is the lattice, but any periodic Dcolex will do, and the existence of periodic lattices follows from the procedure given in [11] to construct D-colexes from arbitrary lattices. The second difference is that now we deal with branyon-nets instead of branyons, but this does not make such a big difference due to the discussion in the previous sections. In this regard, we first need a notion of connectedness of (d + 1)-cells. This is already implicit, for example, in (93): we construct a graph with (d + 1)-cells as its nodes in which nodes are connected by a link when the corresponding cells are part of the same (d + 2)-cell (notice that d ≥ 2). As for the corr function, we transform each connected set of excitations using the procedure of the previous section into a collection of (d − 1) boundaries of D d colors, so that each color can be independently treated exactly as in a toric code.

F. The transversality properties of color codes
Color codes can have very special transversality properties when the lattice and its topology are suitably tuned. In this section we will treat this issue in detail. To this end, we start explaining a simple way to consider D-colexes in manifolds with boundary. We then describe a particular topology for the manifold: in the shape of a D-simplex in which each face has different properties. Finally, we analyze the transversality properties of the resulting simplicial codes.

Boundaries
Up to now we have only considered colexes Λ in closed D-manifolds. However, richer color codes can be obtained by introducing suitable boundaries in the manifold [9,10]. The easiest way to describe such boundaries is as collections of missing cells in the lattice. For a missing cell in Λ we really mean a missing generator of the stabilizer. When the removed generator is independent from the remaining ones, the number of encoded qubits k gets increased (4). This can be understood also in homological terms. Consider a q-brane c ∈ C D with a boundary, |q| = d. Given an encoded state |ψ , the state X c |ψ will have stabilizer violations at those (d + 1)-cells that form the boundary of c. But if we eliminate the generators that correspond to these (d + 1)-cells then X c will belong to the stabilizer and thus we should consider c a closed q-brane. This way, as cells are eliminated we are introducing in the manifold areas in which suitable branes can have a boundary and still be closed. It is as if we had removed a piece of manifold in these aereas, thus creating a boundary. Such an introduction of a boundary does not change homology only in the way just discussed. In addition, when we remove a q-cell the corresponding generator, which can be regarded as a d-brane, transforms into an encoded operator in N − S. Thus, this d-brane should no longer be considered a boundary, but rather a nontrivial cycle.
Although for our purposes it will be much more convenient to describe boundaries as big missing cells in the lattice, this would not be convenient at all in an implementation of the model. Fortunately it is possible to adopt a different approach, as discussed in [36] in the context of 2D toric code models and also in [37] in a more general framework. In this alternative approach boundaries appear at interfaces between the topologically ordered phase and other phases in which some of the branyons are condensated.

Simplicial color codes
There exists a very special class of color codes which live in simplex-shaped lattices. For D = 2 we have triangular codes [9], which bear this name because their lattice is a triangle: each side of the triangle corresponds to a different kind of boundary. For D = 3 we have tetrahedral codes [10], and more generally for arbitrary D we may consider simplicial codes. Instead of giving a detailed description of the properties of each of the boundaries in a simplicial code, it is just easier to give a constructive procedure to obtain such codes, as we do next.
Suppose that we have at our disposal a D-colex Λ with the topology of a D-sphere, D ≥ 2. Since spheres are homologically trivial for D ≥ 2, Λ yields trivial color codes with k = 0, no encoded qubits. Let us now choose a vertex of Λ and proceed to remove the corresponding physical qubit and all the (d + 1)-and (d + 1)-cells that meet at this vertex. The resulting lattice looks like a Dsimplex, because it is a D-ball with its boundary (D −1)sphere divided in the D + 1 regions that where in contact with each of the D+1 removed D-cells. It can be checked using (82) that only two independent generators of S are eliminated in the process, one of X type and the other of Z type. Thus (4), all color codes derived from the new lattice Λ ′ encode exactly one qubit. Since the original lattice must had an even number of qubits [10], it follows that the operators with n the total number of remaining qubits, are the encoded X and Z operators: they belong to the normalizer and because the original number of qubits is even (82). It is easy to construct the smallest example of a simplicial color code for each dimension D ≥ 2. We start with a (D +1)-hypercube, in which we color parallel links with the same color to get [11] a D-colex with the topology of a D-sphere. Then as explained above we eliminate one of its vertices and all neighboring cells. As a result we get a color code with 2 D+1 − 1 physical qubits in which all n-cells have 2 n vertices.

Transversal gates
We will now consider the tranversality properties of color codes. As it turns out, simplicial colexes give the most suitable color codes for the transversal implementation of quantum gates. Thus, we restrict our discussion to them.
First, it is clear that the transversal implementation of the logical X and Z operators is always possible, since they take the form (94). The same reason makes transversal measurements of X and Z are always possible. Similarly, the two-qubit controlled not (CNot) gate can always be implemented transversally on pairs of equal simplicial codes by applying it to each pair of equivalent qubits. The one-qubit Hadamard gate is more restrictive. As it exchanges X and Z operators, it can only be applied to dual codes, those withd = d.
Again, it can be obtained by applying a Hadamard to each of the physical qubits independently. We want to consider in general the family of one-qubit phase gates where k is a non-negative integer. The case k = 0 is just the X gate. The case k = 1 is important since the gates {C X , H, R 1 } generate the Clifford group. Still more interesting is the case k = 2, because C X and R 2 , together with X and Z intializations and measurements, are enough for universal quantum computation [38]. To study in detail when these gates can be implemented transversally on simplicial color codes, we will introduce next the notion of (j, k)-good colexes. From now on, j, k are integers with 0 ≤ j ≤ D, k ≥ 0.
Note that all colexes are (j, 0)-good. From the first expression for encoded states in (71) and the fact that simplicial colexes have an odd number of physical qubits it follows that simplicial color codes obtained from (d, k)good colexes allow the transversal implementation of R k gates. More exactly, if we apply R k to each physical qubit independently we will get a logical R s k gate, with an odd power s. But since s and 2 k+2 are coprime, there exists an integer r such that R sr k = R 2 k+2 +1 k = R k . The problem with definition 3 is that it is not really operative. But we can give a simpler characterization of (j, k)-goodness. For its proof, see appendix B Theorem 4 A nice D-colex Λ is (j, k)-good for some k > 0 if and only if j ′ := 2j − D ≥ 0, all j-subcolexes are (j ′ , k − 1)-good and Moreover, the ⇐ implication holds even if Λ is not nice.
Since (0, k)-good colexes only exist for k = 0, by repeatedly applying theorem 4 it follows that a (j, k)-good and nice D-colex may exist only if Several conclusions may be derived from this result. For example, that dual codes only allow the transversal implementation of the R 1 gate. It could not be other way else, since if a dual code allowed the transversal implementation of R 2 we would get a stabilizer code with a universal set of transversal unitary gates, something impossible [39]. For fixedd, there is a minimal dimension D for which (d, k)-good nice D-colexes exist, namely In particular, settingd = 1 it follows that the minimal dimension D for which R k may be transversally implementable in a color code is D = k + 1.
Once the bound (102) is established, it only rests to show that it is saturated by some lattice. But the simplest examples of simplicial lattices given in the previous section do indeed saturate the bound. The next question is whether periodic lattices that saturate it exist. This is indeed the case for D = 2, 3, and we will assume that it is also true for higher dimensions.

A. Initialization from thermal states
In the previous sections we have studied how quantum memories resilient to thermal noise can be obtained from local quantum models in 4D and above, both from toric codes and color codes. However, a quantum memory is of no much use if we cannot initialize it. We will now show that it is possible to initialize the self-correcting topological quantum memories as long as we can control the local quantum Hamiltonian. In particular, we will consider toric and color code models with d > 1, so that the dressed version of Z-type encoded operators N are protected, and give a procedure to initialize all such operators to N = 1 with a probability of failure exponentially small in the system size. For D = d = 2, this is just the usual initialization of a 2D ferromagnet with a vertical magnetic field.
Our starting point is a modification of the Hamiltonian (75). We introduce single qubit Zeeman terms and some couplings to reflect the fact that now the strength of the different terms can be controlled: where s runs over all qubits and g X , g Z , g 0 ≥ 0. Before considering the details, let us sketch the initialization procedure. We start from a thermalized state with g Z = g 0 = 1 and g X = 0. Then we switch off the Zeeman terms in some time T 1 . Finally, we 'carefully' switch on the X-type stabilizers in some time T 2 till g 1 = 1. Notice that the Hamiltonian is exactly solvable at all times, since all the terms with non-zero coupling at a given time commute. Moreover, all the terms commute with Z-type encoded operators, precisely the ones that we want to initialize with eigenvalue 1.
We first want to show that, for temperatures 1/β below a critical value, the initial thermalized state satisfies, for any encoded operator N ∈ N ∩ P Z and some t > 0, Recall that g X = 0 and g Z = g 0 = 1. Both for toric and color codes we already have a graph of the excitations that correspond to g Z terms, where nodes are labeled by the q i elements of the lattice. We enlarge this graph by adding a node per physical qubit, to represent the excitations that correspond to the Zeeman g 0 terms. We also add a link from the node of the physical qubit s to the node of q i if {X s , Z qi } = 0, and a link between the nodes of two physical qubits s and s ′ if they are both linked to some q i . For example, in a toric self-correcting code with d = 4 the q i nodes correspond to edges and the s nodes to plaquettes, so that the links of the graph just represent the usual notion of connectedness for plaquettes and edges in a lattice. The Zeeman term is responsible for the tension of membranes built of plaquettes, while the Kitaev term for the tension of the loops, i.e., boundaries of the membranes. It is then clear that any connected set of excitations can be independently switched off with a suitable operator in P X . We can then repeat the reasoning of section VI C to show that those excitation configurations which contain connected sets of size bigger than, say, L/2 are exponentially suppressed with the size of L. Therefore, it suffices to observe that the rest of configurations belong to the sector with N dr = 1 for any N ∈ N ∩ P Z , as we detail next using the language of section VII C. First, the eigenstates of the Hamiltonian may be written as |a 0 for some a ∈ A 1 . The corresponding set of excitations corresponds both to the chain a and its boundary ∂ 1 a ∈ A 0 . But corr(S ′ 2 ∩ ∂a) = X a ′ for some a ′ ∈ A 1 such that both a and a ′ lie in the same hypercube of length L/2, and thus X a X a ′ ∈ S. The result follows.
Once we have shown that the initial thermal state is in the desired sector, it is enough to check that this continues to be true as we switch off and on the interactions as indicated. This follows from the fact that g Z = 1 at all times, as long as we keep the temperature of the system stable. In this regard, the process of switching on g X could be a problem since at start we have arbitrarily many violations of the X pi stabilizers and if g X raises too fast we will put a lot of energy in the system. To avoid this, we require that the switching on is done slow enough for the system to progressively thermalize. We assume that the thermalization time is size independent.

B. Operations
From the discussion in section VII F 3 it follows that 6D color codes are enough to have a set of universal transversal operations. Local CNots require an additional dimensions, so that we need 7 spatial dimensions.

Measurements
The fact that we are dealing with CSS-like codes implies that we may perform transversal X and Z measurements. Typically, measuring a physical qubit in the Z basis requires an interaction Z ⊗ H app with a mesuring apparatus. In this regard, during the measurement we can switch off the X-type stabilizers, which do not commute with the measuring Hamiltonian. Switching off this part of the protecting Hamiltonian is not a source of problems since the corresponding errors do not affect the measurement.

Transversal gates
In order to perform transversal gates we have to temporarily modify the Hamiltonian of the system. This means adding new terms that will not commute with the protecting ones and thus make the analysis difficult. In any event, when a gate is half-way of being completed the system will in general be in a state with a high energy with respect to the protecting Hamiltonian. This could easily be a source of problems.
To circumvent them, we propose to switch off the protective Hamiltonian while performing the gates. We will argue that the gate can be applied with high fidelity to the logical qubits, as long as it can be done fast enough (of course at some constant speed not depending on the required fidelity of the gate). First, notice that we can represent the faulty gate as an ideal gate preceded by some noise operation, so that it is enough to consider a situation with a trivial gate (identity), i.e., qubits are subject solely to the interaction with the environment. Thus, the process can be seen as a noisy channel, so that we can use the results of section VI D, which tell us that the quantum memory can resist a small amount of noise. Indeed, the results in that section where obtained for a depolarizing channel acting independently on each qubit, but they can be generalized to more complicated noises as long as correlations are local.
However, this is not really the end of the story. Even if we could perform transversal gates perfectly and in an instant, the gates themselves will increase the number of excitations. In the case of single-qubit gates we know that excitations cannot spread much, so this is not a big problem. The case of CNot gates is worse, because they copy errors (and thus excitations) from one code to another. It is intuitively clear, however, that as long as excitations are scarce enough this will not affect the encoded qubits. A rigorous approach to this problem requires using similar arguments to those in sections VI C and VI D, but considering two copies of the Γ L lattices together.
In summary, the application of a transversal gate will put some amount of energy per volume unit in the system. As long as the temperature is low enough and the energy not too much, this will not produce an error. Of course, we have to wait some time between gates, so that the injected energy can be dissipated.

IX. CONCLUSIONS
We have constructed a model for a self-correcting quantum computer based on topological stabilizer codes. The model, to be local, requires 7 spatial dimensions. Our model consists of 1) a lattice of qubits exhibiting proper topological and geometrical properties so that 2) a code on this lattice allows a universal set of transversal gates (including measurements) and 3) a protecting Hamiltonian, with controllable coupling constants. We have described the procedures of initialization and measurement of the quantum computer, and how gates should be performed. For the latter, we propose to temporarily switch off the protecting Hamiltonian so that we can avoid problems due to the combined effect of the protecting Hamiltonian and the one needed to perform the gates.
We have then obtained two rigorous results concerning the self-protection of such a quantum computer. First, we have shown within the weak coupling limit regime that the memory is stable, generalizing thereby results of [5]. Second, we have shown that if the memory is exposed to a local noise for a short time the quantum information is preserved. Our further results are not rigorous but are physically well motivated. These comprise the initialization scheme and a reasoning showing that we can perform gates on protected qubits with high fidelity.
We would like to emphasize that as the formulation of a self-correcting quantum computer is a challenge, we decided to relax the number of spatial dimensions D in which our proposals are formulated. The point is to address this problem as a fundamental issue regardless of the dimensionality. Once we have seen that this is possible under the circumstances considered in this paper, then we may reflect on possible ways to lower the dimensionality D where the lattices are embedded. To this end, we should consider our models as simplified models as far as the types of degrees of freedom is concerned. We have only used spin 1/2 or qubits. It is an open question to see whether by including additional degrees of freedom like fermions or bosons, we could induce interactions that may lower the dimension in which self-correcting quan-tum computers are possible [2]. A similar possibility is to consider models with generalized spins and discrete nonabelian gauge symmetry groups [40] which are found to posses string tension and confining properties. Generally speaking, there are instances of quantum theories whose critical dimensions for being stable can be lowered by introducing additional types of degrees of freedom or a combination thereof. This could also be the case here and this possibility we leave it open, but with the new insight gained here, we see that at least with simpler models it is possible to achieve the property of self-correctedness.
Finally, we should discuss the apparent contradiction between our results and and those in ref. [14]. In that paper Robert Alicki argues that a quantum computer could be used to draw work from single heat bath. To this end he assumes that a protected bit cannot be used to draw work from a heat bath, i.e. it does not follow the Landauer principle. The author implicitly does not allow to switch off the protective Hamiltonian. Indeed, when the protective Hamiltonian is all the time on, the protected qubit does not interact with the reservoir, and there is no way to use it as an entropy sink in order to draw work from a single heat bath [41]. On the other hand, if the protective Hamiltonian can be switched off, the qubit can interact with the bath, and it can be used to draw work (see e.g. [42]). Now, in our scheme, we need to switch off part of the Hamiltonian during state initialization, and therefore the conclusions of [14] do not apply. It is interesting that the need of switching off and on the protective Hamiltonian for the quantum computer have been obtained from completely different points of view. Alicki obtains it from an elegant thermodynamical considerations, while we need the switchable protective Hamiltonian in order to avoid non-commuting terms both at initialization and at gate application. Thus, in our approach, the need for switchable protection was a matter of convenience (otherwise, we simply would not be able to present a plausible scheme), while Alicki's argument support the thesis that this property is actually necessary in such a quantum computer.