Fault-tolerant interface between quantum memories and quantum processors

Topological error correction codes are promising candidates to protect quantum computations from the deteriorating effects of noise. While some codes provide high noise thresholds suitable for robust quantum memories, others allow straightforward gate implementation needed for data processing. To exploit the particular advantages of different topological codes for fault-tolerant quantum computation, it is necessary to be able to switch between them. Here we propose a practical solution, subsystem lattice surgery, which requires only two-body nearest-neighbor interactions in a fixed layout in addition to the indispensable error correction. This method can be used for the fault-tolerant transfer of quantum information between arbitrary topological subsystem codes in two dimensions and beyond. In particular, it can be employed to create a simple interface, a quantum bus, between noise resilient surface code memories and flexible color code processors.

Fault-tolerant quantum computation [1,2] holds the promise of protecting an operating quantum computer from decoherence for arbitrarily long times, provided the noise is below a certain threshold.Quantum error correction codes are indispensable for any fault-tolerant quantum computation scheme.Among these, stabilizer codes [3], building on classical coding theory, admit a particularly compact description.In particular, the subclass of topological stabilizer codes (TSCs) [4] is promising for practical applications since TSCs permit a local description on regular D-dimensional lattices.
Two of the most prominent examples of TSCs in two dimensions (2D) are surface codes [5,6] and color codes [7].While surface codes support adaption to biased noise [8] and have better error thresholds than comparable color codes [9], they do not support a transversal phase gate.Gauge color codes, on the other hand, were recently shown to support the transversal implementation of a universal set of gates in 3D [10].Moreover, conversion procedures [11] between color codes in different dimensions allow exploiting their complementary advantages.It is hence desirable to store quantum information in surface code quantum memories while performing computation on color codes.
Here we present a practical procedure that makes such hybrid computational architectures viable.We develop a simple, fault-tolerant conversion scheme between surface and color codes of arbitrary size based on lattice surgery [12,13] and measurement-based quantum computation [14].In fact, we generalize the methodology of lattice surgery to any combination of two-dimensional topological (subsystem) stabilizer codes and consider color-to-surface code switching as an example.The required operations act locally on the boundaries, preserve the 2D structure, and are stabilizers of a topological code.Since all stabilizers of the resulting code have constant size and depth, errors on any of their components can only affect a constant number of qubits, making the protocol inherently fault-tolerant.
This paper is organized as follows.We first briefly review the stabilizer formalism and its generalization to subsystem stabilizers followed by a short introduction to topological codes.Then, we present our main results, a protocol for general topological code switching and colorto-surface code conversion as an application thereof.
Stabilizer formalism.We consider a system comprised of n qubits with Hilbert space H = (C 2 ) ⊗n .The group of Pauli operators P n on H is generated under multiplication by n independent Pauli operators and the imaginary unit i.We write P n = i, X 1 , Z 1 , ..., X n , Z n where X i , Z i are single-qubit Pauli operators acting on qubit i.An element P ∈ P n has weight w if it acts nontrivially on w qubits.We define the stabilizer group S = S 1 , ..., S s for s ≤ n as an Abelian subgroup of P n such that the generators S i are commuting and independent operators ∀i = 1, ..., s and −1 / ∈ S. S defines a 2 k -dimensional stabilizer codespace C = span(|ψ ) of codewords |ψ ∈ H through the condition S i |ψ = |ψ ∀S i ∈ S, encoding k = n − s qubits.We denote by N (S) the normalizer of S which is the subgroup of P n that commutes with all elements of S. That is, elements of N (S) map the codespace to itself.We write L = N (S)/S for the group of logical operators which induces a tensor product structure on C, i.e., C = ⊗ k i=1 H i .This construction implies that different logical Pauli operators are actually distinct, nontrivial classes of operators with an equivalence relation given by multiplication of stabilizers.
The distance of an error-correction code is the weight of the smallest error E ∈ P n such that E is not correctable.The code can correct any set of errors A stabilizer code defined through S has distance d iff N (S) − S contains no elements of weight less than d.Equivalently, any element of L supported on less than d qubits acts as the identity on C. From a slightly different perspective, codewords are degenerate ground states of the Hamiltonian H = − s i=1 S i .Then, correctable errors are local excitations in the eigenspace of H since they anticommute with at least one generator S i ∈ S. Logical operators map the degenerate ground space of H to itself.
A subsystem structure can be induced on a stabilizer code by considering non-Abelian gauge symme-tries [15].The group of gauge transformations is defined as G = L G × S × i where S is a stabilizer group and L G is the group of operators in N (S) − S that are not in L = N (S)/G.This imposes a subsystem structure on the codespace C = H L ⊗ H G where all operators in G act trivially on the logical subspace H L [16].We recover the stabilizer formalism if G is Abelian.As before, a set of errors Errors can also be considered as local excitations in the eigenspace of a Hamiltonian H = − g i=1 G i where g is the number of generators in G and G i are the generators of G.
Topological Stabilizer Codes.Stabilizer codes S are said to be topological if generators S i ∈ S have local support on a D-dimensional lattice.Here we focus on twodimensional rectangular lattices Λ = [1, L] × [1, L ] with linear dimensions L and L in the horizontal and vertical direction, respectively, where qubits are located on vertices (not necessarily all are occupied) but our discussion can be easily extended to arbitrary regular lattices.In agreement with Ref. [4], we call a generator S i ∈ S local if it has support within a square that contains at most r 2 vertices for some constant interaction range r, also called the diameter.Moreover, we require of a TSC that its distance d can be made arbitrarily large by choosing the lattice size large enough.In other words, generators S i are not only local but also translationally invariant at a suitable scale (cf.Ref. [17]).This definition of TSCs can be extended straightforwardly to topological subsystem stabilizer codes (TSSCs) where we impose locality on the generators of G instead of S.Then, the generators of S are not necessarily local.
Topological Code Switching.An intriguing feature of 2D topological codes is that logical operators can be interpreted as moving point-like excitations around the lattice.Specifically, the authors of Ref. [4] prove that for any 2D TSC or TSSC on a lattice with open boundaries there exists a quasi-1D string of tensor products of Pauli operators generating a logical Pauli operator whose support can be covered by a rectangle of size r × L , i.e., a vertical strip of width at most r.Consequently, logical operators can be implemented step-by-step by applying Pauli operations along a path connecting two boundaries such that excitations emerge only at its endpoints.In particular, this implies that each single-qubit Pauli operator, which is contained in a logical Pauli operator and that is not an endpoint, anticommutes with at least two generators.Due to the translational invariance of generators with respect to the underlying lattice, one can always increase the code distance or choose the lattice such that there exists a logical Pauli operator whose support is covered by a vertical strip of maximal width r along the boundary.
Since this is a general feature of topological codes, we can generalize the method of lattice surgery [12,13] to such codes.Therefore, consider any two TSCs or TSSCs with open boundaries that have distances d A and d B respectively.W.l.o.g.we place the lattices such that their vertical boundaries are aligned.Let P A L ∈ L A and P B L ∈ L B be two logical operators defined along the aligned boundaries with maximal width r A and r B , respectively, where r I is the interaction range of code I = A, B. The logical operators act nontrivially on a set of qubits, say Q A and Q B , respectively.Let N I = |Q I | (for I = A, B) and N = max{N A , N B }. W.l.o.g.we assume N A = N .In agreement with Ref. [4], we order the sets Q I according to walks along paths on Λ I running, e.g., from top to bottom such that we can implement P I L in a step-by-step fashion as described above.Let us write Q I = {q I 1 , q I 2 , ..., q I N I } for such an ordering.For ease of notation we will drop the superscripts on q I i in the following whenever the association of the q i to the sets Q I is clear from the context.Consequently, the logical operators take the form for single-qubit Pauli operators P L,qi acting on qubits q i with i = 1, ..., N I .
Having specified the prerequisites, we will now define a fault-tolerant protocol that merges the two codes into one, similar to the method of lattice surgery developed for surface codes [12] and extended to color codes [13].The procedure has the following four steps.
(i) Including ancillas.We introduce a set Q C of N − 1 ancillas initialized in the +1 eigenstates of their respective Pauli-X operators.The ancillas are placed on new vertices along a column between boundaries [see Fig. 1(a)] and we order the set Q C accordingly from top to bottom, i.e., Q C = {q 1 , q 2 , ..., q N −1 }.

