Universal fault-tolerant measurement-based quantum computation

Certain physical systems that one might consider for fault-tolerant quantum computing where qubits do not readily interact, for instance photons, are better suited for measurement-based quantum-computational protocols. We develop a framework to map fault-tolerant procedures for quantum computation that have been natively designed for use with stabilizer codes onto a measurement-based protocol, allowing us to take advantage of the wealth of recent developments from the field of circuit-based fault-tolerant quantum computation with promising alternative architectures. We derive our framework by regarding measurement-based quantum computation as a specific case of gauge fixing where the gauge group of the underlying subsystem code is the union of the stabilizer group of a resource state and a single-qubit measurement pattern. To demonstrate our new framework we construct a new model of universal quantum computation based on the braiding and fusion of foliated topological defects that are akin to Majorana modes.


I. INTRODUCTION
Candidate quantum computational architectures must be capable of encoding and manipulating quantum information with its available qubits, while simultaneously identifying errors that may be introduced to the system as data is processed.The most suitable approach to perform these tasks should account for the shortcomings of the qubits of the system.Certain architectures where measurements are most readily performed destructively, for instance linear-optical quantum systems, are more amenable to measurement-based models of fault-tolerant quantum computation [1][2][3][4].
Small demonstrations of photonic measurement-based quantum computation have been carried out and reported in Refs.[5][6][7][8][9].Motivating the programme of research further, measurement-based quantum computation has also been considered as an attractive computational model for superconducting systems [10,11] and for quantum computation using trapped ions [12,13].To this end we look here to find new models of faulttolerant measurement-based quantum computation to support the development of such architectures.
The three-dimensional topological cluster-state model [14] is the prototypical design for fault-tolerant measurement-based quantum computation [15].With this model high-threshold universal quantum computation is achieved [16,17] by supplementing fault-tolerant Clifford gates with magic state distillation [18,19].In the original proposal [15], which is often likened to the surface code in a 2+1 dimensional spacetime manifold, logical Clifford operations are realised by braiding tube-like defects that lie within the cluster-state lattice.Braiding these defects realise non-trivial topologies in the manifold which correspond to different logical operations.
Notably, photonic implementations of the fault-tolerant cluster-state model are discussed in Refs.[20][21][22][23].Since the work of Raussendorf et al. it has since been shown [24], that we can transmit any Calderbank-Shor Steane(CSS) stabilizer code [25,26] through a specially chosen resource state using singlequbit measurements and classical post processing, and, recently, it was shown that sparse codes generated by this method can be decoded in Ref. [27].In Ref. [28] it was shown that lattice surgery [29][30][31] can be mapped onto a measurement-based computational model, thus offering an alternative to computation by braiding defects.See also recent work in Ref. [32] where the topological cluster-state model is generalised to find robust codes, and Ref. [33] where a new scheme for universal fault-tolerant measurement-based quantum computation is proposed based on the three-dimensional color code [34].
Owing to its high threshold error rates [16,17,35] and its experimental amenability the surface code [36,37] has become the cornerstone of modern designs for faulttolerant quantum computation.Recently, there have been a number of proposals [38][39][40][41] in the quantum errorcorrection literature that show how to deterministically perform the complete set of Clifford operations with the surface code.However, such schemes make use of twist defects [42], and to the best of our knowledge, there are no CSS variants of the surface code where the lattice supports a twist away from the boundary.This motivates the generalisation of code foliation [24], namely the process of mapping quantum-error correction schemes onto measurement-based computational models.
In the present work, we show how to propagate an arbitrary stabilizer [43] code through a resource state onto an output system via a measurement-based scheme.In addition to this we show how we can compose multiple foliated channels to implement fault-tolerant gates on an input system.We show that this enables us to realise the full Clifford group via fault-tolerant measurement-based quantum computation based on the surface code model.Together with state initialisation that we also discuss, we recover a universal set of quantum computational operations through magic state distillation.
Advantageous to our framework for foliation is that we can show that the output system, which takes the form of a stabilizer code, is determined simply from the input code and a second stabilizer code upon which we base the resource state we use to propagate the input system.Our model significantly simplifies the development of fault-tolerant measurement-based schemes for quantum computation, as we are able to overlook the intricate microscopic details to find the function of a given channel.Instead, we need only consider two codes that we are free to draw from the wealth of well-studied models in the quantum error-correction literature that has accumulated over the last two decades [44][45][46] to design new fault-tolerant measurement-based channels.With this simplification, not only can we show how to foliate general stabilizer codes, but we can also compose many foliated channels to realise non-trivial computational operations.
The remainder of this article is organised as follows.We begin by reviewing notation we use to describe quantum error-correcting codes in Sec.II.After introducing some basic notation we summarise the results of our paper and give a guide to the reader to parse the different aspects of our model in Sec.III.Then, in Sec.IV develop a microscopic model for the one-dimensional cluster state model as a simple instance of foliation, and we consider parity measurements between separate foliated qubits.In Sec.V we use the microscopic framework we build to show how a channel system can propagate an input stabilizer code unchanged.We explicitly demonstrate this by foliating the twisted surface code model.In Sec.VII we go on to show that we can manipulate input states with a careful choice of channel systems.We demonstrate this by showing we can perform Clifford gates and prepare noisy magic states with the foliated surface code before offering some concluding remarks.

II. QUANTUM ERROR CORRECTION
Here we introduce the notion of a subsystem code [47] that we use to describe the foliated systems of interest.A subsystem code is a generalisation of a stabilizer code [43,48] where not all of the logical operators of the code are used to encode logical information.The disregarded logical Pauli operators for each gauge qubit are known as gauge operators which have been shown to be useful for a number of other purposes [44-46, 49, 50].
A subsystem code is specified by its gauge group, G ⊆ P n ; a subgroup of the Pauli group acting on n qubits.The Pauli group is generated by Pauli operators X j and Z j , together with the phase i, where the index 1 ≤ j ≤ n denotes the code qubit the operator acts on.More precisely we have where 1 1 is the two-by-two identity matrix and P = X, Y, Z is a Pauli matrix.
The gauge group describes a code space specified by its stabilizer group where C(G) denotes the centralizer of a group G within P n which consists of all elements of P n that commute with all elements of G.With the stabilizer group defined we specify the code space as the subspace spanned by a basis of state vectors |ψ where By definition, the stabilizer group must satisfy −1 ∈ S.
We also consider a generating set of logical operators L = C(G)\G.The group L is generated by the logical Pauli operators X j , Z j with 1 ≤ j ≤ k, such that X j anti-commutes with Z k if and only if j = k.Otherwise all logical operators commute with one another.
The logical operators generate rotations within the code space of the stabilizer code.We will frequently make use of the fact that logical operators L, L ∈ L such that L = sL with s ∈ S have an equivalent action on the code space.This follows from the definitions given above.We thus use the symbol '∼' to denote that two operators are equivalent up to multiplication by a stabilizer operator.For instance, with the given example we can write L ∼ L.
It is finally worth noting that the special Abelian subclass of subsystem codes, namely stabilizer codes [43,48], are such that S = G up to phases.

A. Transformations and compositions of codes
It will be important to make unitary maps between subsystem codes.Given the generating set of two different stabilizer codes R and S with elements r ∈ R and s ∈ S, the stabilizer group T = R ⊗ S is generated by elements r ⊗ 1, 1 ⊗ s ∈ T .We also use the shorthand T = U S to define the stabilizer group where U is a Clifford operator.Of course, the commutation relations between two operators are invariant under conjugation by a unitary operator.

B. Expressing Pauli operators as vectors
For situations where one is willing to neglect the phases of elements of the stabilizer group, it is common to write elements of the Pauli group as vectors of a 2n-dimensional vector space over a binary field with a symplectic form that captures the commutation relations of the different elements of the Pauli group [48,51].We express Pauli operators in vector notation such that p = (p X p Z ) T where p X (p Z ) are vectors from the n-dimensional vector space over the binary field Z 2 and the superscript T denotes the transpose of the vector such that, up to phases, the Pauli operator We will frequently move between Pauli operators and the vectorised notation.It is thus helpful to define the function v : where vectors p X , p Z ∈ Z n 2 are such that up to a phase factor and we have defined the support of vector p, denoted |p|, as the set of elements of p that are non-zero.
Using this notation, we additionally have the symplectic form where, for two vectors p and q specifying two elements of the stabilizer group, we have where the summation is taken modulo 2 and 1 1 n is the n × n identity matrix such that Υ(p, q) = 0 if and only if Pauli operators p and q commute.We also define the inner product where addition is taken modulo 2.

III. FOLIATION
Quantum computation proceeds by using a series of channels where each channel maps its input nontrivially onto some output state [52].These channels are commonly known as gates, and with an appropriate composition of said channels we can realise non-trivial quantum algorithms.In this work we build a generic model that takes an arbitrary scheme of fault-tolerant quantum computation based on stabilizer codes, and provides a measurement-based protocol with that performs the same function.
Channels are readily composed by unifying the output of the last with the input of the next, so here we focus on developing a model of a single channel with an input and an output and a single designated function.Most important is that the channel is tolerant to errors, and as such we show that we can propagate quantum error-correcting codes through a channel in a fault-tolerant manner.While a foliated system is relatively straight forward to understand in comparison to its analogous circuit-based counterpart, its microscopic details can become quite obtuse without subdividing the system into constituent parts that depend on their function.In what follows is a macroscopic overview for the model of foliation we consider with some description of the function of each part.We conclude our overview with a reader's guide which outlines which subdivisions of the total system each section addresses.Nonetheless, the reader should bare the macroscopic structure presented in this section in mind throughout our exposition.

