11
Fault-tolerant interface between quantum memories and quantum processors Hendrik Poulsen Nautrup, 1, * Nicolai Friis, 2, 1 and Hans J. Briegel 1 1 Institut f¨ ur Theoretische Physik, Universit¨ at Innsbruck, Technikerstr. 21a, A-6020 Innsbruck, Austria 2 Institute for Quantum Optics and Quantum Information, Austrian Academy of Sciences, Boltzmanngasse 3, 1090 Vienna, Austria (Dated: August 30, 2017) Topological error correction codes are promis- ing candidates to protect quantum computations from the deteriorating effects of noise. While some codes provide high noise thresholds suit- able 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. Noise and decoherence can be considered as the ma- jor obstacles for large-scale quantum information process- ing. These problems can be overcome by fault-tolerant quantum computation [1, 2], which holds the promise of protecting a quantum computer from decoherence for arbitrarily long times, provided the noise is below a cer- tain threshold. Quantum error correction codes are in- dispensable for any fault-tolerant quantum computation scheme [3]. Among these, stabilizer codes [4], building on classical coding theory, admit a particularly compact description. In particular, the subclass of topological stabilizer codes (TSCs) [5] is promising since TSCs are scalable and permit a local description on regular D- dimensional lattices. Two of the most prominent examples of TSCs in two dimensions are surface codes [6, 7] and color codes [8]. While surface codes support adaption to biased noise [9] and have better error thresholds than comparable color codes [10], they do not support a transversal phase gate. However, gauge color codes were recently shown to sup- port the transversal implementation of a universal set of gates in 3D [11]. It is hence desirable to store quantum information in surface code quantum memories while per- * [email protected] forming computation on color codes in two (and three) dimensions [12]. Here we present a protocol that makes such hy- brid computational architectures viable. We develop a simple, fault-tolerant conversion scheme between two- dimensional (2D) surface and color codes of arbitrary size. Our flexible algorithm for code switching is based on a formalization of lattice surgery [13, 14] in terms of op- erator quantum error correction [15] and measurement- based quantum computation [16]. This introduces the notion of subsystem lattice surgery (SLS), a procedure that can be understood as initializing and gauge fixing a single subsystem code. The required operations act lo- cally on the boundaries, preserve the 2D structure, and are generators of a topological code. Since all generators of the resulting code have constant size, errors on any of their components only affect a constant number of qubits, making the protocol inherently fault-tolerant. As we ex- plicitly show, this generalizes the methodology of lattice surgery to any combination of two-dimensional topologi- cal subsystem stabilizer codes, with color-to-surface code switching as an example of particular interest. While we restrict ourselves to 2D topological codes for the better part of this paper, we show that the essential ingredients of SLS carry over to higher-dimensional codes. In fact, the procedure works even for non-topological codes at the expense of locality. Therefore, our results represent a significant step towards a fault-tolerant interface be- tween robust quantum memories and versatile quantum processors, independently of which topological codes will ultimately prove to be most effective. The method pro- posed here hence has the prospect of connecting different components of a future quantum computer in an elegant, practical, and simple fashion. This paper is organized as follows. We first briefly review the stabilizer formalism followed by a short intro- duction to topological codes. Then, we present our main results, a protocol for general topological code switching and color-to-surface code conversion as an application. I. FRAMEWORK 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 multiplica- tion by n independent Pauli operators and the imaginary unit i. We write P n = hi, X 1 ,Z 1 , ..., X n ,Z n i where X j , Z j are single-qubit Pauli operators acting on qubit j . An arXiv:1609.08062v3 [quant-ph] 29 Aug 2017

Institute for Quantum Optics and Quantum Information, · two-body nearest neighbor interactions in a xed ... It is hence desirable to store quantum ... n has weight w(P)

  • Upload
    vukhue

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Fault-tolerant interface between quantum memories and quantum processors

Hendrik Poulsen Nautrup,1, ∗ Nicolai Friis,2, 1 and Hans J. Briegel1

1Institut fur Theoretische Physik, Universitat Innsbruck, Technikerstr. 21a, A-6020 Innsbruck, Austria2Institute for Quantum Optics and Quantum Information,

Austrian Academy of Sciences, Boltzmanngasse 3, 1090 Vienna, Austria(Dated: August 30, 2017)

Topological error correction codes are promis-ing candidates to protect quantum computationsfrom the deteriorating effects of noise. Whilesome codes provide high noise thresholds suit-able for robust quantum memories, othersallow straightforward gate implementationneeded for data processing. To exploit theparticular advantages of different topologicalcodes for fault-tolerant quantum computation,it is necessary to be able to switch betweenthem. Here we propose a practical solution,subsystem lattice surgery, which requires onlytwo-body nearest neighbor interactions in a fixedlayout in addition to the indispensable errorcorrection. This method can be used for thefault-tolerant transfer of quantum informationbetween arbitrary topological subsystem codesin two dimensions and beyond. In particular,it can be employed to create a simple interface,a quantum bus, between noise resilient surfacecode memories and flexible color code processors.

Noise and decoherence can be considered as the ma-jor obstacles for large-scale quantum information process-ing. These problems can be overcome by fault-tolerantquantum computation [1, 2], which holds the promiseof protecting a quantum computer from decoherence forarbitrarily long times, provided the noise is below a cer-tain threshold. Quantum error correction codes are in-dispensable for any fault-tolerant quantum computationscheme [3]. Among these, stabilizer codes [4], buildingon classical coding theory, admit a particularly compactdescription. In particular, the subclass of topologicalstabilizer codes (TSCs) [5] is promising since TSCs arescalable and permit a local description on regular D-dimensional lattices.

Two of the most prominent examples of TSCs in twodimensions are surface codes [6, 7] and color codes [8].While surface codes support adaption to biased noise [9]and have better error thresholds than comparable colorcodes [10], they do not support a transversal phase gate.However, gauge color codes were recently shown to sup-port the transversal implementation of a universal set ofgates in 3D [11]. It is hence desirable to store quantuminformation in surface code quantum memories while per-

[email protected]

forming computation on color codes in two (and three)dimensions [12].

Here we present a protocol that makes such hy-brid computational architectures viable. We develop asimple, fault-tolerant conversion scheme between two-dimensional (2D) surface and color codes of arbitrarysize. Our flexible algorithm for code switching is based ona formalization of lattice surgery [13, 14] in terms of op-erator quantum error correction [15] and measurement-based quantum computation [16]. This introduces thenotion of subsystem lattice surgery (SLS), a procedurethat can be understood as initializing and gauge fixing asingle subsystem code. The required operations act lo-cally on the boundaries, preserve the 2D structure, andare generators of a topological code. Since all generatorsof the resulting code have constant size, errors on any oftheir components only affect a constant number of qubits,making the protocol inherently fault-tolerant. As we ex-plicitly show, this generalizes the methodology of latticesurgery to any combination of two-dimensional topologi-cal subsystem stabilizer codes, with color-to-surface codeswitching as an example of particular interest. While werestrict ourselves to 2D topological codes for the betterpart of this paper, we show that the essential ingredientsof SLS carry over to higher-dimensional codes. In fact,the procedure works even for non-topological codes atthe expense of locality. Therefore, our results representa significant step towards a fault-tolerant interface be-tween robust quantum memories and versatile quantumprocessors, independently of which topological codes willultimately prove to be most effective. The method pro-posed here hence has the prospect of connecting differentcomponents of a future quantum computer in an elegant,practical, and simple fashion.

