On the Universality of the Quantum Approximate Optimization Algorithm

The quantum approximate optimization algorithm (QAOA) is considered to be one of the most promising approaches towards using near-term quantum computers for practical application. In its original form, the algorithm applies two different Hamiltonians, called the mixer and the cost Hamiltonian, in alternation with the goal being to approach the ground state of the cost Hamiltonian. Recently, it has been suggested that one might use such a set-up as a parametric quantum circuit with possibly some other goal than reaching ground states. From this perspective, a recent work [S. Lloyd, arXiv:1812.11075] argued that for one-dimensional local cost Hamiltonians, composed of nearest neighbor ZZ terms, this set-up is quantum computationally universal, i.e., all unitaries can be reached up to arbitrary precision. In the present paper, we give the complete proof of this statement and the precise conditions under which such a one-dimensional QAOA might be considered universal. We further generalize this type of universality for certain cost Hamiltonians with ZZ and ZZZ terms arranged according to the adjacency structure of certain graphs and hypergraphs.


Introduction
A question in the field of quantum information processing is whether contemporary quantum processors will in the near future be able to solve problems more efficiently than classical computers. Combinatorial optimization problems are of special interest, for which a class of algorithms under the name of Quantum Approximate Optimization Algorithm (QAOA) have been proposed [1]. QAOA consists of a bang-bang protocol [2] that is expected to solve hard problems approximately. This procedure involves the unitary evolution under a Hamiltonian encoding the objective function of the combinatorial optimization problem and a second non-commuting mixer Hamiltonian. Since its proposal, QAOA has been extensively studied to understand its performance [3,4,5], for establishing quantum supremacy results [6] and for solving several optimization problems [7,8,9]. This algorithm together with others such as the variational quantum eigensolver (VQE) [10,11,12] are part of the so called variational hybrid quantum/classical algorithms, combining the computational power of a quantum computer to prepare quantum states with a classical optimizer. These variational algorithms (including QAOA) have shown several advantages such as robustness to noise, yet more study is required to know the limitations in algorithms such as QAOA. Recent work has found limitations in parametrized quantum circuits trained with classical optimizers wherein for large enough problem sizes the algorithms suffer from so called barren plateaus from which exponentially low probability to escape don't allow the algorithms to achieve an optimal result [13]. The expressive power of parametrized quantum circuits, namely, the set of probability distributions from which a parametrized circuit is capable to sample from, has also been studied [14]. In this paper, we study the capacity of QAOA to perform universal quantum computation in the sense that sequences of QAOA unitaries can approximate arbitrary unitaries (as we will detail below).
A proof-sketch of the computational universality of a class of QAOA quantum circuits has been given in Ref. [15]. In our work, we make the statement concerning the universality of QAOA circuits more precise and give the complete proof of universality inspired by this previous work. We also give the conditions under which the proof in Ref. [15] applies. In addition to this, we expand and generalize the proof to include QAOA circuits defined by other classes of cost Hamiltonians. Morover, we also discuss cases when universality is not reached, which helps to further advance the understanding of limitations of QAOA. For our proofs, we employ techniques from Lie group theory utilized previously in the context of quantum control [16,17,18,19,20] and also in proving universality of different families of gate sets [21,22,23,24]. In particular, we will make connections with a graph process named zero forcing that was already connected to Lie algebraic controllability questions [25,26]. Previous works [2,27,28] have related controllability to QAOA, our work continuous in this direction and reveals that there are more fruitful connections to be made between these topics. A recent work by one of the present authors [12] proved that an objective function, expressible in terms of local measurements, can be minimized to prepare arbitrary quantum states as output by quantum circuits. The work, however, assumed the existence of universal variational sequences, such as those needed to realize a universal gate set, but did not prove this reachability. Hence the sequences developed here would find further applications therein, as well.
The paper is organized as follows. We provide some background to our work in Sect. 2; the QAOA algorithm is introduced together with the notion of universality used in Sect. 2.1 and a brief introduction on quantum control and its relation to QAOA in Sect. 2.3. We then proceed to complete the proof of Ref. [15] concerning the universality of a 1d QAOA system in Sect. 3. The generalization of the universality proof to other settings is presented in Sect. 4 and Sect 5. Finally, we close with the conclusion and outlook in Sect. 6.