More formally, including ancillas in
(ii) Preparing lattices.By adding redundant vertices without qubits, which corresponds to a relabelling, we increase the interaction range on both lattices and the distance between ancillas by at most a constant r = max{r A , r B }.In this step we ensure that horizontal strips of width r contain the same number of qubits in except for the strips beyond and including the last element of Q B .From thereon, we make this a requirement only between sets Q A and Q C , except for the last strip, where Q C contains one qubit less than Q A .Then, we connect the lattices along their vertical boundary such that the resulting merged lattice Λ M has a linear dimension L A + L B + 1 along the horizontal direction.Note that the lattice Λ M is extended by enlarging the separate lattices and increasing the number of ancillas.This step guarantees that the merged code remains topological.Instead, one could have considered a different definition of locality for topological codes and just stretched lattices in order to ensure that the merged code remains topological.
(iii) Merging codes.After merging the underlying lattices, the codes need to be merged.To this end, one measures N merging stabilizers defined on Λ M , which are given by where Z C qi acts on ancilla q i with Z 0 ≡ 1 and Z N ≡ 1, see Fig. 2(a).Since N A ≥ N B , we have to identify (iv) Correcting errors.In order to retain full faulttolerance, d min = min{d A , d B } rounds of error correction are required on the merged code.
We then formulate the following theorem.
Theorem 1.For any two TSCs (or TSSCs) defined on regular 2D lattices with open boundaries, the procedure described in steps (i)-(iv) fault-tolerantly projects onto an eigenstate of P A L P B L .Moreover, all operations therein are generators of a TSC (or TSSC) defined on the merged lattice with potentially increased interaction range and distance no less than the minimum distance of the merged codes.
Proof.Since P A L P B L = i S M i by construction, measuring all stabilizers in Eq. ( 2) is equivalent to a projective measurement of P A L P B L .From the parity of the product of all merging stabilizers one can then deduce the outcome of the logical projective measurement.This projection also merges generators of G A and G B with singlequbit stabilizers acting on ancillas.
To illustrate this, consider the stabilizer group S = i, X 1 , X 2 as a simple example.
The associated codespace is one-dimensional with codeword |+ 1 |+ 2 and we note that X 1 X 2 ∈ S. Projecting onto an eigenstate of Z 1 Z 2 , the two generators of S are merged in the sense that one can identify a new stabilizer group S = i, Z 1 Z 2 , X 1 X 2 where the one-dimensional codeword is a Bell state.
More generally, the projection leaves only gauge transformations that commute with all merging stabilizers.For ease of presentation, let us assume w.l.o.g. that P I L,qi = Z I qi ∀i = 1, ..., N I .Consider a set of generators F I ⊆ G I whose elements have nontrivial commutative properties w.r.t.
given some odd number K and indices {j 0 , j 1 , ..., j K } such that {q iv+j0 , q iv+j1 , ..., q iv+j K } ⊆ Q I for j 0 = 0 and for some value i v .Note that, for any generator G I v ∈ F I to commute with P I L globally, K has to be odd.As illustrated in Fig. 2(b), measuring the stabilizers in Eq. ( 2) merges the generators G I v ∈ F I with single-qubit X-stabilizers of the ancillas, transforming the generators as The set of operators { GI v } v,I for v = 1, ..., |F I | and I = A, B is the largest set of independent operators in i and all merging stabilizers.Hence, the merging procedure does not increase the number of generators of G A × G B × i beyond the addition of the merging stabilizers.As an illustrative example, consider the generator indicated by the shaded region in Fig. 2(a).We can track the step-by-step incorporation of ancilla stabilizers into G A 1 as the merging operators S M 1 , ..., S M 4 are consecutively measured.First, G A 1 is merged with X C q1 in order to commute with S M 1 .Next, the measurements of S M 2 and S M 3 further include X C q2 and X C q3 , respectively, since Finally, S M 4 commutes with G A 1 since it acts in the support of the generator.Altogether, the modified generator is GA , which cannot be written as a product of other generators, commutes with all merging stabilizers, see Fig. 2(b).
Note that there exist at least two generators containing the operator X C qi , ∀i = 1, ..., N B − 1 and at least one such generator for each i = N B , ..., N .Potential errors arising from projections onto the (−1) subspace of some stabilizers across the join can hence be corrected analogously to Ref. [12] since a surface code has effectively been created along the ancillas.In fact, the procedure is fault-tolerant since all operations involved are constantweight stabilizers of the merged code.
The merged code has distance at least d min .To see this, note that the merging procedure reduces the number of logical qubits in the combined code space by one, altering the logical structure of the subspaces only minimally.More specifically, consider the pre-merge logical operations P I L that act on horizontal strips of widths r I such that [ P I L , P I L ] = 0.The post-merge surface has a logical subspace L M partially represented by the logical Pauli operator P A L (or, equivalently P B L ) and for some set of ancillas J ⊆ Q C .The set J is comprised of strings of qubits in Q C , connecting P A L and P B L on Λ M .All other inequivalent operations in L M can be represented by operators acting solely on one of the pre-merge codes (and, possibly, on ancillas).In other words, the merging procedure preserves the structure (up to merges to include ancillas) of all operators in L A and L B , except those equivalent to P I L and P I L , and their weight can only be increased by deformation across the join.Therefore, no multiplication by generators of G M can reduce the weight of such operators below d min .For the same reason, the weights of P A L and P B L cannot be reduced below d min using operators in G M .Consequently, the class of operators equivalent to P M L does not contain any element of weight less than d min .Hence, any nontrivial operator of the merged code has support on at least d min qubits.
What remains to be shown is that the interaction range of any generator of the merged code is at most a constant.The merging procedure increases the interaction range of any modified generator by at most r along the horizontal since this is the maximum width of the vertical strips.The merging operators also have at most diameter 2r + 1 along the horizontal since they act on both strips and ancillas.The preparation of both lattices before merging [see Fig. 1] ensures that the interaction range of the merging stabilizers in the vertical direction is at most 2r.Similarly, the interaction range of the merged generators is increased by at most r through the preparation and again by at most r through the merge itself.
Summarizing, the post-merge code is a well-defined TSC or TSSC of distance d min which encodes k A +k B −1 qubits where k I is the number of logical qubits encoded by G I .Its interaction range is at most 3r, and extending the lattice sizes of lattices Λ A and Λ B allows effectively increasing the lattice size and distance of the merged code.Indeed, the post-merge lattice can be understood as a lattice with linear dimension L×(L A +L B +1) where L is the maximum linear dimension of both codes after increasing the interaction range in step (ii).Note that, although Theorem 1 guarantees that the merged code is a TSC or TSSC, the merging procedure may not be optimal in terms of minimizing the interaction range of the merged code.
Following a merging of two topological codes as described in steps (i)-(iv), the merged code can be split again by measuring all ancillas in the X-basis.This projects onto the separate surfaces with two representative logical Pauli operators P A L and P B L supported on some horizontal strips of G A and G B , respectively.That is, one effectively prepares a logical Bell pair with re-spect to the selected logical Pauli operations.Thus, the two logical subspaces become entangled and information can be teleported from one to the other by measurement.Note that error-correction has to be performed on the separate codes after splitting in order to retain full faulttolerance due to the random outcome of measurements in the X-basis (cf.Ref. [12]).L and a merged X L -operator along both surfaces, e.g., X (M ) L = X (SC) ⊗X (CC) for the case considered in Fig. 3(b).Clearly, the distance of the merged code is still 3.Nevertheless, increasing the weight (and interaction range) of X-stabilizers on the boundary between the two codes could lead to a temporally worse performance in terms of error correction.After three consecutive rounds of error correction on the merged code, we can proceed to split the codes.To this end, we simply measure ancillas in the X-basis, while ceasing to measure merging stabilizers.This procedure projects onto the separate surfaces while entangling the logical operators X (SC) L and X (CC)