A. The model
We look to build a foliated system, denoted F. The channel consists of two components; a resource state, R, and a measurement pattern, M, that propagates the input state that is encoded within R onto the output system.The union of both M and R can be regarded as the generating set for subsystem codes.
The resource state is a specially-prepared many-body entangled state known as a graph-state that we describe in more detail shortly.The measurement pattern is a list of single-qubit measurements that are performed on the physical qubits not included in the output system.The measurement pattern is chosen specifically to move the input state through the resource onto the output system up to the data collected from the single-qubit measurements.In addition to this, the data obtained form the measurements is used to determine physical qubits that have experienced errors during the preparation of the resource state or during the readout process.
Abstractly, we can regard the foliation as a gaugefixing procedure where the foliated system is described by the gauge group where we use the symbol • ∪ • to denote the group generated by elements of both R and M. Foliation then is the procedure of preparing system the system R and subsequently fixing the gauge of F by measuring M. The preparation of R and choice of M determines the action of the channel, and the data we obtain to identify the locations of errors.
Advantageous to the model we present here is that, provided we choose a channel that is consistent with some stabilizer code in a sense we make precise shortly, and that we choose the graph state of the channel such that it respects some well-motived symmetry, we need only regard the input and the subsystem code implemented by the channel to understand the logical effect of the channel on the input system.The microscopic model we build on the other hand will indeed become helpful for the development of numerical simulations to test and compare different foliated systems.
We next briefly elaborate on the resource state R. The resource state can be decomposed into an entangled channel system K and ancilla qubits A together with a unitary operator U A which couples the ancilla qubits to the channel Supposing that R = K, the resource state will propagate the input system onto the output system provided no errors occur once the measurements are performed and interpretted.Once coupled to the channel, the ancilla qubits perform two roles upon measurement.First of all they are included to perform check measurements on the channel system to identify errors that may be introduced to the physical system.Their second role is to modify the input system through the channel as it progresses to the output system.This modification is analogous to code deformation in the more familiar circuit-based model of quantum computation [35,39,53,54].Later we will investigate how different choices of channel affect the transformation made on the input state.
The microscopic details of the channel system require careful bookkeeping; a system for which we introduce below, but broadly speaking, the channel system is a series of one-dimensional cluster states that propagates the input quantum error-correcting code.The one-dimensional cluster state can be used as a channel for a single physical qubit where a qubit is encoded on the first site of the system and measurements are performed to move the encoded qubit onto the last qubit of the chain.The channel system then uses a single one-dimensional cluster state for each qubit of the input code to move each of the code qubits onto the output system of each chain.Using a single chain to move each qubit of the input code thus provides a measurement-based channel for an entire quantum error-correcting code that may consist of many qubits.We discuss different approaches to for moving information through individual chains as this determines different ways we might choose to couple ancilla to the different chains to perform different functions throughout the channel.

B. A guide for the reader
The following exposition follows a number of avenues to help better understand foliated systems both at the microscopic and the macroscopic level, but ultimately all the sections have the model presented above in common.We thus provide a guide to help explain the aspects of the fault-tolerant measurement-based model we build over the course of this article.
The main results are stated most abstractly in Sec.V.This section states the general results we obtain, namely, we describe the action a given foliated system will have on an input code which is manifest at the output system once the data from the single-qubit measurement pattern has been collected and processed.The section also describes the check observables that are collected at the microscopic level of the foliated system that are used to identify the locations of errors.This will become important when discussing the error-correction procedure for the foliated system.
In order to understand the details of Sec.V we must first examine closely the one-dimensional cluster state t G in G out FIG. 1: Three resource states shown in red, blue and green are composed to map an input state onto the output state under a mapping determined by the different resource states.A temporal direction can be assigned such that the input system is input at the initial time and the output system emerges at the final instance.
that propagates qubits through an entangled system of physical qubits by means of single-qubit measurements.In Sec.IV we study the one-dimensional system and we build notation to describe parity measurements between qubits propagated through a series of one-dimensional cluster-states that make up the measurement-based channel for a quantum error-correcting code.The details presented in this section are necessary to understand the technical aspects of the proof we give in Sec.V.
Beyond Sec.V we look at specific instances of the general theory we develop.Indeed, in Sec.VI we examine the microscopic details of the foliated variant of the twisted surface code.This presents a non-trivial generalisation of the foliated models considered in Ref. [24] since there exists no CSS representation of this model.In Sec.VII we show at a logical level how we can compose different channels to realise fault-tolerant measurement-based quantum computation.We consider a model based on surface code quantum computation using code deformations as an example of our framework.
In Fig. 1 we show a schematic diagram of how faulttolerant measurement-based quantum computation will proceed.The figure shows the composition of three channels, each of which perform a different operation.The system is measured such that the logical data is mapped from the input system to the output system, under an operation that is determined by the choice of different resource states.Each of the sections describe how to produce different channels that can be composed to realise measurement-based quantum-computational protocols.

IV. FOLIATED QUBITS
Measurement-based quantum computation proceeds by performing single-qubit measurements on a specially prepared many-body entangled state.We begin by focusing on a one-dimensional cluster state which propagates a single-qubit along a line.
To foliate a quantum error-correcting code we first encode each of the code qubits of a quantum error-correcting code onto a separate one-dimensional cluster state.We can propagate the quantum error-correcting code through this collection of one-dimensional chains from one end to the other via single-qubit measurements.To this end we examine here the one-dimensional cluster state and show how to move quantum information along the chain by making different types of single-qubit measurements on the physical qubits of the system.We additionally show how to perform parity measurements between several chains using additional ancilla qubits.
A. The one-dimensional cluster state The cluster state is readily described using the stabilizer formalism introduced above.However, while discussing the cluster-state wire we will denote Pauli matrices acting on the physical qubit indexed µ with operators σ X [µ], σ Y [µ] and σ Z [µ] to discriminate them from Pauli matrices that act on the code qubits of the input and output quantum error-correcting code.Similarly, the logical operators of the cluster state are denoted X, Y and Z without the bar notation for the same reason.The logical qubits of the one-dimensional cluster-state wire will become the code qubits of foliated stabilizer codes as this discussion progresses.To this end, wherever there is ambiguity, we will refer to the qubits that lie in a cluster state as 'physical qubits'.These qubits are not to be confused with the 'code qubits' of a quantum error-correcting code.
To describe the cluster state we first consider the initial product state |ψ 1 |+ 2 |+ 3 . . .|+ N where |ψ is an arbitrary single-qubit state, the states |± are eigenstates of the Pauli-X matrix, i.e., σ X |± = (±1)|± .We can express this state with the stabilizer group whose logical operators are X = σ X [1] and Z = σ Z [1].The cluster state, whose stabilizer group we denote as K = U I, with U defined as where is the controlled-phase gate.The unitary operator U couples nearest-neighbour pairs of physical qubits along the open chain.
The following facts about the controlled-phase gate are helpful throughout our exposition.We firstly note that operators U Z [µ, ν] and σ Z [ρ] commute for an arbitrary choice of µ, ν and ρ.Moreover, U Z [µ, ν] and U Z [ρ, λ] commute for any µ, ν, ρ and λ.Further, the Hermitian entangling gate satisfies the relationship We also have that With the above definitions it is readily checked that K is generated by operators for 2 ≤ µ ≤ N − 1 and the stabilizer The logical operators that act on the encoded qubit are We show examples of a stabilizer operator, and the logical Pauli-X and Pauli-Z operator in Fig. 2. We point out that, as is common when describing cluster states, we use a graphical notation to describe states of interest.In particular, pairs of qubits that are coupled via a controlled-phase gate are connected by an edge of a graph where each qubit is represented by vertex.
The goal of the one-dimensional cluster state is to transport the logical information along the chain onto the last qubit, indexed N .To do so we make single qubit measurements on all of the qubits except qubit N .We study two different types of foliated qubits.The first, which is already well understood in the literature, transmits information by measuring the physical qubits in the Pauli-X basis, and the second, which does not appear in the literature to the best of our knowledge, moves information using Pauli-Y measurements.We refer to these two foliated qubits as type-I and type-II foliated qubits respectively.While we find that using type-I qubits is sufficient to realise any foliated system of interest within the scope we set here, we believe that there may be practical advantages to be gleaned using type-II qubits in a foliated scheme.As such we dedicate an appendix to the type-II foliated qubit in App.A and we discuss their potential applications throughout our exposition.For simplicity though we focus only on type-I foliated qubits in the main text.
FIG. 3: The logical operators of the one-dimensional cluster state after and before the first qubit is measured in the Pauli-X basis.In (a) we show the logical Pauli-X operator and in (b) we show the logical Pauli-Z operator after the first qubit is measured, and the measurement outcome x1 is returned.Importantly, after the measurement the logical Pauli-X operator is a single-qubit Pauli-Z operator on the second qubit, whereas the logical Pauli-Z operator is supported on two physical qubits.In contrast, before the measurement the logical Pauli-Z operator is supported on a single qubit, where as the logical Pauli-X operator is a weight-two operator.We show the logical Pauli-X and logical Pauli-Z operator in (c) and (d), respectively.