Background and setting
Here we summarize the background of our work. We briefly introduce the concept of QAOA and give the precise definition of universality which is used in this article. Then we introduce some notation from quantum control and explain how it relates to our proof of the universality of QAOA under certain conditions.

Quantum Approximate Optimization Algorithm
The quantum approximate optimization algorithm is used to find solutions to combinatorial optimization problems. To introduce the algorithm, we follow the presentation given in [1]. A more complete analysis of the algorithm can be found therein.
The algorithm is defined by a Hamiltonian H Z encoding the objective function f : {0, 1} n → R of a combinatorial optimization problem which we wish to minimize (or alternatively, maximize). This Hamiltonian is assumed to be diagonal in the computational basis and is denoted as the cost Hamiltonian. There is also a second Hamiltonian H X denoted as mixer Hamiltonian which does not commute with H Z .
The operator H X is usually defined as where X i is the usual Pauli matrix acting on the ith qubit.

Universality of QAOA as a parametrized quantum circuit
To study universality we need to define what do we mean by it in the context of QAOA. As explained before, QAOA involves a subroutine where a quantum circuit outputs a quantum state. The family of quantum circuits defined by QAOA from a set of angles and a sequence length is given by the product of unitaries in Eq. (1). As discussed in [29], universality in the quantum circuit model is related to the possibility of generating arbitrary unitary operations by composition of elementary gates in a gate set. In this sense we can consider for a choice of H Z and H X the unitaries U (H Z , α) and U (H X , β) for any angles α, β as an elementary gate set. Thus for fixed Hamiltonians H Z , H X acting on n qubits and p ∈ N >0 the family of circuits defined by QAOA corresponds to the set of unitaries where U (H, α) = e −iαH . Thus, we can define For a problem size n and a choice of H Z and H X acting on n qubits we say QAOA is universal if any element in the full unitary group U(2 n ) is approximated to arbitrary precision (up to a phase) by an element of C H Z ,H X .
Note that our definition of universality does not make reference to the sequence length p of Eq. (1). Studying the sequence length at which any unitary in U(2 n ) can be approximated for certain choices of Hamiltonians or even for unitaries in a subspace A ⊆ U(2 n ) may prove useful in tasks such as state preparation [30,31], modifications of QAOA where constrains are included [32] or for understanding the limitations of this algorithm [33]. It would also be interesting to investigate universality in other variational quantum algorithms, see Ref. [34] for a recent study in this direction concerning variational quantum eigensolvers.
Finally, let us stress here again that the notion of universality here does not provide an algorithm that finds the solution of the objective function. It just quantifies the reachability properties of QAOA unitary sequences. An analogous notion of universality in classical variational neural networks was given by the universal approximation theorem [35,36,37] which states that under some weak assumptions feed-forward neural networks can approximate any continuous function defined on a compact subset of R k without giving an algorithm for the approximation.