This paper is organized as follows. We first brieflyreview the stabilizer formalism followed by a short intro-duction to topological codes. Then, we present our mainresults, a protocol for general topological code switchingand color-to-surface code conversion as an application.

I. FRAMEWORK

Stabilizer Formalism. We consider a system comprisedof n qubits with Hilbert space H = (C2)⊗n. The group ofPauli operators Pn on H is generated under multiplica-tion by n independent Pauli operators and the imaginaryunit i. We write Pn = 〈i,X1, Z1, ..., Xn, Zn〉 where Xj ,Zj are single-qubit Pauli operators acting on qubit j. An

arX

iv:1

609.

0806

2v3

[qu

ant-

ph]

29

Aug

201

7

2

element P ∈ Pn has weight w(P ) if it acts nontrivially onw qubits. We define the stabilizer group S = 〈S1, ..., Ss〉for s ≤ n as an Abelian subgroup of Pn such that thegenerators Si are independent operators ∀i = 1, ..., sand −1 /∈ S. S defines a 2k-dimensional codespaceC = span({|ψ〉}) of codewords |ψ〉 ∈ H through the con-dition S|ψ〉 = |ψ〉∀S ∈ S, encoding k = n−s qubits. Wedenote the normalizer of S by N(S), which here is thesubgroup of Pn 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 (quotient) group of log-ical operators which induces a tensor product structureon C, i.e., C = ⊗k

i=1Hi. This construction implies thatdifferent logical Pauli operators are distinct, nontrivialclasses of operators with an equivalence relation given bymultiplication of stabilizers.

The distance of an error correction code is the smallestweight of an error E ∈ Pn such that E is undetectable.The code can correct any set of errors E = {Ea}a iffEaEb /∈ N(S) − 〈i〉S ∀Ea, Eb ∈ E . A stabilizer code de-fined through S has distance d iff N(S)−〈i〉S contains noelements of weight less than d. Equivalently, any nontriv-ial element of L is supported on at least d qubits. By theabove error-correction condition, an error with weight atmost (d − 1)/2 can be corrected while an error E withweight d/2 ≤ w(E) < d can only be detected. Froma slightly different perspective, codewords are degener-ate ground states of the Hamiltonian H = −

∑si=1 Si.

Adopting this viewpoint, correctable errors are local ex-citations in the eigenspace of H since they anticommutewith at least one generator Si ∈ S, while logical opera-tors map the degenerate ground space of H to itself.

A subsystem structure can be induced on stabilizercodes by considering non-Abelian gauge symmetries [15].The group of gauge transformations is defined as G =LG × S × 〈i〉 where S is a stabilizer group and LG isthe group of operators in N(S) − 〈i〉S that are not ina nontrivial class of L = N(S)/G. This imposes a sub-system structure on the codespace C = HL ⊗HG whereall operators in G act trivially on the logical subspaceHL [17]. While logical operators in L define logicalqubits in HL, operators in LG define so-called gaugequbits in HG. That is, operations in L and LG bothcome in pairs of (encoded) Pauli X and Z operators foreach logical and gauge qubit, respectively. We recoverthe stabilizer formalism if G is Abelian, i.e., LG = ∅.As before, a set of errors E = {Ea}a is correctable iffEaEb /∈ N(S)−G ∀Ea, Eb ∈ E . Errors can again be con-sidered as local excitations in the eigenspace of a Hamil-tonian H = −

∑gi=1Gi where g is the number of genera-

tors Gi ∈ G.

Topological Stabilizer Codes. Stabilizer codes S arecalled topological if generators Si ∈ S have local sup-port on a D-dimensional lattice. Here we focus on two-dimensional rectangular lattices Λ = [1, L] × [1, L′] withlinear dimensions L and L′ in the horizontal and verti-cal direction, respectively, where qubits are located onvertices (not necessarily all are occupied) but our dis-

cussion can be easily extended to arbitrary regular lat-tices. Following Ref. [5], we call a generator Si ∈ Slocal if it has support within a square containing at mostr2 vertices for some constant r, called interaction rangeor diameter. Moreover, we require of a TSC that itsdistance d can be made arbitrarily large by increasingthe lattice size. In other words, generators Si are notonly local but also translationally invariant at a suitablescale (cf. Ref. [18]). This definition of TSCs can beextended straightforwardly to topological subsystem sta-bilizer codes (TSSCs) [19] where we impose locality onthe generators of G instead of S. Then, generators of Sare not necessarily local.

II. TOPOLOGICAL CODE SWITCHING

An intriguing feature of 2D topological codes is thatlogical operators can be interpreted as moving point-likeexcitations around the lattice. Specifically, the authorsof Ref. [5] prove that for any 2D TSC or TSSC on a lat-tice with open boundaries there exists a quasi-1D stringof tensor products of Pauli operators generating a log-ical Pauli operator whose support can be covered by arectangle of size r × L′, i.e., a vertical strip of width atmost r. If S obeys the locality condition, logical opera-tors can be implemented row-by-row by applying Paulioperations along paths connecting two boundaries suchthat excitations emerge only at its endpoints. If S is notlocal, excitations might also emerge elsewhere since logi-cal operators can anticommute with generators that actnontrivially on gauge qubits. Due to the translational in-variance of generators with respect to the underlying lat-tice, one can always increase the code distance or choosethe lattice such that there exists a logical Pauli operatorwhose support is covered by a vertical strip of maximalwidth r along the boundary (or at most a constant awayfrom it).

Since it is a general feature of topological codes to sup-port logical string operators [5], we can generalize themethod of lattice surgery [13, 14] to such codes. To thisend, we consider any two TSCs or TSSCs GA and GB ontwo 2D lattices, e.g., ΛA = [1, LA]2 and ΛB = [1, LB]2,with open boundaries that have distances dA and dB re-spectively. We place the lattices such that their verticalboundaries are aligned. Let PA

L ∈ LA and PBL ∈ LB be

two logical operators defined along the aligned bound-aries with maximal width rA and rB, respectively, whererI is the interaction range of code I = A,B. The logi-cal operators act nontrivially on a set of qubits, say QA

and QB, respectively. Let NI = |QI | (for I = A,B) andN = max{NA, NB}. W.l.o.g. we assume NA = N . Inagreement with Ref. [5], we order the sets QI accordingto walks along paths on ΛI running, e.g., from top tobottom such that we can implement P I

L in a step-by-stepfashion as described above. We write QI = {1, 2, ..., NI}for such an ordering. For ease of notation we denotequbits in the support of P I

L by i = 1, ..., NI since the

3

association of qubits to the sets QI is clear from the con-text. Consequently, the logical operators take the form

P IL = P I

L,1 ⊗ P IL,2 ⊗ ...⊗ P I

L,NI(1)

for single-qubit Pauli operators P IL,i acting on qubits i

with i = 1, ..., NI .

A. Merging Protocol and Code Splitting

Given the two codes GA and GB with respective logicalPauli operators PA

L and PBL along boundaries, the goal

is to achieve a mapping GA × GB 7→ GA × GB × 〈PAL ⊗

PBL 〉 that projects onto an eigenstate of PA

L ⊗ PBL (i.e.,

a Bell state). Therefore, we now define a fault-tolerantprotocol that merges the two codes into one, similar tothe method of lattice surgery, which has been developedfor surface codes [13] and extended to color codes [14].The procedure has the following four steps.