L
. Following three rounds of errorcorrection to preserve fault-tolerance, measuring X (CC) L teleports the information according to the circuit displayed in Fig. 4. In conclusion, we have generalized the method of lattice surgery [12,13] to any pair of 2D topological codes.The applicability of our algorithm to all topological codes arises from their property to support logical string operators on the boundary [4].In contrast to the method of code deformation [17][18][19], where the underlying lattice is smoothly deformed through multiple rounds of local Clifford transformations, we drastically deform the lattices through constant-depth lattice surgery.Our approach provides means by which quantum information can be transferred between color and surface codes.The significance of our protocol hence lies in the prospect of incorporating both surface codes for robust quantum memories and color codes for quantum processors in a single quantum computational architecture.
Our findings further motivate experimental efforts to develop architectures that are flexible enough to implement and connect surface and color codes.For instance, ion trap quantum computers [20] may provide a platform soon capable of performing lattice surgery between two distinct codes.In this endeavour, the inherent flexibility attributed to multizone trap arrays [21] may be specifically helpful.Moreover, topological codes and thus our approach to code switching are also obvious choices for fault-tolerant quantum computation with architectures requiring nearest-neighbor interactions in fixed setups, such as superconducting qubits [22] or nitrogen-vacancy diamond arrays [23].However, given the local structure of arbitrary 2D topological codes and the simplicity of our algorithm, the requirements for any architecture are comparatively low.
As an outlook, we expect that the formalism can be generalized to higher dimensions so long as topological codes are considered whose logical operators can be associated with extended objects on the boundary [24,25].Finally, our code-switching method may find application in the design of adaptive error corrections schemes [26].

