Measurement-based quantum simulation of Abelian lattice gauge theories

The digital quantum simulation of lattice gauge theories is expected to become a major application of quantum computers. Measurement-based quantum computation is a widely studied competitor of the standard circuit-based approach. We formulate a measurement-based scheme to perform the quantum simulation of Abelian lattice gauge theories in general dimensions. The scheme uses an entangled resource state that is tailored for the purpose of gauge theory simulation and reflects the spacetime structure of the simulated theory. Sequential single-qubit measurements with the bases adapted according to the former measurement outcomes induce a deterministic Hamiltonian quantum simulation of the gauge theory on the boundary. We treat as our main example the $\mathbb{Z}_2$ lattice gauge theory in $2+1$ dimensions, simulated on a 3-dimensional cluster state. Then we generalize the simulation scheme to Wegner's lattice models that involve higher-form Abelian gauge fields. The resource state has a symmetry-protected topological order with respect to generalized global symmetries that are related to the symmetries of the simulated gauge theories. We also propose a method to simulate the imaginary-time evolution with two-qubit measurements and post-selections.


Introduction
Gauge theory is a foundation of modern elementary particle physics. The numerical simulation of Euclidean lattice gauge theories [1] has been a great success, even in the non-perturbative regime that is hard to study analytically. On the other hand, there are situations such as real-time simulation and finite density QCD where the path integral formulation of lattice gauge theory suffers from the sign problem-a difficulty in the evaluation of amplitudes due to the oscillatory contributions in the Monte-Carlo importance sampling [2][3][4][5]. In the Hamiltonian formulation, the dimension of the Hilbert space grows exponentially with the size of the system. The quantum computer is expected to solve this issue, enabling us to simulate the quantum many-body dynamics in principle with resources linear in the system size [6,7]. The quantum simulation of gauge theory is thus one of the primary targets for the application of quantum computers/simulators, whose studies are fueled by the recent advances in NISQ quantum technologies [8][9][10][11][12][13][14]. The goal of this paper is to present a new quantum simulation scheme for lattice gauge theories. Our scheme, which we call measurement-based quantum simulation (MBQS), is motivated by the idea of measurement-based quantum computation (MBQC) [15][16][17][18][19]. Just as in the common MBQC paradigm, our procedure consists of two steps: (i) preparation of an entangled resource state and (ii) single-qubit measurements with bases adapted according to the former measurement outcomes. In the usual MBQC, resource states (such as cluster states [15]) are constructed to achieve universal quantum computation. In MBQS, the resource states, the generalized cluster states (gCS), are tailored to simulate the gauge theories and reflect their spacetime structure.

Summary of results
Below, we give an overview of our main results. We sometimes refer to the equations that appear in the main text for convenience.
Our prototype examples are the (2 + 1)-dimensional Ising model and the lattice 2 gauge theory [20][21][22], which we simulate by adaptive single-qubit measurements on appropriate generalized cluster states. Then we extend this idea to Wegner's lattice models M (d,n) [22] that involve (n − 1)-form 2 gauge fields in d spacetime dimensions. For example n = 1 corresponds to the Ising model, while n = 2 is the ordinary lattice gauge theory. We also generalize the method to the model with the group G = N , but in this summary we focus on G = 2 . The partition function of M (d,n) with the inverse temperature β, which we write as post-measurement product state teleportation | Ψ(t)⟩ | Ψ(0)⟩ gCS (SPT) Figure 1: The concept of MBQS. We start from gCS with the initial wave function at the boundary. After applying single-qubit measurements based on a measurement pattern, we obtain |Ψ(t)〉, the wave function after the evolution with the Hamiltonian of the model M (d,n) , at the boundary of the reduced lattice.
Z (d,n) , is constructed with the classical Hamiltonian -or the Euclidean action (eq. (11)) of spin variables. We consider the quantum Hamiltonian on a (d − 1)-dimensional lattice (eq. (14)), which is related to the partition function as in the limit k → ∞. The precise definition of the lattice models will be given with the notation of the algebraic topology in the main text. Our first goal is to present a method to perform the quantum simulation of the time evolution |Ψ(t)〉 = exp(−i t H (d,n) )|Ψ(0)〉 .
We aim to realize the first-order Trotter decomposition T (d,n) (t) of the unitary exp(−i t H (d,n) ). It is common in MBQC to identify one of the spatial dimensions as time in gate-based quantum computation. Similarly, we regard the resource state as a spacetime in which the lattice gauge theory lives. See Fig. 1 for an illustration of the concept of MBQS. The underlying resource state, the generalized cluster state gCS (d,n) , is a quantum many-body state of qubits defined on a d-dimensional lattice. The entanglement structure of gCS (d,n) reflects the spacetime structure of the action. We take the d-th direction of the lattice open, with the past boundary x d = 0 and the future boundary x d = L d , while the other directions are assumed to be periodic. We claim that the Trotterized time evolution T (d,n) (t) is obtained by measuring the bulk and the past boundary of the state gCS (d,n) with a set of single-qubit bases. The outcome of each measurement is random, thus the post-measurement state comes with Pauli operators that depend on the outcomes. This type of Pauli operators are called the byproduct operators, as in the usual MBQC. Nonetheless, by adapting the parameters in the later measurements according to the former measurement outcomes, the Hamiltonian quantum simulation can be performed deterministically. Namely, we will show that 〈Φ({s}, {ξ})|gCS (d,n) where |Φ({s}, {ξ})〉 is the tensor product of measurement basis states with the parameters {ξ} chosen appropriately according to the outcomes {s}, Σ({s}) is the byproduct operators, and N is an unimportant normalization constant. (Here the future boundary of the lattice is left unmeasured, where the final state on the right hand side is induced.) The byproduct operators can be removed at the end of the quantum simulation with appropriate post processing.
We generalize the idea above in several directions. First, we present a generalization to the imaginary-time evolution with exp(−τH (d,n) ) with G = 2 . On quantum computers, it is not straightforward to realize the Trotter steps in the imaginary-time evolution since they are generically not unitary, and the same difficulty carries over to the measurement-based simulation. We modify the resource state gCS (d,n) with further ancillary qubits (eq. (73)) and extend the measurement bases to two-qubit ones. For each measurement, the basis corresponding to measurement outcomes is modified to a set of four two-qubits states. Two of the four induce desired operators for the imaginary quantum simulation. The other two outcomes, which occur with an exponentially small probability, give an undesired operator and the simulation needs to be aborted. The imaginary-time quantum simulation thus can be performed with post-selections.
Another generalization is to the quantum simulation of the Kitaev Majorana chain [23]. The resource state is made of spins and fermions on a two-dimensional lattice. The entangler to generate the resource state is adopted and generalized from the one that is used for the one introduced to implement the Jordan-Wigner transformation in [24].
In the Hamiltonian formulation of gauge theory, physical states are required to obey the gauge invariance condition called the Gauss law constraint. In noisy simulations it is expected to be especially important to minimize the effects of errors that violate gauge invariance [25,26]. In this work we combine the well-known error correcting techniques in MBQC with the analysis of symmetries of the gauge theory and the resource state to formulate an effective method to enforce the Gauss law constraint. In the case with the (2 + 1)-dimensional 2 gauge theory, we assume a particular error model where the error is represented as Pauli operators acting on the resource state (eq. (84)). We identify the errors that violate the Gauss law constraint. We then show that such errors can be detected by analyzing measurement outcomes in MBQS, and that we can construct an operator to apply on the simulated state so that the final wave function obeys the Gauss law constraint. We will also discuss the suppression of the Gauss law violation by energy penalty terms.
We also discuss a relation between the generalized cluster state and the partition function, which is a specialized version of the relation between a graph state and the Ising model found in [27,28]. Concretely, the partition function Z (d,n) for M (d,n) can be written as where |Φ〉 is a product of single-qubit basis states that are related to our measurement pattern in MBQS. A further generalization of the relation implies that the expectation value of the Wilson loop can be estimated via the Hadamard test with a constant-depth circuit. Aside from studies of quantum computational methods, we present more formal aspects of MBQS regarding symmetries. We show that a generalized cluster state possesses a nontrivial symmetry-protected topological (SPT) order [29][30][31][32][33][34][35][36] protected by higher-form symmetries [37,38]. The symmetry generators, S(M) and S(M ′ ), are Pauli operators that are supported on closed manifolds M and M ′ of some nontrivial codimensions. We demonstrate that the state gCS (d,n) possesses the SPT order with respect to such symmetries by using the method called gauging. We further support this claim by introducing boundary to the lattice and explicitly constructing a set of symmetry generators that exhibit a projective representation at the boundary.
Further, we propose that MBQS can be regarded as a type of bulk-boundary correspondence between the resource state and the simulated field theory. Specifically, the gauge symmetry of the boundary simulated theory is promoted to a higher-form symmetry of the bulk resource state. This feature is used in Section 4 for the enforcement of the Gauss law constraint in MBQS. On the other hand, as we discuss in Section 7, the boundary simulated theory has a global (higher-form) symmetry, while the bulk resource state can be regarded as a model in which the boundary global symmetry is gauged. It can be seen as a new type of holographic correspondence.
Measurement has been identified as a new ingredient that allows us to transform shortrange entangled states into long-range entangled states such as the ground states of gauge theories [24,39,40]. It was also pointed out that the MBQC itself has a structure of gauge theory, where the gauge transformation relates different patterns of parameters and measurement outcomes [41]. We construct the gauge transformation for our MBQS in Appendix D. Our holographic interpretation in Section 7 also supports the perspective of MBQC as a gauge theory.