Quantum control
The Quantum Approximate Optimization Algorithm can be understood as a particular quantum control problem. Hence it will be useful to briefly introduce the concept of reachability within quantum control theory.
Let us consider a quantum system with a drift Hamiltonian H 0 , and assume further that one can turn on or off the Hamiltonians H j (j = 1, . . . , n) with time-dependent coupling-strengths (control functions) u j , and in this way obtain the following time-dependent control Hamiltonian The evolution of the (pure) state of a quantum system is then described by the controlled Schrödinger equation The solution to equation (7) can be written using a unitary propagator |ψ(t) = U (t) |ψ 0 , which can be obtained as the solution to the following differential equation We want to answer the following question: given a set of control Hamiltonians P = {iH 1 , iH 2 , ..., iH q }, which unitary propagators can we generate?
We assume that the control functions u j all belong to a set F of allowed control functions which correspond to piecewise constant functions, this choice will be relevant for QAOA. Before delving more into the problem let us make some definitions.
Definition 1 (Set of reachable unitaries) Given a quantum system (described by a d-dimensional Hilbert space) with drift Hamiltonian H 0 and control Hamiltonians {H j } q j=1 , define the set of reachable unitaries at time T > 0 as the set (9) and the set of reachable unitaries are where · denotes the operator norm.
Definition 2 (Generated Lie Algebra) Given a set of Hamiltonians P = {iH 1 , iH 2 , ..., iH q }, we call the smallest real Lie algebra L containing the elements of P the generated Lie algebra of P. We will denote the generated Lie algebra as where L is the Lie algebra generated by P. Moreover, if the quantum system is finite dimensional, we have that e L = {e A : A ∈ L}.
Proposition 1 motivates us to study the Lie algebra generated by a set of Hamiltonians. To understand whether a set of Hamiltonian interactions P can generate another set Q, we need to check the condition P Lie = P ∪ Q Lie .
In the QAOA set-up, we have the control Hamiltonians H Z and H X , and we are interested in knowing whether the Lie algebra L = iH Z , iH X Lie generates (up to a phase) the entire unitary group U(2 n ).
In the examples to follow, we treat families of QAOA gates when universality holds and also mention cases when it doesn't. Our main proof strategy will be to show either that e L contains some gates that are already known to form a universal gate set, or to show that due to some symmetry property we cannot reach all gates.

Proving universality in 1-D set up
In [15], a derivation was given for the universality of the QAOA in terms of two Hamiltonians defined on a 1−dimensional system. Here we give the complete proof and the precise conditions under which such a QAOA is universal.
We start by defining the Hamiltonians in a 1 dimensional line as in [15] We shall prove that when the number of qubits n is odd then the QAOA defined with the previous Hamiltonians is universal. For the n even case we will see this is not the case. A graph representing the Hamiltonian H Z for n = 6 is shown in Fig. 1.
1 System corresponding to Hamiltonian in Eq. (13) for n = 6. Each node corresponds to qubits in the system and the edges to a two-body interaction.
For clarity, we make explicit the limits of the sums for each term in H Z . Furthermore, we write in the upper limits of the sums the corresponding limits for n even | n odd.
It will also be useful to define We will start by proving the following lemma.
Proof Consider first the commutator then, let us perform the calculation and define Next, define also Finally, notice that we have which completes the proof.
Next, we prove that it is possible to generate X even and X odd Next, let us define the following element in the Lie algebra and then calculate the commutator Now notice that From what we have so far proved, we can then generate H A , H B , H AB , H BA . The following proposition states the conditions for this.
The proof of Proposition 3 is given in Appendix A. Note that in Ref. [15] it was required that ω A , ω B , γ AB , γ BA be rationally independent. In our proof of universality this will be relaxed to the condition given by Proposition 3.
In the following, we will prove that when n is odd and the condition of the previous lemmas and propositions are fulfilled, then QAOA can implement all single qubit operators and CN OT .
The proof for Lemma 2 is given in Appendix A.
Theorem 1 Given an odd integer n, H Z as in Eq. (13), H X as in Eq. (14), with coefficients in H Z and H X fulfilling the conditions of Proposition 3 and L = iH Z , iH X Lie , then e L is dense in U(n). This implies universality for odd integers in QAOA.
Thus, all single qubit operators are in e L . If it is possible to generate a two qubit gate such as CN OT , then we can prove that L can generate any unitary by, for example, generating the gate set of Clifford gates + T , which are known to be universal for quantum computation.
In fact, any 2-qubit entangling operator with all 1-qubit gates is enough for universality [21].
In the proof of Lemma 2 we have not only managed to generate 1-qubit Pauli's but also 2-qubit Pauli's such as Z k−1 Z k . To see that CN OT gates can be generated, recall that Note that this last expression is in L.
Finally, note that Since 1 ⊗ 1 − X 2 − Z 1 + Z 1 X 2 is in L, we conclude that CN OT can be generated.
With this we have proved universality for n odd. It is easy to see that for n even iH Z , iH X Lie cannot approximate U(2 n ) due to the presence of a symmetry in the system. This is easier to see with a concrete example, if n = 4 and we number qubits from 1 to 4 then exchanging qubit 1 with qubit 4 and exchanging qubit 2 with qubit 3 is a symmetry of the system. The presence of a symmetry in Hamiltonians H Z and H X imply non-universality; let U be the unitary implementing the symmetry commuting with both Hamiltonians, then H Z and H X can be block diagonalized which necessarily implies that there are elements in U(2 n ) that can't be approximated.