FIG. 1 .
FIG. 1.(a) Depiction of two topological codes defined on lattices ΛA and ΛB (grid not shown) respectively.Logical Pauli operators P I L of the respective codes I = A, B are represented by red lines and have support on a vertical strip (gray areas) of width rI .Here the diameter of the merging operations S M , defined in Eq. (2) and depicted in parts by dashed, green lines, grows with the lattice sizes.(b) Adding redundant vertices (grey dots) to the lattices increases their interaction range such that QA, QB and QC contain the same number of qubits within each horizontal strip of thickness r between adjacent blue, dashed lines (e.g., the yellow area).

FIG. 2 .
FIG. 2. (a) Projective measurements of stabilizers S M 1 , . . ., S M 4 acting on qubits in QI for I = A, B (blue) and ancillas (red) are depicted by solid green lines.The arrows indicate the ordering of the qubits in QI , in accordance with a walk representing the logical operator P I L .Dashed and shaded regions represent generators acting on qubits in QI that anticommute in parts with P I L .(b) The projective measurement merges existing stabilizers as depicted by solid lines according to Eq. (3).

FIG. 3 .
FIG. 3. (a) Examples of a color code (top) and a surface code (bottom) with distance 3 defined on lattices with open boundaries.Different types of boundaries are color coded.Qubits are located on vertices depicted in blue.While each plaquette in the color code corresponds to both X-and Z-type stabilizers, plaquettes in the surface code correspond to X-type (yellow) and Z-type (orange) stabilizers, respectively.Representative logical Pauli operators XL and ZL are depicted by dashed lines and are tensor products of single-qubit X-and Z-operators, respectively.(b) Merging stabilizers are plaquette operators acting as Z on qubits along the boundary and ancillas (all shown in purple).The merging procedure combines X-type stabilizers and XL, respectively, as displayed.

FIG. 4 .
FIG. 4. Circuit for measurement-based information processing implemented via lattice surgery.The upper and lower single, horizontal lines correspond to the logical qubits encoded in the color and surface codes, respectively.MZZ and MX are projective measurements that project onto an eigenstate of ZL ⊗ ZL and XL ⊗ 1L respectively.The double lines labelled m1 and m2 represent classical conditioning of the XL and ZL gates on the measurement outcomes m1 and m2, respectively.