(i) Including ancillas. We introduce a set QC of N − 1ancillas initialized in the +1 eigenstates of their re-spective Pauli X operators. The ancillas are placedon newly added vertices along a column betweenboundaries [see Fig. 1 (a)] and we order the setQC accordingly from top to bottom, i.e., QC ={1, 2, ..., N−1}. More formally, including ancillas in|+〉-states is equivalent to adding N−1 single-qubitX stabilizers to GA×GB. Note that this step is notstrictly necessary but it has been included here tohighlight the similarity to lattice surgery. Nonethe-less, this step is useful if one operates solely on TSCs(rather than TSSCs), since this can allow reducingthe interaction range of the resulting merged code(see Appendix A for details).

(ii) Preparing lattices. Redundant vertices are added tothe lattices ΛA and ΛB without adding correspond-ing new qubits. This corresponds to a relabellingthat increases the interaction range on both latticesand the distance between ancillas by at most a con-stant r2, where r = max{rA, rB}. This is done insuch a way that horizontal strips of width (height) rcontain the same number of qubits in QA, QB, andQC [see Fig. 1 (b)]. Beyond the strip containingthe last element of QB we only require the samenumber of qubits in QA and QC, except for the laststrip, where QC contains one qubit less than QA.The lattices are then connected along their verticalboundary such that the resulting merged lattice ΛM

has linear dimension LA +LB +1 along the horizon-tal direction. This step guarantees that the mergedcode remains topological according to the definitionabove. If a different definition of locality is adoptedfor topological codes, step (ii) can be replaced by astretching of the lattices to ensure that the mergedcode is topological in the same sense as well.

(iii) Merging codes. After combining the underlying lat-tices, the codes are merged. To this end, one mea-sures N merging operators, which are defined on thenew lattice ΛM as

GMi = PA

L,iPBL,iZ

Ci Z

Ci−1 ∀i = 1, ..., N , (2)

where ZCi acts on ancilla i with Z0 ≡ 1 and ZN ≡ 1.

Since NA ≥ NB, we identify PBL,i ≡ 1 for i > NB.

(iv) Correcting errors. In order to retain full fault toler-ance, dmin = min{dA, dB} rounds of error correctionare required on the merged code. For this purpose,the structure of the merged code can be deducedfrom the SLS formalism that is introduced in Ap-pendix A and analyzed in Appendix B.

We then formulate the following theorem.

Theorem 1. — For any two TSCs (or TSSCs) definedon regular 2D lattices with open boundaries, the proce-dure described in steps (i)-(iv) fault-tolerantly projectsonto an eigenstate of PA

L PBL . Moreover, all operations in

steps (iii) and (iv) correspond to generators of a TSSCdefined on the merged lattice with potentially increasedinteraction range and distance no less than the minimumdistance of the merged codes.

For the proof of Theorem 1 we refer to Appendices Aand B, where the required SLS formalism is described infull detail. In this approach, the merged code is effec-tively treated as a subsystem code and the original codesGA and GB are recovered by gauge fixing. Note thatin the merged code, some stabilizers at the boundaryare merged while others can generate new gauge qubits.More details on the merged code structure in the mostgeneral case and in the case of a specific TSSC can befound in Appendices B and C, respectively. After themerging procedure described in steps (i)-(iv), the two in-dividual codes can be recovered1 by measuring all ancillasin the X-basis. In this case the merged code is split andthe two logical subspaces are left in a joint eigenstateof their respective Pauli operators. Quantum informa-tion can then be teleported from one logical subspaceto the other by measurement. This fault-tolerant wayof transferring quantum states from one arbitrary TSC(or TSSC) to another provides a simple method that al-lows exploiting the advantages of different error correc-tion codes. In particular, it can be used to realize aninterface between a quantum memory (e.g., based on asurface code) and a quantum processor (using, for exam-ple, a color code). We will therefore now demonstrateour protocol for this crucial example of two TSCs.

1 Here it is important to note that error correction has to be per-formed on the separate codes in order to retain full fault tolerance(cf. Ref. [13])

4

(a) (b)

FIG. 1. Subsystem lattice surgery between two topological codes (a) Depiction of two topological codes defined onlattices ΛA and ΛB (grid not shown) respectively. Logical Pauli operators P I

L of the respective codes I = A,B are representedby solid red lines connecting qubits (blue dots) within ΛA and ΛB, respectively. These operators have support on a verticalstrip (gray areas) of width rI for I = A,B. Qubits in the support of P I

L are associated with a set QI . Ancillas added in step (i)of the merging protocol are depicted as red dots and are associated with a set QC. Merging operations GM

i , which are defined inEq. (2), are indicated (in part) by dashed green lines (with only the ith component being covered). The product of all mergingoperations acts as PA

L ⊗ PBL such that a collective measurement projects onto a joint eigenstate of the two logical operators.

Here, the diameter of an operator GMi can grow with the lattice sizes since rA > rB. (b) Adding redundant vertices (grey dots)

to the lattices increases the interaction range of the codes such that QA, QB and QC contain the same number of qubits withineach horizontal strip of thickness r between adjacent blue, dashed lines (e.g., the yellow area). Then, the diameter of mergingoperators can be kept constant, i.e. independent of the system size.

B. Color-To-Surface Code Switching

The archetypical examples for TSCs are surface codes(SC) and color codes (CC). Surface codes [6] are definedon 2-face-colorable regular lattices with qubits locatedon vertices. The two colors are identified with X- or Z-type generators SX

p , SZp ∈ S(SC), respectively, acting as

SPp =

∏v∈N (p) Pv, where N (p) is the set of vertices ad-

jacent to the plaquette p and P = X,Z, see Fig. 2 (a).Horizontal and vertical boundaries cut through plaque-ttes and can be associated with their respective colors.The lattice is constructed such that opposite boundariesare identified with the same color. The number of logicalqubits can be obtained by a simple counting argument. Itis given by the difference between the number of physicalqubits and the number of independent stabilizers. For theSC, the former is equal to the number of vertices v, whilethe latter equals the number of faces f . Since v− f = 1,we find that the SC encodes a single logical qubit. Log-ical operators for SCs are strings connecting boundariesof the same color that are separated by a boundary of adifferent color. Note that, for a particular choice of SC,one such logical operator is guaranteed to be aligned withthe chosen (e.g., the vertical) boundary [5], but one maynot be able to freely choose whether this logical operatoris of Z- or X-type. 2D color codes [8] are defined on3-face-colorable regular lattices with qubits located onvertices. The generators of the corresponding stabilizergroup S(CC) are pairs of operators SX

p and SZp , i.e., two

independent stabilizers per plaquette. The lattice is con-structed such that we can use three colors to distinguishthree types of boundaries and plaquettes. That is, anytwo adjacent plaquettes have different colors from eachother and from their adjacent boundary, see Fig. 2, In the

CC, the number of physical qubits is equal to the num-ber of vertices, but there are two independent stabilizersfor each face. A quick count then reveals that the CCencodes one (v−2f = 1) logical qubit. Logical operatorsfor CCs are string operators along the lattice connectingthree boundaries of different colors. This implies thatthere exists a string along the boundary of one type thateffectively connects all three boundaries.

As an example for the application of our protocol let usthen consider the situation shown in Fig. 2 (a), where theoutcome of a quantum computation, encoded in a logicalstate |ψL〉 = α|0〉+ β|1〉 of a color code, is transferred toa quantum memory based on a surface code initializedin the state |+L〉. A circuit representation of this taskis shown in Fig. 3. Since both initial codes in Fig. 2 (a)have distance 3, we include two ancillas in the state |+〉,as instructed in step (i). Step (ii) of the protocol can beomitted since the lattices in this example already havethe desired structure. As laid out in step (iii) and il-lustrated in Fig. 2 (b), one then measures joint Z sta-bilizers across the boundary, projecting the two surfacesonto a single, merged surface (M) corresponding to aneigenstate of Z(SC)