Universality for QAOA defined on graphs
In Section 3, we proved universality in a particular setting of a QAOA. Here we show that universality can be obtained also in more general settings. The algorithms defined here are characterized by the choice of the Hamiltonians H Z and H X . To define H Z , we make a correspondence between a non-directed simple graph (no loops or multiple edges) G = (V, E) and the terms appearing in H Z , while the Hamiltonian H X is defined as in Section 3.

Universality from zero forcing
We prove in this section that the property of universality on this class of QAOA is present depending on a process defined on the graph G called zero forcing. The notion of zero forcing has been presented before in the context of quantum control on graphs [25,26] and we find that it applies as well in this context. Definition 3 (Zero forcing) Consider a simple graph G = (V, E), a zero forcing process on G consists of an initial set of vertices S ⊆ V which we will consider as "infected". The rest of the vertices are non infected. Then we proceed by steps to infect other nodes, at each step an infected vertex v infects a non infected neighbour w if w is the only non infected neighbour of v. We call S a zero forcing set if we can infect all the graph by starting with all infected vertices in S.
As usual with QAOA, we start defining two Hamiltonians H Z and H X . Consider simple graph G = (V, E) and a subset S ⊆ V .
Theorem 2 Let G = (V, E) be a simple graph and S ⊆ V . Define H Z and H X as in Eq. 28 and Eq. 29 and let γ, ω i , ω be rationally independent. Consider S as the inital set of infected nodes in a zero forcing process. If S is a zero forcing set, then Z k Z j ∈ H Z , H X Lie for all (k, j) ∈ E and X k ∈ H Z , H X Lie for all k ∈ V .
Proof Since γ, ω i , ω are rationally independent, using a similar method to the proof in Proposition 4 (see Appendix B) we can generate H γ , H V , Z i for i ∈ S First note that for vertices i ∈ S we can generate X i . Consider two vertices i, j ∈ S such that they are neighbouring vertices in G. To see this, commute Thus, we can also generate Z i Z j . Consider now i ∈ S that only has one neighbour j ∈ V \ S. We show that we can generate X j . Define H i as H γ with the interaction terms corresponding to infected neighbours of i subtracted. Consider now the commutator: And thus Z i Z j can be generated. Then we can commute with H X − X i and generate Z i Y j which commuted with Z i Z j generates X j . This is analogous to an infection step in the zero forcing process. It is then easily seen that if S is zero forcing, then all single qubit and two qubit operators are generated in the graph.
We can generalize even more this zero forcing process by difference considering edge interactions in H Z . Given once again a graph G = (V, E) and set S ⊆ V , consider now that we can partition the set of edges E into q disjoint sets {E i } i∈[q] such that i∈[q] E i = E. From this we write the Hamiltonian Definition 4 (Generalized zero forcing for multi-type edges) Consider a simple graph G = (V, E) with E = i∈[q] E i , a zero forcing process on G consists of an initial set of vertices S ⊆ V which we will consider as "infected". The rest of the vertices are non infected.
The generalized zero forcing process proceeds in one step by considering each infected vertex and the subgraph G 1 = (V, E 1 ). If an infected vertex has a single non infected vertex in G 1 , then infect this new vertex and add it to S. Then proceed in the same fashion with the neighbours of vertices on S in graphs G 2 , G 3 , .., G q . Repeat this process and if the whole graph ends infected then we call the initial set S a generalized zero forcing set.
We prove the following result.
Define H Z and H X as in Eq. (32) and Eq. (29) and let γ, ω i , ω be rationally independent. Consider S as the inital set of infected nodes in a zero forcing process. If S is a generalized zero forcing set, then H Z , H X generates Z k Z j for all (k, j) ∈ E and X k for all k ∈ V .
Proof The proof is almost the same as in Theorem 2.