Organization of the paper
This paper is organized as follows. In Section 2, we review the models M (d,n) and introduce the generalized cluster states gCS (d,n) . In Section 3 we provide the measurement-based protocols for the simulation of the Ising model M (3,1) and the 2 gauge theory M (3,2) . We explain our measurement pattern to execute MBQS. We also study generalization to the imaginary-time evolution. In Section 4, we discuss a procedure to detect certain types of errors and correct them based on the higher-form symmetry of the resource state, enabling us to enforce the Gauss law constraint. In Section 5, we discuss generalization to the N (n − 1)-form theory in d dimensions as well as the case with the Kitaev's Majorana fermion in (1 + 1) dimensions. We also make a connection between the Euclidean path integral and the generalized cluster state for the model M ( N ) (d,n) . In Section 6, we show that the generalized cluster state is an SPT state. In Section 7, we discuss an interplay of the symmetries between the bulk and the boundary in our MBQS. Section 8 is devoted to Conclusions and Discussion. In the appendix we prove some equations used in the main text and discuss supplementary aspects of our MBQS and the generalized cluster states.

Cell complex notation
Let us consider a d-dimensional hypercubic lattice. Let ∆ 0 be the set of 0-cells (vertices), ∆ 1 the set of 1-cells (edges), and ∆ 2 the set of 2-cells (faces), and so on. We write C i (i = 0, 1, 2, ..., n) for the group of i-chains c i with 2 coefficients (later this will be generalized to general Abelian groups), i.e., the formal linear combinations with a(c i ; σ i ) ∈ 2 = {0, 1 mod 2}. Sometimes we regard the chain c i as the union of the i-cells σ i such that a(c i ; σ i ) = 1. The boundary operator ∂ is a linear map C i+1 → C i such that ∂ σ i+1 is the sum of the i-cells that appear on the boundary of σ i . We get a chain complex with ∂ 2 = 0. Similarly, by considering the dual lattice, 1 we get the dual chain complex Figure 2: An illustration of boundary operators and duality for a square lattice. (Top) The 2-cell σ 2 is represented by a shaded square. Its boundary ∂ σ 2 is the sum of four 1-cells. (Bottom) The 1-cell σ 1 is represented by a gray line. Its dual boundary is the sum of two 2-cells. In both figures, the duals of the relevant cells are indicated. 2 The notions of boundary operators and duality are illustrated in Fig. 2. We will often consider placing qubits on all the i-cells σ i ∈ ∆ i for some i. Then on each σ i we have Pauli operators X (σ i ) and Z(σ i ). For each i-chain c i we define The bulk state to be introduced later will be the resource state for MBQS. As we proceed in the protocol of MBQS, the state originally defined on the x d = 0 time slice will be teleported to a middle time slice x d = j, where j ∈ {0, 1, . . . , L d }. Throughout the paper, unless otherwise stated, we use the notation where the bold fonts (∆ ∆ ∆, σ σ σ, ∂ ∂ ∂ , etc.) represent "bulk" quantities related to the d-dimensional lattice, whereas the normal fonts (∆, σ, ∂ , etc.) are used for the (d − 1)-dimensional lattice identified with the space of the simulated model.
A cell σ σ σ i inside a time slice x d = j is of the form while a cell σ σ σ i extending in the time direction takes the form Sometimes we express a point in the time direction as pt and an interval as I.

Model M (d,n)
We consider a class of theories described by classical spin degrees of freedom living on (n − 1) cells in the d-dimensional hypercubic lattice whose action I is given by 2 Between C i and C * n−i , the intersection pairing is given by where J is a coupling constant. S σ σ σ n−1 ∈ {+1, −1} is a classical spin variable living on each (n − 1)-cell σ σ σ n−1 ∈ ∆ ∆ ∆ n−1 and for a given i-chain c c c i = σ σ σ i ∈∆ ∆ ∆ i a(c c c i ; σ σ σ i )σ σ σ i . This class of theories is called "generalized Ising models" in the literature [22], where the action (11) is viewed as the (classical) Hamiltonian of such a classical spin model. For n = 2, (11) is the 2 version of the action of Wilson's lattice gauge theory [1], whose degrees of freedom are 1-form gauge fields. When n ≥ 2, the theory is described by (n−1)-form gauge fields, and the action is invariant under a local transformation at each (n − 2)-cell, This is a higher-form generalization of the standard discrete gauge transformation, which corresponds to the case with n = 2. For n = 1, M (d,n) is the Ising model in d dimensions.
On infinite lattices, the models M (d,n) and M (d,d−n) are dual to each other [22], generalizing the Kramers-Wannier duality of the two-dimensional Ising model. On finite lattices, the duality changes the global structure of the model. See, e.g., [42].
For each classical spin model in d dimensions, one can construct a quantum spin model defined on a (d − 1)-dimensional spatial lattice. See [20] and Appendix B. The qubits are placed on (n − 1)-cells σ n−1 . The Hamiltonian is given by where we used the notation (8) and λ is a coupling constant. Gauge-invariant states |ψ〉 must satisfy the Gauss law constraint for any σ n−2 ∈ ∆ n−2 , where G(σ n−2 ) is defined as and Q(σ n−2 ) = 1 if there is an external charge on the cell σ n−2 and Q(σ n−2 ) = 0 otherwise. Conjugation by the operator G(σ n−2 ) generates a gauge transformation in the Hamiltonian picture.

Example 1:
The Ising model M (3,1) in 2 + 1 dimensions has the Hamiltonian The second term is the nearest neighbor interaction between two vertices connected by edges.

Example 2: M
The Hamiltonian of the model M (3,2) , the 2 gauge theory in 2 + 1 dimensions, is [22] H (3,2) The second sum is over plaquettes (faces) σ 2 . The plaquette operator Z(∂ σ 2 ) is the product of Pauli-Z operators on the four edges surrounding σ 2 . The Gauss law constraint is where the left hand side is the product of Pauli-X operators on the edges attached to the vertex σ 0 . Q(σ 0 ) ∈ {0, 1} is the external charge placed at σ 0 ∈ ∆ 0 . The first-order Trotter approximation of the time evoltion e −iH (3,2) t is given by with t = x 3 δt.

Generalized cluster state gCS (d,n)
Here we describe the resource state which we call the generalized cluster state, gCS (d,n) . We define the eigenvectors of the Pauli operators by We place a qubit on every (n − 1)-cell σ σ σ n−1 ∈ ∆ ∆ ∆ n−1 and on every n-cell σ σ σ n ∈ ∆ ∆ ∆ n . For each n-chain c c c n = σ σ σ n ∈∆ ∆ ∆ n a(c c c n ; σ σ σ n )σ σ σ n , we define We similarly define Pauli Z operators and Pauli operators on (n − 1)-cells. A general Pauli operator takes the form where α is a c-number phase. Now we define the stabilizers The generalized cluster state |gCS (d,n) 〉 is defined by the eigenvalue equations Explicitly, the cluster state can be written as Figure 3: The unit cell in the generalized cluster state gCS (3,1) used to simulate the model M (3,1) . The blue balls represent the qubits living on 1-cells σ σ σ 1 ∈ ∆ ∆ ∆ 1 , while the black ones are those on 0-cells σ σ σ 0 ∈ ∆ ∆ ∆ 0 . The green arrows show the measurement pattern in MBQS.

Measurement-based quantum simulation of gauge theory
In this section, we introduce the MBQS protocols for the real-time evolution of the Ising model M (3,1) and the gauge theory M (3,2) . See [41] for a pedagogical introduction to MBQC. (3,1) For the simulation of the model M (3,1) , we use gCS (3,1) as the resource state. This is a cluster state whose qubits are placed on 1-cells (edges) and 0-cells (vertices). See Fig. 3 for an illustration. We describe the measurement protocol to simulate the time evolution with Hamiltonian H (3,1) given in (17).

