Quantum Origami: Transversal Gates for Quantum Computation and Measurement of Topological Order

In topology, a torus remains invariant under certain non-trivial transformations known as modular transformations. In the context of topologically ordered quantum states of matter supported on a torus geometry in real space, these transformations encode the braiding statistics and fusion rules of emergent anyonic excitations and thus serve as a diagnostic of topological order. Moreover, modular transformations of higher genus surfaces, e.g. a torus with multiple handles, can enhance the computational power of a topological state, in many cases providing a universal fault-tolerant set of gates for quantum computation. However, due to the intrusive nature of modular transformations, which abstractly involve global operations, physical implementations of them in local systems have remained elusive. Here, we show that by engineering an e ﬀ ectively folded manifold corresponding to a multi-layer topological system, modular transformations can be applied in a single shot by independent local unitaries, providing a novel class of transversal logical gates for fault-tolerant quantum computation. Speciﬁcally, we demonstrate that multi-layer topological states with appropriate boundary conditions and twist defects allow modular transformations to be e ﬀ ectively implemented by a ﬁnite sequence of local SWAP gates between the layers. We further provide methods to directly measure the modular matrices, and thus the fractional statistics of anyonic excitations, providing a novel way to directly measure topological order. A more general theory of transversal gates and the deep connection to anyon symmetry transformation and symmetry-enriched topological orders is also discussed.