L Z(CC)

L . That is, the merging procedureprojects onto a merged code that contains Z(SC)

L Z(CC)

L asa stabilizer. The reduced 2-dimensional logical subspacecan be represented by Z(M)

L = Z(SC)

L (or equivalently,Z(M)

L = Z(CC)

L ) and a merged XL operator along bothsurfaces, e.g., X(M)

L = X(SC) ⊗ X(CC). Since both colorand surface codes are TSCs, the merged code can beunderstood as a TSC (as opposed to a TSSC) and merg-ing operators coincide with merging stabilizers. Then,as instructed in Fig. 2 (b), X-type stabilizers have to beextended onto ancillas while Z stabilizers remain unaf-fected. For details on the distinction between TSSCs andTSCs, we refer to the final paragraph in Appendix A.

5

Having obtained this merged code of distance 3, threeconsecutive rounds of error correction ensure fault toler-ance as suggested in step (iv). Note that the mergingprocedure increases the bias towards X-type errors sincethe minimum weight of logical X operators is increased.However, note that increasing the weight (and interac-tion range) of X stabilizers on the boundary can cause atemporarily worse error correction performance w.r.t. Zerrors for the merged code than for the individual codes.

Irrespective of this we can then proceed by splittingthe codes. To this end, we simply measure ancillas inthe X-basis, while refraining from further measurementof the merging stabilizers. This procedure projects ontothe separate surfaces while entangling the logical sub-spaces. After another three rounds of error correction topreserve fault tolerance, measuring X(CC)

L teleports theinformation according to the circuit displayed in Fig. 3.

(a)

(b)

FIG. 2. Lattice surgery between a surface and a colorcode. (a) Examples of a surface code (SC) and a color code(CC) with distance 3 defined on lattices with open bound-aries. Different types of boundaries are color coded. Qubitsare located on vertices depicted in blue. While plaquettes inthe surface code correspond to X-type (yellow) and Z-type(orange) stabilizers, respectively, each plaquette in the colorcode corresponds to both X- and Z-type stabilizers. Repre-sentative logical Pauli operators XL and ZL are depicted bydashed lines and are tensor products of single-qubit X and Zoperators, respectively. (b) Merging stabilizers are (orange)plaquette operators acting as Z on qubits along the bound-ary and ancillas (all shown in fuchsia). Measuring all mergingstabilizers projects onto a joint eigenstate of the two logicaloperators Z(SC)

L and Z(CC)

L . While Z-type stabilizers remainunaffected, the procedure merges X-type stabilizers and logi-cal X operators, respectively, as displayed. In particular, theresulting merged code, labeled by M, encodes only one re-

maining logical qubit defined by Z(M)L and X

(M)L . Note that

the geometry of the underlying codes can be chosen to fit thegeometry of a specific computational architecture. Note fur-ther that there are many different layouts realizing the sameerror correction code and this figure merely shows a commonvariant.

FIG. 3. Circuit for measurement-based informationprocessing implemented via lattice surgery. The upperand lower single, horizontal lines correspond to the logicalqubits encoded in the color and surface codes, respectively.MZZ and MX are projective measurements that project ontoan eigenstate of ZL ⊗ ZL and XL ⊗ 1L respectively. MZZ isimplemented through the merging protocol and code splittingdescribed in the main text. The double lines labelled m1 andm2 represent classical conditioning of the XL and ZL gateson the measurement outcomes m1 and m2, respectively.

III. DISCUSSION

We have introduced the method of subsystem latticesurgery (SLS) as a generalization of lattice surgery [13,14] to any pair of 2D topological codes, exploiting theirsimilarities [20]. The applicability of our algorithm to alltopological codes such that all topological features arepreserved arises from their property to support logicalstring operators on the boundary [5]. Therefore, the rel-evance of our algorithm remains unchanged even if othertopological codes, such as the subsystem surface code [21](see also Appendix C) or Bacon-Shor code [22–24], areused as quantum memories or processors. Indeed, ourmethod can even be generalized beyond 2D topologicalcodes at the expense of the 2D layout or topological fea-tures (see Appendix D for details).

In contrast to the method of code deformation [18,25, 26], where a single underlying lattice is smoothly de-formed everywhere through multiple rounds of local Clif-ford transformations, we combine two initially separatelattices through operations within constant distance oftheir boundaries. To the best of our knowledge, otherestablished methods for code conversion [27–29] have ei-ther been applied solely to specific codes, or have notbeen generalized to subsystem codes.

To highlight the usefulness of incorporating SLS intofuture quantum computers, let us briefly assess the cur-rent contenders for fault-tolerant quantum computation.At present, one of the most promising techniques is SCquantum computation supplemented by magic state in-jection [30]. However, the overhead on magic state dis-tillation is large [6, 7] and it is expected that more ef-fort will be directed towards identifying more resource-efficient techniques. At the same time, other approachesto universal fault-tolerant quantum computation are sig-nificantly constrained by no-go theorems that prohibita universal set of transversal gates in a single stabilizercode [31] and transversal non-Clifford gates in 2D topo-logical codes [32, 33]. The former no-go theorem can becircumvented by gauge fixing [11, 34] or (subsystem) lat-tice surgery, and is hence no issue for our approach. Thelatter no-go theorem can be avoided in a 3D architecture

6

or non-topological codes [35–37]. One potential replace-ment for magic state distillation is hence the 3D gaugecolor code [11, 38] which successfully sidesteps both no-go theorems. Even though the resource requirement issimilar to that of quantum computation with the surfacecode [38], 3D topological codes support other useful fea-tures such as single-shot error correction [39]. As we showin Appendix D, SLS can also be employed to switch be-tween codes of different dimensions, as well as betweentopological and non-topological codes. This facilitatesthe circumvention of both no-go theorems in an elegantfashion. At this point it should also be pointed out thatmany non-topological codes supporting transversal non-Clifford gates [35–37] have lower resource requirementsthan comparable 3D topological codes or magic state dis-tillation. However, while all 2D (and some 3D) TSSCs(including the merged code that appears during SLS)with local stabilizers feature error thresholds [19, 38], er-ror thresholds have not been proven for any of the men-tioned non-topological codes. That is, in the case of non-topological codes it is not guaranteed that the storagetime can be made arbitrarily large by enlarging the codedistance.

In any of these cases, quantum computers can only beexpected to operate as well as their weakest link. Here,this applies to the error correction code used. The clearadvantage of SLS in this context is that the weakest link(i.e., code) may be employed on-demand only and canotherwise be avoided. For instance, in a distributed ar-chitecture a code for the implementation of, e.g., a non-Clifford operation can be called only when required. Inthis scenario, SLS is particularly beneficial since non-Clifford operations could also unfavourably transform er-rors present in the system [36], while SLS does not carrysuch errors to other codes. SLS should thus not be seenas a stand-alone contender with other methods of real-izing universal fault-tolerant quantum computation, but

rather as a facilitator thereof, allowing to selectively com-bine and exploit the advantages of other methods. Wehence expect lattice surgery to play a crucial role in fu-ture quantum computers, be it as an element of a quan-tum bus or for distributed quantum computing [29].