B. Measurement-based qubit transmission
We review here a foliated qubit where the physical qubits of the entangled chain are measured in the Pauli-X basis whose stabilizer group is K as defined above.We first look at the action of measuring the first physical qubit of the system.In particular we are interested in the action of the measurement on the logical operators.This action is easily understood by finding logical operators that commute with the measurement.We find logical operators that commute with the measurement operator M 1 = σ X [1] by multiplying the logical operators by stabilizer operators.We find that the logical operator commutes with σ X [1].Similarly X, as defined above, commutes with the measurement operator M 1 .After making the measurement we project the code such that we have a new stabilizer The stabilizer C [2] is removed from K. Having accounted for the measurement outcome we can also disregard the first qubit of the chain since the projective measurement has disentangled it from the rest of the system.
It is important to note that the logical operator X, up to the sign determined by the measurement outcome, is now a single-qubit Pauli-Z operator acting on the second qubit.In contrast, before the measurement, the logical operator Z that was a single-qubit Pauli-Z operator acting on the first qubit has now become a weight-two operator acting on the second and third physical qubits along the chain.We show the logical Pauli-X and Pauli-Z operators after the first qubit has been measured in Figs.3(a) and (b).We compare these logical operators with the same logical operators before the measurement has taken place in Figs.3(c) and (d), respectively.
The advantage of measurement-based quantum computation lies in the fact that once the resource state is prepared, quantum information can be transmitted and processed by performing single-qubit measurements on qubits of the resource state.Supposing then that we can only make single-qubit measurements, we see that we can measure the logical operator Z with the single-qubit measurement σ Z [1] on the first qubit.Conversely, to infer the value of X, we measure the first qubit in the Pauli-X basis, and the second qubit in the computational basis.We thus see that we can learn either the logical Pauli-X or Pauli-Z information from the cluster state by measuring the appropriate physical qubit in the Pauli-Z basis, and the qubits that preceded it in the Pauli-X basis.Alternatively, were we to measure both qubit 1 and qubit 2 in the Pauli-X basis, we would have moved the logical information along the chain without having inferred any logical data.
To find a general expression for the logical operators, suppose we have measured the first τ − 1 physical qubits in the Pauli-X basis which returned outcomes x µ = ±1 for µ < τ .We then have that for even τ and where τ is odd.With this, we see that we can learn the logical Pauli-X information using single-qubit measurements on sites where τ is even and logical Pauli-Z information on sites where τ is odd, given that we have outcomes for the physical Pauli-X measurements made on the first τ − 1 qubits.To this end, we find that it is particularly convenient to use a new notation to index the qubits of the chain.We define such that now we can rewrite the logical operators of the system such that for any t, where the operators Importantly, the operators Σ X (t) and Σ Z (t) are the tensor product of the Pauli-X matrix.This means these operators are inferred from the single-qubit measurement pattern if all the qubits along the chain are measured in the Pauli-X basis as is the case for type-I foliated qubits.The above redefinition of indices is such that at each 'time' interval, indexed by t, we can recover either the logical Pauli-X or Pauli-Z information from the chain with a single-qubit Pauli-Z measurement provided the previous qubits along the chain have been measured in the Pauli-X basis.Specifically, each interval contains two adjacent qubits of the chain, the first, which lies at site τ = 2t − 1, gives access to the Pauli-Z information via a single-qubit measurement, and at every second site, τ = 2t, we can learn logical Pauli-X information with a single-qubit Pauli-Z measurement.We show the logical operators at a given time interval in Fig. 4.

C. Measurements using ancilla
We have thus far imagined replacing the single-qubit Pauli-X measurement on some appropriately chosen qubit with a Pauli-Z measurement to perform logical measurements on the propagated information.To develop foliated codes further we will require the ability to perform logical measurements without adapting the measurement pattern of the foliated qubits.Instead we couple extra ancilla qubits to the system to learn logical information at a given time interval.
To show how to make a logical measurement of a onedimensional cluster state with an ancilla we consider the resource state R = U A (K ⊗ A), as we have introduced in Eqn.(10), where the channel K is the one-dimensional cluster state described above and A = σ X [a] describes the stabilizer group of a single ancilla qubit we couple to K with unitary U A which we specify shortly.We use the elements of A to measure logical information from K.
We must specify a measurement pattern to carry out the propagation of information, as well as the single-qubit measurement we make on the ancilla to learn logical information from the resource state.We write the pattern of measurements where M C (M A ) describes the measurements made on subsystem K(A).For the case of type-I foliated qubits discussed previously we have N −1 µ=1 .After the measurements are performed the resulting quantum information is maintained on the output qubit which is the last qubit of the chain.
Logical operators of the resource state, P ∈ L = C(R)\R, are measured if P ∼ P ∈ M. For now we choose M A = σ X [a] to this end.In this example we couple the ancilla to the target qubit indexed T = P (t) with unitary U A = U Z [T, a] to perform a logical measurement P ∈ L where P = X, Z is a logical Pauli operator.
We check that P ∈ M by studying the stabilizer group of the resource state R. The state has stabilizers and Now, using that P ∼ P = Σ P (t)σ Z [P (t)] we have provided as prescribed, thus giving the desired logical measurement at time interval t once the resource state is measured with measurement pattern M.
We additionally find that we can measure the logical Pauli-Y information from a type-I foliated qubit using an ancilla-assisted measurement.We achieve this by coupling the ancilla to multiple target qubits.To show this we continue with the resource state model R given in Eqn.(10) where again we have A = σ X [a] and K is a one-dimensional cluster state.The chain is measured as a type-I foliated qubit such that µ=1 , and we couple the ancialla to the chain with the unitary From the discussion given, we have that the operator i Σ The logical Pauli-Y operator on a type-I foliated qubit where the blue ancilla qubit is coupled both to qubits Z(t) and X(t) of the chain.The logical operator commutes with the measurement pattern where all of the qubits along the chain are measured in the Pauli-X basis, and the ancilla qubit is measured in the Pauli-Y basis, thus allowing us to recover Pauli-Y data from the foliated qubit.
the logical Pauli-Y operator for K.It is then readily checked then that is a representative of the logical Pauli-Y operator of R using the expressions given in Eqns.( 12) and (24).Then using the stabilizer C[a] ∈ R where, we find that iXZ which is depicted in Fig. 5, thus showing we can infer the logical Pauli-Y data of a type-I foliated qubit from M by coupling to multiple targets.We finally remark that one can show that the resource state with where T 1 = X(t 1 ) and T 2 = Z(t 2 ) such that t 1 = t 2 , we also recover encoded Pauli-Y information.We do not require this degree of generality here so we leave the proof of this fact as an exercise to the reader.We conclude this subsection by summarising the differences between type-I foliated qubits considered here and the type-II qubits discussed in App. A. Indeed, here we have shown that we can make a Pauli-Y measurement with a foliated qubit by coupling an ancilla to two target qubits.In contrast, following an argument similar to that given above, by measuring the physical qubits of a foliated chain in the Pauli-Y basis instead of the Pauli-X basis we find that we can measure the Pauli-Y operator by coupling an ancilla to a single qubit.This comes at the expense of including three qubits at each time interval instead of two, as is the case with type-I foliated qubits.As such, the physicist that is looking to perform a measurement-based experiment that demands a significant number of Pauli-Y measurements should decide carefully whether type-I or type-II foliated qubits are the most appropriate depending on whether the number of physical qubits or generating interactions between pairs of physical qubits is the most precious commodity of a given laboratory.

D. Parity measurements with foliated qubits
In general it will be necessary to make parity measurements between several foliated qubits that are encoded on different chains.We now specify the channel of a resource state consisting of several foliated qubits, together with its ancilla system to which it is entangled that affects the obtained logical measurements.More precisely we consider the resource state R = U A (K ⊗ A) , of n foliated qubits.As in the previous section, for now we consider a single ancilla prepared in a known eigenstate of the Pauli-X basis.The channel of the resource state is such that and K j = U j I j is the stabilizer group of the j-th onedimensional cluster state of length N j as defined in Subsec.IV A. It will also become helpful later on to define the unitary operator that entangles the initial state to give the channel system, namely where ].This will be helpful where we consider variations on the initial state I = n j=1 I j .One could choose the length of each cluster arbitrarily but for simplicity we suppose that all the type-I chains have an equal length N j = 2D + 1 where D is the number of time intervals and we include an additional qubit at the end of the chain to support the output of each foliated qubit.
The logical operators of K j are denoted X j and Z j , and its physical qubits are indexed X j (t) and Z j (t) according to Eqn. (22) where indices have been appended.Again, we have for logical operators P j = X j , Z j such that with respect to the stabilizer group K.For now we consider the ancilla system that includes only a single ancilla qubit, i.e., A = σ X [a] .The measurement pattern for the foliated system where M C j is the set of single-qubit measurements acting for the cluster K j .We have that M for type-I foliated qubits.We determine the measurements we make on the ancilla system, M A , depending on the choice of parity measurement.We look to prepare R such that we measure the logical Pauli operator P ∈ P n by measuring the ancilla qubit in an appropriate basis.We thus couple the ancilla to the channel to construct R as such with unitary where p = (p X p Z ) T such that p = v(P ) as defined in Eqn.(5).Again, for simplicity, we have coupled the ancilla to the physical qubits of a common time interval t, but showing our construction is general beyond this constraint is straight forward.In fact, as we will observe, we find practical benefits from coupling an ancilla to physical qubits in different time intervals later in Sec.VI.Upon coupling the ancilla to the channel system to form the resource state will include the stabilizer We additionally have logical operators of the resource state and which follows from Eqn. (12) and the definition of the logical operators of the channel system K shown in Eqn.(33) where p Z j is the j-th element of the vector p Z .Combining the above expressions we find P ∼ P such that FIG. 7: Two type-I foliated qubits where we use the ancilla to measure the parity of the two foliated qubits in the Pauli-Y basis.The ancilla is coupled to an X(t) and a Z(t) target for each qubit.We measure the ancilla is the Pauli-X basis, since there are an even number of Pauli-Y terms in the parity measurement.
It follows then that thus showing we can infer the logical operator P from the measurement data given an appropriate choice of measurements M. To the left of Fig. 6 we show the element P ∈ M with P ∼ P = X 1 X 2 measured from a pair of type-I foliated qubits.We also show a parity check P ∈ M in Fig. 7 such that we measure P ∼ P = Y 1 Y 2 .In this case the ancilla qubit couples with each foliated qubit twice to include Pauli-Y terms in the check.