I. INTRODUCTION
The last few decades in condensed matter physics, starting with the discovery of the quantum Hall effect, have yielded remarkable progress in the understanding of the possible quantum states of matter.In particular, at zero temperature, manybody quantum systems can form distinct phases of matter that are distinguished by their topological order [1].Topologically ordered states, such as fractional quantum Hall (FQH) states and quantum spin liquids, exhibit a host of remarkable properties, including quasiparticles with exotic, possibly non-Abelian, exchange statistics, fractional charges, robust topology-dependent ground state degeneracies, and protected gapless edge modes [2,3].The intricate patterns of quasiparticle fusion rules and fractional statistics distinguish different topological orders from each other.
The ground state degeneracy of a topologically ordered state of matter depends on the topology of the (real) space on which it is defined [1].These degeneracies are topologically protected, in the sense that no local operators can distinguish the different states, up to exponentially small corrections in system size.For this reason, topological states of matter provide one of the most promising routes to realizing quantum error correction (QEC) and thus robust, fault-tolerant quantum computation [2].
Topologically ordered states are useful for quantum error correction in two separate ways as summarized in Table I.One route is via a 'passive' approach, where one considers a physical system described by a many-body Hamiltonian whose ground state is a topologically ordered state of matter [2].The topological protection then derives from cooling the system to temperatures much smaller than the energy gap.A sec-ond route is via an 'active' approach to quantum error correction, where one starts with a large collection of physical qubits and continuously performs certain 'stabilizer' measurements associated with a topological code [4].These measurements project the many-body quantum state of the qubits onto a topologically ordered state.
While topologically protected ground state degeneracies provide a path towards realizing fault-tolerant quantum memories, our understanding of how to perform robust faulttolerant quantum gates for quantum computation is limited.Moreover, despite the great theoretical and experimental advances of the last several decades, methods to experimentally measure fractional statistics of quasiparticles and therefore to directly diagnose topological order in any experimental setting are extremely limited.Most experimental measurements that are routinely performed, such as measuring quantized electrical or thermal Hall conductivity, provide extremely limited windows into the nature of topological order.The purpose of this paper is to address these two issues, of experimentally measuring topological order and implementing fault-tolerant logical quantum gates.
Topologically protected ground states can be manipulated by a set of topologically protected unitary transformations that act on the ground state subspace.A well-known example is when the degeneracy arises from non-Abelian anyons [2]; in this case, the corresponding robust unitary transformations that act on the topologically protected subspace are generated by adiabatically braiding the anyons.In general, a given spatial manifold Σ admits a group of operations known as the mapping class group (MCG) of the manifold.Elements of the MCG are referred to as modular transformations, and consist of smooth deformations of the geometry that bring the arXiv:1711.05752v3[quant-ph] 1 Dec 2019 manifold back to itself, modulo those that are continuously deformable to the identity map [5].The braid group for n anyons can be viewed as a special case of the MCG of a disk with n punctures.The ground state subspace H Σ , which arises when the system is defined on a spatial manifold Σ, forms a unitary representation of the MCG.Therefore, the modular transformations acting on the manifold Σ correspond to topologically protected unitary transformations acting on the ground-state subspace H Σ [15].
Remarkably, the representation of modular transformations of a torus fully characterizes the fractional statistics and fusion rules of the quasiparticle excitations of a topological state; therefore it can serve as an order parameter for diagnosing topological order [1,2,[6][7][8][9][10][11][12].On the other hand, the representation of a MCG of a higher genus surface can typically enhance the computational power that can be achieved by braiding the anyons alone [9].For example, the representation of the braid group for anyons in an Abelian topological state is always one-dimensional and thus the braiding transformations only lead to an overall phase in the wave function.On the other hand, the representation of the MCG on a higher genus is always multi-dimensional and leads to nontrivial unitary transformations corresponding to fault-tolerant logical gates.In some cases of non-abelian topological states, such as for the Ising anyon topological state, the braid group of non-abelian anyons does not provide a universal gate set for fault-tolerant quantum computation, while access to the MCG on a high genus surface can provide a universal fault-tolerant logical gate set [13][14][15].
We see that the ability to experimentally measure the modular matrices in a given state of matter would imply the ability to directly measure fractional statistics and thus fully diagnose topological order.The ability to implement modular transformations can further enhance the ability to perform fault-tolerant quantum computation.It is thus of fundamental importance to develop methods to implement and measure modular transformations.
Previous schemes for implementing modular transformations in physical systems involve intrusive techniques such as adiabatically varying the geometry or interactions [15][16][17][18], braiding twist defects [19], topological charge measurements [15,20], or via global rotations of a torus [10,11,21].Crucially, all of these methods require a time overhead that scales polynomially with system size; that is, the time scale to carry out these operations is infinite in the thermodynamic limit.Moreover, the methods presented in Refs.[10,11,16,18,21] cannot be applied in a planar geometry with local interactions, even in principle; as such, they are not feasible for realistic experimental settings.
Motivated by recent experimental progress in implementing error correcting codes in superconducting qubit systems [22][23][24][25][26][27][28] and also the unprecedented level of local control in quantum gas microscopes [29], it is timely to consider whether the seemingly abstract mathematical operations of modular transformations can be effectively implemented in real physical systems with local interactions.
In this work, by folding manifolds in various ways, quantum origami, we demonstrate how modular transformations  I. Dictionary about the connection between several concepts: topological phases of matter, topological quantum error correcting codes (QECC), manifold topology, and fault-tolerant logical gates.can be physically implemented in a single shot, i.e., with constant time overhead, and in a planar geometry with fully local interactions.In particular, we consider a multi-layer topological state, i.e., multiple copies of the same topological state aligned vertically in real space, and with appropriate boundary conditions and twist defects connecting different layers [19,[30][31][32].Our scheme uses local pairwise SWAP gates between certain layers.Transformations of this form are transversal logical gates (TLG), as they can be performed in one shot with a simultaneous unitary transformation independently on each subsystem (labeled by j) under a transversal partitioning of the entire system, i.e., U = j U j , following the strict definition in Ref. [33].We emphasize that in this paper, sites on all layers aligned vertically are merged into a single subsystem and labeled by j.Since the boundary of these layers are glued together, we should treat all layers as a single code block, in contrast to the more commonly encountered case where transversal CNOTs are applied between two code blocks corresponding to two independent layers.In particular, we can see that our gates do not couple different subsystems in the same code block, which is the other equivalent definition for TLGs [33].
TLGs are inherently fault tolerant since the errors cannot be propagated to other subsystems [33,35].Their one-shot nature dramatically speeds up the time to perform logical operations, as they avoid the overhead of other schemes, such as those based on braiding, which grow linearly with the system size (or code distance).As such, TLGs are highly coveted for fault-tolerant quantum computation, however only a limited class of them are known to date [34,36,37], and a number of no-go theorems prohibit their existence under general assumptions [33,35].Our results allow us to dramatically extend the space of known TLGs in topological codes -especially non-Abelian ones -by providing a novel geometric picture for a large class of TLGs.Remarkably, we demonstrate how to bypass the assumptions of previous no-go theorem in Ref. [35], and demonstrate the necessary ingredients that allow a wide class of TLGs to be implemented in topological codes.
We emphasize that in the context of TLGs, the system does not necessarily need to physically involve multiple layers.One can always use a single physical layer of a topological code which is equivalent to multiple virtual layers of topological phases.A well-known example is the equivalence between a single layer of color code and two layers of toric codes [38].The virtual layer permutation symmetry considered in our construction is a special example of onsite topo-logical symmetries in the context of symmetry-enriched topological (SET) phases [12,39,40].Therefore, our construction also reveals the deep connection between symmetry-enriched topological phases and transversal logical gates.In particular, spatial symmetries of a topological phase such as rotation and reflection symmetry can be turned into onsite symmetry by folding (quantum origami), and the onsite symmetry plays the role of TLGs.
We note that our results are closely related to several previous studies on the relation between fault-tolerant logical gate, gapped domain walls, and anyon symmetries in the context of Abelian topological stabilizer codes [41][42][43].Our work builds on these results by utilizing more general constructions involving twist defects, and demonstrating how modular transformations can always be implemented as TLGs for Abelian and non-Abelian topological codes and phases of matter.
We discuss an experimental platform in terms of a singlelayer superconducting qubit array, which can potentially be used for realizing our proposal.The qubit array can be used via either the passive or active approaches to realizing topologically ordered states.In the passive approach, we consider a qubit array engineered with appropriate designer interactions such that the system enters a topological phase of matter, such as a spin liquid or a FQH state, at low temperatures [44][45][46][47][48].In the active approach, we consider quantum error correction with surface codes using active error syndrome measurements [4].We further discuss various methods to measure the modular matrices in an experimental setting.These schemes can be used, for example, to demonstrate fractional statistics and also to experimentally diagnose and distinguish candidate topological orders, such as Z 2 spin liquid or double semion phases [49], in frustrated spin models.For the near-term realization of active topological error correction codes, our measurement protocols can also be used to verify the underlying topological order in the code space.
In order to facilitate the reading of this paper, we summarize our major achievements below and in Table I: We (i) Provide a novel geometric picture for a large class of transversal logical gates (TLGs) in the context of both active and passive topological quantum computation.(ii) Extend the space of known TLGs in topological matter/codes to the cases with twist defects and the cases of non-Abelian topological matter/codes, and hence circumvent the no-go theorem in Ref. [35] by introducing defects.(iii) Propose measurement protocols and an experimental implementation in a passive topological system, to demonstrate fractional statistics and diagnose/distinguish candidate topological orders by measuring modular transformations via transversal operations.(iv) Propose an experimental implementation in an active topological code, to apply TLG and verify topological order.(v) Reveal the deep connections between topological operations (i.e., modular transformations), symmetry operations (including spatial and onsite symmetries), symmetry-enriched topological orders, and transversal logical gates in fault-tolerant quantum computation.(d-i) Non-contractible Wilson loops and their transformations under modular S and T on an effective torus realized by a double-layer topological system in the presence of genons (shown as crosses), i.e., the point defects at the end of the branch cuts (solid lines) connecting the two layers.To get a closed torus, we assume that the boundary in (g) has trivial topological charge.To draw α + β in (i) we use the fact that the double loop around a single genon is contractible (see Appendix E).The S transformation exchanges the two loops and flips the direction of β-loops as shown in (e) and (h), while the T transformation performs a Dehn twist along the β-loop as shown in (f) and (i).

II. GROUND STATE DEGENERACIES AND MODULAR TRANSFORMATION ON A TORUS AND A BILAYER SYSTEM WITH TWIST DEFECTS
To begin, we consider topological ground state degeneracies on a 2-torus (T 2 ), which can be described by points on the plane with periodic boundary conditions along two vectors ê1 and ê2 , parameterized in the complex plane by (1, τ), as shown in Fig. 1(a).We further define the two non-contractible cycles of the torus as α and β.
The topological ground state subspace (the code space) H T 2 is spanned by topological charge values assigned to a given non-contractible loop.For example, one can choose the αloop to label the basis states, such that | a α = W α a | I α is created by inserting a Wilson loop of an anyon a along the α-loop into the trivial vacuum sector | I α .There are n types of possible anyon charges, where n is the ground-state degeneracy.These states are eigenstates of the Wilson loop W β b , which describes an anyon b encircling the β-loop.For example, in the familiar case of the toric code (Z 2 spin liquid) with 4-fold ground-state degeneracy [50], such loop operators are 4 types of different strings of Pauli operators that cross the system in two different directions, corresponding to the 4 types of anyon charges: I (vacuum), e (spinon), m (vison), and em with trivial self-braiding statistics and non-trivial mutual braiding statistics, and also nontrivial topological spin for the em quasi-particle, i.e., em | T | em = −1.The other simple example is the ν=1/k Laughlin FQH state, with the matrices given by S ab = 1 √ k e i2πab/k and T ab =δ ab e i2πa(a+k)/2 , where both the self-and mutual-braiding statistics are non-trivial.These unitary matrices also represent fault-tolerant logical gates in the context of topological quantum computation, as will be discussed in Sec.V.
Another way to create a space that is topologically equivalent to a high genus surface is to consider a bilayer topolog- ical state in the presence of branch cuts that connect the two layers.The endpoints of these branch cuts are twist defects, referred to as genons, which effectively increase the genus of the space by introducing non-contractible loops that intersect only once [see Fig. 1(g-i)] [19,[30][31][32].From Fig. 1(g) we see two different types of non-contractible Wilson loop operators: W α a (blue) passes through two branch cuts (line defects) and travels through the other layer, while W β b (red) goes around a branch cut and always remains in the same layer; since these two loops cross only once, they are equivalent to the two noncontractible cycles of the effective torus in Fig. 1(d).

III. PROTOCOL FOR MODULAR S
Let us consider the case of a torus with τ = i, corresponding to a square with opposite sides identified, so that the system has reflection and 4-fold rotational symmetries (C 4v symmetry).A π/2 rotation U π/2 has the same effect as S on the non-trivial α and β loops [Fig.2(a)], and therefore on the topological state space: U π/2 |ψ = S|ψ for |ψ ∈ H [52].Alternatively, a mirror reflection (M x−ŷ ) about the diagonal has the same effect as R α S on the loops, and therefore on the topological state space: M x−ŷ |ψ = R α S|ψ .For a non-chiral reflectionsymmetric topological state, R α acts entirely within the topological subspace H; if the system is chiral then R α instead maps H to one associated with a reflected system.
We begin with a toy example.By folding the square along the diagonal line as shown in Fig. 2(b), we obtain a 2-layer system defined on a triangle, where the right and bottom edges are connected by long-range couplings.The fold corresponds to a local boundary condition (12)  ; dashed lines help illustrate the square patches.Note we assume the topological charge on the boundary is in the trivial vacuum sector, implying that the system can be treated as a sphere with two branch cuts, which is effectively equivalent to a closed torus.(b) Implementing R α S on a the 4-layer folded system, with layer 1 and 2 (green) corresponding to the top layer of the original bilayer, and layer 3 and 4 (orange) to the bottom layer of the original bilayer.Layer 1 and 2 (3 and 4) are connected along the fold.The branch cuts connect layer 1 to 3, and layer 2 to 4. R α S can be implemented by a sequence of SWAPs between layers.(c) A genon configuration with three-fold rotational symmetry.A single reflection M x implements T R β , equivalent to transversal SWAPs in the folded geometry.teraction connecting layer 1 and 2 (written in cyclic notation of permutation group), which induces a gapped boundary.In this geometry, the α and β loops of the torus are related to each other by a permutation of the layers.Thus we can consider the following protocol in the 2-layer system: apply SWAP(1, 2)= j SWAP j (1, 2), i.e., a product of pairwise local SWAP gates between sites (qubits) in layers 1 and 2 (enabled by inducing hopping for a certain time, see Appendix B).This unitary transformation effectively implements M x−ŷ on the torus.Therefore, R α S|ψ =SWAP(1, 2)|ψ , for | ψ a topological ground state of the 2-layer system.As this operation acts on pairs of vertically separated qubits independently, i.e., on different subsystems under transversal partitioning, it is a transversal operation.For a topological phase of matter, these SWAP operations take a finite time to implement, and thus it is preferable to turn off the Hamiltonian before the protocol and turn it back on immediately afterwards; otherwise, the operation must be done on a time-scale much faster than that set by the energy scales of the Hamiltonian.In the context of active QEC, one applies a recovery operation by syndrome measurements to correct any local errors that are induced by inaccuracies in the SWAP operations (see Sec. X A).
We can also implement the π/2 rotation transversally by local SWAPs, generating S, by folding the system three times.This yields an 8-layer system with fully local boundary conditions, as discussed in Appendix C. In Appendix D, we further discuss a hexagonal geometry that allows implementation of T R β and ST −1 .
The above protocols demonstrate a general concept: nontrivial modular transformations can be implemented as spatial symmetry transformations when the system has rotation and/or reflection symmetries.By folding the system, and thus considering multiple copies of the system with appropriate boundary conditions, the spatial symmetry transformation can be converted to a spatially local layer permutation symmetry, which can then be implemented transversally by SWAP gates.While the unfolded system requires a certain point group symmetry (e.g. a square or a hexagonal lattice), the folded system has no such constraints aside from a layer permutation symmetry, making it more widely applicable and versatile.
However the above protocol has a major deficiency.The R α S operation described in the folded two-layer system requires non-local interactions, as the left and bottom side of the triangle must be glued to each other.Moreover, the number of layers required to have local interactions is at least 6 (see Appendix D).A key result of this work is to demonstrate how to further apply this folding approach in a more general setting, to generate a larger group of modular transformations while requiring fully local boundary conditions and fewer layers.To do this, we need to instead consider generating a nontrivial surface using genons.
In order to implement S and R α S using genons, we consider the protocol listed below and illustrated in Fig. 3(a): i. M x−ŷ ≡ SWAP(x, y ↔ −y, −x): apply mirror reflection along the diagonal axis x − ŷ, equivalent to a long-range pairwise SWAP across the diagonal.Now the locations of branch cuts change, and the state is thus a ground state of a different Hamiltonian, with a different orientation for the branch cuts.To get back to the original topological subspace, apply ii.SWAP (1,2): transversal SWAP between the top (green) and bottom (orange) square patches (surrounded by solid lines representing the branch cuts and two dashed lines), which leaves the central patch with a different color.Steps i and ii achieve R α S. In order to implement S, we also apply iii.M ŷ = SWAP(x, y ↔ −x, y).That is, apply another mirror operation along the y-axis.
The above protocol uses long-range pairwise SWAPs in order to implement the mirror reflections.However if we consider folding the system, then it is possible to implement the entire protocol with only local, vertical SWAPs between qubits in different layers.Specifically, for the R α S protocol, one can fold the system to obtain a 4-layer system, as shown in Fig. 3(b), where the fold is (12)(34), i.e., connecting layer 1 and 2 (3 and 4).The square region enclosed by the branch cuts then becomes a triangular patch with edges defined by the gapped boundary (12) (34), and two types of branch cuts, which connect layers ( 13) and ( 24), respectively.In Fig. 3(b), we translate the R α S protocol to the folded system using only transversal SWAPs, when acting in the topological ground state subspace.Here refers to the triangular patch (formed by branch cuts and dashed lines) in each layer and ¯ represents the region outside the triangular patch.Note that when allowing direct SWAPs between layers that are not nearest neighbors (such as layer 1 and 4), the above logical gate is exactly a depth-1 circuit.If such direct SWAPs are not allowed due to hardware constraint, that SWAPs between layers that are not nearest neighbors can be reduced to a finite sequence of SWAPs between nearest neighbor layers.
We further observe that R α can be implemented in the original bilayer setup (before the folding) by a reflection about the ŷ-axis, M ŷ.This can be converted to a local pairwise SWAP transformation by folding the system about the ŷ-axis.Thus a 4-layer system can support transversal implementations of both R α and R α S, however each of these require a different configuration of defects and boundary conditions.To implement both operations transversally in a 4-layer system then requires moving the defects to convert from one defect configuration to another.It is also possible to directly implement S by a sequence of transversal SWAPs; this requires folding the system into 16 layers.
By changing mirror axes, we can also implement R β and R β S.Moreover, the topological charge conjugation operation C = S 2 can already be implemented transversally in the twolayer unfolded system of Fig. 3(a) by applying SWAP(1, 2) (see Appendix E).

IV. PROTOCOL FOR MODULAR T
In order to implement a transversal gate that involves modular T , one needs C 3v symmetry (a central patch with the shape of a equilateral triangle), as shown in Fig. 3(c).In particular, a mirror reflection along the horizontal axis acts on the loops as T R β .As in the previous discussion, we can then consider folding the system along the mirror axis, which yields a 4layer system, with two different types of gapped boundaries and a line defect extending into the bulk.The mirror reflection then becomes a local SWAP operation between vertically separated layers, providing a transversal implementation of T R β with a depth-1 circuit, i.e., In the same triangular geometry of the genons, R β S corresponds to a mirror reflection along the diagonal line connecting defects 1 and 4 [see Fig. 3(c)], followed by a vertical SWAP operation between the two layers.Folding along this diagonal mirror axis then gives a transversal implementation of R β S by local layer SWAPs in this geometry.
Therefore the transformations, R β S and T R β can each be implemented transversally through local SWAP operations in a 4-layer system.However they each require different configurations of the line defects (due to having originated from different folds), and therefore cannot both be implemented transversally in the same geometry.One can show that by further folding the system, it is possible to arrive at a configuration of line defects in a 12-layer system, which admits both R β S and T R β to be performed transversally (see Appendix F).Combining the two transformations, one can perform the modular transformation T S = (T R β )(R β S).Since C can be implemented by SWAP(1, 2) in the unfolded system, we can also obtain R α S and T R α , etc.
Above, we also observed that R β can be implemented in a 4-layer system with an appropriate geometry of defects.We see that moving the defect configuration between different transversal operations in the 4-layer system allows us to implement T = (T R β )R β , as well as the whole MCG(T 2 ).

V. FAULT-TOLERANT TRANSVERSAL GATES
Due to the transversal nature of the SWAP operations, our scheme can be used as a fault-tolerant logical gate in a wide class of topological codes, both abelian and non-abelian [26,50,53,54].Specifically, considering sites that are separated vertically as a single subsystem, we see that the SWAP gates are local gates acted within the same subsystem.These local gates do not have any coupling to other subsystems, and hence the error cannot be propagated to other susbsystems as well [33,35] (see Sec. X A).
The modular S, T and their combination with R α,β implement particular types of transversal logical gates depending on particular topological states, with examples given in Universal TABLE II.Examples of logical gates and universality of the gate set that can be achieved using the mapping class group on a high genus surface Σ for various well-known topological states.Logical basis on a torus is listed, using a subset of the torus states |a β .The logical string operators of all the Abelian models are as follows.Z 2 toric code: , where 1 and 2 labels the logical qubits.ν = 1/k Laughlin FQH states: Here, X and Z are (generalized) logical Pauli operators, H is logical Hadamard, P is the Clifford phase gate.We note that any non-chiral topological state can be realized as an error-correcting code by using their corresponding commuting projector Hamiltonians [26,50,53,54]; all chiral states have a doubled non-chiral analog.
is the circumvention of the no-go theorem given in Ref. [35], which claims that the power of transversal gates decreases as the universality of representations of the MCG of the topological state increases.The circumvention becomes possible in our scheme due to the non-trivial configurations of defects and boundary conditions, which violates the spatial homogeneity assumption of Ref. [35].In particular, according to Ref. [35], the Fibonacci code admits only trivial transversal gates in the homogenous case; as we have shown here, introducing defects allows us to perform at least two types of transversal gates on a single torus as shown in Table II.A particularly important application is for the Ising phase, where the modular T transformation allows a single-qubit π/8 phase gate, which, in addition to the Clifford group that is generated by braiding of σ particles and measurements, provides a universal gate set [13,15].

VI. POSSIBLE EXPERIMENTAL PLATFORMS
We propose an experimental realization of the above ideas in superconducting qubit arrays, by considering a multi-layer version of topological phases [44][45][46][47][48] and error-correcting codes [4,[22][23][24][25][26][27][28].Multiple layers are embedded in a singlelayer chip with a super-lattice structure, where each unit cell contains multiple sites, shown in different colors in Fig. 4. In the topological phase implementation, one can implement the nearest-neighbor interaction with capacitive or inductive coupling between qubits, in the same sublattice, as shown in Fig. 4(a).Importantly, the crossover bridge architecture ensures that sub-lattices are not coupled to each other [55,56].Different sublattices are only connected when a twist defect, shown as a purple line, is crossed.
The active error-correction implementation is less demanding, since not all links are simultaneously connected [4,[22][23][24][25][26][27][28], and therefore, crossover bridges are not required.Focusing on the toric code as the simplest example, shown in Fig. 4(b), we start with a bilayer code embedded in a single-layer chip, highlighted by green and orange.A similar folded surface code architecture without twist defects has also been considered in Ref. [57] in order to achieve the same set of transversal Clifford gates of a triangular color code Ref. [38,58].There are also some previous studies on adiabatic braiding twist defects in the context of surface code quantum computation [59].
Regardless of the layer, there are two types of stabilizer measurement gadgets, the "plaquette" (Z ⊗4 ) and "star" stabilizers (X ⊗4 ) [4], which can be implemented by dispersive coupling to the central ancilla resonator [60], shown as a white diamond.Each ancilla applies one of the stabilizers, and is connected to 8 neighboring qubits, with no crossing and requiring only two-qubit gates (CNOT) in between.To simultaneously implement the measurements on both layers, one can use an ancilla resonator with two modes, to independently couple to qubits of each layer.Alternatively we can use a single ancilla in two separate steps for each layer.The stabilizers at the branch cuts connect qubits in two different layers, as illustrated in Fig. 4(b).The measurement circuit for the nonabelian Fibonacci code can be found in Ref. [26].
For both topological phases and codes, the four-layer system can be obtained by "code folding" [61], which doubles the size of the unit cell.In this case, the transversal SWAPs, introduced above, become local nearest-neighbor SWAPs between qubits in the same cell.

VII. INTERFEROMETRIC MEASUREMENT OF MODULAR MATRICES
In this section, we show how to measure the modular matrices of a topological phase in order to diagnose its topological order and extract the braiding statistics and topological spins.
In particular, we consider two different approaches: the first one (in Sec.VII A and a generalized verion in Sec.VII B) uses beam-splitter operation and direct parity measurement, while the second one (Sec.VII C) uses an extra ancilla to perform a  Ramsey interferometry (also called Hadamard test) and quantum non-demolition (QND) measurement.

A. Beam-splitter operation and parity measurement
For concreteness, we consider the case where we implement R α S. We thus consider a four-layer state.The expectation value R α S under a certain state | ψ can be expressed as ψ | SWAP (1, 4)(3, 2) SWAP ¯ (3,4)(1, 2) | ψ , implying that one can measure it through the expectation value of a sequence of commuting SWAPs.
The first approach is using the many-body interferometer [29,63] by applying a 'beam splitter' (BM) operation between each pair of sites in two different layers, i.e., BM = j BM j , yielding the following mapping on the local operators in layer 1 and 2, BM j : In this case, the global SWAP operator can be expressed and hence measured from the total parity of the particles in the anti-symmetric basis, i.e., SWAP(1, 2) = j exp iπñ j,2 , where ñ j,2 = ã † j,2 ã j,2 [29,63,64], (see Appendix B).Now, as shown in Fig. 5(c), we replace the four transversal SWAPs by four beam splitters operations: BM (1, 4)(3, 2) • BM ¯ (3,4)(1, 2) , followed by a parity measurement, yielding the expectation value ( One can use a similar protocol to measure T R α or ST .Below we assume a non-chiral system where all anyons are self-conjugate (such as Z 2 spin liquid and double semion), for which R α S = S.We first consider an equal mixture of all states in the ground state subspace, which corresponds to thermalizing the system at a temperature much below the gap (T E g ), and which can be represented by the density matrix ρ = 1 N a β | a a | β , where N is the ground-state degeneracy.The measurement of S under this ensemble thus becomes The trace of the S matrix already contains useful information: for example, for Z 2 spin liquid Tr(S Z 2 ) = 2, while the double semion phase has Tr(S D.S .) = 0. Therefore, such a measurement could distinguish these two competing phases in the context of frustrated spin models.
The diagonal modular matrix element can be obtained by the expectation value in a particular anyon sector | ψ = | a β [initialization and preparation discussed in Appendix H and illustrated in Fig. 5(a)].For example, in the context of Z 2 spin liquid [Eq.( 1)], a nontrivial π-phase can be extracted from originating from the topological spin of the fermionic spinon, labelled em, providing a key signature of the Z 2 spin liquid.Schemes for measuring off-diagonal elements are discussed in Appendix H.

B. Measurement of permutation operator
Note that in the general case, the modular matrices are represented by a general permutation, and cannot be expressed as a product of commuting SWAPs (2-cycle), and hence measured by parity counting after the beamsplitter operation.For example, to measure S for a chiral phase, one needs 8 layers, as shown in Appendix C, and to measure the operator: (7,8)] (applied from right to left).It is clear that SWAP (1,8) and SWAP(1, 2) do not commute and cannot be measured simultaneously.Written in cyclic notation, one re-express the above permutation as (18)(25)(36)(47)(12)(34)(56)(78) = (1735)(2648).In general, one can always express an arbitrary permutation as a product of commuting cyclic permutations (N-cycle), as in this example.These cyclic permutations, also called twist operators V, can hence be measured individually, as a generalization of the above SWAP protocol (for 2-cycle only).
A local twist operator at site j, denoted as V j , applies a cyclic permutation (012...N − 1) on N layers, i.e.
It can be diagonalized in the Bloch eigenbasis as Here l is a layer index and k labels the Bloch vector in the replica space.In order to get the expectation value of the global twist operator, one can first perform a Fourier transform (U FT ) to the Bloch basis via beamsplitter operations, i.e., and count the number in each site j of each layer k, labeled as ñ j,k = ã † j,k ã j,k , and use the following formula [63] to calculate the expectation value: The whole protocol is reminiscent of the evaluation of Renyi entanglement entropy with replica trick [65].For the special case of N = 2, the twist operator is the SWAP operator, and k = 0 and 1 corresponds to symmetric and anti-symmetric basis respectively.

C. Ramsey interferometer with an ancilla
A second approach to measuring the modular transformations is a QND measurement through a Ramsey-interference protocol (Hadamard test) with an extra ancilla qubit.The topological subspace is preserved after measuring the ancilla.
Below we will assume for concreteness, and without loss of generality, that the modular transformation being applied is S. The Ramsey interference is performed by replacing all SWAP gates in the protocol with Control-SWAP gates, conditioned on an ancilla.Measurement of the ancilla can then yield the wave function overlap between the transformed and un-transformed states.The Control-SWAP operations can be realized with cold atoms by using a Rydberg atom as an ancilla [64] or with cavity-QED interactions by using a cavity photon as an ancilla [66,67] and is discussed in detailed in Appendix I.
The interferometry protocol and quantum circuit are: In the beginning of the protocol, one prepares the initial state as 1 , where the ancilla (denoted with a subscript A) is in an equal-superposition state, and | M L is the many-body topological state.The control-S operation then yields the state 1 By measuring the ancilla in either the Pauli X or the Y basis, one gets the real and imaginary parts of the overlaps:

VIII. SCALABLE ARCHITECTURE
The preceding discussion can be generalized to genus g surfaces by considering n = 2(g + 1) genons placed in a geometrically symmetric configuration, for example at the vertices of a regular polygon with n vertices (or n − 1 vertices and one genon in the center).Then the rotational and reflection symmetries of the polygon implement non-trivial modular transformations.As above, folding the system in various patterns allows these transformations to be implemented by transversal SWAP operations between layers.A crucial feature of folding is that microscopically any layer permutation is a possible symmetry of a lattice Hamiltonian, whereas before folding, the possible rotational symmetries of a translationally invariant lattice Hamiltonian are limited.
In the following, we briefly outline two additional scalable schemes for fault-tolerant quantum computation.The first scheme considers a plane composed of individual patches, where each patch effectively corresponds to a topological state on a single torus [see Fig. 6(a)].One can use lattice surgery ideas [68] to split the code into individual patches, perform the previously mentioned modular transformations transversally, and afterwards merge the code.Logical operations that entangle states associated to different patches (handles), could be achieved by adiabatically moving defects to the correct con- (d-e) Modular transformations on a higher-genus surface can be generated with the combination of SWAPs and moving of defects on a bilayer topological state.Branch cuts never have to be moved through each other, providing advantages over braiding-only schemes [19].
figuration in order to set up the required transversal gate.We leave a more detailed study of this for future work.
We can also consider a hybrid scheme, using a combination of vertical layer SWAPs and adiabatic moving of genons, without folding, as shown in Fig. 6(c-e).For the modular transformation in (d) resembling S on a single torus, we apply a SWAP between vertically separated sites from different layers within a central square patch, and then adiabatically rotate the defects by π/2 to recover the original configuration of branch cuts.Depending on the application, the rotation could simply be stored in software, rather than physically implemented in hardware.A modular T (Dehn twist) on a single torus can be implemented by adiabatically rotating a branch cut by π, effectively braiding a pair of genons, as shown in (e) [19].These operations can be used to implement a universal gate set for Fibonacci and Ising topological states (see Table II).Compared to a scheme based on braiding defects alone [19], in this hybrid scheme we never have to take one branch cut through another.

IX. BEYOND MODULAR TRANSFORMATIONS: GENERALIZATION TO GENERIC ANYON PERMUTATION SYMMETRY AND THE RELATION TO SYMMETRY-ENRICHED TOPOLOGICAL ORDERS
We note that although we have proposed experiments for physically folding the lattice into a multi-layer architecture, it is only necessary to do that in the context of measuring topological orders.For topological quantum computation and error correcting codes, one does not necessarily need to have multiple physical layers and can instead always just use a single-layer code or lattice model containing an internal onsite symmetry that permutes anyon types.For example, the topological state could be described by two copies of anyon theories (mathematically known as modular tensor categories) C × C, such that a Z 2 on-site symmetry exchanges the anyons from the copies of C. That is, the anyon (a, b), consisting of a from one copy and b from second copy, is transformed as (a, b) ↔ (b, a).A well-known example is the equivalence between the triangular color codes and a folded surface (toric) code, which both have a complete set of transversal Clifford gates [38].There, the diagonal fold correspond to a specific gapped boundary (e 1 , e 2 )(m 1 , m 2 ) that allows exchange of the two types of e and m anyons in the two virtual layers.More generally, it has been shown how to construct lattice topological phases and codes with enriched onsite symmetries [39,40], known as symmetry-enriched topological states (SETs).In this regard, our "quantum origami" scheme gives a general theoretical recipe for designing useful topological codes in the presence of on-site anyon-permuting symmetries together with twist defects and/or gapped boundaries, enabling powerful transversal logical gates.
Below we present a formalism to generalize the transversal gates discussed in this paper to a more general class of on-site symmetry transformations using the language of the SETs.We consider a collection of twists/branch cuts (denoted by permutation group element P m for the m th twist) connected together to form a closed loop which divides a code into a patch inside the closed loop of twists and a region outside the patch.This is illustrated in Fig. 7(a) for two pairs of twists, and the general case of arbitrary numbers of twists and encoded logical qubits in Fig. 7(c).We can apply an onsite symmetry transformation inside the patch, denoted by a group element g, and an onsite symmetry transformation h outside the patch, such that g and h realize non-trivial permutations of the anyons.In order to ensure that the transformations form a logical gate G, we need to ensure that the transformation maps the code (ground) subspace H Σ back to itself (i.e., forms an automorphism of H Σ ), which in turn requires that the twists (P m ) remain invariant under the symmetry transformations: G : H Σ → H Σ .This leads to the following condition: The classification of all possible transformations g and h satisfying the above condition leads to a complete classification of all possible transversal gates in the corresponding twist configuration, which is left for future systematic development [62].As a simple limit of this condition, one can consider the twist being trivial (P m = I).In this case, one can only have g = h, i.e., the same transformation inside and outside the patch, which obviously preserves the trivial twist and hence the code subspace H Σ .Another simple example is illustrated in Fig. 7(a) with 4 anyon labels (or 4 physical layers), similar to the construction for modular R α S in Fig. 3(b) but without the gapped boundary (fold).In this simple example, the two different types of twists are represented by the permutation group elements as P 1 = (13) and P 2 = (24).The symmetry transformations inside and outside the patch are also represented by the permutation group elements: as g = (14)(23) and h = (12) (34).We can see that gP which gives an additional condition for the qualification as a transversal gate.Indeed, in the example shown in Fig. 7(c), we have gBg −1 = (14)(23)(12)(34)(23)(14) = (12)(34) = B, similarly the other transformation for h in the above condition also holds.
A special limit of the general situations in Fig. 7(a,b) is the limit that there is no twist defect and hence only a single gapped domain wall denoted by P 1 , as illustrated in Fig. 7(d).
In this case, we can still satisfy the condition gP 1 h −1 = P 1 to form a transversal logical gate.When sweeping the domain wall across the whole code block as shown in Fig. 7(d), we effectively apply a transversal gate on the whole code block corresponding to the symmetry transformation g.This specific case of the relation of TLG and the symmetry of a gapped domain wall has been previously discussed in Ref. [41][42][43] for Abelian topological stabilizer codes.
Finally, our theory can be extended into an even more general situation with multiple patches, while each patch is formed by arbitrary number of twists, as illustrated in Fig. 7(e) (for simplicity we only show 4 twists in each patch).Now we can apply a global transversal logical gate acting on each patch with an inside transformation g and an outside transformation h satisfying the condition in Eq. ( 12), as illustrated in Fig. 7(e).Alternatively, if we want to apply logical gates on a small subset of logical qubits, we need to be able to apply symmetry operations on an individual patch.This can be achieved by acting a single inside transformation g p on the p th patch, and a single outside transformation h p on a region encircling the patch, satisfying g p P m h −1 p = P m , as illustrated in Fig. 7(f).After applying the transformations, we will create a gapped domain wall on the outer boundary of the region where h p was applied.We call this an h wall, since it can be represented by the permutation group element corresponding to the h p transformation.Interestingly, we can cancel the hwall by creating a pair of corresponding twist defects, the h defects, and moving them around the wall until they annihilate with each other again.In this way, the combination of the transversal symmetry operation and moving of twist defects apply logical gates only on a subset of logical qubits.This approach can also serve as an alternative to the lattice surgery approach proposed in Fig. 6(a-c), which now does not need any measurement since the entire protocol is unitary.
In sum, our general theory uncovers a profound connection between symmetry-enriched topological (SET) states of matter [12,39,40] and transversal logical gates, which to a nearly unexplored theoretical direction and anticipates further systematic development in future [62].Our study explicitly demonstrates how not only topological operations such as braiding, but also symmetry operations, can be used as faulttolerant logical gates.

X. ERROR AND NOISE ANALYSIS A. Error analysis of the fault-tolerant transversal gate
The modular transformations used here can be viewed as fault-tolerant logical gates for the purpose of quantum computation.In the language of fault-tolerant quantum computation, our global SWAP gate between patches A and B, SWAP AB = j∈AB SWAP j is transversal.That is, if we include qubits from different layers that are aligned vertically in a single subsystem j under transversal partitioning, then the global SWAP operation is a product of operators which do not couple different subsystems ( j and j ) in the same code block.Therefore the error within one subsystem ( j) cannot be propagated into a different subsystem ( j ).This implies that such gates are fault-tolerant, as we will briefly elaborate below.
Topological states can be used for fault-tolerant "topological" quantum computation in two distinct contexts, through either an active or passive approach.In the active error correction approach, the topological state is the eigenspace of a set of commuting projectors, which can be continuously measured through the use of an ancilla and a local finite depth quantum circuit.In this approach the errors can be tracked through various "decoding" algorithms.One can then either deal with the errors entirely in software, or apply a recovery procedure to remove them.
In the passive approach to error protection, one considers a Hamiltonian whose ground state is the topological phase of interest, and cools the system down to a temperature T that is much less than the energy gap ∆ above the ground state.The topological protection in this case is due to the exponential prefactor e −∆/T for the density of quasiparticle excitations.Let us consider local coherent errors in the pairwise local SWAP operations.As discussed above, the local pairwise SWAP is generated by tunneling and an additional phase shift.For simplicity, we express it with a single generator as mentioned above: U j (t)=exp i2Jta † j,− a j,− , where a j,− = 1 √ 2 (a j,A − a j,B ) is the anti-symmetric mode.Here, we have assumed the tunneling time t equal to the phase shift time, which should be t = π/(2J) to obtain the exact SWAP operator, namely SWAP AB = j∈AB U j ( π 2J ) = U( π 2J ).Let us first consider an overall systematic error in the tunneling time: ).We note the additional erroneous unitary U(∆t) is actually factorizable, i.e., U(∆t) = j∈AB U j (∆t), therefore the local error does not spread out in space.The original wavefunction | ψ 0 is in the topological ground state (code) subspace H.The wavefunction after the operation without any errors, | ψ = U( π 2J )| ψ 0 = SWAP AB | ψ 0 , is also in the same code space H (this discussion can be straightforwardly generalized to the case where the initial and final code subspaces are different).On the other hand, the erroneous wavefunction becomes If ∆t is a small quantity, one can perform a Taylor expansion: Note that the major component | ψ is still within the code space H, while the first and higher order corrections with extra tunneling are outside H. Due to the factorizability of the erroneous unitary, the leading low-order corrections all have only local errors, or in other words, local generation of anyons (quasiparticles).Non-local errors with weight larger than half of the code distance d/2 (causing a logical error) is of O[(∆t) d/2 ] and is hence exponentially suppressed.
The above discussion straightforwardly generalizes to the case of local independent errors for each site, i.e.U({ π 2J + ∆t j }) = j∈AB U(∆t j )U( π 2J ).The error is again factorizable, leading to a Taylor expansion: (15) In the context of active error correction, all the terms with order lower than O[(∆t) d/2 ] can be corrected using standard error correction protocols, where errors are either removed by a recovery procedure [69], or simply kept track of entirely in software.
In the context of passive protection by a Hamiltonian, we note that | ψ has virtual anyonic pairs which increases its energy by 4J 2 ∆t 2 E g , to leading order, where E g is the energy gap (excitation energy of an anyon pair).Any further separation of the anyon pair by a distance l is an l th -order process due to the presence of the energy gap, which is suppressed by a factor ( κ E g ) l , where κ is the perturbation strength that leads to anyon separation.With κ < E g , such a virtual process, leading to a logical error when l > d/2, is exponentially suppressed.Therefore, although the wavefunction | ψ is distinct from | ψ in terms of microscopic details, they are simply related to each other by local operators, which does not affect the logical state upon which the Wilson loop operators act.
We have seen above that an individual transversal logical gate is protected.However, the situation is more subtle when applying a sequence of transversal gates.After the application of n such transversal gates, there is an accumulation of virtual anyon pairs and energy increase.After n ∼ O(d/2) steps, a logical error occurs with probability of O(1).Therefore, one needs to suppress the virtual anyon accumulation by coupling the system to a low-temperature bath, such that after the application of each transversal gate, the virtual anyonic excitation can be relaxed to the ground state through a dissipative process via the system-bath coupling [70], in analogy to the recovery operation in active QEC.
We caution that, in 2D, a topological memory with a finitetemperature bath is not truly self-correcting in the sense that there is always a finite maximum lifetime for the logical quantum information that exponentially increases with the gap size and is independent of system size [71].The transversal gates are still protected within this life time.Nevertheless, for higher dimensions (e.g., in 4D), a true self-correcting memory can exist, where similar transversal SWAP gates between different sub-lattices can also be applied.

B. Error analysis of the measurement protocols
In the previous sections, we have proposed two methods for measuring modular transformations: (1) through a Ramsey interferometer (Sec.VII C), which uses an ancilla, and (2) by directly measuring SWAP operators (Sec.VII A), as in a manybody interferometer with beam splitters.In this section we briefly describe the effect of (a) errors in the SWAP operations, (b) deviations of the system from the pure ground state due to finite temperature or perturbations to the Hamiltonian, and (c) errors in the measurement process.Below we briefly discuss these issues.
The Ramsey interferometer essentially takes the overlap between the wavefunctions at the end of two different histories, | ψ 0 and R α S| ψ 0 .Here we consider the simplest protocol, which implements R α S, although the discussion can be readily generalized to other protocols as well.As discussed in the main text, the R α S operation can be implemented by two SWAP operations, j SWAP j (1, 2)SWAP j (3,4).Let us suppose that there is an error in these operations due to error in the required tunneling time needed to implement the SWAP operations.The final wave function, after the controlled-SWAP, is then Here U j (∆t j ) ≈ 1 + i(2J) j (∆t (12)  j a † j,12− a j,12− + ∆t (34)  j a † j,34− a j,34− ).∆t (ab) j are the timing errors for the SWAP operation between layers a and b for site j. a j,12− and a j,34− are the anti-symmetric modes associated with layers 12, and 34, respectively.
We expand the error of the wavefunction in the right branch of the history up to first order, i.e.
where c ≈ 1/ 1 + (2J j,x ∆t (x) j ) 2 ≈ 1 − 2N 2 J 2 ∆t 2 is the normalization constant (for wavefunction up to first order in ∆t).Here, N is the number of sites in the patches, and ∆t = 1 N j,x ∆t (x) j is the average error.The unperturbed and perturbed parts of the wavefunction are in general orthogonal to each other due to the creation of anyons.Therefore, the wavefunction overlap The timing error thus results in an overall amplitude decay for the matrix element of the modular transformation.Since it is an overall amplitude decay, this implies that ratios of the matrix elements of the modular transformations are insensitive to these timing errors, assuming the timing errors are independent of the initial state.Furthermore, we note that the overall amplitude decay is a power-law form, not an exponential, assuming ∆tJ 1/N.Therefore a system with N ≈ 50 particles and the state-of-theart two-qubit gate fidelity F ≈ 1 − J∆t ≈ 99.5% [23] would lead to a 12.5% reduction of the wavefunction overlap.
Another source of error occurs due to a finite thermal density of quasiparticles at finite temperature T .These are suppressed by a factor of e E g /T where E g is the energy gap, at low temperatures, and this implies a small reduction in the expectation value.Assuming that E g corresponds to creating two quasiparticles out of the vacuum, we expect that to leading order, the fidelity is reduced roughly by a factor of 1 (1+N 2 e −Eg /T ) ≈ 1 − N 2 e −E g /T , where the weight N 2 originates from the number of possible configurations of two quasiparticles.
One can consider the case of additional disorder or perturbations to the Hamiltonian which makes the two patches (A and B) that are being swapped non-identical microscopically.If the perturbation is small compared to the energy gap, the wave function again has perturbations that lead to an amplitude reduction set by a term that scales as N 2 , as in the above examples.
Finally, for the case of the many-body interferometer without an ancilla (Sec.VII A), there is a an extra error due to the final parity measurement.
Specifically, since one is directly measuring the global parity operator j exp iπñ j,4 exp iπñ j,2 as mentioned above, the measured value is a product of all the local parity measurements.Thus, the measurement fidelity has an extra exponential decay, F N , with F being the average readout fidelity on each site.The simplicity of the measurement scheme without a global ancilla comes at this price of exponential readout sensitivity.This is the same challenge in the current entanglement entropy measurements in cold atom systems [29].From a practical point of view, this parity measurement scheme is more suitable for small lattices with high readout fidelity.Examples with state-of-the-art parameters: (1) Superconducting qubits [23] (99%) 50 = 60.5%, (99%) 30 = 74.0%.(2) Ion qubits [72] (99.93%) 100 = 93.2%,(99.93%) 50= 96.6%.We caution that although the ancilla-based Ramsey interferometry does not suffer from the exponential readout sensitivity [64], the global ancilla may introduce correlated noise between distant sites, further complicating the fault-tolerance of the measurement.

XI. CONCLUSION AND OUTLOOK
We have shown that when defects in a topologically ordered state are placed in a symmetric configuration, then spatial symmetry transformations in a fully local system can effectively be identified with modular transformations.By folding the system, these spatial symmetry operations become on-site symmetry transformations, allowing a simple method to implement modular transformations as a transversal operation.This yields a novel method for directly measuring fractional statistics and also for implementing a wide class of transversal logical gates.A even general theoretical framework about transversal gates as onsite anyon symmetry in the language of symmetry-enriched topological orders has also been presented, and anticipates further systematic classification in future [62].
Extending the experimental implementation of these ideas to topological phases in multi-layer ultracold atomic systems in the future allows the possibility of directly imaging topological order and fractional statistics.This can be done using local beam splitter operations, as were successfully utilized in quantum gas microscopes for extracting entanglement entropy [29].
where a j,A represents the bosonic operator on patch A and site j.Physical implementation of SWAP can be achieved by turning on this Hamiltonian for time t = π/(2J), i.e., U (t) = e −iH t t , with an additional phase shift Now, in order to also measure the SWAP operator, we use the fact that it can be written as the parity operator in a rotated basis, after the application of the tunneling for time t = π 4J , up to a local phase.More specifically, we define the beamsplitter operator, BM = U As mentioned in the main text, the beam splitter operation maps the operators in the two layers into the symmetric and anti-symmetric basis, respectively.Note the SWAP operator in Eq. (B3) can be rewritten as the parity operator in the anti-symmetric mode of the two layers, i.e., and can hence be measured after beam-splitter operations, where we have defined ã j,B = 1 √ 2 (a j,A − a j,B ).Such a transversal SWAP operation and its measurement, for example, has been recently achieved in cold atom experiments for the measurement of entanglement entropy [29].
Appendix C: Transversal implementation and measurement of modular S on an 8-layer system Here we continue the folding procedure of Fig. 2(b) in the main text.Now we fold the system three times to form an 8layer system, as shown in Fig. 8(a-d).Importantly, note that all the periodic boundary conditions come to the left edge and can be replaced by local boundary conditions (gapped boundary): (16)(25)(38)(47), induced by "gluing" the edges with local interaction (tunneling).We remark that this provides a novel way of effectively creating a torus in a planar system with purely local interactions.
One can represent the folded 8-layer system using the language of unitary modular tensor category (UMTC) [9] as eight copies of UMTCs: where C describs a single copy of the original state.Note that the boundary conditions we specify here are such that C is always glued to its parity-reversed counterpart C, and hence can be realized with local interactions.Note that this discussion applies to both chiral (C C) and non-chiral (C = C) phases.
To illustrate the scheme with clarity, we unfold the 8-layer system and label each patch with the layer number n, as shown in Fig. 8(e).We use n to label the layers with opposite chirality (shaded by dark blue) in the folded system, while the light-blue patches inherit the original chirality of the unfolded system.The dashed lines delineate the lines along which the folds occur in the 8-layer system.The colored markers on the unfolded system indicate gluing of the opposite edges, which then correspond to local boundary conditions on the left edges of the folded system.
In this setup, one can realize R α S transversally through the following SWAP operations [see Fig. 8(f,g)]: R α S = SWAP(1, 2)(3, 4)(5, 6) (7,8). (C1) Note that in order to illustrate the effect of the layer SWAPs on the unfolded system in Fig. 8, we show the protocol with passive transformations (change of basis), i.e., fix the location of Wilson loops but SWAP the patches, which is the same convention as our definition of modular transformations in Fig. 1 (a-c) in the main text.Meanwhile, we illustrate active transformations on the folded systems, i.e., change the location (layer labels) of the Wilson loops.The R α S transformation corresponds to a mirror reflection along the diagonal line: M x−ŷ as shown in Fig. 8(g).One can see that in both the folded and unfolded pictures, the red loop has the path 2 → 1 → 8 → 5 → 2, which was the original path of the blue loop in (e) with the opposite direction, indicating the transformation R α S : (α, β) → (−β, −α).
One can also apply an additional reflection transversally by R α = SWAP(1, 8)(2, 5)(3, 6)(4, 7) after the R α S transformation, in order to cancel out the reflection, as shown in Fig. 8(i,k).This leads to the realization of modular S transversally.In the unfolded system in Fig. 8(i), R α corresponds to a mirror reflection along the vertical line in the new basis: M ŷ (equivalent to M x in the original basis).We can see that the red loop has the path 5 → 8 → 1 → 2 → 5, which has exactly the same path as the original blue loop W α a in (e), i.e., 2 → 1 → 8 → 5 → 2. This indicates the red loop in (i) is W α b .One can see this correspondence more clearly when restoring the orientation of the manifold by a π 2 -rotation [Fig.8(k)] to the configuration of the original basis in (e).On the other hand, the blue loop in (i) has the path 8 → 5 → 4 → 3 → 8, which is gauge-equivalent to the path 1 → 2 → 7 → 6 → 1.This is exactly the path of the original red loop W β b in (e) with the opposite direction, as can also be seen in the restored configuration (k).This indicates that the blue loop in (i) is W −β a .Therefore the whole transformation from (d,e) to (h,i) achieves S : (α, β) → (−β, α).
The transversal modular S can also be abbreviated by two commuting cyclic twist operators as To be concrete, V(1735) represents the cyclic permutation (1 → 7 → 3 → 5 → 1).The equivalence to two commuting twist operations is illustrated in Fig. 8(j).Note that a single twist operator only couples layers with the same chirality, as required.
We note that the folding procedure and transversal operation discussed here have some resemblance with the interpretation of a color code as folded surface code [38] and the (13) ( 24)  (a-d) Folding the square with periodic boundary conditions three times lead to an 8-layer system with local boundary conditions induced by local interactions.In panel (d), all the long-range boundary conditions come to the left edge and the layers with opposite chirality are glued locally.This provides a novel way to effectively construct a torus in a planar system with local interactions.(e) The correspondence to an unfolded system is shown by labeling the patches with the layer number.The bar on the number along with the dark-blue shade indicates layers with reversed chirality (orientation) in the folded system, compared to the original chirality.(f,g) The R α S transformation can be implemented with four transversal SWAPs, corresponding to the mirror reflection along the diagonal line in the unfolded system.(h, i) The modular S transformation can be realized with four additional transversal SWAPs which induce another R α transformation.In the unfolded picture (i), one can make a gauge transformation to shift the blue loop to the right, in order to find correspondence with the red loop in (e).(j) The modular S implemented by transversal SWAPs is equivalent to two commuting cyclic permutations represented by the twist operators.(k) One can restore the configuration in (i) by a π/2-rotation to that of the original basis in (e).The correspondence between the initial and final Wilson loops becomes clearer when viewed in this way.existence of transversal Clifford gate set in the triangular color code [58].However here we are considering a torus in terms of a square with periodic boundary conditions (as opposed to a square with gapped boundaries), and our construction applies to arbitrary Abelian and non-Abelian topological states.
The measurement of the two twist operators, V(1735)V(2648), proceeds according to the general discussion presented in Sec.VII B (see Fig. 9 for an illustration).We apply Fourier transforms (FT) to layer 1,7,3,5 and 2,4,6,8 (sorted according to the order when entering the input l and l of the FT circuit gadget) respectively as illustrated in Fig. 9(b).The FT gadget performs the linear map in Eq. ( 11), and then one measures the twist operators using the relation in Eq. (12).

Appendix D: Transversal implementation of modular transformations on a torus with hexagonal symmetry
In the previous section , we have shown that a torus with C 4rotational symmetry can be used to implement modular S, R α , R β and their combinations transversally by folding the manifold into 8 layers.In this section, we show that a torus with C 6 symmetry can be used to implement modular transformations related to T .
As shown in the upper-left panel in Fig. 10(a), a hexagon with the three pairs of opposite edges being identified is equivalent to a torus.There are two independent loops α (blue) and β (red) on the manifold, and the third one α + β (green) is their superposition.As one can see, a reflection along 'mirror 1' implements the map T R β : (α, β) → (−β, α).Similarly, the reflections along 'mirror 2' and 'mirror 3' implements R β S and R α S. The combinations of reflections can also implement rotations, for example, U π/3 and U −π/3 as shown in the lower panel of Fig. 10(a), which gives rise to T S −1 and ST −1 .Each individual reflection can be implemented transversally if folding the manifold 3 times and into 6 layers, as illustrated in Fig. 10(b), where the T R β can be implemented transversally.The corresponding gapped boundaries created by folding and gluing the edges is shown explicitly in the right panel of (b).Furthermore, one can implement all the modular transformations shown in (a) transversally on the same code by folding the manifold into 12 layers as shown in (c).Transversal SWAP between the two layers flips the direction of the loop and hence is equivalent to charge conjugation operator.(c) On a bilayer system with two pairs of genons (equivalent to an effective torus), interlayer transversal SWAP implements a charge conjugation operation that flips the direction of the loop in both the αand β-cycle.(d) When folding the bilayer system in (c) into a 4-layer system, interlayer SWAP between layer 1 and 3, and layer 2 and 4 implements the charge conjugation.
Appendix F: Protocols on triangular defect code implementing both RS and T R transversally In the main text, we have shown how to perform T R β transformation transversally in the triangular configuration of genons in Fig. 3(c).We also showed how to perform R β S by switching to the genon configuration with C 4v symmetry.Therefore implementing both transformations in a 4-layer system requires moving defects.
Here, we show explicitly that R β S, T R β , and C can all be performed transversally with layer permutations, without moving the defects at all, by folding the system into a 12-layer system.
The scheme is shown in Fig. 12.In panel (a), we first apply a reflection along the line connecting defect 1 and 4, i.e., M x− √ 3ŷ , followed by a SWAP operation in the blue shaded regions, SWAP (1, 2) to return the branch cuts to their original configurations.This achieves an R α S transformation, which acts on the loop as R α S : (α, β) → (−β, −α).In order to also realize R β S, one can apply an additional global SWAP, i.e., SWAP (1,2), equivalent to the topological charge conjugation operation C, as was described above in Appendix E. This in turn achieves the mapping R β S : (α, β) → (β, α), which interchanges the red and blue loop in the initial (leftmost) configuration.One can conclude the following relation: R β S = CR α S. To see the correspondence between the initial configuration more clearly, we note that reversing the arrows in the loops is equivalent to switching the layers of the loop (as shown in the rightmost configuration in the second row and explained in Appendix E).One can also directly achieve R β S by performing the initial inter-layer SWAP between the blue shaded regions outside the central patch, i.e., SWAP ¯ (1, 2), as shown in the second row of panel (a).
All of the above operations can be performed transversally by layer SWAPSs in a 4-layer system when folding along the mirror axis connecting defect 1 and 4, as shown in the lowerleft part of panel (a).We can hence express R α S and R β S as Here, as in the discussion of the C 4v geometry in the main text, ∆ refers to the triangular region enclosed by the branch cuts after folding, and ∆ refers to its complement.
In the main text, we have already shown that folding along the horizontal mirror axis connecting defect 1 and 2 (into 4 layers) enables applying T R β transversally.Here, we show that by folding the whole system along the three types of mirror axes (with an additional one connecting defect 1 and 3) shown in Fig. 12(b), one can get a 12-layer system with three types of gapped boundaries and one branch cut in the bulk.To illustrate the correspondence with the original bilayer system, we unfold system at the bottom of panel (b), with the layer labels on each patch.The bar on top of the number and shade of the patch indicates that after folding, that region has reversed orientation (chirality) relative to the original system.The mirrors (dashed lines) on the unfolded system separating layers with opposite chirality correspond to gapped boundaries in the folded system.The horizontal twist in the unfolded system overlaps with one of the mirror axes and hence modifies the = m ir ro r 2  ( fold FIG. 12. (a) Implementing R α S and R β S with reflection along the mirror axis connecting defect 1 and 4. All the protocols can be applied transversally when folding the system into 4 layers along the mirror.(b) By folding the systems along the three types of mirrors into 12 layers, one can achieve both R β S and T R β transversally without moving the genons.The gapped boundaries and twists are labeled on the folded system.The correspondence to the unfolded system is shown on the bottom of the panel and label the layers on each patch with the same rules as in Fig. 8.The bar on the number along with the dark shade indicates layers with reversed chirality (orientation) in the folded system.The branch cuts connecting the green and orange patches are indicated by the lines and corresponding labels.
gapped boundary in the lower-right part of the folded system.The vertical branch cut in the unfolded system is located in the bulk of the folded 12-layer system (represented by the red line).
In such a folded system, one can perform T R β , R β S, and C transversally without moving genons: Note that one can also apply combinations of such transformations, which allows transversal implementation of , etc.Note that T S, (T S) −1 and T S −1 are all elements of the orientation-preserving mapping class group, and hence they preserve the ground state subspace of chiral topological phases.
We note that a sequence of reflections about different mirror axes implements a ±2π/3 rotation of the unfolded geometry.Therefore, the ±2π/3 rotation combined with SWAPs in the unfolded system implements T S −1 and ST −1 transformations respectively, as shown in Fig. 13.Applying global SWAPs between two layers on top the above transformations implement an additional charge conjugation C, giving rise to T S and (T S) −1 respectively.This again illustrates the fact that spatial symmetry transformations can act as protected logical operations.
Appendix G: Examples of fault-tolerant gates (1) ν = 1/k Laughlin fractional quantum Hall state: We begin by discussing topological states whose topological order coincides with that of the ν = 1/k Laughlin fractional quantum Hall (FQH) states.
In the simplest case of ν = 1/2 bosonic FQH state, the ground-state degeneracy on a torus is 2, encoding one logical qubit labeled as | n s β .Here, n s = 0, 1 represents the semion number, which measured by applying a Wilson loop along the α−cycle.The corresponding logical Pauli operators are Z = W α s and X = W β s .The modular transformations That is, the action of S is equivalent to that of a logical Hadamard gate 1 −1 .Note that we have used the property that semion is self-conjugate, i.e., C(s) = s, where C is the topological charge conjugation operator.The modular T has the matrix representation in the computational basis as T = 1 0 0 i =P, equivalent to the logical Clifford phase gate P.
One can generalize the above analysis to the ν = 1/k Laughlin FQH state, where the ground-state degeneracy on a torus is k, corresponding to a k-level logical qudit, labeled as | a β , where a = 0, 1, 2, ...,.In this case, the Wilson loops of inserting a single anyon along the two cycles of the torus play the role of qudit shift operators, i.e., Z = W α and X = W β , with XZ = e 2πi/k ZX.The shift operator acts on the basis state as X| a In this case, the modular S has the matrix representation in the computational basis as S ab = 1 √ k e i2πab/k , which is a discrete Fourier transform of the basis states.The modular T has the representation T ab = δ ab e i2πa(a+k)/2 , which is a generalized phase gate on the logical qudit.
In the case of ν = 1/2 bosonic FQH, the whole MCG Σ of a genus g surface Σ generates the Clifford group for the logical qubits.In the general ν = 1/k case, the MCG Σ generates the generalized Clifford group for the logical qudits.
(2) Double semion state: The topological order of the double semion coincides with that of two decoupled layers of ν=±1/2 bosonic FQH states, where the layers have opposite chirality.The complete set of Wilson operators are the semion (s) and anti-semion (s ) loops, with the pair of anticommutation relations {W α s , W β s } = {W α s , W β s } = 0.Each particle is self-conjugate, as s × s = s × s = I, where I denotes the trivial (vacuum) sector.The Wilson loops associated with different semions, s and s , commute with each other.The ground states can be labeled by the number of loops inserted along the β-direction, i.e., | n s , n s β = (W β s ) n s (W β s ) n s | 0 s , 0 s β , with n s , n s = 0, 1.We can represent the topological ground state subspace (code space) as a tensor product of the semion and anti-semion parts, i.e., H = H 1 2 ⊗ H − 1 2 .We can choose to store the logical qubit information only in the semion subspace H 1 2 by tracing out (ignoring) the anti-semion part (considering the situation where there is no entanglement between semion and anti-semion), i.e., H 1 2 = Tr − 1 2 H. Thus we can label the logical qubit by the semion number | n s β .The corresponding logical operators are Z = W α s and X = W β s , which is the same as the ν = 1/2 FQH states.Therefore, the previous discussion applies here as well.The modular S and T applies logical Hadamard H 1 −1 and phase P = 1 0 0 i respectively, and MCG Σ generates the Clifford group.Now we also consider R α S and T R α transformation, which can be implemented transversally with only 4 layers.For simplicity, we could instead first consider the transversal logical gate corresponding to R α , i.e., (G2) One can see that the reflection R α exchanges semion and antisemion.This can again be intuitively understood from the picture of two copies of FQH states with opposite chirality, since the reflection changes the chirality of both copies and hence turns semion into anti-semion, and vice versa.Therefore, if the logical quantum information is stored in the semion sector H 1 2 , the reflection R α takes the semion to antisemion and hence takes the logical qubit out of the logical subspace.Therefore, R α S or T R α alone is not considered as a logical gate in this encoding scheme.Only when another R α is applied and the combination leads to S = R α (R α S), T = (T R α )R α , or T S = (T R α )(R α S) etc., do we get a logical gate.This consideration holds for the other doubled states as well, such as the Ising × Ising and Fib.× Fib.states, which can both be considered as two copies of topological states with opposite chirality. ( i.e., logical Hadamard gates on both qubits with an additional logical SWAP.The modular T in this basis has the representation as T = diag(1, 1, 1, −1), corresponding to a CZ gate.
Note that, for Kitaev's Z 2 toric code model, one can choose a particular reflection axis such that the anyons transform trivially under reflection: R α (e) = e and R α (m) = m, and similarly for R β .In this case, the reflection makes the following transformation Similar relations hold for W α m .Therefore, R α acts trivially on the states.Thus for this topological order, R α S is equivalent to S, and T R α is equivalent to T .
Appendix H: Extracting off-diagonal matrix elements and state preparation for measurement protocols We have shown above how one can measure expectation values of modular transformations and the diagonal matrix elements of them.In order to fully diagnose topological order, and to fully determine the fractional statistics of the quasiparticles, we need to measure all of the matrix elements of S and T .This is a difficult problem in general; below we discuss some potential methods for state preparation, in order to reliably access desired matrix elements.
In order to also measure the off-diagonal elements of S, e.g., Thus S = S † when C can be treated as the identity operation, which happens in states where each anyon is its own anti-particle: C : a → ā = a.This is the case, for example, in the Z 2 spin liquid, double semion, Ising, and Fibonacci states.By independently measuring the diagonal elements of S we can thus subtract them from (H1) to get the real part of the off-diagonal elements.Similarly, if one prepare the superposition of state as | ψ = 1 For generic phases where anyons are not all self-conjugate (i.e.C I ), where I is the identity, one can first measure all the matrix elements of the charge conjugation operator, β a | C | b β .Note the charge conjugation can also be expressed as transversal SWAPs, e.g., as C = SWAP(1, 3)(2, 4) for both types of 4-layer systems in Fig. 3 (see Appendix E for details).Therefore, it can also be measured through measuring the SWAP operators.Moreover, since C is Hermitian (C=C † ), the off-diagonal elements can be measured by preparing the two types of superposition mentioned above.Therefore, one can first measure ψ | S | ψ as shown by Eq. (H1) and use the fact that A similar procedure can be used to measure the off-diagonal elements of other modular matrices.We note that since R α S and T R β can be measured transversally with a 4-layer nonchiral system shown in Fig. 3, we can combine the results from these measurements with the results from transversal measurements of R α and R β in the above way, and hence extract S and T matrices.Now we discuss possible state preparation protocols.We can start by considering a system with no genons (twist defects), and then adiabatically pulling out pairs of genons from the ground state.Due to topological charge conservation, the Wilson loops surrounding each branch cut will be in the vacuum sector, i.e. | I α (zero anyon charge when measured along the dual β-cycle).By applying a modular S (or R α S), one can also rotate the vacuum state into the dual basis, i.e., | I β = | I −β = S| I α = R α S| I α .
In order to prepare the state of a particular anyon sector | a β , or superpositions of such anyon sectors, we need additional operations.This can be done in multiple ways.For example, one can use modular transformations themselves as gates (see Table II) to prepare non-trivial linear combinations of the states | a β .Which particular superpositions can be applied then depends on the properties of the modular transformations; for example, for the Fibonacci phase, arbitrary states can be prepared for genus g ≥ 2 due to the dense covering of representations of the MCG in that case.For ν = 1/k The qubits in the lower layer are coupled to the cavity ancilla.All the couplings in this design are through the flux-tunable couplers.This allows time-dependent control of tunneling, which enables SWAP and beam-splitter operations between patches A and B (while A and B are untouched), as well as the dispersive interaction between qubits in patch B and the cavity ancilla.
FQH states, the MCG generates a (generalized) Clifford group and is hence sufficient for measuring all modular matrix elements.In the concrete example of ν = 1/2 bosonic FQH state, the 2-fold degenerate ground space is equivalent to a single logical qubit.One can use S as Hadamard H and T as phase P (see Appendix G) to prepare the states | 0 β , | 1 β , 1 √ 2 (| 0 β +| 1 β ) and 1 √ 2 (| 0 β +i| 1 β ) to extract all the diagonal and off-diagonal matrix elements as discussed above.
An alternative way to prepare states is through flux insertion.We use the Z 2 spin liquid as a concrete example, which has four anyon charge sectors along a particular cycle: | a β , where a = I (vacuum), e (bosonic spinon), m (vison), and em (fermionic spinon).Since the spinon carries spin-1/2, it follows that it acquires a −1 phase upon encircling 2π spin flux along a particular direction in spin space.One can then show, therefore, that | m β = F β (2π)| I β , where F β (2π) is the operator that adiabatically threads 2π spin flux along the β loop.The spin flux can be taken to be, for example, along the S z spin axis.
By inserting fractional flux, it may also be possible to create superpositions of anyons sectors; we leave further study of this for future work.The ancilla-based Ramsey interferometry measurement of modular matrices discussed above utilizes a Control-SWAP operation.Here we briefly review a physical implementation of Control-SWAP in a circuit QED architecture, as shown in Fig. 14.An alternative implementation using a Rydberg ancilla in a cold atom setup can be found in Ref. [64].
We illustrate the setup in Fig. 14 using two layers of qubit arrays, with the lower layer coupled to a transmission-line cavity ancilla with flux-tunable inductive couplers, enabling local selectivity.The qubits within and between layers are also coupled with flux-tunable inductive coupler (gmon) [73], which enables locally selective and time-dependent tunneling to implement SWAP and beam-splitter operations.
The Control-SWAP operation can be generated by turning on the dispersive interaction between the ancilla cavity and the bosons (qubits) in the anti-symmetric mode after the beamsplitter operation between patch A and B enabled by selective tunneling.The dispersive interaction is described by the Hamiltonian [64,66,67] where a † C a C = n C is the number operator for the ancilla cavity mode and ñ j,B is the number operator for the anti-symmetric mode between vertically neighboring qubits from layer A and layer B. This effective Hamiltonian can for example be derived from the Jaynes-Cummings model [74], which describes the interaction between cavity photons and qubits.In terms of the Jaynes-Cummings parameters, χ = g 2 /∆, where g is the Jaynes-Cummings interaction strength and ∆ = − ω is the detuning between qubit frequency ( ) and cavity frequency (ω).When turning on the dispersive interaction for a period τ = π/χ, one gets the global Control-SWAP (Fredkin) gate: C-SWAP =e −iH dis τ = e −iπa † C a C j∈AB ñ j,B = j e −iπñ j,B n C The SWAP operation here is controlled by the ancilla cavity photon state.The implementation of the dispersive interaction between the superconducting cavity ancilla and qubits can be found in Ref. [67].

FIG. 1 .
FIG.1.(a-c) Definition of modular S and T transformations of a torus.(d-i) Non-contractible Wilson loops and their transformations under modular S and T on an effective torus realized by a double-layer topological system in the presence of genons (shown as crosses), i.e., the point defects at the end of the branch cuts (solid lines) connecting the two layers.To get a closed torus, we assume that the boundary in (g) has trivial topological charge.To draw α + β in (i) we use the fact that the double loop around a single genon is contractible (see Appendix E).The S transformation exchanges the two loops and flips the direction of β-loops as shown in (e) and (h), while the T transformation performs a Dehn twist along the β-loop as shown in (f) and (i).

(
fermion).Alternatively, one can choose the longitudinal βbasis, | a β = W β a | I β .The mapping class group of a torus, MCG(T 2 )=SL(2, Z), is generated by S : τ → − 1 τ and T : τ → τ + 1.They correspond to the following transformations of the non-contractible cycles, S : (α, β) → (−β, α) (exchanges the two cycles and flips the direction of β-cycle) and T : (α, β) → (α + β, β) (a Dehn twist along the β-cycle), as illustrated in Fig. 1(b, c).We also introduce the reflection operations which flip the direction along one of the two cycles, i.e., R α : (α, β) → (−α, β) and R β : (α, β) → (α, −β).Now we review the representation of MCG(T 2 ) and the corresponding unitary transformations in the Hilbert space H T 2 [2, 9].The modular S transformation [51] exchanges the loops [Fig.1(e)], i.e., S| a β =| a α and S| a α =| a −β =R β | a β .Note that the S transformation can also be interpreted as a basis transformation between the two dual bases, i.e., | a α = b S ab | b β , where S ab is the modular S matrix.In the Heisenberg picture, the Wilsonloop operators are hence transformed as SW β a S † =W α a and SW α a S † =W −β a .Similarly, the modular T transformation performs a Dehn twist on the Wilson loops [Fig.1(f)], i.e., T | a α =| a α+β and T W α a T † =W α+β a .The modular S and T matrices can be represented in the ground state subspace in a particular basis (e.g.| a β ) and by anyon diagrams as: where d a is the quantum dimension associated with anyon a and D is the total quantum dimension, D = a d 2 a .As suggested by the Hopf-link anyon diagram, the S matrix encodes the self-and mutual-braiding statistics in its diagonal and offdiagonal elements respectively.On the other hand, the T matrix encodes the topological twist (exponentiated topological spin) θ a in its diagonal elements.As a simple example, the S and T matrices of the toric code (Z 2 spin liquid) are shown below (in the basis formed by the 4 topological sectors | I β , | e β , | m β , and | em β ):

FIG. 2 .
FIG. 2. (a) Modular S on a square with periodic boundary condition by π/2 rotation (equivalent to M ŷ M x+ŷ ), while M x+ŷ alone implements R α S. (b) Folding the lattice into two layers along the diagonal line, where the left and bottom edges are still connected with periodic boundary condition.The upper-left edge has local boundary condition (12), connected with only local interaction.Different arrows represent loops in different layers as labelled.R α S can be achieved by transversal SWAPs between layers 1 and 2.
embed a bilayer topological phase on a single-layer chip fold a bilayer topological phase embed a bilayer topological error-correction code on a single-layer

FIG. 4 .
FIG.4.Experimental implementation with superconducting qubits: (a) Embedding multi-layer topological phases in a single-layer chip, using crossover bridges.(b) Embedding multi-layer topological error-correction codes on a single-layer chip with a central ancilla performing stabilizer measurements.When crossing a twist defect, the stabilizers connect qubits on different layers.

FIG. 5 .
FIG. 5. Measurement protocol of modular matrices.(a) Splitting two pairs of twist defects out of the "vacuum", due to charge conservation, the ground state is in the vacuum sector | I α (trivial charge measured by the loop W β a encircling the branch cut).(b, c) Measuring the modular S matrix from local parity measurement after four parallel beam-splitter operations.

FIG. 7 .
FIG.7.Generalization to anyon symmetry transformations in the language of SET theory.(a) Two types of twists (P 1 and P 2 ) encircle a patch.On the right panel, symmetry transformations g and h are applied inside and outside the patch respectively, as indicated by the change of colors.The transformation keep the twists invariant and hence preserve the code subspace.(b) Generalization to a single patch formed by an arbitrary number of twists.(c) Generalization to a patch encircled by both twists and gapped boundaries.(d) A special limiting case with no twist defect and a single gapped domain wall circling the patch.Sweeping the wall across the code block leads to a transversal gate acting on the whole code block.(e) The more general situations with multiple patches composed by arbitrary number of twists.The inside transformation g and outside transformation h lead to a global transversal gate acting on all logical qubits.(f) Apply logical gates on an individual patch and a subset of logical qubits.First apply g p and h p on a region encircling the p th patch.A h wall is automatically created by the h p and can be cancelled via creating a pair of h defects, moving them around the loop and annihilate them again.
FIG.8.(a-d) Folding the square with periodic boundary conditions three times lead to an 8-layer system with local boundary conditions induced by local interactions.In panel (d), all the long-range boundary conditions come to the left edge and the layers with opposite chirality are glued locally.This provides a novel way to effectively construct a torus in a planar system with local interactions.(e) The correspondence to an unfolded system is shown by labeling the patches with the layer number.The bar on the number along with the dark-blue shade indicates layers with reversed chirality (orientation) in the folded system, compared to the original chirality.(f,g) The R α S transformation can be implemented with four transversal SWAPs, corresponding to the mirror reflection along the diagonal line in the unfolded system.(h, i) The modular S transformation can be realized with four additional transversal SWAPs which induce another R α transformation.In the unfolded picture (i), one can make a gauge transformation to shift the blue loop to the right, in order to find correspondence with the red loop in (e).(j) The modular S implemented by transversal SWAPs is equivalent to two commuting cyclic permutations represented by the twist operators.(k) One can restore the configuration in (i) by a π/2-rotation to that of the original basis in (e).The correspondence between the initial and final Wilson loops becomes clearer when viewed in this way.

FIG. 9 .FIG. 10 .
FIG.9.Measuring S as a general permutation on a 8-layer system using two quantum Fourier transform gadgets and readout in the Fourier basis.The FT gadget can be implemented by a sequence of beamsplitter operations.

11 .
Wilson loop relations and charge conjugation.Dashed lines in the figures using top view represent anyons travelling to the bottom layer.(a) The double loop around the genon is considered to be contractible and equivalent to identity.(b) Derivation of the Wilson-loop relation that a loop is equivalent to the loop in the opposite layer with opposite direction.The relation in panel (a) has been used for the derivation.

FIG. 13 .
FIG. 13. ±2π/3 rotations combined with SWAPs inside the central patches on a C 3v symmetric geometry of genons implements modular T S −1 and ST −1 transformations respectively.

) Z 2
Toric code (Z 2 spin liquid): The complete set of Wilson operators are the spinon (e) and vison (m) loops on both cycles, satisfying the anti-commutation relation {W α e , W β m } = {W β e , W α m } = 0. We can choose the logical qubit basis as | n e n m β and the corresponding logical operators become Z 1,2 = W α e,m and X 1,2 = W β m,e .Modular S transforms the logical operators as S

√ 2 [
| a β + i| b β ], one can extract the imaginary part of the off-diagonal elements, namely Im β a | S | b β .
β a | (S + S † ) | b β = β a | (I + C)S | b β = c β a | (I + C) | c ββ c | S | b β .(H2) Since all the matrix elements β a | C | c β are already measured, one can hence infer β c | S | b β by measurements with the N(N+1) 2 possible combinations of a and b and solving the resulting N(N+1) 2 linear equation, where N is the number of topological sectors.

FIG. 14 .
FIG.14.Implementation of cavity-controlled-SWAP for the ancillabased Ramsey interferometry using the circuit QED architecture.Two layers of qubit arrays are illustrated here.Each blue rectangle encircles one qubit; patches A and B (A and B) include qubits to the left (right) of the red dashed line, in layer 1 and 2, respectively.The qubits in the lower layer are coupled to the cavity ancilla.All the couplings in this design are through the flux-tunable couplers.This allows time-dependent control of tunneling, which enables SWAP and beam-splitter operations between patches A and B (while A and B are untouched), as well as the dispersive interaction between qubits in patch B and the cavity ancilla.
Appendix I: Implementation of Control-SWAP with local in-Protocol for implementing R α S and S in a bilayer topological state with genons.The solid lines indicate twist defects (branch cuts) Table II and more detailed illustration in Appendix G.A notable result Toric code (Z 2 spin liquid) | n e n m β (2-qubit; n e Table II in the main text listed several examples of modular matrices and the mapping class group of high genus surfaces for different topological states.Here we briefly elaborate on some of the simplest examples.