Our findings further motivate experimental efforts todevelop architectures that are flexible enough to im-plement and connect surface and color codes. For in-stance, ion trap quantum computers [40] may provide aplatform soon capable of performing lattice surgery be-tween two distinct codes. In this endeavor, the inherentflexibility attributed to multizone trap arrays [41] maybe beneficial. Moreover, topological codes and our ap-proach to code switching are obvious choices for fault-tolerant quantum computation with architectures requir-ing nearest-neighbor interactions in fixed setups, such assuperconducting qubits [42] or nitrogen-vacancy diamondarrays [43]. However, given the local structure of topo-logical codes and the simplicity of our algorithm, the re-quirements for any architecture are comparatively low.

Despite the inherent fault tolerance of SLS, the codeson which it is performed are nonetheless subject toerrors. Further investigations of error thresholds [2, 19]for (non-)topological codes and bench-marking [44]are therefore required, in particular with regard to(subsystem) lattice surgery. Finally, our code switchingmethod may find application in the design of adaptiveerror correction schemes [45].

Acknowledgements. We are grateful to Rainer Blatt,Nicolas Delfosse, Vedran Dunjko, Alexander Erhard, Es-teban A. Martinez, and Philipp Schindler for valuablediscussions and comments. We acknowledge supportfrom the Austrian Science Fund (FWF) through theDK-ALM: W1259-N27, the SFB FoQuS: F4012, and theSTART project Y879-N27, and the Templeton WorldCharity Foundation Grant No. TWCF0078/AB46.

[1] M. A. Nielsen and I. L. Chuang, Quantum Computationand Quantum Information (Cambridge University Press,Cambridge, U.K., 2000).

[2] J. Preskill, Fault-tolerant quantum computation, in: In-troduction to Quantum Computation and Information,eds. H.-K. Lo, T. Spiller, and S. Popescu (World-Scientific, Singapore, 1998) [arXiv:quant-ph/9712048].

[3] E. T. Campbell, B. M. Terhal, and C. Vuillot, The SteepRoad Towards Robust and Universal Quantum Computa-tion, e-print arXiv:1612.07330 [quant-ph] (2016).

[4] D. Gottesman, Stabilizer Codes and Quantum Error Cor-rection, Ph.D. thesis, California Insitute of Technology,Pasadena, CA, USA, 1997 [arXiv:quant-ph/9705052].

[5] S. Bravyi and B. Terhal, A no-go theorem for atwo-dimensional self-correcting quantum memory basedon stabilizer codes, New J. Phys. 11, 043029 (2009)[arXiv:0810.1983].

[6] S. B. Bravyi and A. Y. Kitaev, Quantum codes on alattice with boundary, e-print arXiv:quant-ph/9811052

(1998).[7] A. G. Fowler, M. Mariantoni, J. M. Martinis, and

A. N. Cleland, Surface codes: Towards practical large-scale quantum computation, Phys. Rev. A 86, 032324(2012) [arXiv:1208.0928].

[8] H. Bombın and M. A. Martın-Delgado, Topological Quan-tum Distillation, Phys. Rev. Lett. 97, 180501 (2006)[arXiv:quant-ph/0605138].

[9] K. Fujii and Y. Tokunaga, Error and loss tolerances ofsurface codes with general lattice structures, Phys. Rev.A 86, 020303(R) (2012) [arXiv:1202.2743].

[10] D. S. Wang, A. G. Fowler, and L. C. L. Hollenberg, Sur-face code quantum computing with error rates over 1%,Phys. Rev. A 83, 020302(R) (2011) [arXiv:1009.3686].

[11] H. Bombın, Gauge Color Codes: Optimal TransversalGates and Gauge Fixing in Topological Stabilizer Codes,New J. Phys. 17, 083002 (2015) [arXiv:1311.0879].

[12] H. Bombın, Dimensional jump in quantum error correc-tion, New J. Phys. 18, 043038 (2016) [arXiv:1412.5079].

7

[13] C. Horsman, A. G. Fowler, S. Devitt, and R. Van Meter,Surface code quantum computing by lattice surgery, NewJ. Phys. 14, 123011 (2012) [arXiv:1111.4022].

[14] A. J. Landahl and C. Ryan-Anderson, Quantum comput-ing by color-code lattice surgery, e-print arXiv:1407.5103[quant-ph] (2014).

[15] D. Poulin, Stabilizer Formalism for Operator QuantumError Correction, Phys. Rev. Lett. 95, 230504 (2005)[arXiv:quant-ph/0508131].

[16] R. Raussendorf and H. J. Briegel, A One-Way Quan-tum Computer, Phys. Rev. Lett. 86, 5188 (2001)[arXiv:quant-ph/0010033].

[17] P. Zanardi, D. Lidar, and S. Lloyd, Quantum tensor prod-uct structures are observable-induced, Phys. Rev. Lett.92, 060402 (2004) [arXiv:quant-ph/0308043].

[18] H. Bombın, Structure of 2D Topological StabilizerCodes, Commun. Math. Phys. 327, 387 (2014)[arXiv:1107.2707].

[19] H. Bombın, Topological subsystem codes, Phys. Rev. A81, 032301 (2010) [arXiv:0908.4246].

[20] H. Bombın, G. Duclos-Cianci and D. Poulin, Universaltopological phase of two-dimensional stabilizer codes, NewJ. Phys. 14, 073048 (2012) [arXiv:1103.4606].

[21] S. Bravyi, G. Duclos-Cianci, D. Poulin, and M. Suchara,Subsystem surface codes with three-qubit check operators,Quant. Inf. Comput. 13, 0963 (2013) [arXiv:1207.1443].

[22] D. Bacon, Operator quantum error-correcting subsystemsfor self-correcting quantum memories, Phys. Rev. A 73,012340 (2006) [arXiv:quant-ph/0506023].

[23] P. Brooks and J. Preskill, Fault-tolerant quantum com-putation with asymmetric Bacon-Shor codes, Phys. Rev.A 87, 032310 (2013) [arXiv:1211.1400].

[24] T. J. Yoder, Universal fault-tolerant quantum compu-tation with Bacon-Shor codes, e-print arXiv:1705.01686[quant-ph] (2017).

[25] H. Bombın and M. A. Martın-Delgado, Quantum Mea-surements and Gates by Code Deformation, J. Phys. A:Math. Theor. 42, 095302 (2009) [arXiv:0704.2540].

[26] A. Kubica, B. Yoshida, and F. Pastawski, Unfold-ing the color code, New J. Phys. 17, 083026 (2015)[arXiv:1503.02065].

[27] J. T. Anderson, G. Duclos-Cianci and D. Poulin, Fault-tolerant conversion between the Steane and Reed-Mullerquantum codes, Phys. Rev. Lett. 113, 080501 (2014)[arXiv:1403.2734].

[28] Y. Hwang, B.-S. Choi, Y.-C. Ko and J. Heo, Fault-tolerant conversion between stabilizer codes by Cliffordoperations, e-print arXiv:1511.02596 [quant-ph] (2015).

[29] S. Nagayama, Distributed Quantum Computing Uti-lizing Multiple Codes on Imperfect Hardware, Ph.D.thesis, Graduate School of Media and GovernanceKeio University, Fujisawa, Kanagawa, Japan, 2017[arXiv:1704.02620].

[30] S. Bravyi and A. Kitaev, Universal quantum computationwith ideal Clifford gates and noisy ancillas, Phys. Rev. A71, 022316 (2005) [arXiv:quant-ph/0403025].

[31] B. Eastin and E. Knill, Restrictions on Transversal En-coded Quantum Gate Sets, Phys. Rev. Lett. 102, 110502(2009) [arXiv:0811.4262].