E. The compatibility of parity measurements
Having now discussed how to include a single logical measurement in the foliated system, we next investigate the conditions under which we can simultaneously measure two degrees of freedom of the input system, P and Q where P, Q ∈ P n .
We now consider a resource state R with two ancillas A = σ X [a] , σ X [b] that are coupled to the channel K = j K j at time intervals t and t , respectively, via unitary and where p = v(P ) and q = v(Q).The measurement pattern is chosen according to the rules above such that the chosen parity measurements are made correctly.In any case ancillas a and b are measured in either the Pauli-X or Pauli-Y basis.We first suppose that t = t, and afterwards we look at the more complicated case where t = t .As we will show, we find that we can can measure both P and Q simultaneously from the logical space of the channel provided P and Q commute.While the setup presented above is sufficient if both U a and U b are coupled to the channel at two different time intervals, we find that in certain situations it is necessary to modify U A in order to measure both P and Q with a coupling at a common time interval.Without loss of generality we begin with the case where t < t such that P as in Eqn.( 40) is an element of R since this operator shares no common support with U b .The resource state additionally includes the representation of the logical operator where we take which follows from the inclusion of the term To determine the value of Q we are interested in the commutation relations between the operator U a and the operators Σ X j (t ) and Σ Z j (t ) which share mutual support on the physical system.Using Eqns.( 12) and ( 33) it follows that and where Υ(p, q) is given in Eqn.(7).In this case, for Υ(p, q) = 0 we must measure ancilla a in the Pauli-Z basis in order to infer the value of Q from the measurement pattern.On the other hand, to measure P we must measure ancilla a in either the Pauli-X basis or the Pauli-Y basis to infer its value from M. The conclusion of this discussion is that we cannot infer both measurements P and Q from M unless Υ(p, q) = 0 in order for them to be measured simultaneously from the logical space of the channel.This is consistent with the standard postulates of quantum mechanics which only permits the simultaneous measurement of both P and Q provided the operators commute.
We next consider the case that t = t .In this case we have that and Unlike the previous case though, U a and U b commute with Σ Z j (t) terms.To this end we find that and where M [a] and M [b] are either Pauli-X or Pauli-Y measurements.We thus see that with the current choice of U A the measurements of both P and Q are incompatible unless both p X • q Z = 0 and p Z • q X = 0; conditions which ensures that P and Q commute.Indeed, if We also find that is it possible to modify the channel to measure two commuting operators, P and Q.One approach to deal with this issue, as we have already discovered, is to measure the two operators at different time intervals.A smaller modification may simply be to change only a subset of the target qubits of either U a or U b onto a different time interval.We present an example where we use this method to good effect in the following Section.Alternatively, we can include an additional controlled-phase gate, U Z [a, b], in the entangling circuit U A which also recovers the compatibility of the two commuting measurements.

V. THE FOLIATED SYSTEM
Having discussed how to propagate logical information along a one-dimensional cluster state, and how to make parity measurements between the logical qubits encoded over several chains, we are now ready to define the foliated channel; the system that will propagate an input quantum error-correcting code onto an output state.Further, we will also see that with a suitable choice of resource state we are able to measure the input state in such a way to deform the code with the foliated system.In what follows we sketch out the different components we use to make up a foliated system before presenting two theorems that describe its function.Specifically, we will require definitions of the initial system, the channel system, the resource state and the system after the the prescribed pattern of measurements is made.Theorem. 1 then explains the action of the foliated system on the logical input state, and Theorem. 2 describes stabilizer checks we can use to identify errors that act on the physical qubits of the foliated system.See Ref. [55] for a related discussion from the perspective of code deformations with stabilizer codes.The construction is summarised in Fig. 8.
As described in Sec.III, the foliated system is defined as where R is the resource state, and M is the measurement pattern.The system F is jointly determined by an input code G in and a channel code G ch. Also to be determined is the length of the channel D, which, unless otherwise stated, we suppose is large, i.e. comparable to the distance of the code G ch. .We assume that both codes G in and G ch. are stabilizer codes and, moreover, are supported on the same set of qubits that we index 1 ≤ j ≤ n.
The resource state is of the form R = U A (K ⊗ A) where K is the channel system and A is a set of ancilla qubits prepared in a product state that we couple to the channel with unitary operator U A .The channel K is specified by G in .The ancilla system A and the entangling unitary U A are determined by a generating set of G ch. .We remind the reader that we index the qubits of each chain in terms of time intervals, indexed 1 ≤ t ≤ D, such that the qubit at the 2τ − 1-th site (2τ -th site) of the j-th chain is indexed Z j (t) (X j (t)) and we have that the last qubit of each chain is indexed Z j (D + 1) = 2D + 1 in the Pauli coordinate system which supports the output state.
Previously we have considered the tensor product of n one-dimensional cluster states, n j=1 K j , where K j = U j I j , to propagate n individual qubits described by logical operators X j and Z j for 1 ≤ j ≤ n.In the following definition of the channel system we encode the input code G in onto the logical qubits of the n foliated qubits.
Definition 1 (Channel system).The channel system K = U C I is produced by applying unitary operator U C as defined in Eqn.(32) to the initial state I.The stabilizer group I is such that the stabilizers of G in are encoded on the qubits indexed Z j (1), and the other qubits are prepared in a product state.Explicitly, for each G ∈ G in we have G in ∈ I with where (g X g Z ) T = v(G).The other qubits of I are encoded in the +1 eigenvalue eigenstate of the Pauli-X matrix, such that we have and The resource state is generated by coupling ancilla qubits to the channel.Measuring these qubits in the appropriate basis provides data to identify qubits that have experienced errors.We couple ancilla to the resource state in a fashion according to a particular generating set G R of some gauge group G ch. .The generating set G R may be an over complete generating set of G ch. .Definition 2 (Resource state).For a choice of input code G in that is implicit in the channel system K, see Def. 1, and channel code G ch. with a specified generating set G R , we define the stabilizer group of the resource state by where the ancilla system A and entangling unitary U A are defined as follows.The ancilla system is in the product state where the coordinates G(t) uniquely index all the ancillae in the ancilla system at a given time interval t.The entangling unitary U A is given by where where (g X g Z ) T = v(G) and (h X h Z ) T = v(H).
We remark that in the above, the unitary U A couples the ancilla qubits to the channel system along with each other.The component V enables the simultaneous measurement of all commuting measurements of G ∈ G R at common time intervals (as per the discussion in Sec.IV E).
We specify a measurement pattern that propagates information through the resource state onto the output system while additionally acquiring data that enables us to identify the locations of errors.
Definition 3 (Measurement pattern).The measurement pattern is such that where M C and M A denote the measurements on the channel and ancilla system, respectively, given by (62) where (g X g Z ) T = v(G) and we have It may be helpful to expand Eqn. ( 63) such that and we remember the inner product is taken modulo 2.

