A new twist on the Majorana surface code: Bosonic and fermionic defects for fault-tolerant quantum computation

Majorana zero modes (MZMs) are promising candidates for topologically-protected quantum computing hardware, however their large-scale use will likely require quantum error correction. Majorana surface codes (MSCs) have been proposed to achieve this. However, many MSC properties remain unexplored. We present a unified framework for MSC “twist defects” – anyon-like objects encoding quantum information. We show that twist defects in MSCs can encode twice the amount of topologically protected information as in qubit-based codes or other MSC encoding schemes. This is due to twists encoding both logical qubits and “logical MZMs,” with the latter enhancing the protection microscopic MZMs can offer. We explain how to perform universal computation with logical qubits and logical MZMs while potentially using far fewer resources than in other MSC schemes. All Clifford gates can be implemented on logical qubits by braiding twist defects. We introduce lattice-surgery-based techniques for computing with logical MZMs and logical qubits, achieving the effect of Clifford gates with zero time overhead. We also show that logical MZMs may result in improved spatial overheads for sufficiently low rates of quasi-particle poisoning. Finally, we introduce a novel MSC analogue of transversal gates that achieves encoded Clifford gates in small codes by braiding microscopic MZMs. MSC twist defects thus open new paths towards fault-tolerant quantum computation.


