Classical Ising model test for quantum circuits

We exploit a recently constructed mapping between quantum circuits and graphs in order to prove that circuits corresponding to certain planar graphs can be efficiently simulated classically. The proof uses an expression for the Ising model partition function in terms of quadratically signed weight enumerators (QWGTs), which are polynomials that arise naturally in an expansion of quantum circuits in terms of rotations involving Pauli matrices. We combine this expression with a known efficient classical algorithm for the Ising partition function of any planar graph in the absence of an external magnetic field, and the Robertson-Seymour theorem from graph theory. We give as an example a set of quantum circuits with a small number of non-nearest neighbor gates which admit an efficient classical simulation.


I. INTRODUCTION
From its early days quantum computing was perceived as a means to efficiently simulate physics problem [1,2], and a host of results have been derived along these lines for quantum [3,4,5,6,7,8,9,10,11,12,13,14,15], and classical systems [16,17,18,19,20,21,22,23,24,25,26,27]. A natural problem relating quantum computation and statistical mechanics is to understand for which instances quantum computers provide a speedup over their classical counterparts for the evaluation of partition functions [16,22]. For the Potts model, results obtained in [23] provide insight into this problem when the evaluation is an additive approximation. We provided a class of examples for which there is a quantum speedup when one seeks an exact evaluation of the Potts partition function [24].
In this work we address the connection between quantum computing and classical statistical mechanics from the opposite perspective. Namely, we seek to find restrictions on the power of quantum computing, by employing known results about efficiently simulatable problems in statistical mechanics. Specifically, we restrict our attention to the Ising model partition function Z, and use a mapping between graph instances of the Ising model and quantum circuits introduced in [28], to identify a certain class of quantum circuits which have an efficient classical simulation.
Restricted classes of quantum circuits which can be efficiently simulated classically have been known since the Gottesman-Knill theorem [29]. This theorem states that a quantum circuit using only the following elements * Current address: Ontario Cancer Institute, MaRS-TMDT, Toronto, Ontario M5G 1L7, Canada can be simulated efficiently on a classical computer: (1) preparation of qubits in computational basis states, (2) quantum gates from the Clifford group (Hadamard, controlled-NOT gates, and Pauli gates), and (3) measurements in the computational basis. Such "stabilizer circuits" on n qubits can be be simulated in O(n log n) time using the graph state formalism [30]. Other early results include Ref. [31], where the notion of matchgates was introduced and the problem of efficiently simulating a certain class of quantum circuits was reduced to the problem of evaluating the Pfaffian. This was subsequently shown to correspond to a physical model of noninteracting fermions in one dimension, and extended to noninteracting fermions with arbitrary pairwise interactions [32,33,34] (see further generalizations in Refs. [35,36]), and Lie-algebraic generalized mean-field Hamiltonians [37]. Criteria for efficient classical simulation of quantum computation can also be given in terms of upper bounds on the amount of entanglement generated in the course of the quantum evolution [38].
A result that is more directly related to the one we shall present in this work is given in Ref. [25], but within the measurement-based quantum computation (MQC) paradigm. MQC relies on the preparation of a multiqubit entangled resource state known as the cluster state. It is known that MQC with access to cluster states is universal for quantum computation. Reference [25] considers planar code states which are closely related to cluster states in that a sequence of Pauli-measurements applied to the two-dimensional cluster state can result in a planar code state. MQC with planar code states consists of a sequence of measurements {M 1 , M 2 , . . . , M n , M } where the M i are one-qubit measurements and M is a final measurement done on the remaining qubits in some basis which depends on the results of the M i . Reference [25] demonstrates that planar code states are not a sufficient resource for universal quantum computation (and can be classically simulated). This fact is attributed to the exact solvability of the Ising partition function on planar graphs. Our results complement the work in [25], as they are provided in terms of the circuit model, and generalize to Ising model instances that correspond to graphs which are not necessarily subgraphs of a two-dimensional grid.
Other conceptually related work uses the connection between graphs and quantum circuits and the formalism of tensor network contractions, to show that any polynomial-sized quantum circuit of 1-and 2-qubit gates, which has log depth and in which the 2-qubit gates are restricted to act at bounded range, may be classically efficiently simulated [36,39,40]. A tensor network is a product of tensors associated with vertices of some graph G such that every edge of G represents a summation (contraction) over a matching pair of indexes. We also use a relationship between quantum circuits and graphs but whose construction is quite different [28]. Also, Ref. [41] connects matchgates and tensor network contractions to notions of efficient simulation.
Finally, other closely related work was recently reported in [42] (see also [43,44,45]), which addresses the classical simulatability of quantum circuits. Their results use a connection to the partition function of spin models, as do we, and they too provide a mapping between classical spin models and quantum circuits. Specifically pertinent to our work is the fact that they give criteria for the simulatability of quantum circuits, using the 2D Ising model. That is, circuits consisting of single qubit gates of the form e iθσx and nearest-neighbor gates of the form e iφσz⊗σz are classically efficiently simulable. We shall discuss how the nearest-neighbor restrictions can be lifted while retaining efficient classical simulatability.
The structure of this paper is as follows. We begin with a brief review of the Ising model in Section II, where we define the Ising partition function Z. In Section III we review quadratically signed weight enumerators (QWGT's) and their relationship to quantum circuits, and review the relationship between QWGT's and Z. In Section IV we introduce an ansatz that allows one to associate graph instances of the Ising model with circuit instances of the quantum circuit model. In this section we derive a key result: an explicit connection between the partition function for the Ising model on a graph, and a matrix element of the unitary representing a quantum circuit which is related to this graph via the graph's incidence matrix [Eq. (35)]. We then present our main result in Section V: a theorem on efficiently simulatable quantum circuits. The proof depends on the fact that there are algorithms for the efficient evaluation of Z for planar instances of the Ising model. We also discuss the relation to previous work. In Section VII we present a discussion and some suggestions for future work, including the possibility of a quantum algorithm for the additive approximation of Z. We conclude in Section VIII. The Appendix gives a review of pertinent concepts from graph theory, and additional details, including some proofs.

II. ISING SPIN MODEL
We briefly introduce the Ising spin model accompanied by some notation and definitions. Let G = (E, V ) be a finite, arbitrary undirected graph with |E| edges and |V | vertices. In the Ising model each vertex i is occupied by a classical spin σ i = ±1, and each edge (i, j) ∈ E represents a bond J ij (interaction energy between spins i and j).
Definition 1 An instance of the Ising problem is the data ∆ ≡ (G, {J ij }), i.e., ∆ represents a weighted graph.
The Hamiltonian of the spin system is (1) is a particular assignment of spin values for all |V | spins. A bond with J ij > 0 is called ferromagnetic, and a bond with J ij < 0 is called antiferromagnetic. The probability of the spin configuration σ in thermal equilibrium for a system in contact with a heat reservoir at temperature T , is given by the Gibbs distribution: P ∆ (σ) = 1 Z∆ W ∆ (σ), where the Boltzmann weight is W ∆ (σ) = exp[−βH ∆ (σ)], β = 1/kT is the inverse temperature in energy units, k is the Boltzmann constant, and Z ∆ is the partition function: (Unless there is a risk of confusion we will from now on write Z in place of Z ∆ (β) in order to simplify our notation.) Computation of the partition function is the canonical problem of statistical mechanics, since once Z is known one can compute all thermodynamic quantities, such as the magnetization and heat capacity, by taking derivatives of F = −k log Z (the free energy) with respect to appropriate thermodynamic variables [48]. In this work we restrict our attention to the case J ij ∈ {−J, 0, J}, with J > 0, which already gives rise to the full complexity of spin glass models and the associated computational hardness [46]. For example, with the above restriction the problem of computing the partition function in the three-dimensional spin-glass is NP-hard [47]. 1

III. QUADRATICALLY SIGNED WEIGHT ENUMERATORS AND THEIR RELATION TO THE ISING PARTITION FUNCTION
Quadratically Signed Weight Enumerators (QWGTs) were introduced by Knill and Laflamme in Ref. [49].
Definition 2 A Quadratically Signed Weight Enumerator is a bi-variate polynomial of the form where A and B are 0, 1-matrices with B of dimension n × n and A of dimension m × n. The variable b in the summand ranges over 0, 1-column vectors of dimension n satisfying Ab = 0 (in the kernel, or nullspace of A), b t is the transpose of b, and |b| is the Hamming weight of b (the number of ones in the vector b). All calculations involving A, B or b are done modulo 2.
Note that the evaluation of a QWGT, given that x and y are natural numbers, is in general #P-hard, since it includes the evaluation of the weight enumerator polynomial of a classical linear code [50].

A. QWGTs from Quantum Circuits
We shall now review in some detail how QWGT's were arrived at in Ref. [49] by considering expansions of quantum circuits. Let Ω be a quantum circuit formed by a temporal ordering of N gates g k , and let U (Ω) = 1 k=N g k = g N · · · g 1 be the corresponding unitary operator. Note that a universal gate set can be achieved by allowing arbitrary rotations about tensor products of Pauli operators, i.e., each of the N gates g k can be represented as where with n being the number of qubits, such that the Pauli matrices are is a binary vector whose length is 2n, and the superscript (i) represents the qubit which is operated on by the corresponding Pauli matrix. A circuit constructed using gates of the form (4) may be approximated efficiently to accuracy O( /N ) with polylog(N/ ) overhead using a standard gate set, such as controlled-NOT with single-qubit gates, and there is a classical algorithm that computes such approximations efficiently [49,51]. A universal set of one-and two-qubit gates can be obtained from g k 's as in Eq. (4) from the rotations with cos(θ/2) = 3/5 (i.e., θ = 2 arcsin(4/5)) around operators of weight at most two (the weight of σ b is the number of non-zero pairs of bits in b) (Theorem 3.3, case (e), of [52]). Letting so that γ = √ α 2 + α 2 , we rewrite Eq. (4) as The gate set is still universal if U (Ω) is expressed as a product of real gates [53], i.e., if each gate g k contains an odd number of σ Y 's, so that iσ b k in Eq. (7) is a real-valued matrix. Following Ref. [49], we adopt this convention, so that from now on b k is a binary vector of length 2n, subject to the restriction that the b k can only contain an odd number of 11's. Moreover, the gate set is still universal if we assume that the orientation (the sign of θ) is positive if the number of σ Y 's is 1mod(4) and negative otherwise [49]. This means that we can replace Eq. (7) by with the sign determined by the number of σ Y 's in σ b k . Then, by definingσ where |b| Y is the (always odd) number of σ Y 's occurring in σ b k , we may write which is the desired representation of real-valued gates [49]. Now define C to be the block diagonal matrix whose blocks consist of i.e., Then the property that b has an odd number of 11's is given by b t Cb = 1. In addition, we have the multiplication ruleσ where the addition in the subscript is bit by bit modulo 2.
Let H be the (2n × N ) matrix whose columns are the b k : H is a linear size, bijective representation of the quantum circuit, where each column represents a gate and every pair of rows represents a qubit.

Definition 3
A matrix H which is constructed according to Eq. (14) is called the "H-matrix representation" of the quantum circuit Ω.
Using the rule (13) we then have the following expansion [49]: where Q aa ≡ a t Qa (16) and where the N ×N lower-triangular matrix Q is defined by and where a ranges over all binary column vectors of length N . (Thus Q aa is not a matrix element of Q; we use this notation merely for convenience.) In order to make contact with the partition function of the Ising model, we shall be interested in the matrix element 0|U (Ω)|0 , where |0 = ⊗ n i=1 |0 i , and |0 i is the +1 eigenvector of σ (i) Z . For this matrix element to be non-zero no qubit can be flipped, i.e., U (Ω) cannot contain any σ X or σ Y factors. When taking the same matrix element of the right-hand side of Eq. (15) we have 0|σ Ha |0 , and similarly, for this to be non-zeroσ Ha cannot have σ X or σ Y factors. This is enforced by summing only over those binary vectors a such that CHa = 0 [49]. Thus: A glance at the QWGT expression (3) reveals a striking similarity to the latter matrix element.

B. Example
As a simple example meant to illustrate the correspondence between the H-matrix representation of a quantum circuit Ω and the actual operation of the circuit, consider This matrix represents a circuit Ω comprising three gates (three columns) acting on three qubits (two rows per qubit), U (Ω) = g 3 g 2 g 1 , with the following unitaries: The superscripts represent which qubit is being acted upon and we have omitted the tensor product symbols. The Pauli operators can be read off from the corresponding column entries in H; thus the entry (1 0) t in the top position of the first column of H represents the σ (1) Z Pauli matrix in g 1 , etc.

C. QWGTs and the Ising Partition Function
In Ref. [22] it was shown that the Ising partition function can be expressed in terms of a QWGT. Let A be the incidence matrix of the graph G = (E, V ), i.e., Let us associate a binary vector w = (w 12 , w 13 , . . . ) (20) of length |E| with the bond distribution {J ij = ±J}, by letting so that w specifies whether edge (i, j) supports a ferromagnetic (w ij = 0) or antiferromagnetic (w ij = 1) bond. Thus we can give an equivalent definition of an instance of the Ising model (recall Definition 1) as the data ∆ ≡ (G, w). Let λ = tanh(βJ), (22) and define the |E| × |E| matrix Writing the instance data as ∆ ≡ (G, w) we then have (Theorem 2 of [22]): where a in the sums ranges over all 0−1 vectors of length |E| satisfying Aa = 0, where a t Ba = i a i w i a i = a · w (since a i = 0 or 1) was used in the second equality, and where the QWGT definition (3) was used in the last equality.
This establishes the link between QWGTs and the Ising model partition function. Because of the similarity to the matrix element 0|U (Ω)|0 , we expect to be able to relate the partition function to quantum circuits, via QWGTs. We take this up in the next section.
Definition 4 An even subgraph of a graph G (or equivalently an Eulerian subgraph) is any subgraph of G whose vertices are of even degree. Equivalently, these are paths in G which begin and end at the same vertex, and which pass through each edge exactly once. Now, note that the sum in is over vectors that are in the kernel (nullspace) of A, which here means that only subgraphs having an even number of bonds emanating from all vertices are allowed, i.e., the sum is taken over all even subgraphs or equivalently, all Eulerian subgraphs. In this work we will sometimes refer to even or Eulerian subgraphs as cycles.

IV. CONNECTING THE ISING MODEL PARTITION FUNCTION TO THE QUANTUM CIRCUIT MATRIX ELEMENT
Our goal in this section is to connect the partition function Z to 0|U (Ω)|0 . To do so we will use a mapping found and described in detail in Ref. [28].

A. A circuit ansatz
Focusing on the representation of the quantum circuit given in Eq. (15) and of the partition function given in Eq. (25), we begin by asking ourselves if there exists some ansatz for the gate set g k such that where λ = tanh(βJ). If such a form were possible, the two representations would be closely linked. Indeed, we can almost get this form. Let us take as an ansatz i.e., the special case of Eq. (10) with λ = α /α, or Note that since the inverse temperature β and the bond strength J are both positive, Eq. (29) restricts (θ/2)mod2π to be in the range (0, π/2) ∪ (π, 3π/2), or θmod4π to be in the range (the range for which tan(θ/2) > 0). Fortunately, this includes the case θ = 2 arcsin(4/5) ≈ 1.85 ∈ R (i.e., λ = 4/3), which, as noted above, allows a universal set of one and two qubit gates to be obtained. 2 Thus, we have not restricted the generality of the class of quantum circuits so far. On the other hand, most θ ∈ R do not correspond to universal quantum circuits. Next, we obtain from Eq. (15): After taking matrix elements 0|·|0 , we have, recalling Eq. (18): Comparing Eqs. (25) and (32), while using λ = α /α, we see that a sufficient condition for them to be equal, is to identify the incidence matrix A with CH viã whereÃ is a matrix containing twice the number of rows of the incidence matrix A, but where each even row is a zero row, and each consecutive odd row is equal to a row of the original incidence matrix A, and to equate the exponents, i.e., find an edge distribution w which solves where Q = lwtr(H tÃ ) [recall Eq. (17)]. For then Equation (35) is a key result of this paper, as it establishes the equivalence between quantum circuits and the Ising model, for bond distributions w that satisfy Eq. (34), and λ's that satisfy Eq. (29).
It has two consequences. First, if we are able to determine 0|U (Ω)|0 , then we are able to determine the partition function Z ∆ (λ). Note that estimating 0|U (Ω)|0 in general is BQP-complete [54] and thus something one could do with a universal quantum computer. Alternatively, if we had a way of classically computing Z ∆ (λ), then we would be able to classically simulate the quantum circuit Ω (if it were solving a decision problem) [55]. This latter alternative is the one we focus on in this paper.

B. Circuit-Ising model compatibility
The connections we established in the previous subsection between quantum circuits and the partition function imply certain restrictions. We flesh these out in the present subsection.
First, since we wish to work only with the physically relevant range of positive temperatures and positive J, we restrict the gate angles θ from now on to lie in R. Formally: Next, we note that Eq. (33) gives rise to a compatibility relation between circuits and graphs: Definition 6 A quantum circuit Ω, constructed with λcompatible angles, is "G-compatible" with a graph G if the H-matrix representation of Ω satisfies Eq. (33), where A is the incidence matrix of G, and C is defined in Eq. (12).
When we take a G-compatible circuit and plug its Hmatrix into Eq. (34) we are not guaranteed that there exists a solution w. Hence we need an appropriate restriction of the class of G-compatible circuits: We need a similar notion for the bond distributions: with a graph G and circuit Ω if it satisfies Eq. (34).
Note that in this last definition the circuit Ω must be Gw-compatible, for otherwise we are not guaranteed that the solution set of Eq. (34) is non-empty. Note further that, as these definitions imply, Eqs. (33)-(35) describe a connection between quantum circuits and instances of the Ising model over given graphs. Namely, any H which solves Eq. (33) is a matrix representation of a circuit Ω which belongs to a class defined by the incidence matrix A of a given graph G. In addition, we can populate the vertices of G with weights from the bond distribution w provided w is compatible. Thus: Definition 9 Let Γ be any set of graphs for which a solution to Eq. (34) exists. Then Ω Γw is the set of circuits which are Gw-compatible ∀G ∈ Γ.
Definition 10 I(Ω Γw ) is the class of Ising model instances {∆(G, w)} w whose graph is G ∈ Γ and whose bond distributions {w} are GΩ-compatible ∀G ∈ Γ. Equation (34) is a system of linear equations over GF (2). The number of equations is equal to the number of even subgraphs of the given graph or the total number of elements in the set ker(CH), and the number of unknowns is equal to the number of edges. However, in spite of the fact that the number of elements in ker(CH) scales exponentially in the number of vertices, it turns out that finding a w which solves Eq. (34) can be done efficiently [see Eq. (38) below]. Let us further stress that Eq. (34) is only a sufficient condition for the equality of Eqs. (25) and (32), and does not capture the whole set of possible graph instances that our scheme can handle. We define our instances via this condition because it simplifies the analysis and it allows us to extract information about an interesting set of quantum circuits which may be classically simulated. We discuss more general sufficient conditions in Section VII A, but leave the development of a complete understanding of the actual graph instances that our mapping can handle, and in particular finding necessary conditions for the equality of Eqs. (25) and (32), as a problem for future study.

V. CIRCUITS CORRESPONDING TO CERTAIN PLANAR GRAPHS HAVE AN EFFICIENT CLASSICAL SIMULATION
Let us recap the general idea we have developed so far. At the basis of our construction are an inverse temperature β, bond strength J, and a given graph G. We use this graph to first identify a compatible class of quantum circuits Ω G (Definition 9). This class is restricted to a subclass Ω Gw of circuits for which there exist solutions to Eq. (34). Such solutions are used to assign weights to the graph's edges (a bond distribution), which yields a class of Ising model instances compatible with G and Ω G (Definition 10). In other words, we go from the unweighted graph to a class of compatible circuits, and from there to back to the graph, which is now populated by a class of compatible Ising models. Each circuit is also parametrized by an angle θ, and when we vary θ in the range R [Eq. (30)] we also vary over β and J, via tan(θ/2) = tanh(βJ). However, not all values of θ correspond to universal circuits. Conversely, not every circuit need correspond to a physical (positive) temperature.
In more detail, we identify the class of quantum circuits Ω G compatible with G (whose incidence matrix is A) by solving Eq. (33) for the matrices H representing each (or some) Ω ∈ Ω G , and then find the subset Ω Gw for which the solution set to Eq. (34) is non-empty. We then look for a bond distribution w that satisfies Eq. (34) for a given H. Every such w defines an Ising model instance ∆(G, w) that is compatible with G and the corresponding Ω ∈ Ω G . We are guaranteed that provided such a bond distribution w exists, the partition function for the corresponding Ising model is proportional to the matrix element 0|U (Ω)|0 [Eq. (35)]. In other words, any bond distribution w that satisfies Eq. (34) induces a direct connection between quantum computation and the Ising model on a graph with that same bond distribution.
It is important to emphasize that Eq. (34) will not always have a solution w. Whether or not this is the case is entirely determined by the given graph G, since G, via its incidence matrix A, determines the class of Gcompatible circuits Ω G [i.e., the matrices H that solve Eq. (33)], and together they determine a and Q aa that go into Eq. (34), which w needs to solve. Thus, it makes sense to define a class of graphs for which there exists a solution w to Eq. (34).
Definition 11 Θ is the set of graphs for which a solution to Eq. (34) exists.
In order to characterize Θ we require some basic ideas from graph theory, such as obstruction sets and downward closure. These are reviewed in Appendix A. We shall prove: This will come as a consequence of Θ's downward closure and the Robertson-Seymour theorem -Theorem 3. This is proved in Appendix B. We shall also prove there that there are no solutions to Eq. (34) for the graphs K 4 (the complete graph on four vertices) andK 3,3 , wherē K 3,3 is K 3,3 with one edge missing (which edge does not matter, since upon deletion of another edge one can just relabel the edges and nodes and obtain exactly the same incidence structure). Formally: The obstruction set for Θ includesK 3,3 and K 4 .
The proof is described in Appendix B. See Fig. 2 in Appendix A for a pictorial representation of the graphs mentioned in Lemma 2. As a consequence we will find that all graphs in Θ are planar.
We shall clarify this conclusion and the previous lemma in the next subsection, but given their validity, a GΩcompatible bond distribution w necessarily corresponds to a planar graph G. From this it follows that its partition function can be efficiently computed classically, and hence the corresponding class of quantum circuits, i.e., Ω Θw , also has an efficient classical simulation. Let us be precise about what we mean by "classically efficiently simulatable" (CES).
Definition 12 A uniform family G n = {Ω i } of n-qubit quantum circuits is "classically efficiently simulatable" (CES) if the matrix element | 0|U (Ω i )|0 | of each circuit in G n can be obtained to k digits of precision in time poly(n, k) by classical means [55].
This definition is a modified version of the one given in Ref. [36], which also includes a discussion on how it can be weakened.
When we collect the observations above we arrive at an efficient classical test for whether a given quantum circuit is CES. This is summarized in Theorem 1, which is our main result and the subject of the remainder of the paper:

Theorem 1 (Circuits Corresponding to Certain Planar Graphs have an Efficient Classical Simulation)
The class of quantum circuits Ω Θw is CES. Deciding whether a given a graph G is in Θ can be efficiently decided.
The theorem comprises two parts. In the first we characterize an entire class of CES quantum circuits. The proof we offer below is not constructive, i.e., we prove that there exists an efficient classical simulation of the class of quantum circuits Ω Θw , and also provide a test of non-membership in Ω Θw for a given quantum circuit. In the second part we given an explicit construction which decides whether a given graph belongs to the set of graphs resulting in CES circuits. To illustrate this part, we discuss a class of graphs (which is a subset of Ω Θw ) in Section VI, for which we can explicitly find the GΩ-compatible bond distribution. This class is highly restricted in that the number of even subgraphs only grows polynomially in the number of vertices, whereas in general, including restrictions to planar graphs, the number of even subgraphs grows exponentially. Nonetheless, the class of quantum circuits that one obtains under this restriction is interesting in light of some new results about the classical simulatability of quantum circuits [36,42].
For the benefit of the reader we summarize the scheme of the first claim of the proof informally. This will also serve to summarize again the mapping between quantum circuits and graphs.
1. Given: any subset Γ of Θ. Every G ∈ Γ has a GΩ-compatible bond distribution for some quantum circuit Ω, by assumption.
2. Take the incidence matrices CH of the graphs in Γ and transform them into the H-matrix representations of the corresponding quantum circuits. The following constraint must be respected: Every column must have one Y -operation and can have at most one X-operation. [This constraint comes from the fact that CH should be an incidence matrix for a graph, where C is the block-diagonal matrix defined in Eq. (12). Without it one has a correspondence between quantum circuits and hypergraphs [28]. Indeed, if the incidence matrix has more than two ones per column than one has a hypergraph.] 3. Thus Γ corresponds to a set of quantum circuits Ω Γw , i.e., every quantum circuit Ω ∈ Ω Γw is Gwcompatible for some G ∈ Γ.
4. Show that our mapping from circuits to graphs defines a "downward closed set" of graphs, which means that we may apply the Robertson-Seymour Theorem [56]. This theorem guarantees that there is a finite set of graphs (obstruction set) for which we can test whether or not G has any members of this set as a graph minor [57] (at most cubic complexity in the number of quantum gates in Ω).
5. Define Θ, via this obstruction set, i.e., a graph is a member of Θ if it does not have K 4 andK 3,3 = K 3,3 with one edge deleted as minors (there may be other forbidden minors). One has a set of circuits which correspond to the graphs which have a satisfying bond distribution w for equation (34). We call the corresponding class of quantum circuits Ω Θw . (This specific obstruction set has been tested with mathematical software. See Appendix C.) 6. Due to the fact that these graphs are planar, the partition function Z of any graph in Θ can be computed efficiently by a classical computer [50].
7. Using equation (35), show that knowledge of Z can be used to determine the outcome of a quantum circuit Ω ∈ Ω Γw for a decision problem.
8. Conclude: Families of quantum circuits in Ω Θw which solve a decision problem can be classically simulated.
Being that Γ is a subset of Θ, any subset Ω Γw of Ω Θw is CES.
Conversely, we have a test for non-membership in the set Ω Θw : 1. Input a quantum circuit Ω.

Transform Ω into a matrix whose columns represent
Pauli operations (that are to be exponentiated) and every pair of rows are the qubits being acted upon as described in Section III A. This matrix is called H [Eq. (14)] and is in 1-to-1 correspondence with Ω. As above, the following constraint must be respected: Every column must have one Y -operation and can have at most one X-operation.
3. After the above transformation, construct a corresponding incidence matrix CH of a graph G.
4. Check the graph G for the minorsK 3,3 and K 4 .

5.
Conclude: If either of these are minors of G then reject Ω.

A. Ordering Lemma
The following lemma allows us to introduce an ordering on the elements in Θ.
Lemma 3 If a graph G is a member of Θ, then so is G \ e j or G/e j , i.e., the deletion or contraction of an arbitrary edge e j from a graph in Θ is also in Θ.
The proof of this lemma is technical and is given in Appendix B. Lemma 3 implies that Θ is a downwardly closed set with respect to the minor ordering. Hence we can apply the Robertson-Seymour theorem [56], Theorem 3, which states that any graph may be tested for membership in a given downwardly closed set of graphs by just searching the graph for a finite set of minors. The complexity of doing this, given knowledge of the minors one is looking for, can be shown to be cubic in the number of edges. We implemented this to test Eq. (34) for non-planar solutions, as we describe next.

B. Equation (34) implies planarity
Using mathematical software we demonstrated that the mapping between graphs and circuits described above, with the sufficient condition given by Eq. (34), cannot be satisfied for K 5 and K 3,3 . That is, K 5 and K 3,3 are forbidden minors for Θ. The algorithm we implemented to check this is described in Appendix C. However, a finite graph is planar if and only if it does not have K 5 or K 3,3 as minors (Wagner's theorem; see Appendix A). As stated earlier, we thus have Lemma 4 All graphs in Θ are planar.
We remark that we have been able to find examples of planar graphs for which there do exist solutions w to Eq. (34), e.g., K 2,3 . As we explain below, this means that Θ includes planar graphs which are not outerplanar. The standard way in which a quantum circuit U solves a decision problem, is to measure, say, the first qubit, and decide the problem according to this measurement outcome. In Ref. [55] it was shown that for every such decision problem, there exists another quantum circuit U such that the evaluation of 0|U |0 is equivalent to the decision problem solved by applying U and measuring the first qubit. In this sense we have: Lemma 5 Knowledge of 0|U (Ω)|0 suffices to determine the output of a quantum circuit which is being used to solve a decision problem.

D. Proof of Theorem 1
Collecting everything we now prove our main theorem. We first need one more technical Lemma: Here diag(A) denotes a vector comprising the diagonal of A. The proof of this Lemma is presented in Appendix B.
Proof of Theorem 1. We start from the second claim of the Theorem, namely we prove that we can efficiently decide whether a given graph belongs to the set Θ, and that we can find some w if it does belong. Let G be a given graph and let K be the matrix whose columns are a basis of Ker(A), where A is the incidence matrix of G. This means that any a ∈ Ker(A) may be written as a = Kx where x is an arbitrary m = dim(Ker(A))dimensional binary vector. Using this we may rewrite Eq. (34) over GF(2) as Since the right-hand side is linear in x for all x, the left-hand side must also be linear in x. It follows by Lemma 6 that K t QK is symmetric, and moreover that the quadratic form x t K t QKx can be written as x t diag(K t QK). Thus, solving Eq. (34) for w is equivalent to solving the linear system x t K t w + x t diag(K t QK) = 0, or Since this equation must be true for all x, it follows that K t w + diag(K t QK) = 0 and hence that w is the solution to Since K is efficiently constructable, w can also be found efficiently using standard methods for solving linear equations over GF (2). Now for the first claim of the theorem, which states that the circuits corresponding to the graphs in Θ are CES. Θ is a downwardly closed set of graphs which generates a set of compatible quantum circuits Ω Θw via the mapping described above. In turn we have the corresponding Ising model instances I(Ω Θw ) and by assumption, the GΩ-compatible bond distributions w for the circuits Ω ∈ Ω Θw and graphs G ∈ Θ. Lemma 4 states that these instances are planar. It follows that they are CES, i.e., we may compute the Ising partition function for any of these instances efficiently with a classical computer. This is due to a result by Kasteleyn, who gave a classical algorithm for the exact evaluation of the Ising partition function of any planar graph in the absence of an external magnetic field [58]. According to our definition of CES quantum circuits (Definition 12), all we need is to be able to obtain the evaluation in a time polynomial in the number of qubits (which translates to the number of vertices), and the desired number of bits of precision of Z ∆ (λ), which is achieved by the algorithm given in [58]. Now, since 0|U (Ω)|0 ∝ Z ∆ (λ) [Eq. (35)], and for any graph in Θ we have an efficient way of classically determining Z ∆ (λ), we are thus able to determine the matrix element 0|U (Ω)|0 for any quantum circuit in Ω Θw efficiently. It follows from Lemma 5 that any quantum circuit in Ω Θw which solves a decision problem is CES.
We remark that this technique can be used to prove that quantum circuits which correspond to non-planar classes of graphs for which the Ising partition function has efficient classical evaluation schemes, e.g., graphs of bounded tree width, are CES. We suspect that some of the results obtained in Ref. [39] may be reproduced in this way.
We further remark that due to algorithms for planarity testing, given a quantum circuit one can test if it belongs to the class Ω Θw of CES quantum circuits. For example, a simple test follows from the Eulerian criterion of planarity: |E| ≤ 3|V | − 6 where |E| is the number of edges and |V | is the number of vertices. (This follows from the application of a handshaking lemma to the famous relation |F | − |E| + |V | = 2, where F is the number of faces [57].) Examining the close relationship between the circuit representation H and the incidence matrix CH, one can give the restriction number of gates ≤ 3(number of qubits) − 6, provided that the universal gate set consists of rotations about products of Pauli operations. A circuit Ω for which Eq. (39) holds generates a planar graph G via the mapping we have described. Provided Eq. (34) has a nontrivial solution w, it follows that Ω is Gw-compatible, and hence CES by planarity of G.

VI. FURTHER CHARACTERIZATION OF THE CLASS OF CES QUANTUM CIRCUITS ΩΘw
Our motivation in this subsection is to present a result on CES quantum circuits which allows a comparison to the recent results presented in [42] and [36]. In both papers, results dependent on quantum gates being restricted to nearest neighbor qubit operations in one dimension are presented. Via our construction we derive a similar result, but show that the restriction to nearestneighbor operations and one dimension can be lifted. We begin with a simple example.

A. Graphs in Θ are compatible with CES circuits which include non-nearest-neighbor operations
Recent work in Ref. [42] demonstrates that any circuit that is built out of X-rotations and nearest neighbor Z ⊗Z rotations can be efficiently simulated. Now assume that one is restricted to a class of planar graphs, Θ p , for which the number of even subgraphs scales polynomially with the number of vertices. This restriction is not necessary and is introduced merely for simplicity. Let us call the corresponding set of quantum circuits (under the mapping presented above) Ω p . Upon inspection of the incidence matrix of a typical graph in Θ p one sees that even though the majority of incident vertices are nearest neighbor, there are several that are not, no matter how one labels the vertices. For example, consider the graph depicted in Fig. 1.
Note that the fifth and sixth columns correspond to gates of the form respectively. The superscripts indicate which qubit is being operated on, and thus one can clearly see that nonnearest neighbor interactions are possible. This example demonstrates that our construction may extend the results in [42], for example, by linking together graphs like the "necklace" shown. Note, however, that the nearestneighbor restriction can only be relieved slightly as most of the interactions will in fact remain nearest-neighbor. Taking this example as motivation, what follows is a more general construction which will be used to pursue a better understanding of CES circuits.

B. A class of CES circuits with non-nearest neighbor gates
We now define a simple subclass of planar graphs which have a polynomial (in the number of vertices) number of even subgraphs. Because of planarity this class of graphs correspond to CES quantum circuits. However, note that this class of graphs is by no means an exhaustive characterization of all planar graphs which have a polynomial number of even subgraphs.
Definition 13 A basis of the null space of the incidence matrix CH is referred to as a cycle basis.
Definition 14 Let Θ pc be those planar graphs with V vertices and E = V + O(log V k ) edges, where k ∈ R + . Proposition 1 Θ pc has a polynomial, in V , number of even subgraphs.
Proof. A cycle basis consists of a set of connected even subgraphs of a given graph in Θ pc . The dimension of the null space (or the number of elements of the cycle basis) is in this case equal to the number of edges minus the rank of CH. Recall also that the rank of the incidence matrix equals the number of edges minus the number of components (which is one in our case). Thus, asymptotically, one has, nullity = V +O(k log V )−rank(CH) = O(log V k ). (40) Now, note that the null space allows all possible sums of the basis and therefore we are left with O(V k ) elements as claimed.
One could imagine graphs in Θ pc as being sparse graphs consisting of cycles (even subgraphs) strung together along trees without too many branching points. This is due to the relationship between E and V given above. One can see that a branch without a cycle always adds an additional vertex (one edge has two vertices) and the only way that the relationship between vertices and edges can be satisfied is if the number of branches is kept smaller than the number of cycles. That is, there will need to be more cycles than edges that do not terminate at a cycle. Further, the incidence matrix of these structures, like the example above in Fig. 1, will have columns that consist of nearest neighbor consecutive "1's" for the majority of positions. This rule is broken when a tree branches and when one runs into a cycle. By Theorem 1, this can only happen O(log V k ) times. As E is the number of gates and V is the number of qubits in the corresponding quantum circuit, we have just proven: Corollary 1 A quantum circuit consisting of gates of the form e −iθ(X (i) ⊗Y (j) ) , which act on nearest neighbor qubits except for O(k log(#of qubits)) gates, which can act on qubits i and j such that |i − j| ≥ 2, is CES.
Note: Z operations may be included in the exponent of this operator at any position not occupied by the X and Y operations.
The important point in the last corollary is that we allow non-nearest neighbor gates, thus extending the results of [42], and also [59], where only nearest-neighbor CES quantum circuits were considered.

C. Θ includes some but not all outerplanar graphs
So far we have stressed the special role of K 3,3 and K 5 , which led us to the conclusion that all graphs in Θ are planar. However, it turns out that we can be more specific, since we have also been able to show that K 4 and K 3,3 are forbidden minors for Θ (Lemma 2; see Appendix C for a description of the proof, using mathematical software). In other words, there does not exist a solution to Eq. (34) for the graphs K 4 andK 3,3 . These graphs play a role in characterizing the set of outerplanar graphs [57], which we define next: Definition 15 For any planar graph, there are regions bounded by the cycles of the graph and an unbounded region outside of all the cycles. An outerplanar graph is a planar graph for which every vertex is within the unbounded region when it is embedded in the plane such that no edges intersect.
For example, the graph in Fig. 1 is outerplanar. More informally, a graph is outerplanar if it can be embedded in the plane such that all vertices lie on the outer (exterior) face. A graph G is outerplanar iff K 1 + G (a new vertex is connected to all vertices of G) is planar [60]. The characterization of relevance to us is the following analog of Kuratowski's theorem for planar graphs (described in Appendix A): Theorem 2 (Chartrand & Harrary [61]) A graph is outerplanar if and only if it has no subgraph homeomorphic to K 4 or K 2,3 .
In other words, K 2,3 is a forbidden minor for outerplanar graphs, where K 2,3 is like K 3,3 except that one side of the bipartite graph has two vertices instead of three.

Proposition 2 If a graph is outerplanar then it does not haveK 3,3 as a minor.
Proof. Assume thatK 3,3 is a minor of some G ∈ Outerplanar. Then G has K 2,3 as a minor, since K 2,3 is a minor ofK 3,3 . (This is easy to see: just contract one edge and delete another.) But by Theorem 2 outerplanar graphs cannot have K 2,3 as a minor, which is a contradiction. Thus G cannot be outerplanar.
Note that the converse is not necessarily true, i.e., not all graphs which do not haveK 3,3 as a minor are outerplanar.
Proof. By Lemma 2, if G ∈ Θ then G cannot have K 4 or K 3,3 as minors. By Theorem 2 and Proposition 2, if G is an outerplanar graph then it cannot have K 4 orK 3,3 as minors either. This suggests that Θ may have graphs in common with the set of outerplanar graphs. We have verified, using mathematical software, that the intersection is indeed nonempty. For example, we have found that certain trees with cycles, which are outerplanar by construction, are in Θ. Moreover, we have verified using mathematical software that K 2,3 ∈ Θ, i.e., it is not a forbidden minor for the existence of a solution w. But K 2,3 is not outerplanar, hence there are graphs in Θ which are not outerplanar (in particular, all subdivisions of K 2,3 ). This is interesting since some problems are NPcomplete for subclasses of planar graphs but solvable in polynomial time for outerplanar graphs. Some examples are the chromatic number, Hamiltonian path and Hamiltonian circuit. Another example is the page number which is one for outerplanar graphs. This means that we can embed the vertices on a line which divides the plane into two subplanes, and draw all edges in one of the subplanes without crossing. In a sense, outerplanar graphs are "easy" computationally. The fact that Θ includes non-outerplanar graphs thus suggests that it may include interesting computational problems.

VII. DISCUSSION AND FUTURE DIRECTIONS
In this section we briefly discuss two possible future directions for research.

A. General condition for the bond distribution
So far we have assumed the sufficient condition (34) in order to obtain the desired equality between the partition function and the circuit matrix element 0|U (Ω)|0 [Eqs. (25) and (32)]. We have also shown that a satisfying bond distribution w can always be efficiently tested for an computed, under Eq. (34). Let us now relax the constraint of Eq. (34) by considering a more general way in which the desired proportionality, can be obtained. Indeed, Eq. (34) is clearly not a necessary condition. The following construction demonstrates that it is likely that the number of cases which do not have a solution w for the bond distribution is much smaller than the case we analyzed given by Eq. (34).
Note that in Eq. (41) the powers of the λ's are the weights of the null vectors a, that is the number of ones in a. Thus it is possible for an equality to occur for a given term in the sum in the two sides of Eq. (41) for different a's, as long as the weights of the a's are equal. This gives us the constraint for the following. One can organize all the a's in bins in terms of weights from 1 to |E| = N . Let us now take bin r, i.e., the set of vectors of weight r. Let a r1 , . . . , a rn be all the null vectors of CH of weight r. Then, if for all r where {j 1 , ..., j n } is any permutation of the numbers {1, ..., n}, then Eq. (41) would be satisfied. Clearly, Eq. (34) is a special case of this more general condition. This demonstrates that it is likely that a satisfying bond distribution w can be found for a given graph even if the sufficient condition (34) cannot be satisfied. Loosely, this is due the fact that there are many conjunctive statements of the form (42) that can be satisfying. In fact it seems likely that also non-planar graphs (i.e., those containing K 5 or K 3,3 as minors) may have a satisfying w according to Eq. (42). We leave this as a problem for future investigation. An important point concerning the more general condition (42) is that we do not know if it can be efficiently tested for a satisfying bond distribution w, let alone solved for such a w.

B. Computing the Ising partition function
As mentioned in Section IV A, Eq. (35) has two consequences, and our focus in this paper has been on the ability to find CES circuits using known results about the hardness of computing partition functions. Let us now briefly consider the other consequence, namely the fact that if we are able to determine 0|U (Ω)|0 , then we are able to determine the partition function Z ∆ (λ).
A fully-polynomial randomized approximation scheme (fpras) for the fully-ferromagnetic Ising partition function was presented in [62]. It is well known that having an fpras for the non-ferromagnetic Ising model implies that N P = RP (randomized polynomial time) which would be quite unexpected [50]. It should therefore be of no surprise that no fpras for this problem has been found, even with quantum resources. However additive approximation schemes seem likely and in fact one was given in [23] for the related Potts model partition function, even though the instances that they were able to account for are not known to be BQP-complete and the hardness is in fact unknown.
Equation (35) precisely relates a matrix element of a quantum circuit with the value of the partition function of the Ising model for a corresponding graph instance. This means that if we could approximate the matrix element, we would have an approximation for the Ising partition function. Due to the Hadamard test, it is well known that a polynomial estimation of this matrix element is BQP-complete. (See Ref. [54] for a description of the Hadamard test.) Specifically, by making 1/ 2 measurements, one can either have Re 0|U (Ω)|0 or Im 0|U (Ω)|0 to precision , but one must keep in mind that this approximation is an additive one. This means that with some probability of success bounded below (say by .75) the approximation returns m such that where p is a polynomially small parameter and δ is the approximation scale of the problem. Note that if δ = O( 0|U (Ω)|0 ) then the approximation will be an fpras [23]. Equations (35) and (43) taken together quantify how a measurement of 0|U (Ω)|0 yields an approximation of the partition function of the Ising model instance ∆ corresponding to the circuit Ω.

VIII. CONCLUSIONS
We have provided a construction that allows one to determine if a given quantum circuit corresponds to a class of quantum circuits which are classically efficiently simulatable (CES). This was done by looking at the corresponding graph instances of the classical Ising model using a mapping previously introduced in [28]. This was then used to conclude that any class of quantum circuits which solve decision problems and are restricted to certain planar graph instances are CES. Our main result is stated in Theorem 1, which characterizes the class of CES circuits via the set of planar graphs Θ. We have given a partial characterization of Θ by stating that its obstruction set includesK 3,3 and K 4 (and hence, by downward closure also K 3,3 and K 5 ). An interesting open problem is to give a complete characterization of the obstruction set; we know from the Robertson Seymour Theorem that this set is finite, since we have proved that Θ is downwardly closed.
Our mapping can also be used to construct a quantum algorithm for the additive approximation of the partition function. However, there are two issues. The instances we are able to handle are constrained by our use of equation (34) which does not capture all the ways a certain bond distribution may satisfy equation (41), but which simplifies our analysis greatly. The other issue is the fact that our mapping may fail to provide information about the bond distribution of a given graph.
An open problem is to obtain a better understanding of what the complexity of finding the bond distribution for a particular graph instance is. This understanding will have consequences in our knowledge of where BQP is in the complexity hierarchy, as we will be able to relate the simulatability of universal quantum circuit families with the complexity of finding bond distributions. On the other hand, it is possible that the complexity of finding bond distributions is somehow incorporated in the power of the quantum circuit that corresponds to the graph instance of the Ising model, in the sense that the circuit corresponding to a planar graph (under our mapping) may not be CES, because the effort of obtaining the bond distribution via Eq. (42)  Here we review some essential definitions and theorems form graph theory needed for the results presented in this work. A good reference for these concepts is the wikipedia article on planar graphs, or Ref. [57].

Definition 16
A subgraph H of a given graph G is called a minor (or child) of G if it is isomorphic to a graph that can be obtained from G via a sequence of edge deletions, edge contractions, or deletion of isolated vertices. Edge contraction is the process of removing an edge and combining its two endpoints into a single vertex. Edge deletion removes an edge without removing its vertices.

Definition 17
The set of graphs S is downwardly closed with respect to minor ordering if whenever G is a member of S, then so is any minor of G.
A trivial consequence of the definition of downwardly closed sets is that every such set has an obstruction set: Corollary 2 An obstruction set for G is a set of minors of G, also called forbidden minors, with the property that they prevent downward closure.
In other words, if one constructs a set of minors of G and encounters a minor that violates the property for which downward closure is being tested, such a minor is called forbidden, and belongs to the obstruction set. Now comes a seminal theorem due to Robertson and Seymour [56]: Theorem 3 (Robertson-Seymour) Every downwardly closed set of graphs (possibly infinite) has a finite obstruction set, i.e., a finite set of forbidden minors.
For our purposes an important example are the planar graphs: Definition 18 A planar graph is a graph which can be embedded in the plane, i.e., it can be drawn on the plane in such a way that its edges may intersect only at their endpoints, i.e., edges never cross. A nonplanar graph is a graph which cannot be drawn in the plane without edge intersections.
There are two particularly important nonplanar graphs, denoted K 5 (the complete graph on five vertices; complete means that each pair of vertices are connected by an edge) and K 3,3 (the complete bipartite graph on six vertices, three of which connect to each of the other three). They are depicted in Fig. 2.
Planarity is characterized by Wagner's Theorem [57]: Theorem 4 (Wagner) A finite graph is planar if and only if it does not have K 5 or K 3,3 as a minor. In other words, if one deletes or contracts the edges of a graph and finds one of these minors, then the graph is not planar. Hence K 5 and K 3,3 are forbidden minors (form an obstruction set) for planarity.
For completeness we note that an alternative characterization can be given in terms of the concept of a subdivision of a graph: Definition 19 A subdivision of a graph results from inserting vertices into edges.
Thus, while deletion and contraction of edges shrinks a graph down, subdivision builds it up.
Definition 20 Two graphs G and G are homeomorphic if there is an isomorphism from some subdivision of G to some subdivision of G .

Theorem 5 (Kuratowski)
A finite graph is planar if and only if it has no subgraph homeomorphic to K 5 or K 3,3 .
In other words, a finite graph is planar if and only if it does not contain a subgraph that is isomorphic to a subdivision of K 5 or K 3,3 .
In this work we give a criterion for graph membership (in a certain set Θ which is defined in Definition 11) based on the existence of a solution for the system of linear equations over GF (2) defined by Eq. (34). We want to be guaranteed that this membership has an ordering in the sense that if G is a member, then so is every minor of G. In other words, we are testing for downward closure. The Robertson-Seymour theorem guarantees that membership in our set Θ is not obstructed by an infinite set of graphs. However, the situation is in fact far better: membership of a graph to a fixed downward closed set can be checked by running a polynomial time algorithm for all elements of the obstruction set (if it is known), since searching for a minor on a given graph only requires cubic time [57]. In fact, checking whether a graph is planar can be done in linear time.
For completeness we include the definition of a hypergraph as our correspondence between quantum circuits and graphs is actually a mapping between circuits and hypergraphs [28].
Definition 21 A hypergraph is a generalization of a graph where edges are replaced by hyperedges. Let V = {v 1 , v 2 , . . . , v k } be the set of vertices and let E = {e 1 , e 2 , . . . , e n } be the set of hyperedges.
Thus the main difference from ordinary graphs is that edges consist of arbitrary collections of vertices rather than two and thus graphs are special cases of hypergraphs. As shown in Ref. [28], the existence of hyperedges is what gives us access to the universal gate set presented in [49], via the two assumptions enumerated at the end of Section IV. However, the circuits that correspond to graphs is what is interesting here, as our results depend on information about the Ising partition function defined on ordinary graphs.

APPENDIX B: PROOF OF LEMMAS
Here we present the proof of lemmas 1, 3, and 6, which we repeat for convenience: Lemma 3 If a graph G is a member of Θ, then so is G \ e j or G/e j , i.e., the deletion or contraction of an arbitrary edge e j from a graph in Θ is also in Θ. Proof. Assume that G ∈ Θ. Recall that a graph G is an element of Θ if there exists some solution w to the set of linear equations over GF (2) where A (G) is the matrix whose rows are elements, a i , of the nullspace of the incidence matrix of the graph G (given as the Ising instance), and α (G) is the vector whose entries are the a t i lwtr(H t CH)a i . These null elements, a i , correspond to the even subgraphs of G and will be referred to as cycles (recall Definition 4). From elementary linear algebra we know that a solution exists if α (G) may be written as a linear combination of columns of A (G) or in other words if We must demonstrate that after we either delete or contract an edge, and arrive at the subgraph G , we have We shall demonstrate this with an edge deletion as the case of a contraction is similar. We begin with a given graph G which is a member of Γ w . We have Using Einstein notation this equals Keep in mind that if we were to delete an edge from G, this would correspond to losing a column from CH which would correspond to losing, say the s th column from matrix (B5). Taking the lower triangular portion of matrix (B5) and calculating we find that the m th element of the vector α (G) is where a mi is the i th element of the m th null vector of CH or the matrix element A m,i . Now, let ξ s m = a m(s+1) a ms G 2i−1,s+1 G 2i,s + a m(s+2) a ms G 2i−1,s+2 G 2i,s + · · · + a mN a ms G 2i−1,N G 2i,s .
This is the portion of α (G) m that would vanish if we were to omit the edge that corresponds to the s th column of the matrix (B5). This means that if we remove this edge, we will end up with the subgraph G and we can write This equation is saying that the m th entry of the right hand side of is given by the m th entry of the right hand side of (the corresponding system of equations for the graph G ) plus the term ξ s m . From the assumption that G ∈ Γ w and by construction we have How does the matrix A change as we go from G −→ G by this edge deletion? If the edge is a dangling edge, i.e., not part of a cycle, then we lose a column (column s) but if the edge deletion causes the breaking of M cycles, then A will lose M rows (in addition to column s), as the rows encode the cycle structure of the graph. In this case, the dimension (or length) of α (G ) will be M less than the dimension of α (G) and the c i will also be shorter by M entries. We call these shorter c i , c i . Further, and most importantly, ξ s will vanish, as mentioned. After taking this into consideration we now can conclude that The proof for edge contractions is similar. The main difference is that an edge contraction does not cause the loss of a cycle except when the edge in question belongs to a cycle of length three. Thus in general, the contraction case is simpler except when dealing with cycles of length three. In this case the proof caries over in the same way.
Thus the set of graphs Θ is downwardly closed. Lemma 1 The obstruction set for Θ is finite. Proof. The set of graphs Θ is downwardly closed by the above lemma. One may then apply the Robertson-Seymour Theorem (Theorem 3) and immediately conclude that the number of forbidden minors of Θ is finite.
Lemma 6 A quadratic form x t Ax over GF(2) is linear in x (equal to x t diag(A)) iff A is symmetric. Proof. Let x be an m-dimensional column vector and A an m × m matrix, both over GF (2). Consider the quadratic form x t Ax = ij x i A ij x j and assume that A is symmetric: A = A t . Then where in the second line we used x 2 i = x i [true over GF (2)], exchanged i and j in the third summand and used A ij = A ji . The first and third summands are equal and hence add up to zero over GF (2). We are left with the, second, linear term, i.e., x t Ax = x t diag(A), where diag(A) denotes a vector comprising the diagonal of A.
Next, assume that A is not symmetric. Then there exists a pair of indices i < j such that A i j = A j i , i.e., A i j + A j i = 1. As above, we have: x t Ax = i<j A ij x i x j + i A ii x i + j>i A ji x j x i . Consider the index pair (i , j ) in this sum: (B16) Thus the quadratic form contains at least one non-linear (quadratic) term x i x j .

APPENDIX C: ALGORITHM FOR MINOR TESTING
Note that all calculations are done modulo 2. Input: A graph G for which we wish to determine if there exists some satisfying edge interaction w that satisfies Eq. (34). Specifically, we considered G = K 3,3 , K 5 ,K 3,3 (K 3,3 with one edge deleted) and K 4 .
Output: A binary vector w that is a satisfying bond distribution or a null vector (indicating no such bond distribution).
1. From the incidence matrix A of G obtain the following items: (a) All vectors a i belonging to the null space L of the incidence matrix. These row vectors form a matrix M .
(b) Construct a matrix representation H of the possible corresponding quantum circuits (under the mapping presented earlier). From H construct Q = lwtrH t CH. This matrix will have variables z i corresponding to all the possible ways that one can include or omit Z operations (changing these affects the types of edge interactions that one obtains, if any.) 2. Form the vector B whose i th entry is B i = a t i Qa i , where a i are the elements of the null space of L. This is the left-hand side of Eq. (34). Each entry of B consists of linear equations whose variables z i represent the presence or absence of a Z operation in a quantum circuit that corresponds to G.
3. Form a matrix W whose rows are all possible bonds. 4. Produce a matrix D whose i th row D i is equal to M W i . These are all possible values of the right hand side of Eq. (34). (Note that due to symmetry there will be many repeats, so that the total number of possible bonds to check is far fewer than all possible bonds.) 5. Attempt to solve the system of linear equations B k = D 1,k , B k = D 2,k , . . . , B k = D |L|,k over GF (2) (where k runs from 1 to the number of rows of D) for the variables z i . A solution for some k gives information for a specific circuit representation H. If no solution for the z i exists, then there is no satisfying bond distribution w for Eq. (34). This is indeed the case for K 3,3 , K 5 ,K 3,3 and K 4 . If there is a solution for some fixed k, continue.
6. Take this specific H (i.e., this H has no variables and corresponds to a specific circuit given by the solution of the z i above) and now form B i = a t i (lwtrH t CH)a i again. This time however, B contains no variables and is a numerical vector. Thus, one now has the binary vector B and the matrix M . 7. Solve the linear system M w = B and output the edge interaction w.
Having applied this algorithm we proved using mathematical software that the obstruction set for Θ includes K 3,3 , K 5 ,K 3,3 and K 4 , i.e., Lemma 2.