A. Foliation
With the resource state and measurement pattern defined above we now turn our attention to the foliated system F. Important properties of the system will be determined from elements in C(F).While we have introduced the foliated model as a subsystem code, we have included additional structure to capture the process of foliation, namely, we prepare the system in a fixed gauge of the resource state, R and we project the system onto a gauge of M. As such, elements of C(F) have a different role depending on their inclusion in R and M.
Elements C(F) ∩ M are observable degrees of freedom that are measured under projection by the single-qubit measurement pattern.Among these include stabilizer operators and logical operators of the input state that are measured by the resource.On the other hand elements C(F)\M give rise to the stabilizers and logical operators of the output state which are propagated or inferred at a later point by taking the output as the input of another channel.Further, we can also look at elements of C(F) with respect to their membership of R. Indeed, elements C(F) ∩ R are stabilizers whereas elements C(F)\R are logical degrees of freedom that are either propagated through the resource state or measured under the projection.
Remarkably, due to the decomposition of the foliated system we have presented here we can separate error correction, determined by stabilizer group S, and the logical function of a given channel, G out , into two separate parts.Let us now characterize the output state of the foliated system after measurements have been performed, as well as the stabilizers of the channel responsible for detecting errors.
The output of the channel consists of an encoding, determined by G out , and a set of logical operators L out .The logical function of the channel can be summarised by how it maps input logical operators to output logical operators.The following theorem describes the output encoding and logical degrees of freedom.
Theorem 1.For any foliated channel F determined by input code G in , channel code G ch. , the output state is a codeword of the output code G out , with The logical operators of G out are given by Further, elements of (C(G in )\G in ) ∩ G ch. are measured.
The two equations given above specify precisely the function of a channel at a macroscopic level, independent of the foliated system that performs the manipulation of the input state.
For the channel to be fault-tolerant, we need the channel to contain stabilizers that can check for errors, and these stabilizers need to be able to be inferred from measurements.Recall the stabilizer of the foliated sytem is given by The following theorem identifies two types of important operators that we call bulk stabilizers and boundary stabilizers.
Theorem 2. For any foliated channel F specified by input code G in and G R which generates G ch. , we have where for v(G) = (g X g Z ) T we have where ξ(G) ⊆ G R is defined such that the product of all the terms of ξ(G) give G ∈ G ch. .We remark that the set ξ(G) necessarily exists by definition, since we construct the resource state with terms G R which generates G ch. .However, ξ(G) is not necessarily unique, in which case any choice will suffice.We defer the proofs of the above Theorems to Appendix B.
It is also worth pointing out that Theorem 2 may not necessarily describe the stabilizer group of F exhaustively.Indeed, with certain choices of G R we can obtain additional elements of C(F) ∩ F. For instance, we may choose to foliate a self-correcting stabilizer model [45] such as the four-dimensional toric code [37].In which case we have additional checks that are local to a given time interval due to constraints among the stabilizer group.It is precisely the constraints that these models present that give rise to single-shot error correction [56][57][58][59][60] which enable us to identify errors on the ancillary qubits we use to make checks, see also Appendix ?? for a discussion on single-shot error correction by foliation of the gauge color code.The stabilizers we have described in Theorem 2 are generic to all foliated models using the construction we have presented.
In the following section we apply the above to theorems to the twisted surface code model as an illustrative example that we later use in our model of faulttolerant quantum computation.We note that the above construction and theorems are readily generalised to include other methods of foliation including foliation using type-II qubits as we will see in the next section and Appendix A, and compressed foliation, Appendix C. Our scheme for foliation and related results also generalise to subsystem codes provided they are generated by a group with particular properties.For instance, our results apply to all CSS subsystem codes.We give a discussion of this extension in Appendix D.

VI. THE TWISTED SURFACE CODE
The twisted surface code [40] provides an interesting example of a stabilizer code that cannot be foliated using existing constructions [24].Moreover this example will be helpful later on when we consider different schemes for fault-tolerant measurement-based quantum computation.We will briefly review the stabilizer model before showing resource states for the foliated model.
The stabilizer group for the twisted surface code are closely related to those of the surface code.However the model has an impressive encoding rate due to a twist defect [42] lying in the centre of the lattice [39,40].Nonetheless, due to the central twist defect we cannot find a CSS representation of the model, and as such, we FIG. 9: The twisted surface code model.Examples of star and plaquette operators are shown explicitly on thick outlined plaquttes on a blue and yellow face respectively.Logical operators are supported on the qubits followed by the yellow and blue dotted lines.A defect line runs from the right-hand side of the lattice to its centre.An example of the modified stabilizers that support the defect line is shown at (a).The green line terminates at the centre of the lattice.We write the stabilizer where the defect line terminates below the lattice at part (b).We focus on foliating the stabilizers that lie on the defect line, as such we number them explicitly with indices shown in black circles on the figure .require the generalised construction for foliation given above.We will mostly focus on these stabilizers.The stabilizer group for twisted surface code G twisted is represented on the lattice in Fig. 9 where qubits lie on the vertices of the lattice and stabilizers are associated to the faces, indexed f .On blue(yellow) faces we have the well-known star(plaquette) operators which are the tensor product of Pauli-X(Pauli-Z) operators lying on the vertices on the corners of their respective face.The twisted surface code additionally has a defect line running from the right-hand side of the lattice to the centre, along which, stabilizers are modified.The stabilizers lying along the defect line, which is marked green in the figure, are weight-four terms that are the tensor product of Pauli-X(Pauli-Z) stabilizers on the blue(yellow) part of the face.An example of a modified stabilizer is shown in Fig. 9(a).The stabilizer where the defect line terminates also includes a Pauli-Y term as shown in Fig. 9(b).Representations of logical operators X(Z) that act on the one encoded qubit are the tensor product of Pauli-X(Pauli-Z) operators supported on the dotted blue (yellow) lines on the lattice.
We now consider foliating the twisted surface code with the prescription given in the previous section where G ch. = G twisted .Stabilizers of the form of a CSS code, i.e. stabilizers where either g X or g Z are the null vector where (g X g Z ) T = v(G) for G ∈ G twisted , are foliated using the methods of Ref. [24] and take the form of those in the original works [15][16][17], as such we focus on the terms that lie along the defect line.In Fig. 10 we show the resulting graph where physical qubits indexed Z j (t)(X j (t)) are coloured black(red) in the figure and time runs ver- FIG. 10: A foliation pattern for the defect line of the twisted surface code.The code is initialised at the bottom of the figure where the lattice that describes the stabilizers of the code are shown.Qubits that are coupled with a controlled-phase gate are connected by an edge.Qubits indexed Zj(t)(Xj(t)) are coloured black(red), and ancilla qubits are coloured in blue(green), depending on whether they are measured in the Pauli-X(Pauli-Y) basis.Example elements S bulk (as in Theorem 2) which belong to C(F) ∩ R ∩ M are also shown.
tically up the page.
We denote the stabilizers lying along the defect line G f ∈ G twisted where we index face terms 1 ≤ f ≤ L as shown in Fig. 9.We consider vectors v(G f ) = (g X f g Z f ) T .Notably, the stabilizers that lie along the defect line all have g X f • g Z f +1 = 1.As such the operator couples adjacent ancilla qubits.These bonds are shown as horizontal edges connecting adjacent blue ancilla qubits in Fig. 10.Further, the stabilizer G 1 is such that g X 1 • g Z 1 = 1, we therefore measure these ancillas in the Pauli-Y basis, i.e., σ Y [G 1 (t)] ∈ M. We color these ancilla qubits in green in Fig. 10.
The figure also shows two stabilizers, i.e., elements of S = C(F) ∩ R ∩ M of the form shown in Eqn.(68).The stabilizers are weight six, except the stabilizer at the centre of the lattice which includes a Pauli-Y term.This operator is weight seven.
We finally remark that the resource state we have thus far considered is by no means unique, and using the foliation techniques considered in the previous section we can devise other, arguably favourable, resource states.In FIG. 11: Resource state where we change the time interval of some of the targets of certain ancilla qubits as is described in the main text.Qubits indexed Xj(t), Yj(t) and Zj(t) are coloured red, green and black, respectively, and ancilla qubits are shown in blue.We also show the type-II foliated qubit in blue.No physical qubit has more than four incident edges.Two elements of C(F) ∩ R ∩ M are shown.
where now the check couples to targets Z j (t + 1) instead of Z j (t).With this modification all the checks are compatible where we set V = 1, thus reducing the valency of the ancilla qubits.We additionally replace the foliated qubit where the defect terminates with a type-II foliated qubit, which is coloured by blue edges.This further reduces the valency of ancillas used to measure operators S 1 (t) as we need only couple to a single target to measure the Pauli-Y component of this check.This also reduces the valency of the physical qubits of the type-II foliated chain.However, this comes at the expense of including an additional physical qubit per time interval to include a type-II foliated qubit in the system.
To summarise the present discussion we have seen that we can introduce Pauli-Y terms in stabilizer measurements either by using type-II foliated qubits or by coupling an ancilla to multiple targets of the same foliated qubit, and we have seen that in general we can periodically measure a full set of check measurements by either lifting the targets of selected check measurements to higher time intervals or by coupling pairs of ancillas where it is appropriate.The examples of resource states we have considered here are by no means exhaustive and other variations can be made following the general principles of foliation given in the previous section, but given the multitude of variations one could come up with we leave further experimentation to the reader.One variation we have considered [61] is where checks are made at intermediate time intervals where we couple additional ancilla to physical qubits at layers indexed X j (t) and Z j (t + 1).This increases the number of ancilla qubits required along the defect line, and increases the valency of the physical qubits along each foliated wire, but in return we reduce the weight of the check operators and increase the number of available check operators.We summarise this compressed construction in Appendix C.