Universality without zero forcing
Note that a Hamiltonian defined from a graph and a initial subset of vertices S may not have a zero forcing set, yet nonetheless can be universal. We will give one such an example with a two dimensional grid with only two edges under control. This example points to a more general process than zero forcing that allows to study universality in the corresponding QAOA, although we will not pursue this direction in this work.
Define a graph composed of a square grid with N = n 2 vertices, number the vertices from v 1 to v N left to right and top to bottom . We assume all interactions in the grid are labeled by the same interaction type A. We also add two extra nodes labeled v N +1 and v N +2 . Connect v N +1 to vertex v 1 with an edge labeled B and connect v N +2 to v N with an edge labeled C. We give an example for N = 25 in Fig. 2.
For this graph we define the following Hamiltonians:  We want to prove that every single qubit operator Z i and two body operators Z i Z j can be generated.
Note that Lemma 1 applies in this situation as well, so we can separate From this, we easily see that we can generate as well X N +1 , X N +2 and To prove that any gate can be generated with these Hamiltonians, we prove that all Z j with j ∈ {1, .., n} and Z k Z k+1 with k ∈ {1, .., n − 1} can be generated. In this way there is full controllability of the first horizontal line in the grid. After proving this, it directly follows that QAOA defined from the grid is universal by the zero forcing argument.
Theorem 4 Given a graph G as described above, vertices numbered in the order mentioned previously, and given the Hamiltonians H A1 , Z N +1 , Z N +2 , X N +1 , X N +2 , X Grid , H A2 , Z 1 Z N +1 , Z n Z N +2 , then for i ∈ {1, .., n − 1} and j ∈ {1, .., n} we have that Z j , X j , Lie . This implies universality for any n on the grid.
The proof is given in Appendix C. As mentioned before this points to a more general process that allows to show universality but for brevity we won't go further in this direction.

Universality for QAOA defined on hypergraphs
So far the Hamiltonians H Z induced by graphs define only quadratic or linear terms. We can consider higher order terms for H Z by studying a modified version of a zero forcing process on hypergraphs. Here we will consider the specific case of Hamiltonians with cubic terms as there is already work studying problems with cubic order term Hamiltonians as in the MAXE3LIN2 problem [39].
From a hypergraph we can define Hamiltonians H Z with k−body terms where k > 2. A hypergraph G = (V, E) is a generalization of a graph, it is defined by a finite set of vertices V and a finite set E which contains non empty subsets of V which are called hyperedges. In Fig. 3 we show an example of a hypergraph defined by V = {v 1 , v 2 , ..., v 6 } and This is also an example of a 3−uniform hypergraph, a k−uniform hypergraph is one where all hyperedges have exactly k nodes.  Fig. 3 (without the 2−edge).