Measurement pattern
Our simulation protocol will involve two types (A and B) of measurements. Each measurement realizes a desired unitary operator, multiplied by an extra Pauli operator that depends on the non-deterministic measurement outcome. The desired operator simulates a factor in the Trotterized time evolution operator (18). The extra operator is called a byproduct operator and is determined by the measurement outcomes. As we will explain, we can adaptively choose the measurement bases according to the previous outcomes so that the simulated unitary operator is deterministic. Let us explain the A-type measurement as part of the MBQS. In a two-dimensional layer at x 3 = j, we have qubits on the vertices σ 0 ∈ ∆ 0 and the edges σ 1 ∈ ∆ 1 . See Fig. 3 (1). The qubits on the edges are entangled by the C Z gate with the adjacent qubits on ∂ σ 1 . The wave function |Ψ〉 for the qubits on the vertices is arbitrary. Our claim is that the unitary operator For the time evolution from x 3 = j to x 3 = j + 1, the measurement pattern on the threedimensional cluster state gCS (3,1) for our MBQS protocol is as follows. basis See Fig. 3. We have a set of measurement outcomes and angles, which depend on locations of cells. We denote them as where the subscripts indicate the order of the corresponding measurements within the time step. To avoid clutters, we often make the cell dependence of these parameters implicit. The total unitary operator for one time step is As in the usual protocols of measurement-based quantum computation, the outcomes of measurements with bases M (A) and M (X ) should be collected before performing the measurements with M (B) , and the parameter ξ 3 for each σ 0 should be chosen so that the unitary gate of the X rotation is as wanted. Concretely, we choose the parameters in the first step as follows: We use the relation (47) to propagate the byproduct operators forward. Then U (3,1) ({ξ i }) in eq. (44) becomes where Σ (1) ({s}) is the product of all the byproduct operators from the 1st time step, i.e., and the remaining product of operators is T (3,1) (δt) defined in eq. (18). In the following steps, we continue with the same measurement pattern, except that the measurement angles are adjusted according to the former measurement outcomes as we propagate the byproduct operators to the frontmost position. After j Trotter steps we have with Σ (k) ({s}) being the byproduct operators coming from the k-th time step and |ψ(t)〉 = T (3,1) (t)|ψ(0)〉. Performing another time step gives us by choosing {ξ i } appropriately according to the preceding byproduct operators. In the end, we have and the effect of the total byproduct operator can be removed by the post processing. (3,2) In this section we present the MBQS protocol for the 2 lattice gauge theory M (3,2) . The resource state is gCS (3,2) , whose qubits are placed on 2-cells (faces) and 1-cells (edges), and the entanglers are applied appropriately. This state is also known as the Raussendorf-Bravyi-Harrington (RBH) cluster state [44]. See Fig. 4 for illustration.

Measurement pattern
First, let us focus on a 2-cell (face) σ 2 and the four 1-cells (edges) ∂ σ 2 surrounding it, in a layer at the level x 3 ∈ {1, ..., L 3 }, As a straightforward generalization of the simulation of the interaction term in (32), we find that the simulation of the plaquette term with a byproduct operator is induced by measuring the qubit on σ 2 with the basis In other words, Here, |Ψ〉 is a general wave function of qubits defined on 1-cells at x 3 . We have already seen in Section 3.1 that we can simulate the X -rotation gate with a teleportation. We utilize and Now we present our measurement pattern in Table 1. The measurement basis M (G) (3,2) , which we will explain below, is used to enforce gauge invariance, See Fig. 4 for an illustration. basis

Enforcing gauge invariance
In simulating gauge theory dynamics on real devices, a time evolution that violates gaugeinvariance, or more precisely the Gauss law constraint (20), would be induced due to the noise that occurs to physical qubits. We consider the following two methods to enforce gauge invariance. (i) Add an energy cost term for violating gauge invariance to the Hamiltonian of the simulated gauge theory: where the coefficient Λ is taken so large that the cost term becomes much more significant than the other terms but is small enough so that the Trotter decomposition is justified. We expect, but do not prove, that such a cost term would suppress the violation of gauge invariance. See [25,[45][46][47][48][49][50][51][52] for the study of similar cost terms.
(ii) Actively correct the errors based on the measurement outcomes, much in the spirit of topological quantum memory [53]. In the following we explain how the protocols for the two methods work in the error-free situation. In Section 4, we will explain the protocols in a specific error model in detail. (i) Gauss law enforcement by energy cost. In the first method, we use the measurement basis M (G) (3,2) In this case, the total unitary for a single time step in a unit 2-cell in 2d becomes Figure 4: The protocol for the model M (3,2) . The black balls represent the qubits living on 2-cells σ σ σ 2 ∈ ∆ ∆ ∆ 2 and the blue ones are those on 1-cells σ σ σ 1 ∈ ∆ ∆ ∆ 1 .
We write the wave function with the Trotterized time evolution as and denote the by product operators coming from the j-th time step as Σ ( j) . Then we obtain the following for ( j + 1)-th step by appropriately choosing {ξ i } i=1,2,4 : (ii) Gauss law enforcement by error correction. The second method is well known in the context of the topological MBQC [54][55][56]. We use the measurement basis M . In this case we obtain Here ∂ * σ 0 is a summation of 1-cells (edges) that surround the 0-cell (vertex) and |Ψ〉 is a general wave function of qubits defined on 1-cells at the time interval [ j, j + 1] (2-cells in three dimensions). Thus we obtain Then the total operator for a single time step in 2d becomes The operator is a projector that restricts the measurement outcome s 3 (σ 0 ) to be the eigenvalue of X (∂ * σ 0 ) of the simulated state. At the j-th time step ( j ≥ 0), assume that the measurement outcome was Then at the ( j + 1)-th time step, since the Z byproduct operators from the measurements at σ 1 × { j + 1} may flip the eigenvalue of X (∂ * σ 0 ), the measurement outcome becomes Therefore we obtain the following relation for the error-free MBQS: with j ≥ 0. In Section 4, we introduce an error model and consider an error correction scheme, and we will see that the left-hand side of the relation above serves as a syndrome for the error correction.
We remark that the byproduct operators are handled in the same manner as before. The parameters {ξ 1 , ξ 4 } are chosen accordingly to the former measurement outcomes.

MBQS of imaginary time evolution
The properties of the ground state of a gauge theory can be an interesting target of study. The imaginary-time evolution with Hamiltonian H can be used to prepare the ground state via from a generic initial state |Ψ in 〉. However, it is non-trivial to implement the imaginary-time evolution on a quantum computer because e −τH is not unitary. In this subsection, we wish to explain how we can perform the imaginary-time evolution of the gauge theory M (3,2) in MBQS by including ancillary qubits and allowing us to implement two-qubit measurements.
A method to realize any linear operator for qudit systems using measurements is given in the literature, see e.g. [57][58][59]. 5 Let us consider gCS (3,2) , the cluster state on the three-dimensional lattice with qubits on the 1-and 2-cells. For each 2-cell σ σ σ 2 , we consider a qubit on its copyσ σ σ 2 and attach the state |0〉σ σ σ 2 as a direct product to the cluster state: Here∆ ∆ ∆ 2 is a copy of the set of 2-cells ∆ ∆ ∆ 2 .
For the plaquette interaction with measurement at σ σ σ 2 = σ 2 × pt, we generalize the singlequbit A-type measurement basis (54) to a set of the two-qubit measurement basis that includes where a and b refer to two qubits. They are both normalized and mutually orthogonal, with s = j − 1 is implemented. Indeed, we have the equality where |Ψ〉 is a general wave function defined on 1-cells within a time slice. See Fig. 5 for an illustration. Writing the cluster state with free ancillary qubits in the middle of simulation as |ϕ〉, the probability of obtaining j = 1 or j = 2 is where |φ〉 is defined via the relation Thus we have e −4α 2 ≤ prob( j; α) ≤ 1 2 . Thus, the probability of finding either j = 1, 2 becomes exponentially close to 1 when α is small: This means that as we take the Trotter step small, the probability of success for each measurement is exponentially close to 1. On the other hand, the success probability of the entire algorithm becomes small as we increase the total time to be simulated. Figure 5: Measurements in the imaginary time MBQS. The gray balls represent the ancillary qubits to implement the imaginary time evolution, and the black lines indicate the C Z gates for the resource state. (Left) Setup for the A-type measurement to implement e αZ(∂ σ n ) . We measure the two qubits encircled by the purple line in the basis |φ A j=1,2,3,4 〉. If |φ A j=1,2 〉 comes out, the measurement is a success. If it fails, one should throw away the result from the simulation. (Right) Setup for the B-type measurement to implement e αX (σ n−1 ) . We measure the two qubits encircled by the purple line in the basis |φ B j=1,2,3,4 〉. Likewise, the measurement is a success when we obtain |φ B j=1,2 〉.
For the imaginary time evolution corresponding to the X term in the Hamiltonian (19), we generalize the B-type measurement basis (56) to a two-qubit measurement basis which satisfy 〈φ B i |φ B j 〉 = δ i j . We measure with this basis the two-qubits a, b in the state |ϕ〉 = C Z a,c |Ψ〉 a |0〉 b |+〉 c . See Fig. 5. We obtain for j = 1, 2 (s = 0, 1) where a = σ 1 × I is a 1-cell stretching in the time direction, b =ã is its ancillary qubit, and c = σ 1 × pt is the 1-cell in the next time slice. The probability to find either j = 1, 2 is prob(1, α) + prob(2, α) ≳ e −4α .

Enforcement of Gauss law constraint against errors
In Section 3.2, we presented two measurement patterns for the MBQS of the model M (3,2) , the 2 gauge theory in (2 + 1) dimensions. The two, Methods (i) and (ii), differed in how to deal with the Gauss law constraint. The protocols for the two methods were explained assuming that there were no errors. In this section, we analyze the effect of errors with the following simplified error model where we assume that the measurement is always perfect while the resource state may be affected by the phase and bit flip errors. Namely, we consider a faulty resource state |ψ E 〉 := Z(e e e 1 )Z(e e e 2 )X (e e e ′ 1 )X (e e e ′ 2 )|ψ〉 , where and e e e n (e e e ′ n ) are the n-chains which support Z (X ) errors. We assume that the state |ψ 2d 〉 is defined on the plane x 3 = 0, and that e e e 1 6 Here we use abbreviated notations such as {σ 0 ×{ j}|σ 0 ∈ ∆ 0 } =: ∆ 0 ×{ j}. The ideas presented here can be generalized to the MBQS of imaginary-time evolution.

Gauss law enforcement by error correction
Here we explain how the gauge invariance violation of the simulated state can be suppressed by syndrome measurements and error correction. The essence of ideas is adopted from the literature [53][54][55]63]. We make a connection to the symmetry of the resource state, which will play an important role in identifying an SPT order of the state in Section 6.
We focus on the real-time evolution, and examine how the error chains affect the timeevolution operators. We claim that only the phase error on the bulk 1-chain Z(e e e 1 ) leads to the violation of the Gauss law constraint, but one can perform error corrections to suppress contributions that violate the gauge invariance. The other types of errors Z(e e e 2 ), X (e e e ′ 1 ), and X (e e e ′ 2 ) do not affect the eigenvalue of X (∂ * σ 0 ). They affect the time evolution but the faulty time evolution operator which we denote as U E+R (t) still commutes with X (∂ * σ 0 ).