Introduction
Quantum computers promise considerable advantages over their classical counterparts, such as the ability to efficiently simulate large quantum systems [1].In order to achieve these advantages, one requires quantum systems that are well-shielded from environmental noise, and on which one can perform operations fault-tolerantly.
Surface codes also have a fermionic counterpart, built from MZMs rather than qubits [56][57][58][59][60][61].These Majorana surface codes (MSCs) utilize the topological protection of MZMs and also enjoy partial protection of quantum information by fermion parity conservation [56,58].In certain physical setups, stabilizer measurements can also be performed in a single shot [57,62]; this is in contrast to qubit-based surface codes where this requires multiple gates and ancillas.Setups with large charging energies require fewer stabilizer measurements [22,61].Additionally, MSCs have favourable error thresholds [58,63], and can be used for fault-tolerant fermionic computation [58] that allows considerable resource savings on fermionic sim-ulation tasks [64,65].
The full range of MSC features are yet to be explored.Analogously to the bosonic (i.e., qubitbased) surface code, storing logical qubits in holes can achieve a logical CNOT gate by braiding the holes [33,57,60].But other Clifford gates require measuring high-weight operators, or distilling ancilla states and implementing gadget circuits [57,60].While braiding holes alone cannot achieve all Clifford gates, the study of twist defects may expand the gate set: In the bosonic surface code, braiding twists and holes can achieve all Clifford gates [39], and in the bosonic Color Code [34] (closely related to the MSC [56]), braiding twists alone can achieve the same [47].This suggests that twists in MSCs are features worthy of exploration.
Motivated by this, in this work we establish the fundamental features and classification of twist defects in the MSC, and show how to use them for quantum computation.Besides highlighting features analogous to bosonic codes, we show that MSC twists can include "logical MZMs" [56,58]: fermion-parity-odd objects that can enhance the protection from "microscopic" MZMs and enable fault-tolerant fermionic quantum computation.(Objects related to logical MZMs appeared also in other contexts [62,[66][67][68].)The presence of both bosonic and fermionic twist features opens up two modes of fault-tolerant quantum computation that could be profitably combined.Our study of MSC twists also complements results on the classification and use of topological defects in the context of topological order [48,[69][70][71].
The rest of this work is structured as follows.We start, in Section 2, with the main ingredients of MSCs, including their anyons, and fault-tolerant quantum computation.We also establish here the types of boundaries supported by MSCs.In Section 3, we classify MSC twists and detail their properties, including their logical Hilbert space dimensions (i.e., their "quantum dimensions").As in bosonic codes, twists are classified via the symmetries of the MSC's anyons.But logical MZMs are inherently fermionic and hence have no counterparts in bosonic codes.We find that a phase transition along the domain wall connecting two twists can result in logical MZMs emerging at the twists.This expands on how one-dimensional physics can enrich the classification of twist defects [69], by showing how this may lead to non-local logical MZMs.While mentioned in the MSC literature [56,58], the range of scenarios in which one expects to find logical MZMs and their link to twists have not yet been explored.
In Section 4, we discuss how universal fault-tolerant quantum computation can be performed with twists in the MSC, simultaneously utilizing both logical qubits and logical MZMs.This allows for roughly twice the information to be stored and manipulated per twist as would be possible in bosonic ap-proaches.The twists we discuss provide independent ways to protect information from fermion-parityviolating errors (so-called quasi-particle poisoning or QPP events [17]) and fermion-parity-conserving (FPC) errors.
In Section 5 we explore the spatial overheads of computing with logical MZMs, and show that these may be considerably reduced if the QPP probability is suitably small.We focus on a fault-tolerant implementation of "Pauli-based computation" (PBC) [62,72,73] with the MSC; PBC is a measurement-based model of quantum computation that optimizes the use of quantum resources, at the cost of additional, but efficient, classical computing.
Finally, in Section 6, we present a new method to implement fault-tolerant gates in MSCs.This is a fermionic analogue of transversal gates in bosonic codes.It implements encoded Clifford gates by braiding the MSC's constituent MZMs.This technique is particularly suitable for small codes, and hence could be utilized in early-generation Majorana devices.In Section 7 we conclude and discuss avenues for future work.

Basic MSC Ingredients
In this section, we briefly review the basics of Majorana fermion codes [56], fault-tolerant quantum computing [1], and the construction of MSCs and their anyons [57,60,61].We also establish the types of boundaries MSCs can support and describe their lattice realization.
Majorana fermion codes, and as such the MSC, are based on Majorana operators γ i satisfying where { , } is the anti-commutator.MZMs in topological superconductors realize this algebra.In addition, they commute with and are absent from the Hamiltonian, hence the term zero mode.In the MSC, the latter property will not hold for constituent MZMs, thus we will sometimes call them simply Majoranas.Logical MZMs however, as we will see, enjoy both the Majorana [Equation (1)] and the zero mode properties.

Majorana Fermion Codes
Let Maj(2n) denote the group of Majorana strings generated by Majorana operators γ 1 , . . ., γ 2n and the phase factor i. For index subsets A and B, take Γ A and Γ B to be Γ A (B) = j∈A (B) γ j .Equation (1) implies where |A| is the weight of Γ A , i.e., the cardinality of A.  From the 2n Majorana operators we can construct n fermionic creation operators c † j = (γ 2j−1 − iγ 2j )/2.The 2n Majorana operators thus act on a 2 ndimensional space, with basis states labeled by c † j c j .Let Γ = (−1) j c † j cj = i n 2n j=1 γ j denote the total fermion parity operator.Half of the states will have even fermion parity, Γ |ψ⟩ = |ψ⟩, and the other half will have odd fermion parity.

Majorana fermion code object
A Majorana fermion code is specified by its stabilizer group S, an Abelian subgroup of Maj(2n) [18,56].The stabilizer group satisfies −I / ∈ S and all s ∈ S have even weight, hence [Γ, s] = 0. (We assume for now that Γ ∈ S, although this assumption will be dropped below.)Logical (or code) states |ψ⟩ span the code space.They satisfy s |ψ⟩ = |ψ⟩ ∀s ∈ S. Since Γ ∈ S, code states have definite (namely even) parity, hence they can be superposed [56,64].Suppose that S has m independent generators.This leaves a 2 n−m -dimensional code space.Hence k = n − m is the number of logical qubits.
The code's logical operators are even-weight elements of Maj(2n) that commute with all s ∈ S but are not themselves in S. We define logical operators Xj and Zj such that they act as Pauli operators on logical qubit j.Note that a logical operator L and Ls act equivalently on code states for any s ∈ S. Hence we define the equivalence class of logical operator L to be [L] = {Ls|s ∈ S}.Some Majorana fermion codes also have parity-non-preserving (odd-weight) operators that commute with all members of S apart from Γ (in such cases Γ is removed from S, and we separately require that logical operators commute with Γ).We refer to these operators as logical MZMs, for reasons mentioned above (see also Section 3).
Suppose the code is defined on a D-dimensional lattice with one Majorana operator per site.Suppose also that S has generators O p whose support (i.e., sites where O p differs from identity) is local.While logical operators in [L] act the same way on code states, they can have different weights.The distance of the code is defined as the smallest among the weights of logical operators, min L,s |Ls|.To further characterize codes, we define the diameter diam(Γ A ) of a logical operator Γ A to be the geometrical diameter of its support.Similarly to the distance, the code diameter is defined as min L,s diam(Ls).As noted in Ref. [56], and as we explain in Section 3.3, a code with logical MZMs can have large diameter but small distance.See Table 1 for a summary of the objects and quantities introduced above.
Error correction is performed in the same way in Majorana fermion codes and bosonic stabilizer codes [18,56].First, one measures the generators of S; the returned outcomes form the "syndrome".If no error has occurred, then all of these outcomes are +1; if some of them are −1, then an error has occurred (assuming for now perfect measurements).Then one can use classical algorithms, called decoders, to diagnose the syndrome, and determine the correction operation to map the post-measurement state back to the original code space.Methods also exist for performing stabilizer measurements in a way that is resilient to measurement errors, and hence error correction can be performed fault-tolerantly [1,32,36].Error correction results in a logical error rate approaching zero with increasing code distance when the error probability (both for storage and measurements) is below the error threshold [32,36].

Universal Fault-Tolerant Quantum Computation
Beyond just storing quantum information we also require methods for performing gates on encoded qubits in ways resilient to faults or pre-existing errors in the system.A universal set of logic gates allows one to enact an arbitrary quantum circuit [1].One such universal gate set is given by the Clifford gates combined with the T gate.Suppose we have k qubits.
Let P k be the k-qubit Pauli group and C k be the kqubit Clifford group.The group C k consists of Clifford gates: those unitary operations that preserve P k under conjugation.That is, for all P ∈ P k and U ∈ C k , U P U † ∈ P k .C k is generated by the singlequbit Hadamard and phase gates and the two-qubit CNOT gate.The Hadamard gate H i = H † i acting on qubit i maps the Pauli operator X i (also acting on qubit The CNOT gate, controlled on qubit i and targeted on qubit j sends X i → X i X j and Z j → Z i Z j (while preserving Z i and X j ) under conjugation.The single-qubit T gate is a non-Clifford gate which acts as diag(1, e iπ/4 ) in the computational basis.
We now describe a universal set of gates for fermionic quantum computation with Majorana operators, in which n qubits are "densely" encoded [17] using 2n + 2 Majorana operators into a fixed total fermion parity sector (either even or odd).This model of computation is ultimately equivalent to qubit-based computation, but it conveys advantages for tasks such as simulating other fermionic systems, as it avoids the overheads associated with non-local fermion-qubit mappings (e.g., Jordan-Wigner transformations) [64,65,74].
Braid operations generate some of the gates required for quantum computation [17,64].These are unitary transformations of the form exp ( π 4 γ a γ b ) for a, b ∈ {1, . . ., 2n + 2}, sending γ a → −γ b and γ b → γ a under conjugation.They can be performed in a (e.g., two-dimensional) physical system by braiding (physically or via measurements) two MZMs in a clockwise direction.Braids are naturally fault-tolerant, since the unitary transformation depends only on the topology of the path along which the state is taken, rather than the details of this path.However, braids alone do not generate a universal gate set.
A universal gate set with 2n + 2 Majorana operators (n ≥ 1) is given by two types of operators, denoted B 4 and T 2 [64].B 4 operators are fermionic variants of Clifford gates [62], and they have the form B 4,abcd = exp (i π 4 γ a γ b γ c γ d ) for distinct indices a, b, c, d ∈ {1, . . ., 2n + 2}.We call these operators "logical braids" since they have the same form as a braid operator, but between Majorana γ a and the logical Majorana operator Υ bcd = iγ b γ c γ d .(This logical Majorana is not necessarily a logical MZM for it may not commute with all stabilizer operators; when all the γ a are used for computation, the stabilizer group is {1, Γ}).If multiple logical Majorana operators Υ j (with multi-index j) are defined on nonoverlapping sites, they obey the same relations as Majorana operators [cf.Equation (1)]: Υ † j = Υ j and {Υ j , Υ k } = 2δ j,k for all j, k.T 2 operators are non-Clifford gates, with the form T 2,ab = exp ( π 8 γ a γ b ) for indices a, b ∈ {1, . . ., 2n + 2}.B 4 gates can be implemented fault-tolerantly via a combination of an-cilla preparation, braids and fermion parity measurement [64], whereas the fault-tolerant implementation of T 2 gates requires magic state distillation (see below).
There are many proposed methods for performing logic gates fault-tolerantly on information stored in quantum codes.For MSCs, previous proposals have suggested replacing Clifford gates with measurements, which can be performed fault-tolerantly via "lattice surgery" [37,58,61].These involve fault-tolerantly measuring extra stabilizer operators, which results in the fusion of two or more patches of code.In the bosonic surface code, Clifford gates can be performed via the introduction of holes or twist defects (see Section 3) in the lattice.Using "code deformation", one can braid these lattice features, thereby achieving gates on the logical qubits [39,45,47].Holes can also be introduced to the MSC and braided to achieve CNOT gates [57].The Hadamard gate can also be applied to these qubits, but this involves measuring a high-weight Majorana operator, which may be challenging in physical setups [57,60].The S gate can be implemented by preparing an ancilla logical qubit in a high-fidelity Pauli-Y eigenstate, and then performing H and CNOT gates to the ancilla and target qubits [57,60].Thus, all Clifford generators can be enacted in MSCs with holes.
T gates may be enacted by preparing an ancilla logical qubit in a "magic state" such as By performing Clifford gates and measurements on the ancilla and target qubits, one can generate a T gate acting on the target [1].To prepare these magic states fault-tolerantly, we can prepare many (noisy) copies in our quantum code, and distill a single purified copy, again via Clifford gates and measurements (this procedure is called magic state distillation) [75][76][77][78][79][80].Magic states can also be used to enact T 2 gates (or other non-Clifford gates) on Majoranabased qubits [62,65].
In addition to logic gates, we require the ability to fault-tolerantly prepare logical qubits in some state (e.g., the state |0⟩ ⊗N for N logical qubits) and measure the logical qubits in the computational basis.In bosonic codes, these processes involve performing single-qubit Pauli measurements and stabilizer measurements [36].We will discuss how they are performed in the MSC below.

Majorana Surface Code
We define the MSC on a trivalent, three-colorable lattice [57] (i.e., a lattice whose plaquettes can each be assigned one of three colors, such that no two adjacent plaquettes have the same color).In general, the plane has several trivalent, three-colorable tilings [34].Among these, we focus on the honeycomb lattice, a patch of which is shown in Figure 1.Majorana operators γ i are assigned to sites of the lattice.Plaquettes are assigned one of three colors, red, green or blue, as shown in Figure 1.Each plaquette p has an associated plaquette operator O p = i |∂p|/2 j∈∂p γ j , where ∂p is p's boundary and where we choose an arbitrary (but definite) ordering of the product (see Figure 1).The stabilizer group S is then generated by the complete set of O p in the system.In Figure 1, there are 2n = 60 Majoranas and m = 29 independent stabilizer generators.Hence there is k = 1 logical qubit encoded in the patch.
Bonds are also assigned a color, namely that of the plaquettes at their ends.A bond operator associated with bond e, connecting Majoranas γ j and γ k , is defined as O e = iγ j γ k .A string S is a set of bonds that all have the same color.String operators are then given by the product of all associated bond operators: O S = e∈S O e .Logical operators of the MSC are string operators that commute with all plaquette operators.For the patch in Figure 1, these correspond to strings running between opposite boundaries.In general, boundary conditions determine the number of logical qubits in the code.The patch in Figure 1 contains one logical qubit, which has logical operators given by the string operators X and Z shown.To see that X and Z anticommute note that their strings intersect an odd number of times; this renders |A ∩ B| odd in Equation (2), while |A| and |B| are both even.As noted earlier, logical operators can be deformed by stabilizers (L → Ls for s ∈ S) while still acting in the same manner on logical qubits.In the MSC, these deformations map between different string oper-ators running between the same boundaries.Thus, in Figure 1, the equivalence class [ X] contains all string operators terminating on horizontally opposite boundaries and similarly, [ Z] contains all string operators terminating on vertically opposite boundaries.[20,31,[81][82][83].

Anyons in the MSC
In topological quantum codes, we can define a stabilizer Hamiltonian according to which errors in the code correspond to anyons [20,30].The MSC, owing to its fermionic nature, has an anyon content that differs significantly from bosonic codes [57].We review the MSC's anyon model here.
One can assign a stabilizer Hamiltonian to the MSC by H = − u 2 p O p , where u > 0 and the sum runs over all plaquettes in the lattice.Thus the ground states of the Hamiltonian are code states of the MSC.Excited states are created by applying string operators to one of the ground states |ψ⟩.If string operator O S anti-commutes with plaquette operators O p1 , . . ., O p k , then O S |ψ⟩ has energy ku above the ground state energy.We interpret plaquettes p 1 , . . ., p k as hosting anyons and O S as creating these anyons (or annihilating anyons already located at those sites, if O S acts on an excited state).An anyon is labeled with the same color as the plaquette that hosts it: R, G or B for those hosted on red, green or blue plaquettes respectively.The simplest string operator is a bond operator; this creates a pair of anyons at its endpoints, such as those indicated by blue dots in Figure 1.If we consider two blue bonds e 1 and e 2 that have endpoint plaquettes p, q and q, r respectively, applying O e1 to |ψ⟩ is interpreted as creating anyons on p and q.Then subsequently applying O e2 is interpreted as annihilating the anyon on q and creating one on r.Alternatively, it can be thought of as moving the anyon from q to r.Thus applying string operators to an excited state can move the anyons to any other plaquette of the same color as the anyon.
There also exist parity-non-conserving processes that create anyons in triplets, rather than pairs.For example, applying a Majorana operator γ j to a ground state creates three anyons located on the plaquettes surrounding γ j .Due to the 3-colorability of the lattice, these anyons will all be colored differently.
Along with the three anyons mentioned, we also interpret the vacuum (no anyons present) as a quasiparticle, labeled 1.This will allow us to formalize fusion: the process of bringing two anyons close together and viewing the result as a separate anyon.For example, the fusion of R and B can be viewed as the anyon BR.A triplet of anyons created by a single Majorana operator is also considered as a distinct anyon, RGB.Note that creating a single RGB from 1 is not a fermion parity conserving process.To highlight this, we break the anyon content of the model into two sets, {1, R, G, RG} and {RGB, GB, BR, B} [57], where the second set is obtained from the first by fusion with RGB.We have the following (commutative and associative) fusion rules, dictating how anyons can be combined or split: The non-trivial rules are summarized in Figure 2. The fusion rules imply that anyons can be created (via splitting from an initial set) only in color-neutral combinations.All anyons in the system must be able to annihilate back to the initial set of anyons.There are two initial sets, 1 and RGB, which are inequivalent because RGB cannot transform to 1 under any fermion parity conserving process.These anyons and fusion rules thus describe a system with a Z 2 fermion parity grading [57].We discuss the braiding statistics of these anyons in Appendix A.1.
Similarly to anyons, string operators also obey fusion rules.Viewing C as the endpoint of string operator of color C ∈ {R, G, B} and 1 as the identity operator, we can apply Equations (3) to string operators even away from their endpoints.(We equate RGB with 1 in this context because an RGB pair can be created by a Majorana pair without string operators.)Fusion and splitting of string operators is implemented by multiplication with stabilizers.For example, the green string operator Z in Figure 1 can be split, by multiplication with green stabilizers, into blue and red strings (i.e., products of blue and red bond operators) along its length.This is shown in Figure 3. Hence the non-trivial rules from Equations (3) for string operators become R = G × B and all cyclic permutations of this.

Boundaries in the MSC
Topological systems sometimes admit gapped boundaries, with a classification that is possible purely by considering the model's anyon content (see Appendix A.2 for details).A system is gapped if the gap in energy between ground and lowest-energy excited states is bounded from below by a constant independent of the system size.Gapped boundaries of topological models are not only important from a condensed matter perspective [84,85], but also play an important role in quantum computation [31,52,86].
In the MSC there exist three topologically-distinct types of gapped boundary, which can be colored red, green and blue respectively.These are shown in Figure 4.The three boundaries are distinguished from one another by the color of string operator that can terminate on that boundary.(Equivalently by the plaquette color not appearing on the boundary.)For example, in Figure 1, the top and bottom boundaries are green, since the green string operator Z terminates on both of them.Equivalently, any green anyons present in the system may be brought into proximity of a green boundary, where local, fermion-paritypreserving processes (e.g., the application of a green bond operator) can result in the anyon being absorbed by the boundary: we say that the anyon "condenses" at that boundary.C-boundaries (for C = R, G, B) can condense only C-anyons.Anyon condensation processes are shown in Figure 4. Beyond this classification, fermionic systems have an extra Z 2 fermion parity grading along their one-dimensional boundaries.We will explore this further in the next section.

Twist Defects of the Majorana Surface Code
If φ is a permutation of the anyon labels, we say that φ is a symmetry if it preserves the fusion rules and statistics (see Appendix A.1) of the anyons [71].In two- dimensional topologically ordered systems, (transparent) domain walls are one-dimensional defects that are associated with symmetries of the anyon labels [71,84,87].An anyon a crossing the wall (in a given direction) is transformed into φ(a) where φ is the symmetry associated with the domain wall.If a crosses the wall in the opposite direction, it is transformed into φ −1 (a).
Domain walls can terminate at point-like twist defects ("twists" for short) [48, 69-71, 84, 87-89].It has been shown that these twist defects are closely related to non-Abelian anyons [46,49,69,90], and can be used for topological quantum computation in surface codes [39,[46][47][48]91].Twists can be classified by the permutation that is enacted on an anyon encircling the twist in a clockwise direction.If a domain wall associated with symmetry permutation φ terminates at two twists, one will be a φ twist, and the other will be a φ −1 twist.
We now introduce the twist defects appearing in the MSC.While some examples of MSC twists have previously appeared in the literature [56,61], we establish here their fundamental features and provide their exhaustive categorization 1 .In this model we have three non-vacuum anyon labels (either {R, G, B} or {RG, GB, BR}) that can be permuted in any way while still preserving the anyonic data, and hence the anyons possess an S 3 symmetry.Any non-identity element of the permutation group S 3 either swaps a pair of labels, generating a cyclic group Z 2 , or it is a length-3 cycle, generating the subgroup Z 3 .Thus domain walls and twists in the MSC are either of type Z 2 or Z 3 .
Beyond this classification, we can further identify sub-types.There are three types of Z 2 twists, which we label T R , T B and T G , according to the color of the anyon that is preserved when wound completely around the twist.There are two types of Z 3 twists, labeled T RGB and T −1 RGB .The former enacts the cycle 1 Note that twists have appeared in the MSC context for codes conceptually equivalent to bosonic codes.In Ref. [61], one of the MSC stabilizer colors is implemented as a parity constraint (i.e. the Majoranas are located on "hexons" or "tetrons") and the others are actively measured.This yields a code which is a Majorana realization of a bosonic surface code and hence the twists considered are those of the surface code.This corresponds to a restricted class of MSC twists: only bosonic Z 2 twists of a single type (e.g.T B ) can be included in such setups.R → G → B → R on anyons wound clockwise around the twist, and the latter enacts the inverse cycle.We provide lattice-based realizations of Z 2 and Z 3 twists in Figure 5. Discussion of these sub-types is convenient, but note that we can inter-convert twists between sub-types by relabeling the plaquettes.Indeed, a relabeling of an area A of code in this way amounts to having introduced a closed loop of domain wall at its boundary ∂A.Similarly, by relabeling an area adjacent to the domain wall, we can, effectively, move the path of the wall.This shows that domain wallsbut not the locations of their endpoints -are gauge dependent.Furthermore, if the loop of domain wall encircles a twist, it can change a Z 2 twist's sub-type to any other within the Z 2 class (T B , T G or T R ) and, similarly, can map between the two Z 3 twist sub-types (T RGB and T −1 RGB ).See Appendix B.1 for further details of such gauge dependencies.
Twists in the MSC differ from those in bosonic models in an important way: they can be further subdivided into "bosonic" and "fermionic" types of twist.These differ by a single MZM.However, rather than an extra MZM simply furnishing the twists, as might be expected, in Figure 5 we show that in fact the result can be a logical MZM located at the twist (cf.Section 2.1).In Figure 5a we provide a lattice realization of bosonic Z 2 and Z 3 twists and the domain walls connecting them, while in Figure 5b we show Z 2 and Z 3 fermionic twists.In the latter, the lattice contains pentagonal holes.The (Hermitian) product of all Majorana operators around the boundary of this hole is a fermion-parity-odd operator that, by Equation (2), commutes with all plaquette operators.These operators cannot be included in the stabilizer group, owing to their odd fermion parity.Instead they are logical MZMs.They generalize the key features of MZMs, including their commutation with the Hamiltonian.We discuss these logical MZMs appearing at fermionic twists below, in Section 3.3.
A domain wall lying along a boundary can change the color of that boundary, since it alters the color of anyons condensing there.Thus, there is an association between twists and corners, or interfaces between boundaries of different types (see Appendix B.2) [52].In Figure 1, we have indicated the corners between R and G boundaries in the MSC using pink dots.When such corners are fermionic, they host an MZM (see Figure 5c).
Twists can also be fused or split.For example, a Z 3 twist can be split into two Z 2 twists of different sub-types; this follows from S 3 being generated by transpositions (i.e., Z 2 operations) [92].However, the splitting or fusion of twists must preserve their overall fermionic or bosonic character: it cannot change the number of logical MZMs (mod 2).When a fermionic corner is split, logical MZMs appear, associated with boundaries of odd-length (see Figure 5d).Appendix B.3 has further twist fusion details and ex- amples.
When the MSC is defined on the honeycomb lattice, some Majoranas along domain walls are not included in any plaquettes.In Figure 5a and 5b, we draw orange, pill-shape faces between pairs of Majoranas left out of the lattice in this way.These Majorana operators furnish extraneous fermion modes (cf.Section 2.1), so we introduce additional bilinear stabilizers (iγ a γ b , for left-out operators γ a , γ b ), represented by the orange faces in Figure 5, to remove the groundstate degeneracy associated with these modes, i.e., to remove these states from our code space.Those Majorana operators included in orange stabilizers are not included in any other stabilizer of the code.
These extraneous Majorana operators, along with the logical MZMs at the twists, form a system similar to the Kitaev chain [3]: a one-dimensional string of adjacent, nearest-neighbor Majorana bilinears.Specifically, we replace the first and last of the 2n Majoranas of a Kitaev chain with logical MZMs Υ a and Υ b .The Hamiltonian [3] therefore has two fixed points, one in a topological phase in which unpaired logical MZMs exist at the endpoints (the situation of Figure 5b), and one in a trivial phase without unpaired logical MZMs.In the latter phase, Υ a and Υ b combine with neighboring Majoranas to form parity-even plaquette operators (e.g., the blue plaquettes at Z 2 twists in Figure 5a).A transition between fermionic and bosonic twists therefore requires the chain to go through a topological phase transition.This corresponds to a change of the chain Hamiltonian (i.e., domain wall stabilizer set) along its entire length, so that the bilinears change from one assignment of adjacent nearest neighbors to the other.The two sets can be seen in Figures 5a and 5b.The existence of these two types of twists thus corresponds to the existence of a topologically non-trivial phase for one-dimensional fermionic systems, as modeled by the Kitaev chain [69,93,94].The fermionic or bosonic nature of a twist is as robust as this topological phase; it is immutable under local, fermion-parity-conserving processes.

Quantum Dimensions of Twists
The ground state degeneracy of a code with twist defects (or equivalently the dimension of the code space) is governed by the quantum dimension of those twists.Given a code with N twists of quantum dimension d, the dimension of the code's ground space grows as d N for large N .The quantum dimensions of twists in the MSC differ between bosonic and fermionic types, due to fermionic twists also contributing to the degeneracy via their logical MZMs.
We can calculate these quantum dimensions by counting the number of anyons that can "localize" at a given twist.An anyon is localized at a twist if it is brought close to that twist and absorbed through local processes.For example, if anyon a obeys a = b × c and twist φ is such that φ(b) = c (the anti-particle of c, such that c × c = 1), then anyon a can be dragged to the vicinity of a twist, then split into anyons b and c. b is then wound clockwise around the twist and thus transformed to c which can then annihilate with c.This process results in anyon a being localized at the twist.The quantum dimension of a twist d φ is given by d 2 φ = a∈A N a,φ , where A is the collection of anyons the system permits, and N a,φ is 1 if anyon a can be localized at φ, and 0 otherwise [52].
Let us now count the anyons that can localize at each type of twist.Some of these localization processes are shown in Figure 6.Trivially, all twists localize the vacuum particle 1.Additionally, for bosonic Z 2 twists, anyon RG can localize at T B , GB at T R and BR at T G .We do not count B as localizing at T B , nor similarly for the other twists, because in order to split B to R × G, we need to introduce an RGB anyon to the system, and hence the twist is localizing RGB × B = RG, rather than just the B anyon.However we can localize B at a fermionic T B twist, because a blue string operator can directly terminate at the odd-length, blue boundary associated with this twist (see Figure 5b), and thereby commute with all stabilizer generators in the vicinity of the twist.Fermionic twists also localize RGB anyons since, for example, RGB = B × RG, so one can split RGB into these two anyons.Then both B and RG can localize at T B .Thus bosonic Z 2 twists localize two types of anyons (including 1), while fermionic Z 2 twists localize four.
Bosonic Z 3 twists can localize RG, GB and BR (and 1), since these particles can be split into their constituents (e.g., BR = B × R), one of which can be wound either once or twice around the twist until it is transformed into the same type as its partner (e.g., R transformed into B, as shown in Figure 6).Fermionic Z 3 twists also have an odd-length boundary of a single color and hence can localize either R, G or B in the same manner as fermionic Z 2 twists.However, R, G and B can be transformed into one another by en-  circling the twist, and hence fermionic Z 3 twists can localize all three of these.Finally, they also localize RGB, similarly to fermionic Z 2 twists.Thus in total, fermionic Z 3 twists can localize all eight anyons.
From the above, we can see that bosonic This signals their similarity to Ising anyons [46].Fermionic Z 2 twists have quantum dimension d F 2 = 2. Bosonic Z 3 twists have quantum dimension d B 3 = 2, whereas fermionic Z 3 twists localize all anyons and hence have quantum These quantum dimensions are verified using a different method in Appendix B.4.
MZMs are also similar to Ising anyons [17]; hence they also have quantum dimension √ 2. This precisely equals the ratio between fermionic and bosonic twist quantum dimensions.Thus going from bosonic to fermionic twists can be seen as attaching an MZM, or a logical MZM, to the defect, as discussed previously.

Logical Qubits from Twists
The degeneracy associated with twist defects discussed in the preceding section can be exploited for quantum computation.Introducing k pairs of bosonic Z 2 twists of a single type (e.g., T B ) into the MSC (without boundaries), results in 2 k−1 additional ground states and hence k−1 additional logical qubits.(The −1 is because it takes at least four twists to get a set of logical operators.This is analogous to at least four Ising anyons being needed to furnish a qubit [83].)For reasons discussed below, we will refer to this type of logical qubit as a "bosonic twist (BT) qubit" and the information it stores as "bosonic logical information." Logical operators for these BT qubits correspond to string operators encircling pairs of twists.Specifically, if l is a set of red bonds forming a closed loop around a pair of T B twists, then the red string loop (j,k)∈l iγ j γ k is a logical operator.The fact that it is not in the stabilizer group results from the inability to deform it past any of the twists.If one could do this, it would change the number of RG anyons localized at that twist, and hence violate the total color conservation of anyons in the system.The conjugate logical operator is given by a red/green string operator encircling a pair of twists and crossing two domain walls (see Figure 7a).Blue string operators encircling T B twists are stabilizer operators.
We schematically illustrate the logical operators associated with four Z 2 twists in Figure 7a, using colored lines to indicate string operators.The operators X and Z shown anti-commute, since different-colored string operators that cross each other once intersect at a vertex, and hence anti-commute.These logical operators generate the full algebra of operators acting on the logical qubit created by the addition of four twists to the system.
In Figure 7b we illustrate the logical operators for four Z 3 twists.In the figure, an anyon crossing a domain wall in the direction of the arrows is transformed according to the permutation T RGB , while those crossing in the opposite direction are transformed according to the inverse permutation.As can be seen, four Z 3 twists permit twice the number of logical operators as four Z 2 twists, owing to the extra degeneracy they afford (cf.Section 3.1).
There is an arbitrariness to the logical operators shown.In Figure 7a, one may wrap blue string operators around the two upper-most or left-most twists (these operators are stabilizer elements).The blue strings can be fused with the logical operators indicated, in the sense outlined in Section 2.4, thereby changing the red string operators to green ones and vice versa.If the code is embedded on a sphere, red and green string operators encircling all four twists are stabilizers, since they may be deformed around to the other side of the sphere, where they are not encircling any twists.With different boundary conditions, this becomes complicated, and we deal with these cases in the following section.For now, we continue with the simple case of a sphere.Operators X and Z can then be deformed into operators that instead circle the two bottom and right-most twists respectively.In Figure 7b, one cannot change the colors of the strings, since any string operator encircling a pair of Z 3 twists is not a stabilizer.But on a sphere, all strings may be deformed to encircle the other two twists in the set of four.
Twists can admit either sparse or dense encodings of logical qubits.This is analogous to encodings with MZMs [17].In a dense encoding, 2k + 2 twists encode k logical qubits.In sparse encodings, certain logical operators from the dense encoding become stabilizers, thereby lowering the number of logical qubits.For example, in a collection of 4k T B twists, we can promote to stabilizers all red (and hence also green) string operators surrounding each group of four twists.This results in k logical qubits, each stored within one group of four twists, and having the logical operators shown in Figure 7a.

Logical MZMs from Fermionic Twists
Both bosonic and fermionic twists in the MSC host the BT qubits discussed above.This same type of topological degeneracy is seen in twists of qubit-based codes, which is why we refer to it as "bosonic."For fermionic twists in the MSC we will label the corresponding bosonic logical operators as XB and ZB .In addition, fermionic twists also host logical MZMs.In the same way as four physical MZMs can store a single qubit in a fermionic parity sector [17], so too can four logical MZMs Υ a , Υ b , Υ c , Υ d .We can also define encoded Pauli operators acting on the qubits stored by these logical MZMs.For example, for four logical MZMs, we may have "fermionic" logical operators XF = iΥ a Υ b and ZF = iΥ a Υ c .We will refer to qubits stored in this way as "fermionic twist (FT) qubits." Figure 8a shows the operator iΥ a Υ b for two twists, deformed such that it is the product of a red string operator encircling the twists, and a blue string operator terminating on the two twists.It also shows the representation in terms of string operators of a single logical Majorana Υ c , which is equivalent to the localization of an RGB anyon at that twist (cf.Section 3.1).The logical operators XF and ZF have low minimum weights but large diameters, if the twists are far-separated (cf.Section 2.1).If only local, fermion parity conserving (FPC, i.e., even-weight) errors can occur, FT qubits are protected by the twists' separation [56].(Here we assume local coupling to the environment so that elementary FPC error operators are locally supported; all possible FPC error operators are products of these elementary FPC operators.)In realistic setups, however, we also have to contend with quasi-particle poisoning (QPP) resulting in non-FPC errors.The simplest such error operator is a single Majorana operator.To protect FT qubits from QPP, we can grow the size of the odd-length boundaries associated with twists and hence grow the weights of logical MZMs.As such (assuming we also increase twist separation), the FT qubits will have larger distances and so an increased protection against QPP noise.An example of such an enlarged hole is shown in Figure 8b.
Note that in systems where FPC errors are more common than QPP events, and if the former have below-threshold error rates, we can reduce the logical error rate to a low value set by QPP by increasing only the twist separation (i.e., increasing the code diameter but not the distance).This contrasts to MSC strategies without logical MZMs, where the code distance must be increased to reduce the logical error rate.Using fermionic twists in systems with low QPP probability, we can store double the number of logical qubits with only a minor increase in overheads, resulting from the size of the odd-boundary holes (see Figure 8b).While for low enough QPP probability microscopic MZMs could be used to store topological qubits, without error-correcting codes such a strategy is not fault-tolerant as any finite QPP rate will inevitably limit the coherence times of the topological qubit.Meanwhile, using logical MZMs, logical error rates resulting from QPP can be made arbitrarily small by increasing the code distance, provided the QPP rate is below the corresponding error threshold.
Logical MZMs can also appear in systems with only bosonic twists, when a boundary is introduced to the system.To our knowledge, this type of logical MZM has not been identified previously in the literature.We introduce it in Appendix C.

Fault-Tolerant Computation With Twists
In this section we detail how to perform fault-tolerant quantum computation with FT and BT qubits.These procedures will require the ability to move twists via "code deformation" (Section 4.1).In Section 4.2 we discuss how to prepare logical Pauli eigenstates and apply Clifford gates to BT qubits.In Sections 4.3 and 4.5 we discuss performing measurements of BT and FT logical operators.The above, combined with the preparation of magic states (Section 4.4), is sufficient for universal computation with both types of qubit.

Code Deformation
For fault-tolerant computation using twists, we need to understand how to move them.We can do this with  code deformation [44,45,47,95,96]: a process where a code with stabilizer group S is mapped to another code with stabilizer group S ′ .To project to a code state of S ′ , we perform measurements of its stabilizer generators.In particular, in the new code those previous S stabilizer elements that anti-commute with any s ′ ∈ S ′ are replaced.While this changes the code's stabilizer group, it preserves the logical state if each logical operator equivalence class [L] of the original code has members that are also logical operators of the new code.
Here we introduce a novel code deformation procedure for the MSC that allows us to move twists.The procedure differs between fermionic and bosonic twists.

Moving Bosonic Twists
The code deformation procedure for bosonic Z 2 twists is illustrated in Figure 9a.In the figure, a T B twist along with part of a logical operator (a red string operator encircling this and another twist) are shown.To move the twist to the blue plaquette to its right, we measure the bilinear υ involving Majorana operators at the two light-blue sites.This then becomes an orange stabilizer along the newly enlarged domain wall.Since υ anticommutes with the plaquette operators O p1 and O p2 (indicated in the figure), these two operators are not included in S ′ .However their product O p1 O p2 commutes with υ and hence is included as an 8-body stabilizer element.Note that measuring υ means that the blue hexagonal plaquette formerly hosting the twist can be replaced by a rectangular (4body) plaquette: the new stabilizer generator is the product of υ and the original hexagonal plaquette op-erator.
The logical operator in the figure commutes with the updated stabilizer group.In general, we can always deform these string-like logical operators away from twists [56,97], so that they commute with the code deformation measurements performed.Thus, twists can be moved via series of small steps like the above, without destroying the information stored in logical qubits.
In Figure 9b, a Z 3 bosonic twist is illustrated.If we again wish to move this twist to the right, we first measure the rectangular operators γ 1 γ 2 γ 3 γ 4 and γ 3 γ 4 γ 5 γ 6 , with the vertex numbering indicated in the figure .Again, these operators anti-commute with certain members of the original stabilizer group S.After measuring both rectangular operators, the adjacent red, green and blue hexagonal operators to their right are replaced by a 10-body operator (see upper inset of Figure 9b).The rectangular operators both commute with the operator defined on the twist's original location, O T = iγ 1 γ 2 γ 5 γ 6 γ 7 γ 9 .The product of the two rectangular operators is −γ 1 γ 2 γ 5 γ 6 and multiplying this with O T , we find that the bilinear iγ 9 γ 7 is a stabilizer element.This is shown in orange in the top inset of Figure 9b.We then measure operators iγ 7 γ 8 and iγ 9 γ 10 .This produces the same orange operators as in other locations along the domain wall.By following how the stabilizer group is updated after each of these two measurements, we see that they result in the stabilizer generators indicated in the lower inset of Figure 9b.
We can similarly move twists in different directions or generate a pair of twists in the lattice by measuring the stabilizer generators of the new code lattice.If any of these measurements return a −1 result, we can simply define the new stabilizer generators to be the negative of all measured operators whose eigenvalues are −1.
Moving the twists a short distance (compared to the twist separation) does not change the encoded states of the BT qubits, since the changes are restricted to be far from the paths of a suitable set of logical operators.However we shall see that performing a large sequence of small code deformation steps can result in unitary transformations of the code states.

Moving Fermionic Twists
This procedure must preserve the information stored both by BT qubits and by logical MZMs.As above, the former can be ensured by deforming bosonic logical operators away from the twists.However, logical MZMs cannot be deformed in such a way: their support always has an odd-weight intersecton with the boundary associated with the twist (cf. Figure 8a).
Code deformation can most easily be seen to preserve information in MZMs by considering moving an enlarged hole, such as the one in Figure 8b.We move this hole through a series of enlarging and contracting procedures.In Figure 9c, the hole from Figure 8b is enlarged to the left by measuring the bilinear operators indicated in light-orange in Figure 9c, along with the four-body plaquette operators colored light-green and light-red in the figure.Figure 9d then shows the same hole shrunk from the right by measuring the light-colored plaquette operators indicated.The final result is that the location of the hole, and hence the twist, has moved to the left.
To see the preservation of the logical state, consider the logical operators in Figure 8a.The logical operator iΥ a Υ b is the product of a string operator encircling twists a and b, and a string operator connecting twists a and b.Similarly, any parity-even product of logical MZMs can be deformed into an operator that intersects each of the twists' boundaries at a single site (e.g., operator iΥ a Υ b in Figure 8a).Other sections of the fermionic logical operator can be deformed away from the twists during code deformation, but the string operator(s) terminating on the twist boundaries cannot.The procedure will preserve fermionic information if we can deform these operators so that their support intersects none of the sites involved in the measurements to be performed.In Figure 9c we indicate such a string operator terminating on the right-hand side of the boundary of a T B twist -this is unaffected by the measurements that enlarge the hole.In Figure 9d we indicate the same string operator, deformed to terminate on the left-hand side of the boundary.This operator is now unaffected by the measurements that shrink the hole.Hence the information stored in these logical MZMs is protected during code deformation.

State Preparation of BT Qubits and Clifford Gates via Braiding Twists
We will now discuss how to prepare logical Pauli eigenstates and perform fault-tolerant Clifford gates using BT qubits.The latter will be achieved purely by braiding Z 2 and Z 3 twists, in analogy to Clifford gate procedures in the bosonic Color Code [47] (though Clifford gates may also be achieved through lattice surgery; see Section 4.5).Our MSC scheme requires no ancilla logical qubits for the implementation of single-qubit Clifford gates, unlike other approaches [57,60].We shall consider BT qubits stored sparsely in quartets of either Z 2 (storing one qubit in four twists) or Z 3 (two qubits in four twists) bosonic twists.We will see that we need only consider two sub-types of Z 2 twist, which we take (without loss of generality) to be T B and T R .
To prepare four Z 2 twists in an eigenstate of a given logical Pauli operator, we start with a MSC patch hosting these twists, such as the one of Figure 1.For example, to prepare this patch in the +1 eigenstate of X (a red string operator), we initialize the patch in the +1 eigenstate of all red bond operators.This prepares X and green and blue plaquette operators in their +1 eigenstates since they are all products of red bond operators.To prepare red plaquette operators in their +1 eigenstates, we measure them and apply red string operators that take the state to the code space given the observed syndrome (in practice, we would not apply this operator and instead, redefine the stabilizers).Since X and the green/blue plaquette operators commute with the red plaquette operators, these measurements do not change their eigenvalues from the preceding step.The inequivalent choices of string in the last step differ by X; this is again immaterial given we already had a +1 eigenstate of X.This procedure thus prepares the patch in the +1 eigenstate of X in the code space.We can then move the twists away from the boundaries of the patch using code deformation (cf.Section 4.1).Finally, we can fuse the patch with the rest of the lattice hosting logical information by adding stabilizer operators that bridge the gap between the boundaries of the two lattices.
As is possible in the bosonic surface code [39], we can braid bosonic twists in the MSC to perform certain encoded Clifford gates on logical qubits.This procedure is achieved with code deformation via sequences of small steps.It is a naturally fault-tolerant procedure, since the code distance (and the diameters of logical operators) can be kept large throughout the whole braiding process.If we were restricted to using Z 2 twists of a single type (e.g., T B ) then, just as in the bosonic surface code, braiding could not generate the entire Clifford group for the logical qubits.Braiding T B twists can generate only the single-qubit Clifford gates, as explained in Appendix D. This is due to the similarity between bosonic T B twists and Ising anyons [83], as is also the case in the surface code [46,90].
However, unlike the bosonic surface code, the MSC also has Z 3 twist defects and hence allows for a larger set of gates to be implemented by braids.This is similar to the case of the bosonic Color Code [47].We can enact an entangling gate between the two qubits stored in a quartet of Z 3 twists by using the braid shown in Figure 10.If we call this braiding operation B, it can be seen from the figure that the operator X2 is mapped to B X2 B † = X1 X2 by this braid.Similarly (see Appendix D), the other logical Pauli operators are transformed as: X1 → X2 , Z1 → Ȳ1 Ȳ2 and Z2 → Z1 X2 .We can fix the signs in these mappings by carefully defining the logical operators and stabilizer generators.It can be verified that B is equivalent to the following circuit between the two logical qubits: A Z 3 twist can be split into two differently-colored Z 2 twists (cf.Appendix B.3). Splitting all four Z 3 twists into T B and T R twists results in qubit 1 being stored between the T R twists and qubit 2 between the T B twists.Thus, through this splitting, we can enact all single-qubit Clifford gates on qubits 1 and 2 with Z 2 twist braids.We can therefore achieve the full set of Clifford gates on qubits 1 and 2 via twist braids (note that a CNOT gate controlled on qubit 1 and targeted on qubit 2 can be achieved with the gate Z1 H1 B 3  H1 , where H1 is the Hadamard gate acting on qubit 1).
To enact a Clifford circuit on n BT qubits, we can store some of them in T B twists and the rest in T R twists.This allows single-qubit Cliffords to be implemented within same-color quartets and entangling gates to be implemented between T B -stored and T Rstored qubits with the above procedures.We can also entangle T B -stored (equivalently T R -stored) qubits by introducing a quartet of T G twists as an ancilla qubit.Entangling gates between the ancilla and the two logical qubits (which are possible due to the above discussion) are all that is required to perform an entangling gate on the two logical qubits.

State Preparation of FT Qubits and Logical Majorana Parity Measurements via Lattice Surgery
To compute with the logical MZMs of fermionic twists, we need the ability to prepare eigenstates, perform computational basis measurements, and perform logical B 4 and T 2 gates, which have the form In general we may also wish to perform B 2k = exp (i k+1 π 4 Υ j1 . . .Υ j 2k ) gates as these too are fermionic variants of Clifford gates acting on FT qubits.While these could be synthesized from B 4 gates [62], it may be preferable to perform them directly.We also want to perform all of these fermionic gates while preserving the bosonic information stored in the twists.We will, similarly to the previous section, detail how to achieve this with T B and T R twists as this will be sufficient for universal computation.
We can perform B 2k gates if we can prepare ancilla logical MZMs furnishing known eigenstates and measure arbitrary logical MZM products, i.e., logical fermion parity operators [64].The ability to perform these measurements also allows us to prepare eigenstates of operators iΥ a Υ b for arbitrary logical MZMs a, b.In this section, we detail how to prepare patches of code that host ancilla logical MZMs, and how to perform logical fermion parity measurements.In the next section, we detail how to perform T 2 gates.This, combined with the above, allows us to perform universal computation with logical MZMs.

Bilinear Measurement and Eigenstate Preparation
The simplest measurement to consider is that of logical MZM bilinears, i.e., operators of the form iΥ a Υ b .This type of measurement may appear at the end of a fermionic circuit (sampling the output distribution) and can also be used to prepare computational basis states for the start of a circuit.To perform such a measurement in a non-destructive, fault-tolerant manner, we first prepare an ancillary pair of logical MZMs ( Υa and Υb ) in a separate patch of code located close to the first.This ancilla patch is shown in Figure 11.Note that this patch contains no BT qubits, owing to its boundary conditions.Comparing this patch with the one in Figure 1, we see that while in the latter, there exist multiple inequivalent logical operators running between separated boundaries of the same color ( X and Z in Figure 1), the ancilla patch in this case has only one such string operator, a blue string terminating on the two blue boundary sections.This is equivalent to the operator i Υa Υb .The patch can be prepared in the +1 eigenstate of i Υa Υb by, similarly to the preparation of BT qubits, preparing the +1 eigenstate of all blue bond operators, then measuring all blue stabilizers, and applying a correction string if needed.
To measure iΥ a Υ b on the neighboring patch of code, we merge the twists supporting Υ a and Υ b with a boundary colored differently from the twists, so that the logical Majoranas are located along the exterior boundary of the lattice (see Figure 5d and 11).For T B and T R twists we merge the twists with a green-colored boundary.In Figure 11 we show an example in which Υ a and Υ b are both supported along blue boundaries.See Appendix E for a more general example.
We can measure operators iΥ a Υa and iΥ b Υb by fusing the blue boundaries associated with the logical Majoranas, thus forming an extra blue plaquette operator (see Figure 11).We begin by measuring the operator iΥ a Υa , obtaining the result η a .This operator anticommutes with both iΥ a Υ b and i Υa Υb , but the effect of the measurement is simply to logical-braid Υ a with Υb [62,72] The operator we wish to measure, iΥ a Υ b , is thus mapped to η a i Υb Υ b through the above measurement.Hence we must now measure the operator i Υb Υ b , another blue plaquette operator fused from the corresponding blue boundaries.We denote the outcome by η b .The desired measurement outcome of iΥ a Υ b is thus η a η b .After these measurements, −η a η b Υ a Υ b Υa Υb is a stabilizer of the resulting state of the full system.Finally, we measure i Υa Υb destructively (i.e., via its constituents [64]) to decouple the ancilla patch: we measure all blue bond operators of the patch, yielding the eigenvalue of i Υa Υb p∈B O p with the blue stabilizers O p∈B of the patch.We then measure these O p∈B (or use previous syndrome measurement outcomes) and thereby infer the outcome ηab for i Υa Υb .This yields a +1 eigenstate of ηab η a η b iΥ a Υ b .If ηab = −1, this state is not the one corresponding to the obtained iΥ a Υ b outcome η a η b .But this error can simply be classically tracked, and subsequent computations can be updated.
We can generalize this procedure to cases in which Υ a and Υ b have larger weights, and are hosted along boundaries of different colors.We outline the more involved setups required in Appendix E.
The bosonic information in the twists is again preserved by these lattice surgery procedures, since bosonic logical operators (such as ZB and XB of Figure 11) can be deformed away from all of the lattice surgery measurements.
We need not move twists to a distant boundary if they are deep within the code bulk.Instead, we can create a hole within the lattice by ceasing the stabilizer measurements within and altering the stabilizers along the boundary to ensure that it has a single color.We then introduce the MSC patch with the ancilla logical MZMs into this hole and proceed as above.Afterwards we fill in the hole by measuring the original plaquette operators.Such a hole may add an extra logical qubit, but if so, filling in the hole simply discards the qubit again.While the introduction of the hole will affect the weights of certain logical operators, and hence may reduce the code distance, this distance can still be kept arbitrarily large by increasing the separation of the code's twists.

Arbitrary Fermion Parity Measurement
We can measure arbitrary products Γ 2k = i k 2k j=1 Υ j of logical MZMs similarly.We again treat the case in which all twists hosting the Υ j are of types T B or T R .We move the twists to a boundary of color different to all the twists (i.e., green), using code deformation.Similarly to above, this can either be an exterior boundary or we can introduce a hole in the center of the lattice.Now the logical MZMs are supported on 2k sections of odd-length boundary.A k = 2 example where these boundary sections lie around a hole is shown in Figure 12.
An ancilla patch of code is then prepared close to the boundary that now hosts all Υ j .This patch will also host 2k logical MZMs labeled Υj for j = 1, . . ., 2k, supported along the boundary of the patch.Each Υj is located close to Υ j on the main lattice.The ancilla patch will have the 2k-MZM parity operator Γ2k = i k 2k j=1 Υj .We choose these logical MZMs to be supported on blue sections of boundary.This patch will contain BT qubits as well as logical MZMs.Specifically, it encodes k − 1 BT qubits.In Figure 12a we show the logical operators for the patch in the example considered.
We prepare the ancilla patch by first preparing all blue bonds within the patch in their +1 eigenstates and then measuring all blue plaquette operators.In the example of Figure 12, there are three independent logical operators for the ancilla patch that are made up only of blue string operators, as seen from representing logical MZM bilinears similarly to Figure 8a (but with the green XB replacing the red loop of Figure 8a for i Υ1 Υ2 and i Υ3 Υ4 ): i Υ1 Υ2 XB , i Υ2 Υ4 ZB , and − Υ1 Υ2 Υ3 Υ4 = Γ4 .After preparation, the system will be in the +1 eigenstate of all three of these operators.
We now measure iΥ j Υj , obtaining outcome λ j , for all j = 1, . . ., 2k, using lattice surgery.This involves measuring plaquette operators that bridge the gaps between logical MZMs Υ j and Υj .The product of these plaquette operators is equivalent to the operator iΥ j Υj .Examples of these plaquette operators are shown in Figure 12b.Notice that, in this example, the product of blue plaquette operators connecting Υ 1 and Υ1 give the outcome for iΥ 1 Υ1 , since the green plaquette operators between these two boundaries are simply products of original four-body and two-body stabilizer generators.Similar situations apply to the measurement of iΥ 2 Υ2 , iΥ 3 Υ3 and iΥ 4 Υ4 .
To explain the effect of these iΥ j Υj measurements, we consider the example of Figure 12 more closely.Here we will use Γ to denote the total fermion parity operator of the main lattice (containing Υ 1 , . . ., Υ 4 ).We can assume the system is initially in a Γ = +1 state (this just sets the parity sector for the logical MZMs).Before any lattice surgery measurements, there exist four independent logical operators that stabilize the full system (i.e., the system is in a +1 eigenstate of all these operators): Γ, Γ4 , i Υ1 Υ2 XB and i Υ2 Υ4 ZB .The first measurement operator, iΥ 1 Υ1 , anti-commutes with Γ, Γ4 and i Υ1 Υ2 XB , and hence only products of pairs of these three operators continue to stabilize the state of the system.The full list of such (independent) stabilizing logical operators is: λ 1 iΥ 1 Υ1 , Γ Γ4 , i Υ2 Υ4 ZB and i Υ1 Υ2 XB Γ4 = i Υ3 Υ4 XB .Similarly to Section 4.3.1,we may replace the projector associated with the logical measurement with a logical braid: ).This produces the correct post-measurement state.This operator can be thought of as a braid between Υ 1 and iλ 1 Υ2 Υ3 Υ4 : it maps Υ 1 → iλ 1 Υ2 Υ3 Υ4 .Thus the operator Γ 4 we wish to measure is mapped to operator The subsequent measurements of iΥ j Υj (for j = 2, 3, 4, each with outcome λ j ) commute with this and, hence, the lattice surgery measurements can be seen to result in the measurement of Γ 4 : it has outcome λ 1 λ 2 λ 3 λ 4 .This is explained in detail in Table 2 by tracking updates to the stabilising logical operators, logical MZMs and Γ 4 after each measurement.λ 1 λ 2 λ 3 λ 4 is also the eigenvalue of the operator Γ 4 Γ4 = 4 j=1 iΥ j Υj .To disentangle ancilla and logical degrees of freedom, we measure all blue bond operators on the ancilla patch, from which we can infer the eigenvalues of Γ4 (call it η 1 ), i Υ1 Υ2 XB (call it η 2 ) and i Υ2 Υ4 ZB (call it η 3 ).These operators do not commute with the operators iΥ j Υj but they do commute with Γ 4 Γ4 .Hence from the previous measurement outcomes and the measured eigenvalue of Γ4 , we can find the Γ 4 eigenvalue to be η 1 λ 1 λ 2 λ 3 λ 4 .If η 1 = −1, we need to apply a correction to map the state to an eigenstate of Γ 4 with the measured eigenvalue λ 1 λ 2 λ 3 λ 4 .This correction operation can simply be kept track of classically.There are multiple such possible correction operations owing to the degeneracy of the Γ 4 = ±1 eigenspaces.To determine which we should apply, we need to determine if all logical bilinears (iΥ 1 Υ 2 , iΥ 3 Υ 4 , etc.) have been correctly preserved by the entire series of measurements above.
We discuss the details of this in Appendix F.
Note that, similarly to the case of Section 4.3.1, this measurement procedure does not directly affect the bosonic information stored between the twists, as all bosonic logical operators can be deformed away from the locations of the lattice surgery measurements.The introduction of the hole again reduces the distance of some logical qubits, but this distance can be preserved by further separating the twists in the code.Hence all encoded information can remain topologically protected throughout the entire procedure.

Magic State Injection
Combining the above operations with the injection of magic states into MSC patches allows one to perform universal quantum computation fault-tolerantly with both bosonic logical qubits and logical MZMs.Here we detail how to achieve magic state injection in two ways: the first is within an existing patch of code, while the second is in a separate patch of code (e.g., in an ancilla register).
Several noisy copies of this magic state can be purified to a single copy using Clifford gates and measurements [76]."Magic state gadgets," also composed of Clifford gates and measurements [1], can be used to apply T gates on BT or FT qubits in the code, using these purified magic states as a resource.; we assume we can perform at least a noisy version of this gate using established methods [22,24,25].This approximately yields

Pre-measurement
where |0⟩ F and |1⟩ F are the +1 and −1 eigenstates of operator iΥ a Υ b , respectively.Throughout this process, twists a and b are farseparated from twists c and d, and hence XB and iΥ a Υ c logical errors are suppressed by this large separation, and the weights of the logical MZMs, which can be made arbitrarily large.So, provided error rates are below the error threshold, the BT qubit remains in the |0⟩ B state throughout the process with arbitrarily high probability, while the FT qubit is prepared in a noisy magic state.Alternatively, we could prepare the BT qubit in a magic state by instead first preparing the state |0⟩ F |+⟩ B .The same gate as above then approximately prepares the state: We can also prepare magic states in both FT and BT qubits by enacting the following operators on the state where CX J,K is the CNOT gate controlled on qubit J and targeted on qubit K.

Off-Patch Magic State Injection
In Figure 13b we illustrate injecting magic states into separate MSC patches via measurements.Four MSC patches are prepared, each with two logical MZMs.
On each patch, one of these logical MZMs has low weight and the other has high weight.The low-weight logical MZMs are labeled Υ 1 , Υ 2 , Υ 3 , and Υ 4 (cf.the weight-three logical MZMs in Figure 13b), and the large-weight logical MZMs are labeled Υ a , Υ b , Υ c , and Υ d , respectively (cf. the weight-seven logical MZMs of Figure 13b).These patches do not contain any BT qubits, owing to their boundary conditions.Our goal will be to inject a magic state into the fourpatch FT qubit furnished by Υ a , Υ b , Υ c , and Υ d , i.e., using the large-weight MZMs.We start by preparing the patches in the +1 eigenstates of iΥ a Υ 1 , iΥ b Υ 2 , iΥ c Υ 3 and iΥ d Υ 4 (cf.Section 4.3).We then prepare a patch with four Majorana operators (orange rectangle in Figure 13b and labeled γ 1 , γ 2 , γ 3 , γ 4 ) in a possibly noisy magic state encoded in subspace stabilized by the patch parity −γ 1 γ 2 γ 3 γ 4 .We inject this magic state into an FT qubit furnished by Υ a , . . ., Υ d by measuring operators O j = iΥ j γ j for j = 1, 2, 3, 4. The example of O 4 is represented as a plaquette operator in Fig- ure 13b.This measurement maps γ 1 to Υ a (and similarly for the other measurements), by the same logic that we have used repeatedly: due to the anticommutation of O 1 and iΥ a Υ 1 , the measurement, with outcome λ 1 effectively implements the logical braid exp( π 4 λ 1 Υ a γ 1 ) and similarly for j = 2, 3, 4. In this way, the magic state furnished by γ 1 , γ 2 , γ 3 , γ 4 is transferred to the FT qubit furnished by logical MZMs Υ a , Υ b , Υ c , Υ d (specifically in the subspace stabilized by −Υ a Υ b Υ c Υ d ), up to a correction operation (if λ 1 λ 2 λ 3 λ 4 = −1) which can be tracked.The resource cost of this magic state preparation method is compared with alternatives in Section 5.

Arbitrary String Operator Measurements
We now discuss measuring various string operators.The following considerations make this particularly interesting.The twist framework established above allows for not only fermionic and bosonic computation to be done side-by-side, but also for hybrid computing schemes involving both FT and BT qubits.To complete the set of universal gates for both types of logical qubit, we require a gate that entangles the two.This would, for example, allow us to use magic states stored in FT qubits (cf.Section 4.4) to apply T gates to BT qubits.Moreover, the measurement of BT qubit logical operators opens up an additional route for implementing Clifford gates on top of braiding twists, which could result in reduced overheads [98].
We can achieve the effect of entangling gates between BT and FT qubits by fault-tolerantly measuring Γ F P B , where Γ F is a logical MZM parity and P B is a bosonic logical Pauli operator.For example, take an FT, a BT, and an ancilla twist qubit, with logical operators { ZF , XF }, { ZB , XB } and { ZA , XA }, respectively.To implement a CNOT gate controlled on qubit F and targeted on B, we can prepare the ancilla qubit in the |+⟩ A state, then measure ZF ZA , then XA XB , and finally ZA .This results in the desired gate, up to a logical Pauli operator which can be tracked.We can avoid introducing these ancilla qubits by instead classically tracking Clifford gates and updating circuit measurements accordingly (see also Section 5) [61,72,99].
Here, we detail how to measure arbitrary Γ F P B , all of which will be some product of string operators.We distinguish between two types of string operator, with arbitrary Γ F P B operators being products of multiple instances of these two types.Define fermionic string operators as those that terminate on the odd-length boundaries associated with two fermionic twists, and bosonic string operators as simply products of bosonic logical operators (thus they are simply of the form P B ).The latter will either encircle some number of twists or alternatively terminate at a boundary of even length.Hence only fermionic string operators have a non-trivial action on FT qubits.We describe the measurement of fermionic string operators first, then move on to bosonic string operators.We describe how to measure arbitrary products of these two types in Appendix G.
The procedures for measuring string operators use lattice surgery and are very similar to those for measuring fermion parity operators, as described in Section 4.3.We begin with the case of a single fermionic string operator, S 1 .For concreteness, we assume that  8a, would now connect the red boundaries and hence can be shrunk: it is a stabilizer element.)To measure the operator S 1 , we perform lattice surgery between the logical patch and the ancilla patch.For the example of Figure 14, we perform measurements of the green plaquette operators bridging the gap between the two patches.Notice that the product of these green plaquettes is equal to ±S 1 (i Υa Υb ).This procedure differs from that of Section 4.3.1 since there we only measure two plaquette operators bridging the gap between the patches.Those plaquette operator measurements fused pairs of logical MZMs on the ancilla and code patches.In the present case we fuse the patches along the two string operators shown in Figure 14 resulting in different logical information being extracted.Call the product of all measurement outcomes of these green plaquette operators λ.Similarly to the cases examined in Section 4.3, λ is the measurement outcome for S 1 that we desire (up to a known sign defined by the ordering of the operators).To decouple the ancilla patch, we then destructively measure i Υa Υb (cf.Section 4.3.1).This produces the result i Υa Υb with certainty (assum- ing perfect measurements) since we can find a representative of this logical operator that commutes with all lattice surgery measurements.Hence we need not track any correction operation, as we had to do in previously-described lattice surgery procedures.
We now explain the measurement of a bosonic string operator using lattice surgery.Without loss of generality we assume this is a red string operator, which we call S 2 .If S 2 encircles some twists, we move these to one of the boundaries of the lattice, as before.Thus S 2 now terminates on even boundaries.An example involving two twists is shown in Figure 15a.The lattice hosting S 2 in this figure is the same as that hosting S 1 in Figure 14a.While the ancilla patch looks slightly different, it still only hosts two logical Majoranas Υa and Υb .The patch is prepared in the +1 eigenstate of i Υa Υb , a red string operator shown in Figure 15a.Measuring the blue and green/blue plaquettes that fuse the two patches (shown lightly shaded in Figure 15b) measures the operator ±S 2 i Υa Υb .These measurements commute with the fermionic logical operators on the upper patch and, moreover, do not reveal any information about them.Finally, the ancilla patch is destructively measured leaving the upper patch in the measured eigenstate of S 2 .
In Appendix G, we extend these procedures to the measurement of arbitrary products of bosonic and fermionic string operators.Thus, any logical operator in the code can be measured using lattice surgery.We can therefore achieve universal quantum computation with BT and FT qubits side-by-side, by combining these measurements with the procedures of Sections 4.2-4.4.

Qubit Storage State Preparation Long-range Measurement
All bosonic Fermionic qubits and bosonic ancillas Table 3: Number of Majoranas required for Pauli-based computing with various schemes, utilizing either bosonic or fermionic aspects of the MSC.d is the code distance chosen for bosonic patches, while d ∆ ≲ d, is half the distance of the triangle code patches (i.e., d ∆ is the minimum weight of the logical Majoranas hosted therein), and the minimum thickness of ancilla patches.The chosen d ∆ will depend on the QPP probability.We compare the requirements for storing a logical qubit in a 6.6.6 lattice (1 st column), and the ancilla costs of preparing a magic state (2 nd column) and measuring a long-range multi-qubit logical Pauli operator with an ancilla patch of length roughly L (3 rd column). 1 st row: Majorana requirements for storing magic states in BT qubits and using the same "bosonic" MSC patches (with no logical MZMs) for logical Pauli operator measurements [61].
For state preparation, only those MZMs in the storage patch are required and hence the ancilla cost is zero [61]. 2 nd row: requirements for storing qubits in Majorana triangle codes and using bosonic ancilla patches where possible [58].3 rd row: requirements for storing qubits in Majorana triangle codes and using ancilla patches that contain logical MZMs.

Overheads for Universal Fault-Tolerant Computation
Universal quantum computation can be achieved via the measurement of arbitrary Pauli operators on (distilled) magic states [72,73].Universal fermionic quantum computation, which is more suitable for fermionic simulation, can be performed in a similar manner [62].
Here, we consider the resource costs for performing such computations using the MSC, in setups in which QPP is suitably rare.We consider encoding logical MZMs in "Majorana triangle codes" [58] and performing Pauli measurements on magic states encoded using these.That is, we perform "Pauli-based computation" with the MSC, taking full advantage of the Gottesman-Knill theorem to reduce the quantum resources required.Our method is able to find potential avenues for increased resource savings by exploiting the fermionic aspects of the MSC.A Majorana triangle code is a patch of MSC encoding a single logical MZM.It has three odd-length boundaries of different colors (see Figure 16a).We begin by preparing n magic states in 4n Majorana triangle codes, using for each quartet the "off-patch" method outlined in Section 4.4.2,followed by additional measurements to sever the "tails" in Figure 13b.(We assume having high-fidelity magic states, otherwise we can employ magic state distillation to improve the magic-state quality.)Let the distance of this encoding be 2d ∆ ; that is, the minimum weights of the logical MZMs hosted on the four triangle codes are all d ∆ .Meanwhile, let the distance of any bosonic MSC patch be d.We will assume we are in a parameter regime in which d ∆ < d and discuss the possibility of this below.
Our state-injection procedure takes only a d ∆independent time (that of the measurements) to increase the distance of the logical qubit from 2 to 2d ∆ .However, the code patches for magic state in-jection (cf. Figure 13b) include low-weight logical MZMs, along with thin-width patches of code vulnerable to the type of error process described below.These two features, respectively, act in favor of and against the fidelity of the injected state.The overall magic state preparation process, however, is fault-tolerant because of magic state distillation used.
Note that the "tails" of the initial state-injection patches (Figure 13b) may be maintained at a constant length, independent of the code distance.Increasing the tail length beyond a certain length simply increases the diameter of operators iΥ a Υ 1 , iΥ b Υ 2 , etc., not the minimum weight d ∆ + 3 of these operators.While this decreases the probability of parityconserving processes resulting in logical errors such as iΥ a Υ 1 , these logical "errors" act as +1 on the initial state of the patch and hence are inoperative.
Hence, since we use tails of constant width and length, the total number of constituent Majoranas involved in the preparation of a single (potentially noisy) magic state is 4N ∆ (d ∆ ) + O (1), where N ∆ (d ∆ ) is the number of Majoranas in a single side-length-d ∆ triangle code.After the magic states are prepared, the tails can be deleted, resulting simply in four triangle codes (see Figure 16a).For triangle codes based on hexagonal, 6.6.6 lattices (i.e., those with red, green and blue plaquettes having support on 6 Majoranas each) Meanwhile, for triangle codes based on 4.8.8 lattices (i.e., those with square and octagonal plaquettes [61]) ).We will continue to analyse the resources of 6.6.6 codes, but we can obtain lower asymptotic overheads with 4.8.8 codes, at the cost of higher-weight stabilizer measurements.The Majorana overhead for qubit storage using triangle codes and bosonic MSC patches are presented in Table 3.
Previous work demonstrated computation with Majorana triangle codes but utilized only bosonic aspects of the MSC for the ancilla patches containing magic states [58].This yielded a scheme where magic state injection required an O(d 2 ) number of ancilla Majoranas in addition to four triangle codes: The ancilla cost is at least that of a distance-d patch (e.g., that of Figure 1).This compares to the O(1) number of ancilla Majoranas [namely the 4 MZMs used to prepare the noisy state for injection, and the O(1)-length tails] required in the off-patch method from Section 4.4.2.Thus, for large d, utilizing fermionic aspects of the MSC in magic state preparation and storage becomes more efficient.(Note that it is not possible to use bosonic ancilla patches for measurement as we require odd-length boundaries for lattice surgery with triangle codes; see Table 3.) We will now consider the overheads for information storage and ancilla patches more closely.To make our estimates more precise, suppose that between error-correction rounds, q is the QPP probability (for any given Majorana), p the FPC error probability (along any given bond) and p m is the measurement error probability.For small values of q, p and p m , a useful proxy for the logical error probability on any given code patch is the probability p LWL of the lowest-weight logical (LWL) error.We will assume q 2 ≪ p, so that we can restrict our attention to logical errors that have only one QPP component.For example, on a triangle code patch at some time long after state preparation, the largest term in p LWL will be proportional to qp (d ∆ −1)/2 (where we consider an undetectable fermion-parity-odd error on a triangle patch to be a logical error, even though technically such an error is not a logical operator, as it is parityodd).Meanwhile, the p LWL ∝ p d/2 for a bosonic code patch.The proportionality refers to the multiplicities of each LWL error (which will be functions of d or d ∆ ).
We choose d and d ∆ such that the same p LWL for bosonic and fermionic patches is achieved, which will set the logical error probability for the entire computation (in practice, one would choose d and d ∆ with a target maximum logical error probability for the computation in mind).These distances would depend on p and q.As can be seen from Table 3, if we can achieve a parameter regime such that d ∆ < d/ √ 2 is permissible, using Majorana triangle codes for logical qubit storage becomes asymptotically favourable for large d or d ∆ .
To consider the overheads associated with fermionic ancilla patches for logical measurement, we first discuss error processes that we must contend with in order for our procedures to be fault-tolerant.Measurement errors may make thin-width sections of code vulnerable to unobservable, low-weight error mechanisms, depending on the patch preparation and readout used.We illustrate this error through the example shown in Figure 16b (black ring).In this example, ancilla patch preparation starts by preparing blue bond operators in their +1 eigenstates, followed by the measurement of blue plaquettes, which all have random outcomes.A fermion-parity-odd string that terminates on red and green boundaries can flip a blue plaquette, as shown in Figure 16b.However, if such an error string occurs shortly after state preparation along blue bonds, measurement errors can make it unobservable: suppose, for example, a blue plaquette suffers an initial measurement error, and it is then flipped by the parity-odd string described above.Subsequent measurements of the blue plaquette cannot detect the error string because of the initial measurement error (see Ref. [100] for a discussion of analogous error mechanisms in the bosonic Color Code).
This error mechanism occurs with probability proportional to qp (d ∆ −1)/2 p m , for measurement error probability p m (the minimum thickness of the ancilla patch in this example is d ∆ ).To suppress the probability of such errors occurring, we let all ancilla patches have a thickness above some minimum value.For simplicity, and because we assume q is the smallest of the error probabilities, we assume the minimum patch thickness to be d ∆ .
We next show that the Majorana overhead of ancilla patches may be reduced compared with bosonic MSC schemes if d ∆ < d/2 can be permitted in the parameter regime considered.Let us consider the measurement of an arbitrary fermion parity operator i k Υ 1 Υ 2 . . .Υ 2k , where logical MZMs are stored in triangle code patches.To measure this operator, we prepare an ancilla patch containing 2k logical MZMs along its boundary and perform lattice surgery between the ancilla patch and the triangle codes in the same way as shown in Figure 12.Several sections of this patch have opposite boundaries that are colored differently to one another.In Figure 16a, we show a k = 2 example wherein a two-qubit logical Pauli operator is measured.As can be seen, two sections of the ancilla patch can have minimal thickness d ∆ , where opposite boundaries are colored red and green, while the middle section has thickness d, where opposite boundaries are both colored red.The d ∆thickness of sections of the patch is afforded by the logical MZMs along blue boundaries -without these, the patch would have boundaries of two colors only.
In Pauli-based computation, we may have to measure logical Pauli operators with support on any logical qubit.Thus, the ancilla patch may have to connect two qubits stored in far-separated parts of the system.For these long-range measurements, we can use ancilla patches with O(d) thickness between logical MZMs of the same logical qubit and O(d ∆ ) thickness in every other section, as shown in Figure 16b.Note that this patch differs from that of Figure 16a only by a change in geometry -the topology of the patch is unchanged.In this way, the O(d ∆ ) thickness sections have arbitrarily long length L, while the O(d) thickness sections have length only ∼ d+2d ∆ (sufficient to accommodate two logical MZMs and maintaining their separation ∼ d).The width required for the length-L sections is 2d ∆ , since one width-d ∆ "arm" of the patch needs to extend its entire length, as shown in Figure 16b (this is true for higher-weight logical Pauli measurements too).Assuming 2d ∆ < d, we therefore find that this patch improves on the patch geometry from Figure 16a and improves on purely length-L bosonic patches: we require ∼ 2d ∆ L + O(d 2 ) Majoranas, compared to ∼ dL + O(d 2 ) for bosonic patches, since the latter require a thickness of d everywhere [61].
For a two-dimensional system with n logical qubits and O(d) distance for each, the maximum separation between distant logical qubits is Hence this resource saving can be significant for large n and d.Table 3 summarizes these Majorana overheads for long-range measurement.
The ability to use ancilla patches with thinner sections is a unique feature of MSCs, owing to the qualitatively different mechanisms of FPC, QPP and measurement errors.For q ≪ p, parameter regimes may exist where d ∆ is significantly smaller than d (by some additive amount).Determining such regimes precisely would require numerics, which we leave for future work.This resource saving depends on all error probabilities.For example, as p m → 0, the resource cost of such a patch becomes ∼ wL+O(d 2 ) with w = O(1).There may be non-trivial trade-offs between the overheads of qubit storage and ancilla patches that will depend on q, p and p m .

Fault-Tolerant Gates on Small Majorana Surface Codes
In this penultimate section, we describe another approach to achieving native Clifford gates in the MSC.This method has no analogue in bosonic codes, as it arises from the non-Abelian statistics of constituent Majoranas.Specifically, braiding these Majoranas in the MSC can implement Clifford gates on the logical qubit(s) stored therein.The patches of MSC require one or more lines of mirror symmetry to be suitable for this type of gate.Two examples of these are shown in Figure 17, with the symmetry axes indicated by dashed lines.We require braids to occur across this line of symmetry which, as drawn, are relatively longrange.Hence, this technique would be either suitable for small patches of the MSC or patches that are "folded" along these lines of symmetry to make the braids short-range.
We begin with the code shown in Figure 17a, which stores one logical qubit.We will show that we can enact a single-qubit Clifford gate on this qubit by braiding the constituent Majoranas.Let U be the unitary that braids all Majoranas on opposite sides of the symmetry axis of the code (i.e., those labeled with the same numbers in Figure 17a).That is, U = 7 j=1 exp ( π 4 γj γ j ), where γj is in the top-right half of the code and γ j is in the bottom-left.To see that U implements an encoded Clifford gate, we firstly show that it preserves the stabilizer group.We start with the four-body blue plaquette operators in the bottom-left and top-right corners of the code, which we denote O 1 and Ō1 respectively (see Figure 17a).We choose the ordering O 1 = −γ 3 γ 2 γ 4 γ 5 and Ō1 = −γ 3 γ2 γ4 γ5 .Then U O 1 U † = −γ 3 γ2 γ4 γ5 = Ō1 , and similarly We similarly choose oppositely-oriented plaquette operators between the two halves, so that U maps stabilizer generators to other stabilizer generators under conjugation, without any sign changes.The blue plaquette operators that are intersected by the symmetry axis have their orientations reversed by U .In the case of the blue four-body operator in the topleft corner, this results in a change of sign.But it picks up another minus sign because, under conjugation, U : γ 1 → γ1 and γ1 → −γ 1 .It can similarly be seen that the blue hexagonal plaquette operator does not change its sign under conjugation by U .Hence U preserves the whole stabilizer group.
This operation U is fault-tolerant as it retains the locality of errors.That is, suppose E ∈ Maj( 18) is an error operator acting on the constituent Majoranas of the code.Then conjugating E with U results in another error operator E ′ with the same weight as E.Moreover, we can ensure that U has a very low probability of introducing further errors into the system, since the constituent braids making up U can be made arbitrarily accurate by increasing Majorana separation.In this way we combine the topological protection of constituent braid operations with the protection afforded by the MSC.
A larger set of encoded gates via braids can be found in codes that have more than one axis of symmetry.MSCs defined on the same lattice as stellated Color Codes [52], such as the one shown in Figure 17b, have this property.They also possess highly favourable encoding rates among planar code architectures [52], making them interesting candidates for near-term devices.The code of Figure 17b stores two logical qubits and one logical MZM.(It contains an odd number of constituent Majoranas; this implies that it is part of a larger Majorana system.)The logical operators of the encoded qubits are the string operators indicated in Figure 17c.Let U L (resp.U R ) denote the operation that braids all constituent Majoranas across the first (resp.second) line of symmetry [labeled L (resp.R) in Figure 17b].One can again show that U L and U R both preserve the stabilizer group.Furthermore, , and U L X2 U † L = Z2 Ȳ1 .(Different ordering choices for the logical operators and stabilizers can introduce signs into the above relations.)These transformations are enacted by the following Clifford circuit: The braid U R maps Z1 → Z1 , X1 → X1 X2 , Z2 → Z1 Ȳ2 and X2 → X2 , up to signs.The Clifford circuit that enacts this gate is the following: It is interesting to note that (U L U R ) 5 = 1 up to a phase, while L , U 2 R ∈ P 2 , the group of 2-qubit Pauli operators.Hence, U L and U R do not generate a representation of the dihedral group D 5 (the symmetry group of the code lattice) in C 2 (the 2-qubit Clifford group) as one might expect.Rather they generate a representation of D 5 in C 2 /P 2 .We note that |D 5 | = 10 while |C 2 /P 2 | = 720 and hence we can generate only a small fraction of Clifford gates with these two braiding operations.By considering stellated codes with larger dihedral symmetries, we can obtain larger numbers of C 2 /P 2 gates with braids.But since |D n | = 2n, this is not a very promising avenue for generating the entire C 2 .However, expanding the size of this code so that the corners may be braided via code deformation (cf.Section 4.2), one can fault-tolerantly attain more Clifford gates.An interesting direction for further study is to consider higher-dimensional Majorana codes: these may have larger symmetry groups and so could have a larger set of gates implementable via constituent braids.

Conclusion
We have presented a comprehensive framework for twist defects in the MSC and have established new methods for fault-tolerant quantum computation with these codes.A complete characterization of the topological features of the MSC reveals a Z 2 fermion-parity grading on boundaries and domain walls.This indicates that twist defects (and equivalently corners) can possess fermionic features leading to a larger set of topologically-protected code states.However, rather than this grading allowing one to simply attach extra microscopic MZMs at twists, as might be naively expected, we find that twists host logical MZMs: largeweight, odd-parity operators commuting with the stabilizer group.Twists in the MSC therefore host not only the same logical qubits seen in bosonic codes with twists, but also logical qubits possible only in fermionic models.As such, comparing twist-based encodings to hole-based ones [57,60], we can store roughly twice the number of logical qubits in an equivalently sized lattice.
We can fault-tolerantly compute with both of these types of twist qubit -BT and FT qubits -simultaneously.We have shown that Clifford gates can be applied to BT qubits by braiding twists via code deformation (Section 4.2) or alternatively by lattice surgery (Section 4.5).This contrasts to techniques for performing single-qubit Clifford gates on hole-encoded logical qubits in the MSC, which involve the introduction of an ancilla qubit and multiple Clifford gates and measurements on target and ancilla qubits [57,60].Instead, our Clifford gate implementation is similar to that in bosonic codes with twists [37,39,44,47].
The above twist braids would also implement braid operations of the form exp(i π 4 Υ i Υ j ) on logical MZMs stored in the twists.The effect of braiding twists on FT logical qubits is analogous to that of braiding microscopic MZMs on topological qubits [19,101].If we wish twist braids to implement a Clifford gate only on the BT logical qubits of fermionic twists (but not on their FT qubits), we can perform the associated braid and classically track the resulting "error" to the FT logical qubits.
We can enact Clifford gates on FT qubits with measurement-based procedures, for which we require the ability to measure logical fermion parity operators and prepare ancilla states.We achieve such measurements with novel lattice surgery techniques.These techniques differ from lattice surgery introduced in previous schemes [58,61], since the logical measurements performed do not commute with the operator to be measured.Instead, lattice surgery measurements can be understood to be "teleporting" logical MZMs between different odd-length boundaries of the lattice (see Section 4.3.1 and Table 2).This makes our lattice surgery techniques annalogous to "anyonic state teleportation" protocols [102].
To achieve universal computation, we can inject magic states into the code in two different ways.The off-patch method provides a low-overhead approach to preparing magic states in groups of Majorana triangle codes.Finally, we can also perform Clifford gates between BT and FT qubits through measurement-based procedures, using lattice surgery.
We also discussed an alternative approach where Clifford gates on BT and FT qubits need not be explicitly implemented.Rather, in the spirit of Paulibased computing (PBC) [72], we can classically track their effects on subsequent gates and measurements in the circuit so long as we can measure arbitrary products of logical Pauli operators.We showed how to measure any operator of the form Γ F P B , where Γ F is a logical MZM product and P B is a logical Pauli operator for BT qubits, using lattice surgery.Hence, we can achieve the effects of Clifford gates on BT and FT qubits with zero time overhead (apart from the measurement time and that of efficient classical processing).
Beyond these advantages, we have found that, given a suitably small QPP probability, the fermionic features of the MSC could be exploited to reduce the number of Majoranas required.Using PBC, we explored a method for expanding the capacity of an nlogical-qubit register [72].Using Majorana triangle code patches and fermionic ancilla patches, we find potential avenues for a lowered Majorana overhead for logical qubit storage and measurement, depending on the QPP and FPC error rates.This arises when d ∆ -the required minimum weight of logical Majoranas to achieve a desired logical error probability p L -is considerably smaller than d -the bosonic patch distance required to achieve the same p L .We also find in such cases that the Majorana overhead of measuring multi-logical-qubit operators using a fermionic ancilla patch of length L is reduced from O(dL) to O(d ∆ L).For d ∆ < d/ √ 2 we also find an asymptotic reduction in the Majoranas required for logical qubit storage in triangle codes (see Table 3).Even outside of the PBC context, the same considerations result in smaller spatial overheads of measurement-based Clifford gate implementation.More in-depth, numerical analysis is required to determine the parameter regimes in which this reduction in resources is possible.
Finally, we explored the consequences of having non-Abelian anyons constitute the building blocks of the MSC.We found that braiding constituent Majoranas can result in fault-tolerant Clifford gates applied to BT qubits, which can be combined with braids between (Z 2 ) corners to generate the full Clifford group.This would be a method suitable for either small or "folded" patches of MSC.This ability to achieve Clifford gates with constituent-Majorana braids is likely related to a connection between a folded MSC and the Color Code, which has a large set of transversal Clifford gates [103].Future work could investigate this identification of the MSC as an "unfolded" Color Code [56,104].
One of the advantages of our MSC approach is that it allows different levels of protection for FPC and QPP errors.For example, consider a logical qubit encoded in four logical MZMs located at twist defects.One can protect against FPC errors by increasing the separation between twists, and one can protect against QPP errors by increasing the weights of the logical MZMs.These quantities may be tuned independently (without sacrificing twist separation), to tailor codes for given FPC and QPP error rates.
Regarding potential realizations, a key requirement for the MSC with twists is the ability to create superpositions of parities of various subsets of microscopic Majoranas.This requires a setup where a definite parity is required only for the entire collection of 2n Majoranas.(This is distinct from MSCs that are effectively bosonic surface codes [59][60][61] based on qubits sparsely encoded [17] in small groups of Majoranas.)A proposal for such a MSC setup exists based on the proximity effect in topological insulators [57], and analogous constructions are expected to be possible for superconducting hybrid structures based on two-dimensional electron gases or spin-orbit nanowires [15,16].The stabilizer measurement scheme outlined in Ref. [57], using topological transmon ingredients [105], can in principle be used to implement the manipulations we used in our scheme to compute with the MSC.
However, one key consideration with these proposed designs is the expected QPP times.In designs with large-charging-energy, fixed-parity islands the QPP times are expected to be long [22,29], while the optimal designs without such constraints are less well-specified in the literature.However, the expected QPP times may still be comparable to the coherence times of, e.g., superconducting qubits [29], hence the Majorana resource efficiency in our designs may present non-trivial trade-offs among designs.Furthermore, mitigation measures exist that decrease the effect of quasi-particles (QPs) on the coherence times of superconducting qubits, including QP traps [106][107][108] and pumps [109].These could be adapted to protect MZMs in bulk superconductors from QPP.One way this could occur is by utilizing traps to reduce QP density near the center of bulk superconductors, to thereby simulate the lower density of QPs expected from mesoscopic superconductors [29].Furthermore, QP detection may help greatly reduce the effect of QPP in Majorana systems [110].While these considerations suggest avenues for realizing the marked benefits of our proposals, further work is needed to combine QPP protection with flexible parity constraints in order to identify the most suitable setups.
Further studies are needed as well to understand the error thresholds for our MSC scheme under various noise models.We expect these thresholds to be similarly high to those found in other MSC approaches [58,63].Future research could also explore other routes for generating encoded gates through braids or other transformations of the constituent Majoranas in MSCs, as we did in Section 6. Studying twist defects in generalizations of the MSC, including parafermion codes [111]

A.1 Anyon Statistics
Given a collection of anyons A, we can assign to them self-exchange and mutual statistics.The selfexchange statistic θ a for a ∈ A is the phase acquired when two a particles are clockwise interchanged.In general, Abelian anyons can pick up any U (1) phase under self-exchange.The mutual statistic, M a,b , of two anyons, a, b ∈ A with a ̸ = b, is the phase acquired when a is wound completely around b in the clockwise direction.In the MSC, the particles R, G and B all have bosonic (+1) self-exchange statistics but mutual semion statistics (M R,G = M G,B = M B,R = −1) [57].This is due to different-colored string operators anticommuting with one another, because they overlap at an odd number of vertices (cf. Figure 1).GB, BR and RG differ from R, G and B by the addition of RGB which has a fermionic (−1) self-exchange statistic.Hence these three particles also have fermionic self-exchange statistics.All mutual statistics are preserved under the addition of RGB, as can be seen by splitting it into R, G and B, and separately moving these particles around anyon a ∈ A (for any such a, an even number of M R,a , M G,a and M B,a are −1).

A.2 Lagrangian Subgroups
In bosonic systems, types of gapped boundaries are in one-to-one correspondence with "Lagrangian subgroups" of the anyon model, and hence can be fully classified with reference only to the anyons and their properties [85,113].A Lagrangian subgroup is a subset of the collection of anyons L ⊆ A, such that for all a, b ∈ L: To every Lagrangian subgroup we can associate a gapped boundary G L (and vice versa).The boundary G L will be such that all anyons in L can condense at that boundary.This condensation process is achieved by string operators that terminate on the boundary, and hence commute with all plaquette operators around this endpoint.Such condensation processes are shown in Figure 4.
The properties of L can be understood as follows.Property (2) ensures that processes that are confined to the boundary G L and that commute with the Hamiltonian act trivially on the ground state.In topological codes, these processes correspond to stabilizer elements, which must mutually commute -hence the associated anyons must have trivial statistics.Property (1) ensures that L is a group under the fusion operation, while (3) ensures that this group is maximal: no other anyon can be added to it without violating either (1) or (2).
In the MSC there exist three different Lagrangian subgroups: L R , L G and L B , where L C = {1, C} for C = R, G, B. Hence, each boundary can be colored according to the color of the anyon that it condenses (cf. Figure 1).These boundaries are closely related to a subset of gapped boundaries of the Color Code [34,52].However, as described in the main text, fermionic systems have an extra Z 2 fermion parity grading along their one-dimensional boundaries, allowing for a further classification.

B Properties of Twists and Domain Walls B.1 Gauge Dependence of Domain Walls and Twist Sub-Types
Domain walls can be moved, or a closed loop of domain wall can be artificially introduced, by simply relabeling the colors of plaquettes.Thus domain walls are gauge-dependent objects.While the locations of twists are gauge-independent, twists do have gaugedependent features.Consider, for example, wrapping a domain wall ψ around a pair of twists φ and φ −1 , with ψ and φ both symmetry transformations of the anyon labels.Then an anyon a encircling the twist φ from outside the domain wall ψ is mapped to ψ −1 • φ • ψ(a) ̸ = φ(a).Hence, twists are only defined up to conjugation by other permutation group elements.S 3 has two conjugacy classes, one containing all Z 2 twist permutations, the other containing those of the Z 3 twists.
To illustrate the gauge-dependence of domain walls, Figure 18 shows two domain walls that have been inserted into the lattice by simply changing plaquette labels.In Figure 18a, a closed loop of Z 2 domain wall (of type T G ) is shown.Note that 3-colorability of the lattice is violated along this wall.In Figure 18b, a Z 3 domain wall enacting the permutation T RGB on anyons travelling across it from top to bottom is shown.

B.2 Twist-Corner Correspondence
As explained in the main text, twists and domain walls are closely associated with boundaries and corners of a model respectively [69].For example, creating a domain wall φ along a boundary of the model can change the boundary type.If the original boundary was G L , for Lagrangian subgroup L, it now becomes G φ(L) , where φ(L) is also a Lagrangian subgroup, owing to the fact that φ is a symmetry.Twists in these cases are then associated with corners between boundaries of different types.

B.3 Twist Fusion Rules
Similarly to anyons, twists obey fusion rules dictating how they can combine and split.Consider an anyon encircling both a T R twist and a T B twist, located in close proximity to one another.This anyon first undergoes the transformation T R , and then the transformation T B , which is equivalent to the transformation T RGB .Thus we can consider the combination of T R and T B (with a suitable ordering of the domain walls) to be T RGB .We can split a Z 3 twist into any two Z 2 twists of different sub-types.We demonstrate this at the lattice level in Figure 19, where a T RGB domain wall terminates at a (fermionic) T RGB twist on the left, and splits into two Z 2 domain walls on the right.The domain walls shown terminate at a (bosonic) T B twist and a (fermionic) T G twist.In general, twists obey the same relations as members of S 3 .The overall fermion grading of the twists must be preserved when combining or splitting them.Thus, for example, bosonic twists can split into two bosonic or two fermionic twists, whereas fermionic twists must split into one fermionic and one bosonic twist.

B.4 Calculating Quantum Dimensions of Twists
We can calculate the quantum dimensions of twists of a given type by determining the number of ground states that a code with those twists possesses.We begin with bosonic T B twists.First, consider the code to contain 2n Majorana operators, and to be embedded on a torus.With zero twists present, we have the following non-trivial relationship between plaquette operators and the total fermion parity operator where R, G and B are sets of red, green and blue plaquettes respectively.Thus the degeneracy of the ground state is: because there are 2n/6 plaquettes of any given color and so the number of independent stabilizer generators [considering Equation (11)] is n − 2. Hence the code contains two logical qubits, owing to the topology of the lattice.We now add a pair of bosonic T B twists into the lattice.In this case, we only have the following nontrivial relations between plaquette operators: where RG is the set of all red/green plaquette operators (including those that span the domain wall, colored both red and green in Figure 5a), and BO is the set of all blue and orange operators.From Figure 5a, it can also be seen that introducing a pair of bosonic Z 2 twists lowers the number of stabilizer generators along the domain wall by 1 (note that we also count the orange operators as stabilizer generators).Hence, counting the degeneracy of the ground state when two twists are present, we still obtain: However, as we continue to add pairs of twists, the number of independent stabilizer generators is decreased by 1 each time, while Equations (13) remain unchanged.Thus, D 4 = 8, D 6 = 16, etc.So for large twist numbers, introducing an additional pair of twists doubles the number of ground states, indicating that the quantum dimension of these twists is Similarly, introducing a pair of Z 3 twists lowers the number of stabilizer generators along the domain wall by 2 and hence, for large twist numbers, introducing a pair of them quadruples the number of ground states.Thus, their quantum dimension is In both cases, it can be seen from Figures 5a and 5b that the fermionic counterparts of these twists have 1 fewer stabilizer generators again, indicating that the quantum dimensions of fermionic twists are

C Logical MZMs in Systems with Boundary
Logical MZMs can be found in systems with only bosonic twists when boundaries are introduced to the patch of MSC.Without loss of generality, we can consider the boundary as having a single color and all twists as being in the bulk, since corners are equivalent to twists.
To begin with Z 2 twists, the ground state is nondegenerate when the boundary is colored differently to the twist type.For example, in a single parity sector (Γ = +1) and in the case of a blue boundary and T R twists, we have the non-trivial relation p∈RO O p = Γ.Whereas without twists there are two: p∈R O p = p∈G O p = Γ.Thus, introducing two bosonic T R twists lowers the number of constraints by 1 and the number of plaquette operators by 1, thus not changing the number of unconstrained degrees of freedom.
However, when two T B twists are introduced to a patch with a blue boundary, the total fermion parity is no longer a product of plaquette (and orange) operators, whereas it still commutes with all s ∈ S.So we can expect to find a fermion-parity-odd logical MZM which also commutes with all members of the stabilizer group.Indeed, if we count both fermion-parity odd and even states, the only non-trivial constraint on the plaquette operators before and after the introduction of twists is p∈RG O p = 1.So introducing two T B twists increases the number of unconstrained degrees of freedom by 1 (since it decreases the number of independent stabilizer generators along the domain wall), and Γ = ±1 states are now degenerate.The logical MZM (along with the logical operator Γ) is shown in Figure 20a.The logical MZM is equivalent to a process of producing an RGB anyon, splitting this into RG×B, localizing the RG anyon at one of the twists and condensing the B anyon at the boundary.We can similarly find logical MZMs whenever we have two Z 3 twists in a patch with a boundary, since Z 3 twists can localize RG, GB and BR anyons.In order to encode a qubit with this logical MZM (which requires working with a single total parity sector [17]), we can either encode it into two copies of this code (in which case Γ above becomes the patch fermion parity instead of the total fermion parity, leading to a setup The phase can be set by a careful definition of the logical Pauli operators and plaquette operators in the model.
In the same way, exchanging twists T 2 and T 4 preserves the operator Z while sending X → Ȳ and Ȳ → X.This has the equivalent action as the logical phase gate S. Thus we have two independent generators of the single-qubit Clifford group and so we can use these to generate all such gates.
In Figure 22, we show how braiding two Z 3 twists in a quartet affects the logical operators X1 , Z2 and Z1 for the two BT qubits.The effect on logical operator X2 is shown in Figure 10 of the main text.

E Lattice Surgery for Large-Weight Logical MZM Bilinear Measurement
In Figure 23, we illustrate the lattice surgery procedure for measuring the bilinear operator iΥ a Υ b , where these two logical MZMs have arbitrarily high weights.
In the example, Υ a is supported on a blue boundary and Υ b on a red boundary.Similarly to in Section 4.3.1,we prepare a patch, supporting ancilla logical MZMs Υa and Υb , in the state i Υa Υb = +1.These logical MZMs will have a similar weight to Υ a and Υ b respectively, and will be supported on blue boundaries.We measure the extra plaquette operators shown in Figure 23b connecting the two patches.Note that the product of the eigenvalues of those plaquette operators connecting Υ a and Υa is equal to the eigenvalue of iΥ a Υa , and similarly for iΥ b Υb .We then measure i Υa Υb destructively (by measuring all blue bond operators) and perform/track a correction operation dependent on this measurement outcome (cf.Section 4.3.1).

F Calculating the Correction Operation for Logical Fermion Parity Measurement
Here, we go through the details of Section 4.3.2,specifically showing how to determine the correction operation that needs to be tracked when measuring a logical fermion parity operator.
To determine this operation, we need to assess whether each logical bilinear operator has been preserved by the measurement-based procedure outlined.We deal with the example of iΥ 1 Υ 3 specifically.We can use the final column of Table 2 to determine that after the lattice surgery measurements, this bilinear is mapped to λ 1 λ 3 ZB (it is unchanged by the final measurement of iΥ 4 Υ4 ).The final step of the procedure from Section 4.3.2 is to measure all blue bond operators on the ancilla patch, from which we deduce the measurement outcome of operator Γ4 to be η 1 , i Υ1 Υ2 XB to be η 2 and i Υ2 Υ4 ZB to be η 3 (these measurements do not commute with ZB ).The postmeasurement state of the logical qubits can be obtained by acting three logical operators R 1 , R 2 and R 3 on the pre-measurement state.This is equivalent to replacing projectors with logical braids in Section 4.3.1.
We now determine R 1 , R 2 and R 3 for this example.Note the logical operators stabilizing the premeasurement state are those that were just measured via lattice surgery: λ j iΥ j Υj for j = 1, 2, 3, 4. We con-   sider first the measurement of Γ4 (it does not matter which we choose to consider first, since the measurements all commute).A logical braid that enacts the same transformation as this measurement is (see Section 4.3.1): The measurement operator anti-commutes with all λ j iΥ j Υj and so only products of pairs of these operators will stabilize the post-measurement state.The full list of independent operators stabilizing this state is: η 1 Γ4 , and λ 1 λ j Υ 1 Υ j Υ1 Υj for j = 2, 3, 4. Note also that Γ 4 = η 1 λ 1 λ 2 λ 3 λ 4 on the post-measurement state.
The operator λ 1 λ 3 ZB is therefore updated by the measurements to: We can then multiply this operator by the stabilizers η 2 i Υ1 Υ2 XB , η 3 i Υ2 Υ4 ZB and η 1 Γ4 to find the operator that acts equivalently on the post-measurement state.This operator is −η 1 η 3 iΥ 1 Υ 3 .Hence, we find that the bilinear iΥ 1 Υ 3 is preserved whenever −η 1 η 3 = 1.Otherwise, we need to apply/track a correction operation which flips (i.e., anti-commutes with) operator iΥ 1 Υ 3 .We do the same for all other bilinear operators.The appropriate correction operation is one that anticommutes with all bilinears that need to be flipped and commutes with all bilinears that do not need to be flipped.

G Arbitrary String Operator Measurement Details
Here we extend the procedures of Section 4.5 to measuring arbitrary products of fermionic and bosonic string operators.We assume we wish to measure a product of k operators, labeled S 1 , . . ., S k and colored either red or blue.We start by introducing k ancilla patches, each hosting two logical MZMs, Υja and Υj b for j = 1, . . ., k, and we prepare each patch in the i Υja Υj b = +1 state.This also prepares the +1 eigenstate of operator Γ = k j=1 i Υja Υj b .An example of this setup is shown in Figure 24a for k = 2.In this example, S 1 is a bosonic string operator encircling a pair of fermionic twists hosting logical MZMs on blue boundaries.Both S 1 and S 2 are red string operators.We then measure i Υj b Υ(j+1)a for all j < k, to entangle these ancilla patches, while preserving the state of Γ.To achieve this, we can bridge the gap between ancilla patches with other ancilla patches.In Figure 24a, we introduce a patch hosting Υc and Υd .The measurement of i Υ1 b Υ2a is performed via lattice surgery, shown in Figure 24b (see also Section 4.3.1 for an explanation of this procedure).After this measurement, the middle patch hosting Υc and Υd is discarded.
We then measure S j (i Υja Υj b ) for all j, using lattice surgery.This does not reveal any information about the individual S j but we can use the fact that Γ = 1 to learn the eigenvalue of k j=1 S j .This measurement is shown in Figure 24c.Finally we measure i Υj2 Υ(j+1)1 for all j once again (with k + 1 ≡ 1), to disentangle the ancilla patches from the code lattice.We can then discard the ancilla patches.Our code patch is left in an eigenstate of k j=1 S j .We may need to apply/track a correction operation that is dependent on the final ancilla measurements.
Notice that the logical MZMs encircled by S 1 in the example of Figure 24 commute with all lattice surgery measurements.Interestingly, there are only bosonic twists present during the lattice surgery phase (see pink dots in Figure 24c) and hence the logical MZMs are temporarily of the form discussed in Appendix C.

=Figure 1 :
Figure1: MSC patch encoding a single logical qubit.Plaquettes are colored red, green or blue.Plaquette operators Op are defined as shown for the example of a green plaquette.An example of a blue bond operator is highlighted.This operator creates two anyons (blue dots) on the blue plaquettes at its endpoints.The boundaries of the patch are red or green as shown; they are assigned the colors not featured in boundary plaquettes.Logical operators X and Z correspond to red and green string operators respectively, which terminate on samecolored, opposite boundaries.Corners between boundaries of different types are indicated by pink dots.

Figure 2 :
Figure 2: Non-trivial anyon fusion processes in the MSC.Any two anyons of the same color may be fused to the vacuum (top).Two anyons of different colors A and B may be fused into the composite AB (the example of B and G fusion is shown at the bottom).

Figure 3 :
Figure 3: An example of string operator fusion.(a) Schematic illustration of a green string splitting into blue and red strings away from its endpoints.Black dots indicate single Majorana operators, at which points strings of three colors fuse.(b) A lattice-based illustration of the same phenomenon.The blue and red strings arise from the green string via multiplication by stabilizers O1 and O2.

Figure 4 :
Figure4: Three boundary types of the MSC and their anyon condensation processes.Each boundary can be colored green (left), blue (middle) or red (right) depending on the anyons that may be condensed at that boundary.

Figure 5 :
Figure 5: Lattice realizations of twists and logical MZMs in the MSC.In (a) and (b), twists and domain walls are indicated by pink dots and yellow dashed lines respectively.The Majoranas around the boundary of floating orange, pill-shape faces belong to the original honeycomb lattice but, after the introduction of twists, are not included in any plaquette operators.We introduce additional stabilizers of the form iγaγ b , represented by the orange faces, to remove the degeneracy from these Majorana operators.In (a) we display an example of bosonic Z2 twists, specifically of type T B (top), and of Z3 twists (bottom) and the domain walls connecting them.Examples of the new stabilizers introduced are shown at the top.In (b) we display the fermionic counterparts of each of these twists and the resulting change to the orange stabilizers.This results in logical MZMs at twist locations, defined at the top.In (c), a fermionic stretch of boundary is displayed, with pink dots indicating corners.Unpaired MZMs exist at the ends of the green boundary.Local changes to the stabilizer group result in the lattice in (d), which expands the unpaired MZMs into logical MZMs Υa and Υ b hosted on the odd-length blue boundaries.

Figure 6 :
Figure 6: Schematic illustration of examples of anyon localization.Bosonic twists are indicated by crosses, and fermionic twists by circles containing crosses.Domain walls are indicated by dashed lines.Solid blue/red/green lines are string operators.(a) RG anyon localized at a bosonic T B twist indicated in blue.(b) B anyon localized at a fermionic T B twist indicated in blue.(c) RGB particle localized at a fermionic T B twist.String operators of three different colors meet at a single Majorana operator (black dot).(d) BR anyon is localized at a bosonic T RGB twist indicated in black.The arrow on the domain wall indicates the direction in which an anyon crossing the wall undergoes the permutation T RGB .

Figure 7 :
Figure 7: Schematic illustration of logical operators for examples of Z2 (a) and Z3 (b) twist defects (either bosonic or fermionic; we depict bosonic twists here).Twists are shown as crosses, domain walls as dashed lines, and string operators as solid lines, colored according to their type.The Z2 twists and domain walls shown are of type T B .For the Z3 twists and domain walls, the arrows indicate the direction in which a particle crossing the wall undergoes the permutation T RGB .

Figure 8 :
Figure 8: Logical MZMs in the MSC with fermionic twists (blue circles containing crosses).In (a) a logical MZM Υc and a logical MZM bilinear iΥaΥ b are represented as string operators, the latter being the product of the red string encircling the two twists, and the blue string terminating on the twists.The holes associated with fermionic twists may be enlarged, so long as the resulting boundary has odd length.An example is shown in (b), with the location of the twist and domain wall indicated by a pink dot and dashed line respectively.

Figure 9 :
Figure 9: Code deformation to move bosonic (a)-(b) and fermionic (c)-(d) twists (pink dots).Domain walls are yellow/pink dashed lines.(a) A Z2 bosonic twist along with part of a logical operator (red string), deformed away from the twist.To move the twist one plaquette to the right, we measure the bilinear with the light blue Majorana operators and merge the stabilizers at plaquettes p1,2.(b) A Z3 bosonic twist.After measuring the new stabilizers γ1γ2γ3γ4 and γ3γ4γ5γ6, the stabilizer generators appear as shown in the top inset.Performing two more bilinear measurements produces the stabilizers shown in the bottom inset.The result of these measurements is that the twist is moved to the right.(c) The hole from Figure8b, associated with a fermionic twist, is enlarged to the left by measuring all light-colored operators.The blue string operator indicated commutes with all these measurements.(d) The hole is shrunk from the right by measuring all light-colored operators.The same blue string operator is now deformed to meet the hole on the left-hand side, where it commutes with all of these measurements.

Figure 10 :
Figure10: A braid of Z3 twist T3 around the pair T1 and T2 results in an entangling gate between the logical qubits.We show how this braid affects the logical operator X2.In panel(3) we have altered the location of the domain wall between T3 and T4 with a relabeling of plaquettes (see Appendix B.1).In panel(5) we have deleted the closed loop of domain wall with another relabeling.

Figure 11 :
Figure 11: Fault-tolerant measurement of iΥaΥ b through lattice surgery with a neighboring MSC patch containing ancillary logical MZMs Υa and Υb .A small MSC section is shown in the top part of the figure.This patch contains the logical MZMs to be measured (Υa and Υ b ), and some BT qubits.Some examples of bosonic logical operators ( XB and ZB) are shown.The ancilla MSC patch, shown in the bottom of the figure, is prepared in the +1 eigenstate of i Υa Υb .Operators Υa and Υb are associated with the length-3 blue boundary sections.iΥa Υa and iΥ b Υb are eight-body plaquette operators indicated by dashed lines.The measurement of these two operators fuses the two patches together along their blue boundary sections.

Figure 12 :
Figure 12: Lattice surgery procedure for measuring logical parity operator −Υ1Υ2Υ3Υ4.(a) Logical MZMs are supported on blue (for Υ1 and Υ2) or red (for Υ3 and Υ4) sections of odd-length boundaries on the patch surrounding the central hole.The patch inside the hole has ancilla logical MZMs ( Υ1, . . ., Υ4) supported on blue, odd-length boundaries.It also encodes a BT qubit, with logical operators XB (green string) and ZB (red string) indicated.The lattice surgery involves measuring the plaquette operators connecting logical MZMs Υj and Υj, for j = 1, 2, 3, 4.These plaquette operators are shown lightly colored in (b).

Figure 13 :
Figure 13: Code configurations for magic state injection.(a) On-patch injection.Two fermionic T B twists are at minimal separation, with another two twists located far away (not shown).A magic state can be injected by preparing a suitable initial state and applying the gate exp( π 8 γ1γ2).Logical MZMs Υa and Υ b reside on the blue boundaries shown.The blue bond operator iγ1γ2 is the logical iΥaΥ b ZB, acting on both FT and BT qubits stored between the four twists.(b) Off-patch injection.Four MSC patches are prepared, each with two logical MZMs along blue boundaries (e.g., Υa and Υ1 indicated).A qubit with Majorana operators γ1, γ2, γ3, γ4 (orange rectangle) is prepared in a magic state.Plaquette operators Oj = iΥjγj (for j = 1, 2, 3, 4, with O4 shown) are measured to inject this magic state into the four-patch qubit furnished by Υa, Υ b , Υc, Υ d .

Figure 15 :
Figure 15: Lattice surgery procedure for measuring a bosonic string operator.Lattices before being fused are shown in (a): S2 (red) is the bosonic string to be measured; the ancilla patch has logical MZMs Υa and Υb (red boundaries) with i Υa Υb realized by the red string connecting them.The lattice after fusion is shown in (b), with the extra plaquettes connecting the two patches shown lightly colored.

Figure 16 :
Figure 16: (a) Setup for measuring a two-qubit logical Pauli operator, with logical qubits encoded in Majorana triangle code quartets (in dashed boxes).The operator being measured is Υ1Υ2Υ3Υ4, with logical MZMs on triangle codes indicated.An ancilla patch hosts logical MZMs on blue boundaries of weight d ∆ , where d ∆ is the minimum weight of logical MZMs on triangle code patches.This patch has alternating thickness ∼ d ∆ and ∼ d as shown, to protect from the error mechanism from (b) and FPC errors respectively.The separation of logical MZMs on the patch is everywhere ∼ d.(b) Ancilla patch altered such that O(d ∆ )-thickness sections run between far-separated logical qubits, located distance L apart.The width of the patch is ∼ d + d ∆ and ∼ 2d ∆ in alternating sections (in this example, d = 10, d ∆ = 5).A potentially undetectable error string is shown, circled.A parity-odd string flips the blue plaquette indicated.Preparation of this patch involves preparing eigenstates of blue bond operators, followed by the measurement of blue plaquettes (with random outcomes).Plaquette measurement errors can result in this flipped plaquette not being detected.

Figure 17 :
Figure 17: Surface code patches with symmetry axes (some shown dashed) and with boundary colors indicated.Braiding constituent Majoranas enacts Clifford gates on logical qubits.(a) Patch with one symmetry axis.Braiding equivalently numbered Majoranas across this line results in an encoded Hadamard gate on the logical qubit.(b) Patch with two logical qubits and one logical MZM.This patch has five symmetry axes (the domain wall is a gauge choice, thus does not break this symmetry), two of which are shown and labeled L and R. (c) Logical (string) operators for the patch in (b) are schematically illustrated.
(1) a × b ∈ L and ā, b ∈ L, where ā refers to the antiparticle of a such that a × ā = 1; (2) a and b are self-bosons (θ a = θ b = 1) and have trivial mutual statistics (i.e., M a,b = 1); (3) every c / ∈ L has non-trivial mutual statistics with at least one a ∈ L.

Figure 18 :
Figure 18: Domain walls can be inserted into the lattice via a gauge transformation (a change of plaquette coloration).In (a) a closed loop of Z2 domain wall of type T G is illustrated by a yellow dashed line.In (b) a line of Z3 domain wall of type T RGB (for anyons travelling from top to bottom across the wall) is illustrated by a blue line.

Figure 19 :
Figure 19: An example of a Z3 twist having split into two Z2 twists.On the left we have one fermionic Z3 twist.On the right, we have a bosonic T B twist (top) and a fermionic T G twist (bottom).

Figure 20 :
Figure 20: Logical MZMs in the MSC with twist defects and boundaries.In (a) a logical operator (red string operator, equivalent to Γ) and a logical MZM (red, green and blue operator) are shown, for a code with two bosonic T B twists (blue crosses) and a blue boundary (outer blue ring).In (b), the twists are replaced by fermionic twists, allowing for a qubit to be stored in a single parity sector.The logical operators are the blue and red strings indicated.

Figure 21 :
Figure 21: Braiding twists T3 and T4 transforms ZB into ȲB.XB, which is a red string operator encircling T1 and T2, is not affected by this braid.The steps of the braid proceed according to the panels, clockwise from the top-left.

Figure 23 :
Figure 23: Procedure for measuring a high-weight logical MZM bilinear, iΥaΥ b .In (a), a small section of surface code patch is shown in the top-half of the figure, with the color of all boundaries indicated.Logical MZMs Υa and Υ b are supported on odd-length boundaries of color blue and red respectively.Ancilla logical MZMs Υa and Υb are supported on blue boundaries.The ancilla patch is prepared in the +1 eigenstate of i Υa Υb .(b) Plaquette operators connecting the surface code patch with the ancilla patch are then measured.The product of light blue plaquettes (left) and four-and six-body plaquettes (right) are the operators iΥa Υa and iΥ b Υb respectively.Once these operators are measured non-destructively, destructive measurement of i Υa Υb is performed.The product of the first two measurements gives the measurement outcome of iΥaΥ b while the final measurement determines the correction operation required.

Table 1 :
Summary of important objects and quantities of Majorana fermion codes.

Table 2 :
Operators and their updates after each set of lattice surgery measurements.Top row: the operator measured by lattice surgery.First column: we track updates to the set of logical operators stabilizing the state, the logical MZMs Υ1, . . ., Υ4, and measurement operator Γ4.The updates to these after measuring iΥj Υj are shown in the respective columns.The final measurement iΥ4 Υ4 is not considered, as this, unlike the preceding iΥj Υj, commutes with all stabilizing logical operators.
4.4.1 On-Patch Magic State InjectionFigure13ashows two fermionic twists (hosting logical MZMs Υ a , Υ b ) at minimum separation.Suppose there exist another two twists at large separation from this pair (hosting logical MZMs Υ c , Υ d ).For this setup, the logical operator iγ 1 γ 2 , shown in the figure, equals iΥ a Υ b ZB , where ZB is a logical Pauli operator (green string loop encircling the two logical MZMs, not shown) for the BT qubit stored between the four twists.Hence, iγ 1 γ 2 acts on both FT and BT qubits stored in the twist.To prepare a magic state, we first prepare the state |+⟩ F |0⟩ B (cf.Sections 4.2 and 4.3.1),where |0⟩ B = ZB |0⟩ B is a computational basis state of the BT qubit and |+⟩ F = iΥ a Υ c |+⟩ F is a basis state of the FT qubit stored between Υ a , Υ b , Υ c , Υ d .We then perform the rotation exp ( π 8 γ 1 γ 2 ) Figure 14: Lattice surgery procedure for measuring fermionic string operator S1.The lower ancilla patch contains logical MZMs Υa and Υb , while the upper patch contains logical information.(a) The setup before lattice surgery, with the ancilla patch prepared in the i Υa Υb = +1 state.Blue, red and green boundaries on both patches are indicated; blue boundaries host logical MZMs.Also indicated are blue string operators S1 and i Υa Υb running between blue boundaries on the logical and ancilla patches respectively.(b) Lattice surgery is performed, with extra operators fusing the two patches indicated with lightly colored plaquettes.
S 1 terminates on the boundaries of two (fermionic) T B twists.As in Section 4.3.1,wemovethese two twists to a (green-or red-colored) boundary of the lattice, and introduce an ancilla patch of code nearby to this boundary, hosting two logical MZMs Υa and Υb (hosted on blue boundaries).Alternatively, a hole can be created in the lattice and the patch prepared in this hole, as described in previous sections.An example of the resulting setup is shown in Figure14a.The ancilla patch is initialized in the +1 eigenstate of i Υa Υb (cf.Section 4.3.1),which is a blue string operator.(The red string operator part of i Υa Υb , akin to that in Figure or models displaying fracton order, such as the Majorana checkerboard model [112], could also be fruitful.