From G we define the following Hamiltonians
We wish to generate all 2−qubit operators between neighbours and 1−qubit operators on every vertex. This hyper-zero forcing is defined by starting with some initial set of infected vertices S 1 and a set of infected 2−edges S 2 ; at each step pick an infected vertex, if it has only one non infected 3−neighbour then infect the neighbour. If two infected 3−neighbours share a a 2−edge and then connect each infected node to the non infected one with 2−edges.
In the 3−uniform hypergraph, the infection step in terms of the commutators proceeds as follows, first note that the term Z 1 Z 2 Z 3 can be separated from the other cubic terms and that X 2 can be easily separated, now consider From this we see that X 3 can be separated and we can proceed to separate Z 2 Z 3 Z 4 . In this way we proceed until the end of the chain having produced all one qubit and two qubit operators between neighbours which proves universality.
We can define a hyper-zero forcing procedure on hypergraphs which allows to check if the corresponding QAOA is universal. We will write here for conciseness only the case of hypergraphs with hyperedges with at most three elements although a more generalized version is possible Definition 5 Consider a hypergraph G = (V, E) where |e| ≤ 3 for all e ∈ E, a hyper-zero forcing process on G consists of an initial set of vertices S 1 ⊆ V and an initial set of 2−edges S 2 which we will consider as 'infected'. The rest of the vertices and 2−edges are non infected. Then we proceed by steps to infect other nodes, at each step a pair of infected vertices v 1 , v 2 infects a non infected 3−neighbour w if w is the only non infected 3−neighbour of v 1 and v 2 and also the 2−edge v 1 , v 2 is infected. We call S 1 and S 2 hyper-zero forcing sets if we can infect all the graph by starting with S 1 and S 2 infected.
An analogous theorem can be derived as in the zero forcing case for relating hyper-zero forcing processes and universality. Here, for simplicity, we state such theorem for hypergraphs with hyperedges containing three or less vertices.
Theorem 5 Let G = (V, E) be a hypergraph with |e| ≤, S 1 ⊆ V and S 2 a set of 2−edges. Define H Z and H X as in Eq. 35 and Eq. 36 and let all coefficients in H Z be rationally independent. Consider S 1 as the initial set of infected nodes and S 2 as the set of infected edges in a hyper-zero forcing process. If S 1 and S 2 are hyper-zero forcing sets, then Z k Z j ∈ H Z , H X Lie for all (k, j) ∈ E and X k ∈ H Z , H X Lie for all k ∈ V .
Proof Proof follows directly from arguments in the 3−uniform hyper graph case and similarly as in the zero process case.
In a previous work [22], it was shown that local unitaries and unitaries generated by three-body Pauli-operators does not give rise to universality. This directly implies the following no-go result: Theorem 6 Define H Z and H X as in Eq. 35 and Eq. 36. If the coefficient γ in H Z is zero, then the QAOA defined by H Z and H X does not yield a universal gate set.

Conclusion and outlook
We proved the computational universality of different QAOA set-ups. In particular, we completed an earlier proof for a specific set-up given in Ref. [15], and also found two new broad classes of driver Hamiltonians that allow the corresponding QAOA unitaries to perform universal quantum computation. The first class consists of Hamiltonians with quadratic and linear terms; the quadratic terms are distributed according to the adjacency matrix of a graph, while the coupling strength of the linear terms are grouped into two parts defined by a so-called zero forcing set of the graph. This construction was then generalized to obtain a second class of driver Hamiltonians with higher order terms corresponding to hypergraphs and generalized zero forcing sets. Here it should also be mentioned that the square grid example, presented in Sect. 4.2, points to a more general graph process different from zero forcing that may further advance an understanding of universality in QAOA circuits (and perhaps also in more general quantum control set-ups). Another important generalization of our results would be to regard other mixer Hamiltonians then the type H X = i X i considered here, e.g., one could consider XY mixers [32,40]. One could hope to determine more general conditions for universality of QAOA unitaries, which could include the above mentioned generalizations; we leave this for future work. Such general results could help in understanding the relation between the choice of Hamiltonians and the space reached by the ansatz in the algorithm, and perhaps also to obtain some analytical results about the efficiency of QAOA. We regard our work as a first step towards this goal.