[32] S. Bravyi and R. Konig, Classification of TopologicallyProtected Gates for Local Stabilizer Codes, Phys. Rev.Lett. 110, 170503 (2013) [arXiv:1206.1609].

[33] F. Pastawski and B. Yoshida, Fault-tolerant logical gatesin quantum error-correcting codes, Phys. Rev. A 91,

012305 (2015) [arXiv:1408.1720].[34] A. Paetznick and B. W. Reichardt, Universal Fault-

Tolerant Quantum Computation with Only Transver-sal Gates and Error Correction, Phys. Rev. Lett. 111,090505 (2013) [arXiv:1304.3709].

[35] T. Jochym-Oonnor and S. D. Bartlett, Stacked codes:Universal fault-tolerant quantum computation in a two-dimensional layout, Phys. Rev. A 93, 022323 (2016)[arXiv:1509.04255].

[36] S. Bravyi and A. Cross, Doubled Color Codes, e-printarXiv:1509.03239 [quant-ph] (2015).

[37] C. Jones, P. Brooks and J. Harrington, Gauge colorcodes in two dimensions, Phys. Rev. A 93, 052332 (2016)[arXiv:1512.04193].

[38] B. J. Brown, N. H. Nickerson and D. E. Browne, Fault-tolerant error correction with the gauge color code, Nat.Commun. 7:12302 (2016) [arXiv:1503.08217].

[39] H. Bombın, Single-Shot Fault-Tolerant Quantum Er-ror Correction, Phys. Rev. X 5, 031043 (2015)[arXiv:1404.5504].

[40] D. Nigg, M. Muller, E. A. Martinez, P. Schindler,M. Hennrich, T. Monz, M. A.Martın-Delgado andR. Blatt, Quantum computations on a topologically en-coded qubit, Science 345, 302 (2014) [arXiv:1403.5426].

[41] R. Bowler, J. Gaebler, Y. Lin, T. R. Tan, D. Hanneke,J. D. Jost, J. P. Home, D. Leibfried, and D. J. Wineland,Coherent Diabatic Ion Transport and Separation in aMultizone Trap Array, Phys. Rev. Lett. 109, 080502(2012) [arXiv:1206.0780].

[42] R. Barends et al., Superconducting quantum circuits atthe surface code threshold for fault tolerance, Nature(London) 508, 500 (2014) [arXiv:1402.4848].

[43] N. Y. Yao, L. Jiang, A. V. Gorshkov, P. C. Maurer,G. Giedke, J. I. Cirac, and M. D. Lukin, Scalable Ar-chitecture for a Room Temperature Solid-State Quan-tum Information Processor, Nat. Commun. 3, 800 (2012)[arXiv:1012.2864].

[44] N. Delfosse, P. Iyer and D. Poulin, A linear-timebenchmarking tool for generalized surface codes, e-printarXiv:1611.04256 [quant-ph] (2016).

[45] D. Orsucci, M. Tiersch, and H. J. Briegel, Estimationof coherent error sources from stabilizer measurements,Phys. Rev. A 93, 042303 (2016) [arXiv:1512.07083].

[46] H. Bombın and M. A. Martın-Delgado, Exact TopologicalQuantum Order in D = 3 and Beyond: Branyons andBrane-Net Condensates, Phys. Rev. B 75, 075103 (2007)[arXiv:cond-mat/0607736].

[47] H. Bombın, R. W. Chhajlany, M. Horodecki, andM. A. Martın-Delgado, Self-Correcting Quan-tum Computers, New J. Phys. 15, 055023 (2013)[arXiv:0907.5228].

8

Appendix A: Subsystem Lattice Surgery

In the main text, we have introduced a subsystem lat-tice surgery (SLS) protocol that is applicable to arbitrary2D TSSCs, and we have shown how it can be used toteleport quantum information between surface and colorcodes. In this appendix, we explain how lattice surgerycan be understood entirely within the subsystem stabi-lizer formalism. To this end, we define SLS by the fault-tolerant mapping GA×GB 7→ GA×GB×〈PA

L ⊗PBL 〉, where

the merging procedure as described in steps (i)-(iv) andformalized in Theorem 1 is an initialization of an inter-mediate, merged code GM and the splitting fixes gaugedegrees-of-freedom to obtain GA×GB× 〈PA

L ⊗PBL 〉 from

GM.To see this, we again consider two standard2 TSSCs,

GA and GB. Adopting the previous notation, we assumethat the lattices have been chosen such that the logi-cal operators P I

L (I = A,B) along their boundaries havesupport on NA and NB qubits, respectively. For ease ofpresentation we further choose NA = NB = N . Now,let GI with I = A,B be codes characterized by the tu-ples [[nI , kI , gI , dI ]], where nI are the numbers of physicalqubits, kI the numbers of logical qubits, gI the numbersof gauge qubits, and dI are the distances, respectively.We choose the generating set {GI

1, ..., GIsI+2gI} for code

GI , where sI = nI−kI−gI is the number of independentstabilizer generators (or the number of stabilizer qubitsin accordance with our previous terminology). The lat-tices are then aligned and prepared as in step (ii) of thealgorithm described in the main text, but we omit includ-ing ancillas for now. We proceed by defining the mergingoperators

GMi = PA

L,iPBL,i ∀i = 1, ..., N (A1)

on the merged lattice ΛM. From these merging opera-tors, we then collect ∆g ≤ N − 1 (where the meaningof this notation becomes apparent in Appendix B) in-equivalent ones (w.r.t. GA × GB × 〈PA

L ⊗ PBL 〉) in the

set W = {GMi }i=1,...,∆g, and call the group generated by

these operators M. We refer to elements of W as merg-ing generators. This allows us to define the subsystemcode

GM ..= 〈GA1 , ..., G

AsA+2gA〉 × 〈G

B1 , ..., G

BsB+2gB〉 ×M× 〈i〉.

(A2)

Note that, technically, Eq. (A2) specifies a subsystemstabilizer code only if the center of GM is non-empty, suchthat a stabilizer subgroup SM can be defined. That thisis indeed the case follows from Lemma 2 in Appendix B.As we will show next, the code GM has the structure ofthe merged code discussed in Theorem 1. The essential

2 We exclude certain pathological “exotic” codes as will be ex-plained in the proof of Lemma 1.

features of this structure can be captured in the followingLemma.

Lemma 1. — The code GM defined in Eq. (A2) is aTSSC on the merged lattice ΛM with distance no less thandmin = min({dA, dB}). In addition, GM can be gaugefixed to GA × GB × 〈PA

L ⊗ PBL 〉, effectively splitting the

code into GA and GB.

Proof. First, let us show that GM obeys the locality con-dition for TSSCs. By definition, generators of the sepa-rated codes are also generators of the merged code. Theirinteraction range is increased by at most a constant alongthe vertical direction due to the relabeling in step (ii).Thereby, the interaction range of merging generators isalso kept constant. The generators of the code GM arehence all local.

Second, we verify that the distance of the merged codeis at least dmin. Since GA × GB × 〈PA

L ⊗ PBL 〉 is a sub-

group of GM, the normalizer N(GM) is a subgroup ofN(GA × GB × 〈PA

L ⊗ PBL 〉). Then, note that there exist

stabilizers S ∈ SA × SB that anticommute with someGM ∈ M. If that was not the case, all GM|QI

wouldeither be elements of the code GI or undetectable er-rors. The latter option can be ruled out in accordancewith the argument in the proof of Lemma 2. The for-mer option, GM|QI