Wave function without correction
be the time evolution unitary we wish to realize in the model M (3,2) with Method (ii) in the error-free situation: (21). (The parametersξ 1 andξ 4 should not be confused with the bare parameters that define the measurement angles, {ξ 1 , ξ 4 }, whose signs are chosen depending on the preceding measurement outcomes {s 1 , s 2 , s 4 }.) With a faulty resource state, we find that the following state is induced at the new boundary at x 3 : an X error changes the angle, ξ → −ξ, while a Z error changes the eigenvalue, s → s + 1. See Table 2. For example, the A-type measurement at σ 2 × { j} is affected by a Z error as The sign change is inherited from ξ 1 here toξ 1 in (86). Relative to eq. (86), the sign of the j-th (from the right when the power is written as the product of

Extra byproduct operators
The other effect is indirect and comes from the extra byproduct operators caused by errors, which flip the signs of the angles as we strip them off to the left of the time-evolution unitaries (which were expressed as Z(e (87)). More concretely, a similar calculation as we did in eq. (88) reveals that the X error chains on σ 2 × { j} and Z error chains on σ 1 × { j} give rise to extra Z-byproduct operators, and they flip the signξ 4 → −ξ 4 as we move them to the front. Likewise, the Z error chains on σ 1 × [ j, j + 1] cause extra X -byproduct operators that flip the signξ 1 → −ξ 1 . Now we give the explicit formula of the unitary U E (t). We define the faulty parameters as where the intersection pairing (see footnote below eq. (7)) should be taken by regarding one of the pair of chains as its dual. Then the faulty evolution unitary is given by where the product is ordered from right to left as j increases. We also give explicit formulas for the chains of extra byproduct operators: Crucially, the structure of the Pauli operators that appear in exponents of U E (t) is the same as the error-free time evolution unitary, thus the faulty time-evolution unitary does commute with the Gauss law generator: Also note in eq. (92) and (93) that the only contribution that does not commute with G(σ 0 ) is caused by the phase error Z(σ 1 × { j}). Besides, the syndrome measurement results are affected only by the error Z(σ 0 × [ j, j + 1]). This confirms our claim we made at the beginning of the section that only phase errors on the 1-chain Z(e e e 1 ) cause the effect that is related to the violation of the gauge invariance.

Syndromes and symmetry of resource state
Consider first the error-free resource state. We decompose the bulk qubits into We write We note that for each σ 0 ×{0} the product of the X -basis measurement results over ∂ * σ 0 ×{0} and σ 0 × [0, 1] is forced to be (−1) Q(σ 0 ) . This is because where we used the relation X (∂ * σ 0 )|ψ 2d 〉 = (−1) Q(σ 0 ) |ψ 2d 〉. In other words, the perfect resource state satisfies See Fig. 6 (Left). In terms of the measurement outcomes {s 2 , s 3 }, with the perfect resource state, it should be satisfied that As for the bulk, the corresponding relations are (see Fig. 6 (Right)) and (100) which is exactly the relation eq.(71). The relation (99) can be regarded as a consequence of a 1-form symmetry of which X (∂ ∂ ∂ * σ σ σ 0 ) is one of generators. In Section 6, we will see that the state gCS (3,2) belongs to a nontrivial SPT phase protected by this symmetry (together with another 1-form symmetry).
With the Z errors on a 1-chain e e e 1 , the relations eq. (98) and (100) are modified as follows: with σ 0 σ 0 σ 0 = σ 0 × { j + 1} and j ≥ 0. The combination of measurement outcomes for X (∂ * σ σ σ 0 ∂ * σ σ σ 0 ∂ * σ σ σ 0 ) on the left hand side of eq. (101) and (102) serves as the syndrome for our error correction, and we use these relations to infer the locations of the endpoints of the error chains. When the overlap of a Z error 1-chain with ∂ ∂ ∂ * σ σ σ 0 is even, the error does not change the sign of the eigenvalue of X (∂ ∂ ∂ * σ σ σ 0 ). However, the eigenvalue is flipped when the overlap is odd. Therefore one can identify the endpoints (0cells) of the Z error 1-chains using the X -measurement results on 1-chains ( Fig. 7 (a)). Based on the locations of the 0-cells, one can construct the recovery 1-chains r r r 1 ∈ ∆ ∆ ∆ 1 by connecting them with the shortest paths. Importantly, the recovery chain satisfies ∂ ∂ ∂ (r r r 1 +e e e 1 ) = 0. One can use the minimal-weight perfect matching algorithm [64,65], for example, to find such paths ( Fig. 7 (b)).

Final simulated state
We divide the total time steps into M sets of steps: L 3 = ℓ 1 + · · · + ℓ M , with M and ℓ i both positive integers. We define a stack S i of layers (consisting of cells that are relevant for error correction) as The blue balls represent 0-cells where the number of error chains surrounding it is odd, meaning that the set of X eigenvalues does not satisfies the symmetry equations: The cyan lines are the 1-chains that connect two balls with the shortest paths, which we use as recovery chains Z(r r r 1 ). (c) The error and recovery chains are projected to the final time slice. The net contribution from the errors and their recovery chain is a 1-cycle, Z(z 1 ).
Here we define ℓ 0 = 0 and use abbreviated notations such as We choose {ℓ i } so that in every S i we have an even number of endpoints of Z error chains. Once we perform the MBQS measurements on a stack S i , we analyze the measurement outcomes at 1-cells in it, as explained above. One can construct the recovery 1-chains by connecting 0-cells at which the error is detected via relations eq. (101) and (102), within S i . When the error is on a 1-chain σ 0 × [ j, j + 1] in the last layer of S i , the sum of the error chain and the recovery chain may not be a 1-cycle. Continuing construction of recovery chains for M steps, however, the sum of the total recovery chain and the total recovery chain becomes a 1-cycle, given the assumption that there is no Z errors at We treat the recovery chains constructed in S i as the same manner as the byproduct operators in the simulation after S i . In particular, the parameter ξ 4 is adjusted according to the recovery chain, which would suppress the impact of errors. Let r ( j) 1 be the projection of r r r 1 to the boundary, ∆ 1 × { j} (Fig. 7 (c)): Importantly, the sum of projected error and recovery chains is a 1-cycle on the time slice at When we reach x 3 = L 3 , we post-process the byproduct operator as well as the final recovery chain. The final state is thus where U E+R (t) is given by with t = x 3 δt and where ℓ( j) = A j m=1 ℓ m with A j the largest integer such that ℓ( j) ≤ j. The quantum state prepared with the simulation with the error-correction procedure thus satisfies the Gauss law constraint. We remark that, if we relax the assumption that there is no error at the final layer, endpoints in ∆ 0 × {L 3 } of error chains in the vicinity of the boundary cannot be identified. Also there can be an odd number of endpoints in the final stack S M . (The latter should be properly handled by selecting an even number of endpoints to be corrected.) In general, due to the presence of the error chain one of whose endpoints is not identified, the sum of the recovery and error chain would not be a 1-cycle, but there would be extra contributions of open 1-chains whose endpoints are at the boundary. Such open chains will violate the Gauss law constraint. When the error rate is small, the errors that cause the violation will be localized near the boundary x 3 = L 3 .

Gauss law enforcement by energy cost
In the same setup as above, we consider MBQS with the energy cost term. Again, we focus on Z(e e e 1 ). Here we consider the time x d = j and e 0 (e 1 ) is the restriction of e e e 1 to [ j, j + 1] ({ j}). The state after one step of the procedure with the faulty resource state reads The angle ξ 3 is chosen based on the former measurement outcomesb 1 := b 1 +s 2 with s 2 = σ 1 s 2 (σ 1 )σ 1 : This choice would give us unitaries that suppress contributions with errors Z(σ 1 ) a(σ 1 ;e 1 ) , if e 0 = 0. 7

Generalizations
In this section we generalize the results in Section 3 in several directions. We generalize the gauge group from 2 to N , and at the same time allow the parameters (d, n) of the model M (d,n) to be arbitrary. We also discuss a correspondence between the Euclidean path integral of the lattice gauge theory and the measurement-based quantum simulation of the model. Finally, we propose an MBQS protocol for the Kitaev Majorana chain.

MBQS of M
In this subsection We introduce the MBQS protocol for the Abelian lattice gauge theory with (n − 1)-form fields in d spacetime dimensions. We choose the gauge group to be N with integer N ≥ 2. The case with gauge group is discussed in Appendix C.

State gCS
We begin by reviewing the qudit, the N -dimensional generalization of the qubit. We define the operators Z and X by Z|a〉 = ω a |a〉 , X |a〉 = |a + 1〉 , with ω := e 2πi/N and a ∈ {0, 1, . . . , N − 1 mod N }. They satisfy We define the X -basis by which satisfy X | a〉 = ω a | a〉. The analog of the Hadamard operator is the Fourier transform It satisfies X F = F Z. The controlled-Z operator is defined as We generalize the state |+〉 as Let us consider a d-dimensional hypercubic lattice C. The n-cells in this lattice can be expressed as where 1 ≤ α 1 < · · · < α n ≤ d are the directions in which the cell is stretched, x is the position of the site at a corner of the cell, and e α i is the unit vector in the α i -th direction. We define the boundary operator as where α i means α i is removed from the subscript. One can confirm that ∂ ∂ ∂ 2 = 0 holds and that the definition of ∂ ∂ ∂ is consistent with that in simplicial homology [66].  Let C k ≡ C k (C; N ) be the Abelian group consisting of formal finite sums σ σ σ k ∈∆ ∆ ∆ k a(σ σ σ k )σ σ σ k with a(σ σ σ k ) ∈ {0, 1, . . . , N − 1 mod N } ≃ N . We place a qudit on every (n−1)-cell σ σ σ n−1 ∈ ∆ ∆ ∆ n−1 and on every n-cell σ σ σ n ∈ ∆ ∆ ∆ n . For each n-chain c c c n ∈ C n with c c c We similarly define Pauli Z operators on n-cells and Pauli X /Z operators on (n − 1)-cells. The Hamiltonian that defines the generalized cluster state is now given by whose ground state is given by the cluster state |ψ C 〉 = |gCS The stabilizers and the unitary U C Z are now defined as See Fig. 8 for an illustration with (d, n) = (3, 2).  basis

Model M
The field u σ σ σ n−1 takes values in u ∈ {1, ω, ..., ω N −1 }. The partition function of M n) as a classical spin model is given by

Hamiltonian formulation of M
As a quantum lattice model, M Suppose that we have external charge sources with charges Q s ∈ {0, 1, . . . , N − 1 mod d} associated with (n − 2)-cells s. Physical states must obey the Gauss law constraint where See Appendix B for a derivation of the quantum model as a limit of the classical model.

MBQS protocols for M
One Trotter step consists of measurements (1)-(4) given in Table 3. These measurements have the following effects on the wave function.
We measure the qudit on σ σ σ n−1 along M ( N ,A) to implements the energy cost for Gauss law violation. We apply the identity (A.3). We note that and find Here the state lives on the interval [ j, j + 1].

Euclidean path integral and Hamiltonian MBQS
Our MBQS with the quantum Hamiltonian derived from M ( N ) (d,n) is done by measurements on gCS (d,n) , and it is suggestive that the spacetime structure of the classical action I (d,n) resembles the structure of the entangler in gCS (d,n) . The aim of this section is to make such a quantumclassical correspondence manifest in terms of the Euclidean path integral or the partition function of the model M ( N ) (d,n) . It is a version of the correspondence found in [27], specialized to the model M ( N ) (d,n) . This subsection has some overlap with [67]. For the gauge group N , let us define Its overlap with the generalized cluster state (124) is the probability amplitude for obtaining the special measurement outcomes s = 0 in the measurement of qubits on n-cells with the A-type basis (133) and those on (n − 1)-cells with X -basis. Now we replace κ to an imaginary parameter κ = iβ J, then this quantity is proportional to the partition function Z The case with the gauge group is discussed in Appendix C. For the gauge group 2 , we developed the imaginary-time MBQS in Section 3.3. If we use the A-type measurement basis state and define (74) we have 〈φ The left-hand side of (147), which is real and positive as can be seen from the right-hand side, is the probability amplitude to obtain (146) as the outcome of the simultaneous non-adaptive measurement of all the qubits on n-cells in the A-type basis and those on (n − 1)-cells in the X -basis. We can also consider an extended operator W (C C C), which is a generalization of the Wilson loop. The operator is supported on an (n−1)-cycle C C C ∈ ker(∂ ∂ ∂ n−1 ), where ∂ ∂ ∂ n−1 is the boundary operator ∂ ∂ ∂ acting on n-chains C C C n . The unnormalized expectation value of W (C C C) is The relation (147) generalizes to This relation implies that there is a constant-depth unitary circuit U W such that 〈W (C C C)〉 ∝ 〈0, 0| ⊗∆ n 〈0| ⊗∆ n−1 U W |0, 0〉 ⊗∆ n |0〉 ⊗∆ n−1 . One can perform the Hadamard test [58] to estimate the matrix element of U W to obtain the the expectation value of the generalized Wilson loop operators within polynomial time.

Kitaev Majorana chain
Here we propose a measurement-based simulation scheme for a fermionic system, namely Kitaev's Majorana chain [23] defined by the Hamiltonian where More precisely, we wish to implement the Trotterized time evolution operator via measurements. Unlike [68], where a different scheme for the Kitaev chain was proposed, our scheme involves measurements of fermion parities and is motivated by a relation between the Jordan-Wigner transformation and measurements [24].
To describe the resource state used for simulation, let us consider a two-dimensional square lattice C. As shown in Fig. 9(a), we assign some orientations to edges e e e ∈ ∆ ∆ ∆ 1 and faces and label its eigenvalue and eigenstate as (−1) p and obey the same algebraic relations as the Pauli operators (Z, X , Y ), so that We also define a hermitian operator squaring to 1, where the vertices v v v ± = v v v ± (e e e) are defined by the relation On each edge e e e ∈ ∆ ∆ ∆ 1 we introduce a qubit. Following [24], we define the operator C S e e e to be S e e e controlled by the qubit on e e e and set U C S := e e e∈∆ ∆ ∆ 1 with the following ordering. Within a horizontal layer the operators C S e e e commute with each other, and we let them appear in the product simultaneously. We order such layers so that as we go down in Fig. 9(a) we go to the left within the product (155). 8 We now define the cluster state |ψ C 〉 [24] by Its stabilizers are 9 8 This ordering cannot be realized by a shallow circuit. A different ordering (for example, all vertical edges after all horizontal edges) can be, but it is not clear whether such an ordering enables measurement-based simulation. 9 Note  Fig. 9(d), and for a vertical edge e e e, and U C S X e e e U −1 C S = X e e e S e e e Z e e e ′ = for a horizontal edge e e e. Using the operators S and P on a one-dimensional lattice we can rewrite the Hamiltonian where the vertices v ∈ ∆ 0 and the edges e ∈ ∆ 1 are those of a one-dimensional lattice. Written in this way, it is manifest that different terms commute with each other within each of H hop and H P , so that the evolution operator can be written as Let us now consider a reduced two-dimensional lattice C red which is periodic in the 2direction and has a boundary, which is to be identified with the one-dimensional lattice for the Majorana chain. See Fig. 9(b) and (c). We assign a non-negative integer j ≥ 0 for each layer, so that as cells of the two-dimensional lattice, the vertices are v v v = v × { j}, horizontal edges are e e e = e × { j}, and vertical edges are e e e = v × [ j, j + 1]. In the middle of simulation the state of the total system takes the form See Fig. 10(a). Next let us consider an edge that extends within the bulk in the 2-direction. See Fig. 9(d). We find where In (168), one may move (γ v v v + ) t to the left, changing e −iξP to e −i(−1) t ξP . This implies that we can teleport 10 |ψ〉 = p ψ p |p〉 at v v v − to e −i(−1) t ξP |ψ〉 at v v v + by measuring the fermion in the P-basis at v v v − and by measuring the qubit on e e e in the eigenbasis for e iξZ X e −iξZ , up to byproduct operators. See Fig. 10(b) and (c). By applying (165) and (168) repeatedly, we see that the following measurement pattern, with measurement angles ξ chosen adaptively, realizes the time evolution (161) for the Kitaev chain: Let us discuss the computation of physical observables. Natural local observables of the Kitaev chain are the individual terms in the Hamiltonian. The observable P v in H P can be computed simply by measuring it at v. The computation of the observable S e is more interesting. At the end of simulation the state is of the form where O bp is the byproduct operator. If we measure X on edge e with outcome s e ∈ {0, 1}, the resulting state is This means that the outcome of measuring X e on |Ψ〉 is the same as the outcome of measuring S e on O bp |ψ〉 ∆ 0 . The knowledge of the measurement outcomes throughout the simulation allows us to know whether the operator S e commutes or anti-commute with O bp . Thus we can compute S e for the state |ψ〉 by measuring X e on edge e.

SPT order of the generalized cluster state
A nontrivial phase, in the sense of the topological order, is defined as the depth of the local quantum circuit required to prepare the state from a product state being large. A wave function in an SPT phase can be prepared with a finite depth local quantum circuit. The SPT phase is nontrivial if the state requires a large-depth local quantum circuit when we demand the circuit to commute with the symmetry of interest. The gauging procedure [38,[70][71][72][73] is a powerful tool to diagnose an SPT order. Upon gauging, trivial and nontrivial SPT Hamiltonians belong to two distinct topological phases. This method has been applied to several models to demonstrate that they have nontrivial SPT orders. In the original argument [70], the Levin-Gu SPT state, which is an SPT with a 0-form symmetry, was minimally coupled to a 1-form gauge field, and the gauged model was shown to possess excitations with double-semionic braiding statisics, which differs from the braiding statistics found in the gauged version of trivial SPT order. The method can be employed for detecting SPT orders protected by higher-form symmetries as well [38], and the argument suggested that the RBH cluster state has a non-trivial SPT order protected by a 2 × 2 1-form symmetry [72]. Our generalized cluster state gCS (d,n) is a natural extension of these states, and it is plausible that it has an SPT order with higher-form symmetries. In this section, we discuss gauging the Hamiltonian that defines gCS (d,n) .
First we will see that the generalized cluster state gCS (d,n) possesses (d − n)and (n − 1)form 2 symmetries. Then we define the gauging map and discuss its properties. The definition we employ is the one discussed in [38], for example. (We can regard the map as a result of minimally coupling gauge degrees of freedom. See Appendix E.) Then we apply the method to our generalized cluster state to argue that it possesses a nontrivial SPT order protected by (d − n)and (n − 1)-form 2 symmetries.

Symmetries of the generalized cluster states
The generalized cluster state gCS with We refer to M M M and M M M ′ respectively as nand (d − n + 1)-brane operators (generalizing "membrane" operators). The existence of such symmetries can be shown by taking a product of corresponding stabilizers over the closed manifold: A similar calculation can be done for the other type of stabilizers as well. Special cases of symmetry generators in (176) are X (∂ ∂ ∂ σ σ σ n−1 ) and X (∂ ∂ ∂ * σ σ σ n−2 ). See (99).

Gauging map
We now introduce the gauging map. Let and H s y m 1 with Below we will make use of the following argument [70]. Let us consider gauging two Hamiltonians If the two topological orders that H Γ 1 and H Γ 2 possess differ, then the SPT orders that H 1 and H 2 have cannot be the same. Indeed, if there were a path [74] that connects H 1 and H 2 without breaking the symmetry or closing the energy gap, then there would also be a path that connects H Γ 1 and H Γ 2 , which is a contradiction.

Mapping the generalized cluster states
Now we consider the trivial Hamiltonian defined on n-cells and (n − 1)-cells in d-dimensions, and the Hamiltonian for the gCS (d,n) , Let us first consider gauging the trivial Hamiltonian. The operator X (σ σ σ n ) is mapped to X (∂ ∂ ∂ σ σ σ n ), and X (σ σ σ n−1 ) to X (∂ ∂ ∂ * σ σ σ n−1 ). Following [70] we add Z(∂ ∂ ∂ σ σ σ n+1 ) (if n + 1 ≤ d) and Z(∂ ∂ ∂ * σ σ σ n−2 ) (if n − 2 ≥ 0) to the Hamiltonian so that the fluxes vanish (the gauge fields are flat) in the ground states. Therefore we obtain Here H n and H n−1 define two decoupled theories on n-cells and (n − 1)-cells, respectively. For the generalized toric code H n , there are N site · d C n physical qubits living on n-cells and k := d C n logical qubits, where d C n = d!/n!(d − n)!. There are k pairs of anti-commuting logical operators, where a logical Pauli Z operator acts on n-dimensional hyperplanes and a logical Pauli X operator acts on (d − n)-dimensional hyperplanes which are non-contractable on a torus. See [75] for details.
On the other hand, gauging the gCS Hamiltonian gives where We do not need to add extra terms to make the fluxes vanish because . The Hamiltonian (191) is the Hadamard transform of the original Hamiltonian H gCS , so the ground state described by the mapped Hamiltonian H Γ gCS is still shortrange entangled, meaning it does not have a topological order. Since the gauged version of the trivial Hamiltonian possesses a nontrivial topological order, the ungauged Hamiltonian H gCS is in a nontrivial SPT phase.

Brane operators and projective representation
Another approach to probing a nontrivial SPT order is to find a projective representation 11 by introducing boundaries [33,77]. Recall that we have K(σ σ σ n ) and K(σ σ σ n−1 ) associated with σ σ σ n ∈ ∆ ∆ ∆ n and σ σ σ n−1 ∈ ∆ ∆ ∆ n−1 , respectively. In the bulk, we have a symmetry generators, each of which is a product of stabilizers over a closed manifold. Namely, the (n − 1)-form symmetry is generated by (d − n + 1)-brane operators, and (d − n)-form symmetry is generated by n-brane operators. In this section, we consider a lattice with boundary and we wish to show that the action of the symmetry generator at the boundary forms a projective representation, which indicates that the bulk theory is an SPT protected by the symmetry.
Let us consider a d-dimensional lattice, which is periodic in the (x 2 , x 3 , . . . , The former corresponds to a union of n-cells within a hyperplane extended in the (x 1 , x 2 , . . . , x n )-directions. The latter corresponds to a union of (n − 1)-cells extended in (x 2 , · · · , x n )-directions intersecting with a hyperplane extended in the (x 1 , x n+1 , · · · , x d )-directions. For definiteness, we consider the case where the boundaries at x 1 = 0, L 1 consist of (n − 1)-cells. We denote the boundary at x 1 = 0 as L L L and that at x 1 = L 1 as R R R. The same argument below holds as well when we take n-cells as boundaries.
Now the brane operators are defined as We consider the restriction of these operators to the boundary: 12 Now, since for an arbitrary pair of chains c c c, This implies that the brane operators restricted to a boundary furnish a projective representation of 2 × 2 , with each factor generated by one type of brane operator. This observation supports our claim that the gCS possesses a nontrivial SPT order protected by 2 (d − n)and (n − 1)-form symmetries. This generalizes a result in [72] for gCS (3,2) . For the Majorana state (156) with fermionic symmetry, it was argued 13 in [24] that one can find a nontrivial commutation relation between the fermionic F 2 0-form symmetry and bosonic 2 1-form symmetry, the latter of which has fermionic operators at its endpoints. The SPT class for such pair of symmetries is suggested to be nontrivial, although there is only one SPT class.

Symmetries in measurement-based quantum simulation and a bulk-boundary correspondence
In this section we study the interplay between the symmetries of the lattice models to be simulated and those of the bulk cluster states that simulate the lattice models. We propose that MBQS is a type of bulk-boundary, or holographic, correspondence between the simulated theory M (d,n) and the system given by the generalized cluster state |gCS (d,n) 〉, generalizing [78].
We discuss the case of (d, n) = (3, 1) and (3, 2) explicitly. The reinterpretation of the stabilizers [41] as gauge symmetries discussed in Appendix D also supports our proposal.

Ising model M (3,1)
The Hamiltonian (17) of the model M (3,1) is invariant under the simultaneous sign flip of Z(σ 0 ) for all vertices σ 0 ∈ ∆ 0 . This is an an ordinary (0-form) global 2 symmetry generated by σ 0 X (σ 0 ). In the middle of the simulation, the qubits that remain unmeasured reside on a threedimensional lattice, which is periodic in two (1-and 2-) directions and has a boundary. 14 The simulated state |ψ 2d 〉 of the Ising model is defined on the qubits at the vertices of the twodimensional square lattice that is identified with the boundary of the three-dimensional lattice. The total state |ψ 3d 〉 takes the form Here O bp is the byproduct operator, i.e., a product of Pauli operators acting on |ψ 2d 〉, which arises from the preceding measurements. The state |+〉 bulk is the tensor product of the Xeigenstates with eigenvalue +1 (|+〉) over all the bulk qubits and the vertex qubits on the boundary. The entangler U C Z is the product of all the controlled-Z gates between neighboring pairs of a vertex and an edge. Let g be the generator of the zero-form global symmetry 2 , and U g = σ 0 X (σ 0 ) its representation on the Hilbert space of the Ising model. We wish to understand the effect of U g on |ψ 3d 〉 in the coupled boundary-bulk system. We have 13 The state we consider and the one considered in [24] only differ by the order of application of the entanglers, U C S . 14 Explicitly, in terms of Cartesian coordinates (x 1 , x 2 , x 3 ), we have periodic identifications x 1 ∼ x 1 + L 1 and x 1 ∼ x 2 + L 2 (L 1,2 ∈ >0 ), and have a boundary at x 3 = −(t/δt) ∈ . The vertices σ σ σ 0 ∈ ∆ ∆ ∆ 0 (C red ) are the points (x 1 , x 2 , x 3 ) with x 1,2,3 ∈ and x 3 ≤ −(t/δt).
We note that O bp U g O −1 bp equals (−1) m U g , where (−1) m is a sign determined by the outcomes of the preceding measurements. Therefore, the operator for an arbitrary gauge parameter (0-cochain) Λ : C 0 → 2 whose boundary value is constrained to be Λ(σ 0 ) = 1 for σ 0 ∈ ∆ 0 . The action of U U U g on |ψ 3d 〉 is equivalent to the action of U g on |ψ 2d 〉: We now argue that the relation (202) is a manifestation of a new kind of bulk-boundary, or holographic, correspondence. In such a correspondence, a global symmetry of the boundary theory is identified with a gauge symmetry of the bulk theory. Indeed in the current set-up, the symmetry generator U g of the boundary becomes the product of K(σ σ σ 0 ) = X (σ σ σ 0 )Z(∂ ∂ ∂ * σ σ σ 0 ) over σ σ σ 0 ∈ ∆ ∆ ∆ 0 , and the operator K(σ σ σ 0 ) generates the gauge transformation of the bulk theory defined by the Hamiltonian and the Gauss law constraint X (σ σ σ 0 )Z(∂ ∂ ∂ * σ σ σ 0 ) = 1. It is a (3 + 1)-dimensional Ising model coupled to the topological 2 gauge theory with gauge field X (σ σ σ 1 ), and has the cluster state |gCS (3,1) 〉 as the unique ground state. (3,2) In this subsection, we use the asterisk ( * ) to denote quantities (such as bulk i-cells σ σ σ * i ∈ ∆ ∆ ∆ * i ) associated with the dual lattice. Let us consider the 2 gauge theory defined by the Hamiltonian (19).

Gauge theory M
The electric 2 one-form symmetry is generated by for z * 1 ∈ ker(∂ * 1 ). The operator X (z * 1 ) commutes with the Hamiltonians (19). Moreover, the action of X (z * 1 ) on the physical Hilbert space is invariant under a local deformation of z * 1 because of the Gauss law constraint (20), except when it crosses the location of an external charge and changes its sign. This means that X (z * 1 ) is a topological defect operator that generates the 2 one-form symmetry under which Wilson lines are charged. For each generator of the dual 1-homology, the operator X (z * 1 ) defines a logical Pauli X operator in the toric code limit λ → ∞ in the deconfined phase.
Next let us consider the Wilson loop operator for an arbitrary 1-cycle z 1 ∈ Z 1 . The Wilson loop exhibits the area law in the confined phase and the perimeter law in the deconfined phase [20,22]. In the 2 topological field theory (realized in the low-energy limit with λ > λ c or in the toric code limit λ → ∞ of our 2 gauge theory), Z(z 1 ) is a generator of the magnetic 2 one-form symmetry. 15 Since Z(z 1 ) does not commute with the electric term in the Hamiltonian of the gauge theory, the one-form symmetry  global symmetry / generator gauge symmetry /generator is absent except in these limits. For each generator of the 1-homology, the operator Z(z 1 ) defines a logical Pauli Z operator in the toric code limit λ → ∞ in the deconfined phase.
Recall that the RBH cluster state is defined on the qubits placed on the edges and the faces of the three-dimensional cubic lattice C, with qubits placed on edges σ σ σ 1 ∈ ∆ ∆ ∆ 1 and faces σ σ σ 2 ∈ ∆ ∆ ∆ 2 . The RBH cluster state |ψ C 〉 is the simultaneous eigenstate, with eigenvalue +1, of the stabilizers K(σ σ σ 1 ) = X (σ σ σ 1 )Z(∂ ∂ ∂ σ σ σ 1 ) and K(σ σ σ 2 ) = X (σ σ σ 2 )Z(∂ ∂ ∂ * σ σ σ 2 ). In the middle of the simulation, the system is again defined on the reduced lattice C red . The state of the system differs from the RBH cluster state only on the boundary qubits which encode the gauge theory state and can be written again as (199), where this time |+〉 is the tensor product of copies of |+〉 over all the bulk qubits and the face qubits on the boundary. The same argument as in Section (7.1) applied to U g (z * 1 ) gives the relation where and c c c * 2 is an arbitrary 2-chain on the dual lattice such that its restriction to the boundary coincides with z * 1 . The operator K(σ σ σ * 2 ) = X (σ σ σ * 2 )Z(∂ ∂ ∂ * σ σ σ * 2 ) generates the gauge transformation of the bulk theory defined by the Hamiltonian and the Gauss law constraint X (σ σ σ * 2 )Z(∂ ∂ ∂ * σ σ σ * 2 ) = 1. It is a (3 + 1)-dimensional generalized Ising model coupled to the topological 2 gauge theory (with 1-form gauge symmetry) with 2-form gauge field X (σ σ σ 2 ), and has the RBH cluster state as the unique ground state. Thus the bulkboundary correspondence discussed in Section 7.1 for the Ising model naturally generalizes to the gauge theory.
We summarize in Table 4 the global and gauge symmetries of the resource state in the bulk and the simulated theory on the boundary.

Discussion: comparison to circuit-based quantum simulation
Let us compare the resource required for MBQS of M (d,n) with that for the standard circuitbased quantum simulation. Let us assume that we prepare gCS (d,n) from |+〉 by applying the C Z gate. We have for MBQS, where notations are self-explanatory. The execution time T MB for MBQS is governed by the duration T measure to perform the single-qubit measurement with X -or Z-basis and the duration T rot to perform rotations. The latter needs to be executed after the former measurements are performed since the rotation angle needs to be adapted. We have , for n ≥ 2 (energy cost) , where T 0 (= T H + T C Z ) is the constant time for preparing gCS (d,n) . For the circuit-based quantum simulation, let us assume that we have a (d −1)-dimensional processor whose qubits are placed on nand (n − 1)-cells. We consider the following unitary acting on the simulated state |ψ〉 on (n − 1)-cells and an ancilla |+〉 j on an n-cell to realize the multi-body interaction, which is naturally related to our MBQS: Here k corresponds to a qubit for |ψ〉. Then, the resource to perform the circuit-based quantum simulation would be where N CB C Z (N CB rot ) is the number of C Z (e iξX ) gates required on the processor. For n = 1, each Trotter step has four layers of unitaries: (1) e iξX for (n − 1)-cells (2) C Z gates (3) e iξX for n-cells (4) C Z gates. For n ≥ 2, we have further layers of unitaries to enforce the Gauss law constraint. We find that the execution time T CB is given as follows: for n = 1 , for n ≥ 2 (energy cost) , Both schemes demand run time linear in the number Trotter steps: MBQS has advantage over the circuit-based approach when the measurement can be executed faster than the C Z gate. This advantage is achieved at the cost of using more qubits: As discussed in MBQC literatures, it is also interesting to pursuit advantage by shifting the difficulty of entangling gates to the generation of cluster states: one can use beam splitters instead of the C Z gates to generate large-scale continuous-variable cluster states.

Conclusions and future directions
In this work we introduced a family of resource states gCS (d,n) (generalized cluster states), and showed that the Hamiltonian quantum simulation of Wegner's model M (d,n) , with an (n − 1)form gauge field for the 2 gauge group in d spatial dimensions, can be implemented by specifically adapted single qubit measurements of gCS (d,n) . We devised methods to enforce the Gauss law constraint based on syndrome measurements and the energy penalty. We also generalized the simulation protocols to the gauge group N . By attaching ancillas and allowing two-qubit measurements, we can also perform the imaginary-time quantum simulation. We studied the correspondence (for gauge group N ) between the generalized cluster states and the statistical partition functions of M (d,n) regarded as classical spin models. We also proposed a measurement-based protocol for simulating the Kitaev Majorana chain. We demonstrated that gCS (d,n) has a symmetry-protected topological order with respect to generalized global symmetries that are related to the gauge symmetries of the simulated gauge theories.
For the model M (d,n) with the gauge symmetry generated by G(σ n−2 ), the analogue of the 1-form symmetry of the resource state gCS (3,2) is the (n − 1)-form symmetry of gCS (d,n) . We expect that this higher-form symmetry can be used for the syndromes and the enforcement of gauge invariance for the model M (3,2) would generalize to M (d,n) .
It is possible, at least formally, to make the gauge group continuous. In Appendix C, we discuss an approach to simulating the non-compact U(1) gauge theory using the continuousvariable cluster state [79,80]. The method we present for this gauge group should be regarded formal due to the divergence coming from integrating over non-compact variables, and in experiments the related issue is the imperfection of the continuous-variable cluster state due to the finite squeezing. Nonetheless, we draw readers' attention to recent development in generating large scale cluster states using photons [81][82][83][84]. At the moment, the best approach to simulating compact U(1) theories is to take N large in the model M n) . It would also be important to generalize the MBQS scheme to non-Abelian gauge groups.
Another future direction is the measurement-based simulation of more realistic high energy theories such as QED, QCD, the Standard Model and the Grand Unified Theories, as well as quantum-many body systems in condensed matter physics. In this respect, quantum simulation of Kitaev's Majorana chain we considered in this work would give us a hint on how to combine Dirac or Weyl fermions in a resource state. It would also be interesting to relate the SPT order of the bulk resource states to the dynamical phases of the simulated models, where the bulk-boundary correspondence we observed in our work may be useful.
The presence of an SPT order has been suggested to be an important ingredient of resource states for the ability to perform the (universal) MBQC [85][86][87][88][89][90][91][92][93][94][95][96]. More recently, it was shown that certain quantum states with the long-range entanglement can be obtained with constant depth operations via measuring states in non-trivial SPT phases [24,39,40,97,98], and there have been emerging new aspects of complexity in quantum-many body systems through the lens of measurements. In Appendix F we construct a tensor network representation of the generalized cluster state and show that a projective representation appears via the action of generalized global symmetries. It would be nice to find a continuous deformation of the tensor network within the corresponding SPT phase. As a related future direction, it would also be interesting to relate the ability to perform MBQS of a quantum-many body system with a symmetry to the SPT order of an appropriate resource state.

A Proof of equations
In this appendix, we prove some identities related to measurements. To make the presentation compact, we give proofs in the qudit case, which reduces to the qubit case by taking N = 2, ω = −1, and F = H. We denote F |s〉 by |s〉, which are the X -eigenstates with eigenvalues ω s . Proof of (38), (59), and (139) Consider a general state |Ψ〉 on qudit 0. We wish to transport it to qudit 1 by a measurement in the basis f (Z)|s〉 s = 0, 1, . . . , N − 1 , where f is an arbitrary function such that f (Z) † = f (Z) −1 . The choice f (Z) = 1 corresponds to basis M (X ) in (58) and (135), and f (Z) = e i(ξZ+h.c.) corresponds to M (B) in (56) and (138). We claim that the following identity holds: Here ε = ±1. The equations (38), (59), and (139) follow from (A.1).

3). A qumode identity
We have The proof is similar to the one for (A.1). Next, consider a qumode 0 in state |0 p 〉 and qumodes 1,...,m in a general state |Ψ〉. We prove the relation The relation (A.6) can be shown by using the definition C Z 0a = e iQ 0Qa and by noting that for a general function F .

B Continuous-time limit of model M
In this section, we give a derivation of the continuous-time limit for the model M ( N ) (d,n) , generalizing the discussion for gauge theories [20,100,101]. Consider the N variable u ∈ {1, ω, ..., ω N −1 } with ω = e 2πi/N . We define for a k-chain c k , Consider an anisotropic action Here, σ σ σ s n (σ σ σ t n ) is n-cells stretched in spatial (temporal) directions. The gauge transformation that leaves the action invariant is defined for each (n − 2)-cell and given by We use the gauge transformation to bring temporal fields to unity, Then, using (120), the first term in the action becomes = u(σ σ σ i 1 ,··· ,i n−1 (x + e d ))u(σ σ σ i 1 ,··· ,i n−1 (x)) * + h.c. (B.5) Now the two factors on the right hand side are defined on the same (n − 1)-cell in respective time slices, thus we can simply express it as We can further rewrite it using a norm and we obtain Now, we consider the partition function Z = {u} e −β I [{u}] , and express it as the trace of a product of transfer matrices, Z = tr[(e −τH ) T ]. We will identify the parameters and take the continuum limit as follows: The diagonal element of the transfer matrix between j and j + 1 is identified as which gives us the identification for the diagonal part of the Hamiltonian with the N phase operator, Next, we consider a single-shift transition, This gives the minimum energy cost 2J t (1−cos( 2πi N )) ≡ J t C t 1 from the temporal term and J s C s 1 from the spatial term, the latter of which depends on specific field configurations. We identify in the continuous-time limit as Transitions that involve more than one shift of the field become higher order contributions on the right hand side. Thus we can identify 14) The total Hamiltonian in the continuous-time limit is then Finally, we examine the gauge symmetry of this theory. We have used the gauge transformation to bring the temporal fields to unity, and there are residual gauge transformations that leave the temporal fields invariant. That is, we consider the gauge transformation constant over time: where σ ( j) n−2 = σ i 1 ,··· ,i n−2 (x, j) with x being the spatial coordinate, j being the time coordinate, and i 1 < ... < i n−2 < d. Namely, the product is taken over time for (n − 2)-cells that do not stretch in the time (d-th) direction. This leaves us the gauge transformation that does not depend on time, and it can be written as with the gauge field θ σ n−1 . When θ σ n−1 ∈ [0, 2π), we refer the group as U (1). On the other hand, θ σ n−1 ∈ (−∞, +∞), we refer the group as non-compact U(1) or simply . Our MBQS considered in the following part corresponds to the non-compact U(1) group.

C.2 MBQS of M ( ) (d,n)
We consider MBQS of the model M ( ) (d,n) using the continuous-variable cluster state [79,80]. We introduce the qumode basis by the eigenstate ofP andQ operators, i.e. [Q,P] = i, such thatP The Pauli operators are generalized to the Weyl-Heisenberg operators as Note that The |+〉 state corresponds to |0 p 〉 and the C Z gate is defined by C Z a,b = e iQ aQ b , (C.11) and the Fourier transformation, which corresponds to the Hadamard gate, is defined by This Fourier transformation flips the basis as F |s q 〉 = |s p 〉. 16 Also, the following equalities hold: 17 The measurement pattern is as follows: (P) and consider the measurement in the basis (2) σ σ σ n−1 = σ n−1 × { j} Consider the measurement in the basis We impose the Gauss law constraint by introducing the energy cost term. We consider the measurement basis (Q) . Consider the measurement basis For the A-type measurement we use the identity (A.6) and For the B-type measurement we use the identity (A.5). The unitaries from the sequence (i)-(iv) result in the following unitary: 17 For a general Gaussian rotation R(θ ) = exp i θ 2 (Q 2 +P 2 ) for the (Q,P) quadrature, we have The Fourier transform is a special case with F = R π 2 .
When the measurement outcome is s 1 = m 2 = s 3 = m 4 = 0 everywhere, we choose the function φ i (i = 1, 3, 4) as follows: with q chosen as Q(σ n−2 ) for the measurement at σ n−2 ∈ ∆ n−2 . By identifying the gauge field θ σ n−1 withQ σ n−1 and the conjugate momentum L σ n−1 with (−1) n−1P σ n−1 , we obtain the desired time evolution unitary for the non-compact U(1) lattice gauge theory: To deal with the byproduct operators with m i ̸ = 0, we just need to shift the argument of the function φ i (s). This follows from the fact that we only have X (s) and Z(s) for byproduct operators, so arranging the unitary in the appropriate form only requires the commutation relations φ(Q)X (s) = X (s)φ(Q + s) and φ(P)Z(s) = Z(s)φ(P + s) for a general function φ(x). Experimentally, if one wishes to realize the MBQS with the measurement bases (C.21) using photons, non-Gaussian function φ 1 (x) = δt 1 g 2 cos(x) would be hard to realize. One may instead consider a regime where the approximation cos(x) ≃ 1− 1 2 x 2 is valid: namely, the continuum limit, where the lattice spacing a is small. One can also improve the approximation by expressing higher-order terms in cosine using an expansion with Gaussian gates. See e.g. [102,103]. We note that |0 p 〉 = (2π) −1/2 dθ |θ q 〉. We find

C.3 A formal correspondence between gCS
We note that the right hand side of the equation (C.24) is divergent since the integration is over (−∞, +∞) and the integrand is periodic. Therefore the equation is formal and requires a regularization (including division by the divergent volume of the gauge group) or gauge fixing. Note that the rotation J → iβ J brings the expression to the Euclidean path integral.

D Stabilizer operators as gauge transformations
In [41,104], a reinterpretation of the MBQC as gauge theory is given. In particular, stabilizer operators of the 1-dimensional cluster state (gCS (1,1) in our notation) are reinterpreted as gauge transformations. In this appendix we show that this extends very naturally to gCS and their measurement results s * d−n+1 (σ * d−n+1 ) at σ n−1 = σ * d−n+1 , 18 as well as and their measurement results s n (σ n ) at σ * d−n = σ n . Recall that a k-cochain is a linear map C k → 2 , (D. 4) where C k is the group consisting k-chains. We denote the group of k-cochains by C k . The corresponding objects on the dual lattices will be denoted by C * k and (C * ) k . We regard various quantities as cochains on the primal and dual lattices as cochains: Taken together, the gauge transformations of the parameters are q n−1 → q n−1 + Λ n−1 , s n → s n + dΛ n−1 , and their measurement results t * d−n (σ * d−n ) at σ * d−n = σ n . Considerations similar to the above give the gauge transformations t n−1 → t n−1 + Λ n−1 , p n → p n + dΛ n−1 , (D. 16) We confirmed, in the (d, n) = (3, 2) case, that the simulated unitary evolution including the byproduct operators in (62) is invariant under the gauge transformations (D.13) and (D. 16) in the bulk. Note that at the boundary x 3 = 0, the stabilizer K(σ σ σ 1 ) (σ σ σ 1 = σ 1 × {0}) is not a symmetry of the resource state with an arbitrary initial wave function |ψ 2d 〉 ∆ 1 ×{0} , so there is not a gauge transformation corresponding to this stabilizer.

E Gauging map via minimally coupled gauge fields
The aim of this appendix is to derive the gauging map (184) by minimally coupling gauge fields. For simplicity we use normal fonts and focus on the gauging map Γ : H where α(c n ) are complex coefficients. We note that inserting σ n G(σ n ) a(c n ;σ n ) in front of |c n 〉 does not change (E.2). Thus we can write

F Tensor network representation of gCS d,n
In this appendix we study a tensor network representation of the generalized cluster state gCS d,n . Since we only consider the d-dimensional bulk cell complex, we use non-bold symbols to simplify notations.
As an example, let us consider gCS 1,1 , i.e., the standard one-dimensional cluster state. The above reduces to the matrix product state representation given by the matrices where σ x and σ z are Pauli matrices. We have the relation where U(a, b) = σ a z σ b x is a non-trivial projective representation of 2 × 2 . As noted in [85], such a relation can be used to show that the cluster state is in a non-trivial SPT order.
which guarantee the invariance of |gCS d,n 〉 under K(σ n ). Similarly, for given σ n , let σ ′ n−1 be any of the (n − 1)-cells such that σ ′ n−1 ⊂ ∂ σ n . The same tensors also satisfy the relations of other tensors associated with qubits living on the nand (d − n + 1)-branes. We expect that more general tensor networks obeying the same relation provide deformations of states away from |gCS (d,n) 〉 within the SPT phase, and speculate that they possess the ability to simulate the lattice model M (d,n) via measurements.