APPENDIX A Proof of some results in Section 3
Proof From Proposition 2, we see that H A and H B can be easily generated. To prove that H AB and H BA can be generated, we separate the proof for n odd and n even case.
n odd: Then Note that we have suppressed the (2i) that appear from the commutators. The γ 2 AB and γ 2 BA terms in the last line can be removed, so we define and define Notice that Thus, assuming γ 2 AB = γ 2 BA then we have generated H AB and H BA for odd n.
n even: Following steps analogous to the odd n case, we obtain The last line is true up to a (2i) factor. In the last line we can also eliminate the γ 2

BA
and define Now we perform a similar calculation but using Xeven.

B Proofs of results in Section 4
The following proposition shows that commuting terms in a Hamiltonian can be separated.
Since ω A and ω B are rationally independent, then we can generate the unitary U B and by the same argument we can generate U A . Same proof applies to H Z2 .

C Proof for universality on square Grid
Here we include the proofs for Sect. 4.2.
Theorem 4 Given a graph G as described above, vertices numbered in the order mentioned previously, and given the Hamiltonians Lie . This implies universality for any n on the grid.
Proof To show this, we can apply commutators over the available operators and obtain the two body terms and one body terms required. This can be done in a purely algebraic way, but its also useful to relate this algebraic operations to operations over the graph. First the algebraic proof is given, and then we will relate it to operations over the graph.
Let us begin with the fact that Then since we can generate Y 1 , we can also generate Z N +1 Note that we have now generated a Hamiltonian H (2) = Z 1 Z n+1 + Z 1 Z 2 that corresponds to edges (1, 2) and (1, 6).
We will use a similar procedure to prepare Hamiltonians of the form H (k) = Z k−1 Z k + R (k) , where R (k) does not contain the operator Z k . In this way when we generate H (n) , we will commute it with ZnZ N +2 in order to generate Z k−1 Z k , starting from this we will be able to generate all two body terms for the first line of the form Z j Z j+1 .
We proceed by induction, assume that we have a Hamiltonian where R (k) does not have any terms with operators Z k , nor neighbours Z n+k and Z k+1 and also in any vertex on the line from k to n (Same for Y and X operators). Actually it doesn't contain operators from the k-th column to the n-th. Note that we assume that there is a vertex numbered k + 1. We also assume we have an operator Where X (k) R is an operator without terms containing operators with support in the neighbours of vertex k and also in any vertex on the line from k to n, as before, we assume also that it doesn't contain operators from the k-th column to the n-th. Note that [H (k) , H (2) A1 ] = [Z k−1 Z k + R (k) , X k + X k+1 + ... + Xn + X Where now [R (k) , X (k) R ] doesn't contain operators from the k-th column to the n-th. Note that Z k−1 was not affected by the operation since X Where [[R (k) , X (k) R ], R (k) ] has no support from column k to column n. Define Where now X (k+1) R doesn't have support on k + 1 or neighbours or from column k + 1 to n.
Assume as well there's an operator H (k) A2 . This operator has terms Z k Z neigh(k) (except Z k−1 Z k ), any other term doesn't have support in k or its neighbours.
Finally define H A2 − H (k+1) and we have all the Hamiltonians necessary for step k + 1 with the necessary properties.
We can continue this procedure until generating Hamiltonian H (n) = Z n−1 Zn + R (n) . Recall that R (n) has no support on column n of the grid. Now note that And we can thus generate Xn. Commuting this with H (n) gives Z n−1 XnZ N +2 and commuting again with YnZ N +2 we obtain Z n−1 Zn. We can now repeat this process with H n−1 and Z n−1 Zn. In this way we can generate all the single Pauli operators on the line 1, .., n and also the two body operators of the form Z k Z k+1 on the line.