∈ GI ∀ GM ∈ M, would implythat P I

L is not a logical operator. In a quantum error-correction code, such mutually anticommuting operatorsact either on the logical subspace or on gauge qubits.However, any stabilizer of the separate codes is also con-tained in GM according to the definition of the mergedcode in Eq. (A2). Therefore, the aforementioned anti-commuting stabilizers S must act on gauge qubits andwe can hence identify3 S as belonging to LM

G . SinceSA × SB contains elements that are not in the stabi-lizer of GM but not vice versa, SM must be a subgroupof SA×SB×〈PA

L ⊗PBL 〉. Consequently, any equivalence

class of N(GM)/SM is contained in an equivalence classof N(GA × GB × 〈PA

L ⊗ PBL 〉)/(SA × SB × 〈PA

L ⊗ PBL 〉).

The quotient group N(G)/S defines so called bare logi-cal operators that do not act on gauge qubits. Generally,N(G)/〈i〉S contains all information about the logical op-erators but not about all undetectable errors. At thesame time, undetectable errors are related to bare logicaloperators, since N(S)/G ' N(G)/〈i〉S for any subsys-tem stabilizer code G [19]. To conclude then that thedistance of GM is dmin, we have to verify that defor-mations (i.e., multiplications) of any nontrivial, logicaloperators P ∈ N(GM)/SM by operators in GM yield op-erators of weight at least dmin. Since any such P is alsocontained in LA × LB this is true for deformations byoperators in GA × GB. But we still need to confirm this

3 Recall that if GM is a subsystem stabilizer code, it can be de-composed as GM = LM

G ×SM×〈i〉, as explained in the main text.

We will further discuss this structure in Appendix B.

9

for operators in GM − (GA × GB). Specifically, we haveto consider deformations under 〈GM

i 〉i=1,...,N . In prin-ciple, these merging operators can reduce the weight ofoperators P below dmin. However, this can only hap-pen under rather exotic circumstances. That is, onlyfor logical operators of the form P = PA ⊗ PB, whereP I ∈ LI (I = A,B) and P I � P I

L acts as P IL on a re-

gion KI ⊂ QI such that for the complementary regionsKI (with KI ∪ KI being the set of all qubits on lat-tice ΛI and4 KI ∩KI = KI −KI) the weights of theseoperators satisfy 0 < w(PA|KA

) + w(PB|KB) < dmin in-

dependently of the system size. In such a case, one coulddefine the logical operator PA⊗PB⊗

∏i∈KA∩KB

GMi with

weight 0 < w(PA|KA) + w(PB|KB

) < dmin. At the same

time, this also constricts P IL since P I must be such that

w(P I ⊗ P IL) ≥ dmin. Since this describes extremely re-

stricted cases that (to the best of our knowledge) do notfeature in any practical scenario, we will exclude codeswith such properties from our construction.

Note that we can also exclude cases where w(PA|KA)+

w(PB|KB) = 0. In such cases at least two logical oper-

ators PA, PB ∈ LA × LB with supp(P I) ⊂ supp(P IL)

(I = A,B) exist. However, we are only interested in pro-jecting onto the joint eigenstate of any two logical oper-ators PA

L and PBL along the boundary. Therefore, we can

always exclude the aforementioned case by choosing PAL

and PBL such that there does not exist a logical operator

that has support on a subset of QI . In the case of TSSCwith nonlocal stabilizers, such logical operators may havesupport on disconnected regions of a lattice [19]. Then,these regions have to be connected using local generatorsto obtain proper string operators. Then, any nontriviallogical operator of the merged code has support on atleast dmin qubits. The distance of the merged code ishence at least dmin.

Third, the merged code is scalable since the separatecodes are scalable. Thus, we can conclude that GM isindeed a TSSC. At last, note that fixing SM to SA ×SB

through a measurement of stabilizers S ∈ SA × SB anti-commuting with at least one merging generator, the sepa-rate codes can be recovered while retaining the eigenstateof PA

L ⊗PBL . This gauge fixing has to be accompanied by

error-correction to ensure full fault tolerance.

To finally prove Theorem 1, we will now explainthe connection between the merged code GM defined inEq. (A2) and the framework discussed in the main text.The merging procedure described in steps (ii)-(iv) canbe understood as an initialization of the merged code.Specifically, measuring merging generators as in Eq. (A1)[or similarly, Eq. (2)] initializes GM from the preparedcodes GA × GB. The parity of all random measurement

4 Here we make use of the fact that QA and QB have been labeledequally (cf. main text) and write with a slight abuse of notationKI ∩KI = KI −KI (where I = B if I = A and vice versa).

outcomes yields the parity of PAL ⊗ PB

L and error cor-rection has to be performed thereafter in order to en-sure correctness [see step (iv)]. Fault-tolerance is guar-anteed since merging generators are constant-weight anderrors can only propagate to a constant number of phys-ical qubits. Since we have established in Lemma 1 thatGM is indeed a TSSC with distance at least dmin, thisconcludes the proof of Theorem 1.

Altogether, by proving Theorem 1 and Lemma 1,we showed that SLS is fault-tolerant and well-definedthrough a merging, i.e., a mapping GA × GB 7→ GM, fol-lowed by a splitting, i.e., a mapping GM 7→ GA × GB ×〈PA

L ⊗ PBL 〉.

Concluding this Appendix, we return to the discussionof the ancillas added during step (i) of the preparation.As already discussed in the main text, ancillas can beunderstood as additional stabilizer qubits included intothe initial codes. In the merged code these become gaugequbits. The usefulness of ancillas arises when one con-siders TSCs. In that case the merged code can be un-derstood as a TSC with stabilizers merged across theboundary. Here, introducing ancillas means that stabi-lizers of one surface are instead merged with stabilizersof ancillas, allowing for the possibility of reducing theinteraction range of the merged code.

Appendix B: Merged Code Structure

In this Appendix, we provide a careful analysis of themerged code. In particular, we will discuss the structureof the subgroups SM and LM

G . Here we claim that GM isa [[nA + nB, kA + kB − 1, gA + gB + ∆g, dM]] code withdistance dM ≥ dmin. That is, the distance dM mergedcode has nA + nB physical qubits, kA + kB − 1 logicalqubits and gA + gB + ∆g gauge qubits where ∆g is thenumber of merging generators [see Eq. (A1)]. To seethis, we have to understand the structure of SM and LM

Gin comparison with the separate codes GA × GB.

First, note that we can define ∆g new gauge qubits viatheir respective Pauli operators 〈GM

i , Si〉i=1,...,∆g whereSi ∈ SA × SB ∀i such that [GM

i , Sj ] = 0 for i 6= j. Thatis, there exist ∆g independent stabilizers which are nowincluded as gauge operators. As we will see, the exis-tence of such stabilizers is guaranteed by the choice oflogical operators PA

L and PBL as explained in the proof of

Lemma 1.

Lemma 2. — For the operators PAL and PB

L chosenabove there exists a stabilizer Si ∈ SA × SB for anymerging generator GM

i ∈ W such that {GMi , Si} = 0 and

[GMj , Si] = 0 ∀ GM

j ∈ W − {GMi }.

Proof. Suppose such a stabilizer does not exist. Then,there exists aG ∈M that yields the same error syndromeas GM

i , i.e., 〈ψ|GMi G|ψ〉 = 0 for any codeword |ψ〉 ∈

CA×CB. Since GMi G /∈ GA×GB, it is a nontrivial logical

operator in LA ×LB. Combining this with the fact thatW ⊂ {GM

j }j=1,...,N , the existence of the logical operator