VII. QUANTUM COMPUTATION WITH THE FOLIATED SURFACE CODE
In what follows we explore the general theory we have established here by following the example of the foliated surface code.This model is a CSS stabilizer code and is thus foliated using the methods in Ref. [24] and has been studied from the perspective of computation in Refs.[16,17,28].Beyond the work in the literature, using the generalised framework for foliation we have presented, we can additionally realise a phase gate deterministically in the foliated picture using ideas from Refs.[39,40].In particular, in Ref. [39] it was shown that the corners of the planar code where two distinct types of boundary meet can be regarded as a Majorana mode.Throughout the discussion we give here we extend this analogy [42,[62][63][64][65] further.
We see that, in the spacetime picture provided by a foliation, that the corners of the planar code extend to world lines of Majorana modes.We find that the worldlines of the Majorana modes that live at the interface of different boundaries follow the trajectories we would expect if we were to realise fault-tolerant topological quantum computation by braiding Ising anyons [62,[66][67][68][69][70][71].We show this analogy in a macroscopic picture in Fig. 12 where we show the foliated planar code [24,37].The planar code has rough boundaries and smooth boundaries, that appear as faces of the foliated system as they are extended along the time axis.The figure shows the different boundaries in blue and yellow.At the interface of the different boundary types we see the world line of a Majorana mode.In this picture the modes move vertically upwards with no horizontal motion.This is because with this channel we execute an identity gate.In what follows we show that generalising the picture of foliation allows us to braid and fuse Majorana modes in the spacetime model.We see this by explicitly considering the initialisation of arbitrary states, with lattice surgery by foliation, and by performing a fault-tolerant phase gate.

Initialisation
In order to realise fault-tolerant universal quantum computation with the surface code we require the ability to generate eigenstates of non-Pauli matrices for magic state distillation [18].This is similarly true for computation with the fault-tolerant cluster state model [16,17].State initialisation by measurements with the surface code has been considered in Refs.[30,72,73].The work on initialisation is readily adapted for the inputoutput model of fault-tolerant measurement-based quantum computation we have developed above.
Common to all of the references on initialisation, the At the interface between the rough and smooth boundaries we see the world lines of Majorana modes, depicted by thick red lines.The four modes that encode the qubit move directly along the temporal axis, and as such do not nontrivially manipulate the encoded state over the channel.
qubits that go on to form the surface code begin in some easily prepared state, such as a product state, which are then measured with the stabilizers of the desired code.In Fig. 13(a) we show the initial state we prepare in order to initialise the surface code in an arbitrary state as given in Ref. [72].Qubits in the green(blue) boxes are initialised in known eigenstates of the Pauli-X(Pauli-Z) basis, and the central red qubit is prepared in an arbitrary state.By including this state as the stabilizer group S I of the initial state I, and the stabilizers of the surface code as the stabilizers measured through the channel, S C , we recover the graph state shown in Fig. 13(b).The figure shows the input state on the layer closest to the reader and the time axis of the foliated model extends into the page.The qubits are coloured using the convention in earlier sections where black(red) vertices mark qubits with indices Z j (t)(X j (t)) and the blue vertices show ancilla qubits.The central green qubit is prepared in an arbitrary state.All of the qubits are measured in the Pauli-X basis One could alternatively prepare the green qubit in a known eigenstate of Pauli-X and measure the green qubit in an arbitrary basis, the output will be the same..To help the qubits of the input system stand out we colour the edges that connect them in light blue.
All of the qubits support check operators except the central qubit that is prepared in an initial state, we show examples of elements of C(G) in the figure.We do not draw qubits that were initialised in an eigenstate of the Pauli-Z operator.Indeed, these states respond trivially to the action of the operator U which is diagonal in the computational basis, and as such these qubits do not entangle nontrivially with the resource state.We are therefore free to neglect them.
It is interesting to view initialisation from the macroscopic viewpoint.The initial state shown in Fig. 13(a) are chosen such that both a logical Pauli-X and a logi- FIG. 13: The input state to encode an arbitrary state.(a) The initial product state used to initialise the surface code from Ref. [72].Qubits lie on the vertices of the graph, and star(plaquette) operators lie on the blue(yellow) faces of the lattice.The system is initialised in a product state where all the qubits within the dark green(blue) boxes begin in the +1 eigenvalue eigenstate of the Pauli-X(Pauli-Z) operator, and the central red qubit is prepared in an arbitrary state.Measuring the stabilizers shown on the lattice initialise the code in the state of the central qubit.(b) The graph state showing initialisation where the initial state shown in (a) lies at the front of the figure, and the time axis of the foliated system extends into the page.Qubits initialised in an eigenstate of the Pauli-Z operator are not drawn, as these qubits do not entangle with the resource state.Examples of check operators (elements of C(F) ∩ R ∩ M) are shown on the graph.(c) Initialisation with the fault-tolerant cluster state shown macroscopically.Two pairs of Majorana modes are created at the site where the encoded state is initialised and their worldlines extend to the outer edges of the lattice in between the different boundaries which are determined by how the qubits of the initial system are initialised.
cal Pauli-Z operator are supported on the physical qubits initialised in the Pauli-X(Pauli-Z) basis, where both operators intersect at the central qubit.Both of these logical operators extend along the surface where the input state is initialised onto the distinct boundaries where the logical operators terminate.Once the surface code is foliated the respective boundaries of the surface code extend along the temporal axis of the foliated system, and together with the boundaries extend the logical operators of the system.In this way we can regard the logical operators that extend to the output system as two-dimensional surfaces.Logical operators propagated along a boundary in this way are commonly known as correlation surfaces [15].
In the same way that the different logical operators of the surface code terminate at their distinct respective boundaries, so too do the correlation surfaces of the foliated surface code terminate exclusively at their respective boundary.This is similarly true at the different regions of the surface where the qubits of the input state is initialised differently.In this sense we can regard the different regions where qubits are prepared in eigenstates FIG.14: Macroscopic picture with time moving into the page showing preparation such that the output is state is a logical Pauli-Z(Pauli-X) state on the left(right) of the figure where the input system are prepared with the physical qubits rotated into eigenstates of the Pauli-Z(Pauli-X) basis.The world lines of the Majorana modes that move between the distinct boundaries emerge in two distinct pair creation operations, which is true to the analogy with fault-tolerant quantum computation with Ising anyons.
of the Pauli-X or Pauli-Z basis extensions of the other boundaries of the system.In Fig. 13(c) we colour code the boundaries of the foliated lattice according to the correlation surfaces that can terminate at them.In particular, correlation surfaces corresponding to the propagation of logical Pauli-X(Pauli-Z) operators of the surface code terminate at the blue(yellow) boundaries of the figure, respectively.
As discussed, we can regard the interface between the two different boundary types as worldlines of the Majorana modes.As Fig. 13(c) shows, the four red lines meet at the single point where the nontrivial state is initialised.We thus see that the analogy between the boundaries of the foliated system and Majorana-based fault-tolerant quantum computation holds, as in such a system, to prepare an arbitrary state, two pairs of Majorana modes would need to be prepared simultaneously at a common location and noisily rotated into a desired state before the modes are separated such that the encoded information is topologically protected [74,75].
We can similarly explore this analogy by preparing logical qubits in eigenstates of Pauli operators.With the surface code, we can prepare a logical qubit in an eigenstate of the Pauli-X(Pauli-Z) by initialising all of the physical qubits in the Pauli-X(Pauli-Z) basis.Using these product states at the input states, we can show the boundaries of the system macroscopically in Fig. 14 where the input state is shown by the boundary on the input face shown closest to the reader.In this instance, the figure shows two pairs of Majorana modes are prepared a macroscopic distance from one another.This is similarly true with fault-tolerant quantum computation with anyons, as these logical states are also prepared robustly in this way.

Fault-tolerant parity measurements
We next investigate the how lattice surgery [29][30][31]39] maps into the measurement-based picture.Lat- To measure the parity of these two logical qubits, we initialise the qubits that separate the two lattices in known eigenstates of the Pauli-X operator and then begin measuring the stabilizers of the extended rectangular stabilizers which includes the pale-coloured stabilizers in between the two lattices.
tice surgery offers a route to performing entangling gates between qubits encoded with topological codes via faulttolerant parity measurements.Foliated lattice surgery with the surface code has already been considered in Ref. [28] but here we revisit this example within the more general framework we have developed for fault-tolerant measurement-based quantum computation.We will also witness nontrivial dynamics between the world lines of the Majorana modes that are present in the foliated surface code.
We briefly review lattice surgery with the surface code before examining it at the macroscopic level of foliation.To the left and right of Fig. 15 we see two surface code lattices in bold colours.Each of these encodes a single logical qubit.The goal is to make the logical parity measurement Z 1 Z 2 of these two encoded qubits.The support of the operator we aim to measure is shown in the figure .To make this logical measurement fault-tolerantly, we begin measuring the stabilizers of a single extended rectangular surface code, which includes the pale-coloured stabilizers in between the two codes.Importantly, the logical operator of the two codes we intended to measure is a member of the stabilizer group of the extended code.As such, by measuring the stabilizers of the code we additionally recover the value of the parity measurement.
To initialise the extended surface code, each of the physical qubits that lie in between the two encoded qubits are prepared in a known eigenstate of the Pauli-X operator and we then measure the stabilizers of the rectangular code.To the best of our knowledge, the literature thus far has only considered a very narrow separation between the two encoded lattices such that the number of qubits involved in the procedure is minimal.We know of no practical advantage of widening this gap but for the purposes of our exposition we find that the wider gap helps elucidate some of the topological features of lattice surgery.
We now consider lattice surgery within a measurementbased framework.We consider as an input state included in I two surface code lattices together with some ancil-FIG.16: Lattice surgery for the parity measurement Z1Z2 in the foliated surface code where the time axis runs from the bottom of the page to the top.We show two distinct surface codes at the bottom of the page.At the point where we begin the parity measurement the two foliated qubits are connected through an extended piece of foliated surface code.We show the trajectories of the foliated Majorana modes in red.We see that at the connection point two pairs of Majorana modes are fused, where one mode from each pair are taken from the two different foliated codes.Once the parity data is collected the connection is broken by inputing the rectangular lattice into a new channel to separate the two encoded qubits.This is shown at the top of the figure .lary physical qubits prepared in the +1 eigenvalue eigenstate of the Pauli-X matrix as shown in bold in Fig. 15, where we might imagine that the two surface code lattices have emerged as the output of two foliated surface codes.We then append to the resource state the check measurements of the larger rectangular surface code such that the logical parity measurement is read from the resource state once the single-qubit measurement outcomes have been collected.
We show this foliated picture macroscopically in Fig. 16.The figure shows two foliated surface codes entering the surgery channel where the two lattices are connected make the parity check.Once the parity check is completed, we take as an input the output of the channel of the rectangular code and input it back into the original channel where the two lattices are separated and the qubits that connect the two lattices are measured transversally in the Pauli-X basis which completes the operation.
We next study the trajectories of the Majorana modes while the parity measurement takes place.Given that the qubits that form the connection between the two codes are initialised in the Pauli-X basis, the boundary where the connection is formed terminates the correlation surface that propagates the logical Pauli-X data of the channel.As such, we regard this boundary as an extension of the blue boundaries in the figure where the correlation surfaces for the logical Pauli-X operators can terminate.An equivalent argument holds at the moment the con-nection is broken.From this we can infer the trajectories of the Majorana modes.
At the point the two codes are connected we observe the world lines of the Majorana modes that mark the interface between the distinct boundaries fuse.Two pairs of Majorana modes fuse where each pair takes a single mode from each of the two input codes.The product of these two fusion operations gives the parity of the two encoded qubits which is consistent with the topological interpretation of lattice surgery given in Ref. [39].
More precisely, if we consider a system where two qubits are encoded over eight Majorana modes, γ j with 1 ≤ j ≤ 8, and X 1 = iγ 1 γ 3 , Z 1 = iγ 3 γ 4 , X 2 = iγ 6 γ 8 and Z 1 = iγ 5 γ 6 , and we make measurements M 1 = iγ 3 γ 5 and M 2 = iγ 4 γ 6 we have that Z 1 Z 2 = M 1 M 2 .One may worry that the logical measurement of M 1 and M 2 may affect encoded information, but in fact this measurement only disturbs the global charge conservation of the two encoded qubits, γ 1 γ 2 γ 3 γ 4 and γ 5 γ 6 γ 7 γ 8 , which could be regarded as gauge degrees of freedom.It is clear from Fig. 16 that lattice surgery is performing an analogous operation with the foliated Majorana modes.

A phase gate
We finally show how to perform a phase gate with a surface code that is propagated through a resource state.This presents an interesting example as we require the composition of several channels to complete this operation.Moreover, we will observe a braid in the trajectories of the foliated Majorana modes which is true to the analogy we have painted alongside fault-tolerant quantum computation with anyons.The gate we use is based on a method presented with stabilizer codes in Ref. [40], but we point out that the general theory of foliated quantum computation is readily adapted to other proposals to realise Clifford gates [38,39] including other schemes presented in Ref. [40].See also recent work in Ref. [30,76].As in the previous Subsection we will present the scheme at the level of stabilizer codes before discussing the foliated variant of the logical gate.
We first summarise the execution of a phase gate of a phase gate abstractly at the logical level.A phase gate maps logical operators such that X → Y and Y → X where phases are neglected, and the logical Pauli-Z operator is invariant under a phase rotation.Using an additional ancillary qubit we can achieve this operation by code deformation.If we encode the logical information on the first logical qubit, and we prepare the second qubit in an eigenstate of the logical Pauli-Z operator, then one can check that performing the following sequence of measurements; Y 1 X 2 , Z 1 , X 1 X 2 , Z 2 will complete a phase gate up to phases which are determined by the outcomes of the measurements.In what follows we show how these measurements can be achieved fault-tolerantly using two surface code models.
We must first measure Y 1 X 2 where the ancilla qubit is prepared in an eigenstate of the Pauli-Z operator.We consider the initial system shown in Fig. 17 where logical information is encoded on the lattice shown to the left and the surface code to the right is initialised in an eigenstate of the logical Pauli-Z operator.An important feature of the surface code at the right of the figure is that it has a continuous defect line running through the middle of the lattice, but we remark that the model is locally equivalent to the well-known CSS variant of the surface code on a rectangular lattice.Once the system is prepared in this state, by measuring this system with the stabilizers of the twisted surface code as shown in Fig. 9, we recover the value of the desired logical parity measurement.This is because the operator of the initial system, Y 1 X 2 , is an element of the stabilizer group of the twisted surface code.To make this clear we show the operator Y 1 X 2 explicitly on Fig. 17.
It is worth pointing out that, similar to the standard surface code which, as explained above, can be faulttolerantly initialised in an eigenstate of the Pauli-Z basis, the lattice to the right is readily initialised in an eigenstate of the Pauli-Z operator by initialising the physical qubits above(below) the defect line in a known eigenstate of the Pauli-Z(Pauli-X) basis before measuring the stabilizers of the model to complete the preparation.
Once we have performed the first parity measurement the remaining steps to complete the phase gate have already been well described in the literature, we thus only briefly summarise the remaining technical steps.We must first measure the first system in the logical Pauli-Z basis.This is achieved by measuring all of the physical qubits transversally in the Pauli-Z basis, the outcome of the measurement can be inferred from the single-qubit measurement outcomes.This leaves the logical information encoded on the second logical qubit on the rectan- After transversally measuring the qubits below the defect line of the lattice to the right transversally in the computational basis the right qubit is reduced to a smaller square lattice.The system to the left is initialised in a logical eigenstate of the Pauli-Z operator.The support of the logical parity measurement that is made under the surgery is shown.gular lattice.
To make the final parity measurement, we additionally require that we reduce the length of the rectangular lattice.This is also achieved by transversally measuring the qubits below the defect line on the rectangular lattice transversally in the Pauli-Z basis.After we have completed all of the transversal measurements we reinitialise the first system in an eigenstate of the logical Pauli-Z operator which is carried out by preparing all of the physical qubits in the Pauli-Z basis and subsequently measuring standard surface code stabilizers.
Upon completing these three operations, the first two of which could be carried out simultaneously, we end with the system shown in Fig. 18.Finally, to transfer the rotated logical information back to the first lattice, we perform another logical parity measurement, X 1 X 2 which is carried out using standard lattice surgery that we discussed in the previous subsection before finally measuring the remaining qubits of the second ancillary system transversally in the Pauli-Z basis which completes the final logical measurement Z 2 .
As in the case of lattice surgery, the steps of the code deformation procedure outlined above are readily mapped onto a foliated system by using each new deformation as the stabilizers of the channel system of a resource state such that the output is the deformed variant of the initial state.The phase gate we have presented provides a particularly interesting example as it shows that certain gates are achieved using several different channels where the input of the j-th channel is the output of the j − 1-th channel.We also remark that several of these channels require the general methods of code foliation that we have developed in the earlier sections of this work.The channel where we measure the stabilizers of the twisted surface code for instance can be foliated using the graph states proposed in Sec.VI.
We show the series of channels in Fig. 19 where the temporal axis increases up the page.Interestingly, we observe that the two right-most Majorana modes at the bottom of the figure are exchanged over time, where the right-most mode moves through the interior of the re-FIG.19: The sequence of foliated channels that execute a phase gate on a qubit transmitted with a foliated surface code where time increases up the page.The worldlines of the Majorana modes are shown in red(green) if they run through the exterior boundary(bulk) of the foliated system and the boundary of the dislocation of the foliated surface code is shown in pink.One can track the world lines of the modes from the bottom to the top of the page to see the two right most world lines exchange.
source state through the channel that measures the stabilizers of the twisted surface code.The point where the world line of this mode moves through the interior is highlighted in green.To the best of our knowledge, this presents the first example of a foliated system where a defect is moved through the interior of a resource state.While this defect is in the interior of the system, the other mode involved in the exchange is braided around the exterior of the system before the exchange is completed thus executing a phase gate.Once again, the analogy with Majorana modes holds in the model we consider here as, indeed, exchanging a pair of Majorana modes executes phase gate.This can be seen by considering a qubit encoded with four Majorana modes such that X = iγ 1 γ 3 , Y = iγ 2 γ 3 and Z = iγ 1 γ 2 .One can see that up to phases X and Y differ by the exchange of indices 1 and 2 whereas Z is invariant under the exchange modulo a negative phase which is equivalent to the exchange of the modes in the foliated channel.

VIII. CONCLUDING REMARKS
We have presented a framework that allows us to map quantum computational schemes that use code deformations on stabilizer codes to schemes of fault-tolerant measurement-based quantum computation.We have shown how to view each component of the computation as a 'foliated channel' as a gauge-fixing process of a subsystem code, from which all properties of the computation can be inferred.We have used this framework to show we can initialise, fuse and braid foliated Majorana defects in a three-dimensional fault-tolerant cluster-state model to carry out universal quantum computation with Clifford operations and magic state distillation.
It remains an important problem to find the most resource efficient models of fault-tolerant quantum computation, as such it will be fruitful to study the robustness of other foliated stabilizer codes to experimentally relevant sources of noise.In particular, it will be valuable to study the tolerance of different models to loss, as foliated models are most applicable to photonic architectures where this is a dominant source of error [23].From a condensed matter perspective, the models we have constructed can be viewed as symmetry-protected topological phases [77][78][79][80][81][82].Further study of these models may therefore lead to new phases of matter that are robust resources for quantum information tasks.Finally, one can readily check that we can foliate the canonical examples of subsystem codes [49,56,83,84] within our framework, by replacing the channel stabilizer group by a generating set of the gauge group, whereby the foliated system inherits many of the desirable features of the subsystem code.While the general theory of subsystem code foliation remains to be described explicitly, we find it exciting to map the advantageous characteristics of these models such as gauge fixing [50,56,85] and single-shot errorcorrection [57,59,60,86] into foliated systems in the future.we will not be interested in its gauge degrees of freedom, only its logical operators and its stabilizers.As such, without loss of generality, we will continue to denote the stabilizers of this system as G in as before to maintain consistency with the theorems given above.The gauge and logical degrees of freedom can both be regarded as logical operators.This simplification allows us to keep our definition of the channel system, Def. 1, unchanged in our generalisation to subsystem codes.Further, we keep the ancilla system and the measurement pattern the same following the prescription set by G R .We index elements of the ancilla system with labels G(t) where G denotes an element of the non-Abelian generating set G R and t denotes a time interval.We then define elements of the stablizer group of the ancilla system such that we have σ X [G(t)] ∈ A for all t and gauge generators G ∈ G R .Likewise, we keep our definition of the measurement pattern, Def. 3, where we use only type I foliated qubits in the channel system.
Though we remark that generalising to make use of type II foliated qubits is straight forward.Explicitly, we measure all the qubits of the channel system in the Pauli-X basis.Ancilla qubits are measured in the basis σ X [G(t)] σ Z [G(t)] Since σ Z [G(t)] ∈ M for any G or t, we rely on p X • G∈G R g Z = 0 for all P ∈ C(G R ) ∩ G R and G ∈ G R .This issue was easily dealt with in the case of stabilizer codes with inclusion of the V operator.Indeed, for the case where G R is Abelian we had that ξ(P ) = {P } for all stabilizers P ∈ G R , and P and Q ∈ G R commuted such that p X •q Z = q X •p Z .We were therefore able to eliminate all the spurious Pauli-Z terms in the stabilizer group of R by simply coupling the ancillas with the controlled phase gate U Z [P (t), Q(t)] for all P, Q ∈ G R such that p X • q Z = 1.However, in the case of subsystem codes, where we use multiple ancilla qubits to infer the value of a stabilizer, so it is not clear which ancilla qubits we should couple to nullify the spurious Pauli-Z terms.We leave the general solution to this problem to future work.
Provided the Pauli-Z terms of the resource state can be cancelled out we can use the operators in Eqns.(D6) and (D8) to infer the stabilizers of the foliated system, as in Theorem 2, and we can determine the output stabilizer group as in Theorem. 1.We finally remark that the logical degrees of freedom, P ∈ (C(G in )\G in ) ∩ (C(G ch.)\G ch. ), propagate through the foliated channel, and elements P ∈ (C(G in )\G in ) can be measured by the channel using the operator shown in Eqn.(D8), again, provided σ Z [G(t)] p X • G∈G R g Z = 0.This allows us to generalise Theorem 1 for subsystem codes where σ Z [G(t)] FIG. 23: The stabilizers of a single cell of the resource state for the gauge color code on qubits indexed X(t).Measuring the face terms of the gauge color code infers the value of the stabilizer three times.Taking the product of pairs of these measurements gives additional stabilizer data.
There are many subsystem codes that can be foliated without choosing a nontrivial V operator.The CSS codes are natural candidates since by the definition of a CSS code.We therefore find that V = 1 is suitable to learn stabilizer data.We also find that the subsystem color code [83] can be foliated with our prescription.
It is interesting to study subsystem codes that we can foliate, as they give us another perspective on faulttolerant quantum error correction.As an example, we consider single-shot error correction with the gauge color code [56,57,86].We give an alternative representation of the lattice of the gauge color code in Fig. 22 where the qubits lie on the vertices of a cubic lattice.
The gauge group of the gauge color code has elements B X f = j∈∂f X j and B Z f = j∈∂f Z j for all the faces of the lattice f , where ∂f are the set of qubits that touch the face, and the product of a subset of the faces living on the boundary of a cell give a cell stabilizer.Specifically, the faces surrounding the cube are three-coloured, see Fig. 22(b).The product of the face terms of all of the faces of one particular colour of a cells gives the value of a stabilizer for the corresponding cell.However, as we measure all of the faces, we redundantly learn the value of cell stabilizers three times.This redundancy enables us to predict the locations of measurement errors more reliably as each stabilizer is constrained to give the same value.
We now briefly look at these constraints from the perspective of foliation.In Fig. 23 we show a single cubic cell of the gauge color code on the qubits indexed X(t).It is readily checked that the operators shown in the figure that are the product of the face operators on two of the different colours of each cell are stabilizers of the foliated system.These stabilizers are unlike the stabilizers discussed in the main text where, if we exclude boundary stabilizers, we require measurements from qubits in different time intervals to learn the value of a stabilizer.We therefore find we have additional stabilizer data for error correction with foliated single-shot codes within each time interval.

FIG. 2 :
FIG. 2: The one-dimensional cluster state.Physical qubits are shown as vertices ordered along a line where the left-most vertex represents the first qubit of the system and edges indicated pairs of vertices that are entangled via a controlledphase gate.(a) A stabilizer operator denoted Cµ shown at an arbitrary point along the lattice.(b) and (c) show, respectively the logical Pauli-X and Pauli-Z operators once the cluster state is initialised.

FIG. 4 :
FIG. 4: (a) Logical Pauli-X and (b) logical Pauli-Z operators at time interval t.Each time interval contains one black vertex and one red vertex.Local to each time interval we can adjust our single-qubit measurement pattern by measuring the appropriate qubit in the Pauli-Z operator to measure either the logical Pauli-X or Pauli-Z operator given that the preceeding qubits of the system are measured in the Pauli-X basis.

FIG. 6 :
FIG.6: Two type-I foliated qubits where ancillas are coupled to perform X1X2 parity measurements.To the left of the figure we show a logical operator ∼ X1X2 by coupling an ancilla, shown in blue, to qubits X1(1) and X2(t).To the right of the figure we show an element of the measurement pattern that is generated by two parity measurements that are made at different time intervals.

FIG. 8 :
FIG.8: Sketch of the foliation process and construction of the system.Time moves from left to right across the page in each figure.(a)The initial system, I, consists of an input code, Gin, shown with green qubits to the left of the figure, and other qubits, shown in black and red in the figure, prepared in the |+ state.(b) The channel system K is produced by applying unitary U C to I. The edges in the figure represent controlled phase gates prepared between pairs of qubits.Effectively, we have concatenated each of the qubits of Gin into the code space of a one-dimensional cluster state.(c) We produce R by entangling ancilla qubits of the ancilla system, A, to the channel system.The coupling is specified by the choice of G ch. which determines the check operators of the foliated system, and the deformation on the input qubit.(d) The qubits of R are measured according to M. This propagates the input system onto the output system, G ch. , shown in purple to the right of the figure.The measurement pattern determines the value of stabilizer checks, and in turn the correction that must be applied to the output system.
Fig 11 we show one such alternative.In this figure, for even values of f we replace the coupling operators with

FIG. 12 :
FIG.12:The foliated planar code.The code is extended through spacetime where the rough and smooth boundaries are shown in yellow and blue, and the output is shown in red.At the interface between the rough and smooth boundaries we see the world lines of Majorana modes, depicted by thick red lines.The four modes that encode the qubit move directly along the temporal axis, and as such do not nontrivially manipulate the encoded state over the channel.

FIG. 15 :
FIG.15: Two surface code lattices are shown in bold colours to the left and the right of the figure.To measure the parity of these two logical qubits, we initialise the qubits that separate the two lattices in known eigenstates of the Pauli-X operator and then begin measuring the stabilizers of the extended rectangular stabilizers which includes the pale-coloured stabilizers in between the two lattices.

FIG. 17 :
FIG. 17: Two surface codes where Pauli-X type stabilizers lie on blue faces and Pauli-Z stabilizers on yellow faces.A dislocation is shown in green running through the middle of the right surface code which are the product of two Pauli-X terms and two Pauli-Z terms.An example of such a stabilizer is shown.The left qubit, qubit 1, is initially encoded in an arbitrary state, and the right qubit, qubit 2, is prepared in an eigenstate of the logical Pauli-Z operator.The logical operator whose measurement outcome is inferred from the stabilizer measurements during lattice surgery with support running from the top to the bottom of the figure is shown explicitly.
FIG. 18:After transversally measuring the qubits below the defect line of the lattice to the right transversally in the computational basis the right qubit is reduced to a smaller square lattice.The system to the left is initialised in a logical eigenstate of the Pauli-Z operator.The support of the logical parity measurement that is made under the surgery is shown.

FIG. 20 :
FIG.20:We show the logical Pauli-X, Pauli-Y and Pauli-Z operators in (a), (b) and (c) respectively.From these diagrams we see that by measuring the appropriate qubit within the time interval in Pauli-Z basis, and otherwise measuring the other qubits of the system in the Pauli-Y basis, we can measure the logical information of the chain in an arbitrary Pauli basis.

FIG. 22 :
FIG.22:The gauge color code lattice arranged with the qubits lying on the vertices of a cubic lattice.(a) The stabilizers are supported on cells of the lattice which are eight and thirty-two body terms living on the cuboidal cells of the lattice.(b) The cells are separated to better reveal the structure of the lattice.The gauge terms lie on faces where pairs of cells share common support.(c) A two dimensional representation of how cells lying on the layer above, marked with bold outlines, lie atop the layer below, where the cells are filled with pale colors.