10

GMi G is not compatible with our construction of P I

L asdiscussed in the proof of Lemma 1. That is, there existno logical operators P I ∈ LI with supp(P I) ⊂ supp(P I

L)(I = A,B) for our choice of P I

L .

We have hence defined ∆g new gauge qubits byW andthe same number of independent stabilizers. As anotherconsequence of Lemma 2, we can also define an additionalstabilizer equivalent to PA

L ⊗ PBL . That is, the merged

code has sA + sB − ∆g + 1 independent stabilizers andthus, a necessarily non-empty center (but reduced logicalsubspace).

To complete our analysis of the merged code, we haveto verify that GM still contains gA + gB gauge qubitsbesides new ones. Therefore, note that there might existpairs of gauge operators g, g ∈ LA

G × LBG generating a

gauge qubit, for which {g,GMj } = 0 with GM

j ∈ W ∀j ∈ Jwhere J ⊆ {1, ...,∆g}. While the associated gauge qubitin LA

G×LBG was defined by 〈g, g〉, it is in the merged code

redefined to be generated by5 〈g, g ⊗∏

j∈J Sj〉. Here,

Sj ∈ LMG is associated with one of the ∆g new gauge

qubits introduced above.One can see that this code is indeed generated as in-

dicated in Eq. (A2). Hence, the distinction to the sep-arated codes is that some stabilizers now act on gaugequbits which can be reversed by gauge fixing. Interest-ingly, applying this formalism to two Bacon-Shor codes[22] on regular square lattices [1, L]2, yields a merged,asymmetric Bacon-Shor code [23] on a [1, 2L]× [1, L] lat-tice.

Appendix C: Subsystem Surface Code LatticeSurgery

Here, we exemplify SLS by means of the subsystemsurface code (SSC) introduced in Ref. [21]. Therefore,consider two such codes GA and GB defined on regularsquare lattices [1, L]2 with qubits located on vertices.In Fig. 4 (a), we chose the smallest SSC with distanced = L = 3 defining a unit cell where the central ver-tex is unoccupied. The codes are generated by triangleand boundary operators, labeled GI

i and SIi , respectively,

with i = 1, ...4 and I = A,B [see Fig. 4 (a)]. Triangleoperators {GI

i }i=1,...,4 act on qubits adjacent to a tri-angular plaquette p as GI

i =∏

v∈N (p)Xv for i = 2, 3

and GIi =

∏v∈N (p) Zv for i = 1, 4. Boundary operators

{SIi }i=1,...,4 are weight-two Pauli operators acting on ev-

ery other pair of boundary qubits as either X- or Z-typeoperators for i = 1, 4 and i = 2, 3, respectively. Thestabilizer group is defined as

SI = 〈SI1 , ..., S

I4 , G

I1G

I4, G

I2G

I3〉. (C1)

5 W.l.o.g. we have assumed that [g, GMj ] = 0 ∀j = 1, ...,∆g. Oth-

erwise, we would simply have to apply the same argument tog ∈ LA

G × LBG with {g, GM

j } = 0 for some j ∈ J ′ ⊆ {1, ...,∆g}.

(a)

(b)

FIG. 4. Subsystem lattice surgery between two sub-system surface codes. (a) Example of two subsystem sur-face codes with distance 3 labeled by A and B, respectively.Qubits are located on vertices depicted in blue, while the cen-tral gray vertices are unoccupied. Plaquette generators GI

i

and SIi (I = A,B) are color coded with X-type and Z-type

operators drawn in yellow and orange, respectively. Repre-sentative logical Pauli operators XI

L and ZIL are depicted by

dashed lines and are tensor products of single-qubit X andZ operators, respectively. (b) The merged code, labeled byM, with additional merging generators GM

i colored in fuchsia.Some X-type operators in SM and LM

G are merged across theboundary in accordance with Eq. (C3) and (C4). Includingmerging generators to the codes reduces the dimension of thelogical subspace by one.

A single gauge qubit is defined up to irrelevant phasesby6

LIG ∝ 〈GI

1, GI3〉. (C2)

Logical operators XIL and ZI

L are tensor products ofsingle-qubit Pauli X- and Z operators, respectively, con-necting two opposite boundaries as shown in Fig. 4 (a).

Now we initialize a merged code by measuring merginggenerators {GM

i }i=1,2,3 as depicted in Fig. 4 (b). Themerged code is left with 5 stabilizer qubits,

SM = 〈SA1 , S

B4 , G

A2 G

A3 S

B1 , S

A4 G

B2G

B3 , Z

AL Z

BL 〉 (C3)

where we only kept stabilizers in SA×SB that commutewith the merging generators. Consequently, we can iden-tify 2 additional gauge qubits, i.e., 4 in total,

LMG ∝ 〈GA

1 , GA3 S

B1 ;GB

1 , GB3 ;GM

1 , SB1 ;GM

3 , SA4 〉. (C4)

Here we included a semicolon between generators of in-dependent gauge qubits and neglected additional phases.Evidently, this code has the structure predicted in Ap-pendix B and is indeed a TSSC with distance 3.

6 Whenever we identify a group A with a generating set B up tophases, we write A ∝ B.

11

Appendix D: Beyond 2D Topological Codes

Finally, let us discuss the applicability of SLS tohigher-dimensional topological codes as well as to non-topological codes. As we shall argue, all of the aboveholds true in these cases. In short, this is because theessential feature of SLS is to project onto a joint eigen-state of two logical operators by measuring generators ofa merged code. Such a merged code can always be for-mally defined, irrespective of whether or not the initialcodes are topological.

Let us first consider topological codes in more than twodimensions. For instance, 3D topological codes (as op-posed to 2D topological codes) can support membrane-like logical operators on their two-dimensional bound-ary [46, 47]. Similarly, it can be expected that mosttopological codes in D dimensions can support logicaloperators that are associated with (D − 1)-dimensionalextended objects on the boundary [46]. With this as-sumption, it is straightforward to show that SLS canbe applied in any dimension. This leaves the questionof whether SLS can also be used to switch between di-mensions. This is indeed the case, since, interestingly,3D topological codes also support string-like logical op-erators [33] which can be used to teleport informationfrom a 2D topological code to a higher-dimensional onevia SLS. In fact, at the expense of its two-dimensionallayout, a 2D code can even be wrapped along the sur-

face of a 3D code to perform SLS between a string- anda membrane-like logical operator while preserving a 3Dnotion of locality.

Finally, let us consider the effects of relaxing the con-straint of demanding topological features for the quan-tum error correction codes under scrutiny. For such codesthere exists no notion of locality or scalability. Therefore,an underlying lattice of physical qubits cannot be definedin a meaningful way. However, when revising the argu-ments from Appendix A in the spirit of non-topologicalcodes, it turns out that one does not require any topo-logical features to prove that the distance of the mergedcode is the minimum distance of the initial codes. Neitheris it necessary to require locality or scalability to showthat the merged code can be gauge-fixed to the originalcodes. The merged code as specified in Eq. (A2) is al-ways well-defined algebraically even if it has no topolog-ical features. That is, at the expense of locality and/orscalability, Lemmas 1 and 2 hold and we can use SLSto switch between topological and non-topological codes.Nevertheless, one can expect that scalability in particularis a feature that is desirable for any code. Therefore, letus note that the merged code is scalable if the separatecodes are scalable even if it is not topological otherwise.As an example of codes that are scalable but not topo-logical consider the doubled codes of Ref. [36] which arealso amenable for SLS.