Simulating quantum computations with Tutte polynomials

We establish a classical heuristic algorithm for exactly computing quantum probability amplitudes. Our algorithm is based on mapping output probability amplitudes of quantum circuits to evaluations of the Tutte polynomial of graphic matroids. The algorithm evaluates the Tutte polynomial recursively using the deletion–contraction property while attempting to exploit structural properties of the matroid. We consider several variations of our algorithm and present experimental results comparing their performance on two classes of random quantum circuits. Further, we obtain an explicit form for Clifford circuit amplitudes in terms of matroid invariants and an alternative efficient classical algorithm for computing the output probability amplitudes of Clifford circuits.


I. INTRODUCTION
There is a natural relationship between quantum computation and evaluations of Tutte polynomials [1,2].In particular, quantum probability amplitudes are proportional to evaluations of the Tutte polynomial of graphic matroids.In this paper we use this relationship to establish a classical heuristic algorithm for exactly computing quantum probability amplitudes.While this problem is known to be #P-hard in general [3], our algorithm focuses on exploiting structural properties of an instance to achieve an improved runtime over traditional methods.Previously it was known that this problem can be solved in time exponential in the treewidth of the underlying graph [4].
The basis of our algorithm is a mapping between output probability amplitudes of quantum circuits and evaluations of the Tutte polynomial of graphic matroids [2,5,6].Our algorithm proceeds to evaluate the Tutte polynomial recursively using the deletion-contraction property.At each step in the recursion, our algorithm computes certain structural properties of the matroid in order to attempt to prune the computational tree.This approach to computing Tutte polynomials was first studied by Haggard, Pearce, and Royle [7].Our algorithm can be seen as an adaption of their work to special points of the Tutte plane where we can exploit additional structural properties.
The performance of algorithms for computing Tutte polynomials based on the deletion-contraction property depends on the heuristic used to decide the ordering of the recursion [7][8][9].We consider several heuristics introduced by Pearce, Haggard, and Royle [8] and an additional heuristic, which is specific to our algorithm.We present some experimental results comparing the performance of these heuristics on two classes of random quantum circuits corresponding to dense and sparse instances.* mail@ryanmann.org;http://www.ryanmann.org The correspondence between output probability amplitudes of quantum circuits and evaluations of Tutte polynomials also allows us to obtain an explicit form for Clifford circuit amplitudes in terms of matroid invariants by a theorem of Pendavingh [10].This gives rise to an alternative efficient classical algorithm for computing output probability amplitudes of Clifford circuits.
This paper is structured as follows.We introduce matroid theory in Section II and the Tutte polynomial in Section III.In Sections IV, V, and VI, we establish a mapping between output probability amplitudes of quantum circuits and evaluations of the Tutte polynomial of graphic matroids.This is achieved by introducing the Potts model partition function in Section IV, Instantaneous Quantum Polynomial-time circuits in Section V, and a class of universal quantum circuits in Section VI.In Section VII, we use this mapping to obtain an explicit form for Clifford circuit amplitudes in terms of matroid invariants.We also obtain an efficient classical algorithm for computing the output probability amplitudes of Clifford circuits.We describe our algorithm in Section VIII and present some experimental results in Section IX.Finally, we conclude in Section X.

II. MATROID THEORY
We shall now briefly introduce the theory of matroids.The interested reader is referred to the classic textbooks of Welsh [11] and Oxley [12] for a detailed treatment.Matroids were introduced by Whitney [13] as a structure that generalises the notion of linear dependence.There are many equivalent ways to define a matroid.We shall define a matroid by the independence axioms.
Definition 1 (Matroid).A matroid is a pair M = (S, I) consisting of a finite set S, known as the ground set, and a collection I of subsets of S, known as the independent sets, such that the following axioms are satisfied.
2. Every subset of a member of I is a member of I.

If
A and B are members of I and |A| > |B|, then there exists an x ∈ A\B such that B ∪ {x} is a member of I.
The rank of a subset A of S is given by the rank function r : 2 S → N of the matroid defined by r(A) := max (|X| | X ⊆ A, X ∈ I).The rank of a matroid M , denoted r(M ), is the rank of the set S.
The archetypal class of matroids are vector matroids.A vector matroid M = (S, I) is a matroid whose ground set S is a subset of a vector space over a field F and whose independent sets I are the linearly independent subsets of S. The rank of a subset of a vector matroid is the dimension of the subspace spanned by the corresponding vectors.We say that a matroid is F-representable if it is isomorphic to a vector matroid over the field F. A matroid is a binary matroid if it is F 2 -representable and is a ternary matroid if it is F 3 -representable.A matroid that is representable over every field is called a regular matroid.
Every finite graph G = (V, E) induces a matroid M (G) = (S, I) as follows.Let the ground set S be the set of edges E and let the independent sets I be the subsets of E that are a forest, i.e., they do not contain a simple cycle.It is easy to check that M (G) satisfies the independence axioms.The rank of a subset A of a cycle matroid is |V | − κ(A), where κ(A) denotes the number of connected components of the subgraph with edge set A. The rank of the cycle matroid M (G), denoted r(M (G)) or simply r(G), is the rank of the set E. The matroid M (G) is called the cycle matroid of G.We say that a matroid is graphic if it is isomorphic to the cycle matroid of a graph.
Graphic matroids are regular.To see this consider assigning to the graph G an arbitrary orientation D(G), that is, for each edge e = {u, v} in G, we choose one of u and v to be the positive end and the other one to be the negative end.Then construct the oriented incidence matrix of G with respect to the orientation D(G). otherwise.
The rows of the oriented incidence matrix A D(G) correspond to the vertices of G and the columns correspond to the edges of G.Each column contains exactly one +1 and exactly one −1 representing the positive and negative ends of the corresponding edge.If the column space of A D(G) is the ground set of a vector matroid, then it is easy to see that a subset is independent if and only if it is a forest in G. Hence, the oriented incidence matrix provides a representation of a graphic matroid over every field.
A minor of a matroid M is a matroid that is obtained from M by a sequence of deletion and contraction operations.
Definition 3 (Deletion).Let M = (S, I) be a matroid and let e be an element of the ground set.Then the deletion of M with respect to e is the matroid M \{e} = (S , I ) whose ground set is S = S\{e} and whose independent sets are I = {I ⊆ S\{e} | I ∈ I}.
The deletion of an element from the cycle matroid of a graph corresponds to removing an edge from the graph.Definition 4 (Contraction).Let M = (S, I) be a matroid and let e be an element of the ground set.
Then the contraction of M with respect to e is the matroid M/{e} = (S , I ) whose ground set is S = S\{e} and whose independent sets are The contraction of an element from the cycle matroid of a graph corresponds to removing an edge from the graph and merging its two endpoints.
An element e of a matroid is said to be a loop if {e} is not an independent set and said to be a coloop if e is contained in every maximally independent set.If an element e of a matroid is either a loop or a coloop then the deletion and contraction of e are equivalent.

III. THE TUTTE POLYNOMIAL
We shall now briefly introduce the Tutte polynomial, which is a well-known invariant in matroid and graph theory.
Definition 5 (Tutte polynomial of a matroid).Let M = (S, I) be a matroid with rank function r : 2 S → N. Then the Tutte polynomial of M is the bivariate polynomial defined by The Tutte polynomial may also be defined recursively by the deletion-contraction property.
Otherwise, let e be an element of the ground set.If e is a loop, then T(M ; x, y) = yT(M \{e}; x, y).
The deletion-contraction property immediately gives an algorithm for recursively computing the Tutte polynomial.This algorithm is in general inefficient, but the performance may be improved by using isomorphism testing to reduce the number of recursive calls [14].The performance of this algorithm depends on the heuristic used to choose elements of the ground set [7][8][9].Björklund et al. [15] showed that the Tutte polynomial can be computed in time exponential in the number of vertices.
The Tutte polynomial of a graph may be recovered by considering the Tutte polynomial of the cycle matroid of a graph and using the fact that the rank of a subset A of a cycle matroid is |V | − κ(A), where κ(A) denotes the number of connected components of the subgraph with edge set A.
Definition 7 (Tutte Polynomial of a graph).Let G = (V, E) be a graph and let κ(A) denote the number of connected components of the subgraph with edge set A. Then the Tutte polynomial of G is a polynomial in x and y, defined by The Tutte polynomial is trivial to evaluate along the hyperbola (x − 1)(y − 1) = 1 for any matroid.In the case of graphic matroids, Jaeger, Vertigan, and Welsh [16] showed that the Tutte polynomial is #P-hard to evaluate, except along this hyperbola and when (x, y) equals one of nine special points.
In each of these exceptional cases, except when (x, y) equals (1, 1), the evaluation can be done in polynomial time.
Snook [18] showed that when (x, y) equals (1, 1) and F is either a finite field of fixed characteristic or a fixed infinite field, then evaluating the Tutte polynomial is #P-hard.
It is an open problem to understand the complexity of evaluating the Tutte polynomial at (1, 1) over any fixed field.

IV. THE POTTS MODEL PARTITION FUNCTION
The Potts model is a statistical physical model described by an integer q ∈ Z + and a graph G = (V, E), with the vertices representing spins and the edges representing interactions between them.A set of edge weights {ω e } e∈E characterise the interactions and a set of vertex weights {υ v } v∈V characterise the external fields at each spin.A configuration of the model is an assignment σ of each spin to one of q possible states.The Potts model partition function is defined as follows.
Definition 8 (Potts model partition function).Let q ∈ Z + be an integer and let G = (V, E) be a graph with the weights Ω = {ω e } e∈E assigned to its edges and the weights Υ = {υ v } v∈V assigned to its vertices.Then the q-state Potts model partition function is defined by

The Potts model partition function with an external field is equivalent to the zero-field case on an augmented graph
i=1 of G add a new vertex u i and for every vertex v ∈ V (C i ) add an edge e v = {u i , v} with the weight υ v assigned to it.Then we have the following proposition.
A similar proposition appears in Welsh's monograph [19]; we prove Proposition 3 in Appendix A.
It will be convenient to consider the Potts model with weights that are all positive integer multiples of a complex number θ.We shall implement this model on the augmented graph G with all weights equal to θ by replacing each edge with the appropriate number of parallel edges.Let us denote the partition function of this model by Z Potts (G ; q, θ).Then, we have the following proposition relating the partition function of this model to the Tutte polynomial of the augmented graph G .
The 2-state Potts model partition function specialises to the Ising model partition function.
Definition 9 (Ising model partition function).Let G = (V, E) be a graph with the weights Ω = {ω e } e∈E assigned to its edges and the weights Υ = {υ v } v∈V assigned to its vertices.Then the Ising model partition function is defined by where w G = exp 1 2 e∈E ω e + 1 2 v∈V υ v .Proof.The proof follows from some simple algebra.

V. INSTANTANEOUS QUANTUM POLYNOMIAL TIME
We shall now briefly introduce the class of commuting quantum circuits, known as Instantaneous Quantum Polynomial-time (IQP) circuits [5].These circuits exhibit many interesting mathematical properties.In particular, the output probability amplitudes of IQP circuits are proportional to evaluations of the Tutte polynomial of binary matroids [2].IQP circuits comprise only gates that are diagonal in the Pauli-X basis and are described by an X-program.
Definition 10 (X-program).An X-program is a pair (P, θ), where P = (p ij ) m×n is a binary matrix and θ ∈ [−π, π] is a real angle.The matrix P is used to construct a Hamiltonian of m commuting terms acting on n qubits, where each term in the Hamiltonian is a product of Pauli-X operators, Thus, the columns of P correspond to qubits and the rows of P correspond to interactions in the Hamiltonian.
An X-program induces a probability distribution P (P,θ) known as an IQP distribution.
Definition 11 (P (P,θ) ).For an X-program (P, θ) with P = (p ij ) m×n , we define P (P,θ) to be the probability distribution over binary strings x ∈ {0, 1} n , given by where The principal probability amplitude ψ (P,θ) (0 n ) of an IQP distribution is directly related to an evaluation of the Tutte polynomial of the binary matroid whose ground set is the row space of P .Proposition 6.Let (P, θ) be an X-program with P = (p ij ) m×n .Let M = (S, I) be the binary matroid whose ground set S is the row space of P , then, ψ (P,θ) (0) = e iθ(r(M )−m) (i sin(θ)) r(M ) T (M ; x, y) , where x = −i cot(θ) and y = e 2iθ .
A similar result may be obtained for the other probability amplitudes.This can easily be seen when θ = π 2k for k ∈ Z + , by firstly letting P k x be the matrix obtained from P by appending k rows identical to x, and then observing that ψ (P,θ) (x) = −iψ (P k x,θ) (0 n ).For a proof of Proposition 6 and a treatment of the general θ case, we refer the reader to Ref. [2,Section 3].
We shall consider X-programs that are induced by a weighted graph.
Definition 12 (Graph-induced X-program).For a graph G = (V, E) with the weights {ω e ∈ [−π, π]} e∈E assigned to its edges and the weights {υ v ∈ [−π, π]} v∈V assigned to its vertices, we define the X-program induced by G to be an X-program X G such that Any X-program can be efficiently represented by a graph-induced X-program [5].The principal probability amplitude ψ X G (0 n ) of the IQP distribution generated by a graph-induced X-program is directly related to the Ising model partition function of the graph with imaginary weights.
Proposition 7. Let G = (V, E) be a graph with the weights Ω = {ω e ∈ [−π, π]} e∈E assigned to its edges and the weights Υ = {υ v ∈ [−π, π]} v∈V assigned to its vertices, then, Proposition 7 is well known [20,21]; we provide a proof in Appendix B. It will be convenient to consider graphinduced X-programs X G(θ) with weights that are all positive integer multiples of a real angle θ.As in Section III, this model can be implemented on the augmented graph G = (V , E ) with all weights equal to θ by replacing each edge with the appropriate number of parallel edges.Let us denote the graph-induced X-program of this model by X G (θ) .Then, we have the following proposition.Proposition 8.
We prove Proposition 8 in Appendix C. We also have the following proposition relating the principal probability amplitude to the Tutte polynomial of the augmented graph.
We prove Proposition 9 in Appendix D. Notice that if we let M = (S, I) be the binary matroid whose ground set S is the column space of the orientated incidence matrix A D(G ) of G with an arbitrary orientation D(G ) assigned to it, then we can use Proposition 6 to obtain Proposition 9.

VI. QUANTUM COMPUTATION AND THE TUTTE POLYNOMIAL
In this section we show that quantum probability amplitudes may be expressed in terms of the evaluation of a Tutte polynomial.We achieve this by showing that output probability amplitudes of a class of universal quantum circuits are proportional to the principal probability amplitude of some IQP circuit.
It will be convenient to define the following gate set.
It is easy to see that the gate set G π 4 generates the Clifford group and the gate set G π 8 is universal for quantum computation.
In the IQP model it is easy to implement the gates e iθX and e iθXX .So in order to implement the entire gate set G θ , it remains to show that we can implement the Hadamard gate.This can be achieved by the use of postselection when θ = π 4k for k ∈ Z + [6].To apply a Hadamard gate to the target state |α t consider the following Hadamard gadget.Firstly introduce an ancilla qubit in the state |0 a and apply the gate e iπ 4 (I−X)t(I−X)a to |α t |0 a .Then measure qubit t in the computational basis and postselect on an outcome of 0. The output state of this gadget is then H |α a .
We shall consider quantum circuits that comprise gates from the set G π 4k for an integer k ∈ Z + .Let C k,n,m denote such a circuit that acts on n qubits and comprises m Hadamard gates.Further let X G (C k,n,m ) denote the graph-induced X-program that implements the circuit C k,n,m by replacing each of the m Hadamard gates with the Hadamard gadget.Then we have the following proposition.
Proof.The proof follows immediately from the application of the Hadamard gadgets.
Any quantum amplitude may therefore be expressed as the evaluation of a Tutte polynomial by Proposition 8, Proposition 9, and Proposition 10.

VII. EFFICIENT CLASSICAL SIMULATION OF CLIFFORD CIRCUITS
In this section we show how the correspondence between quantum computation and evaluations of the Tutte polynomial provides an explicit form for Clifford circuit amplitudes in terms of matroid invariants; namely, the bicycle dimension and Brown's invariant.This gives rise to an efficient classical algorithm for computing the output probability amplitudes of Clifford circuits.We note that it was first observed by Shepherd [2] that to compute the probability amplitude of a Clifford circuit, it is sufficient to evaluate the Tutte polynomial of a binary matroid at the point (x, y) equals (−i, i), which can be efficiently computed by Vertigan's algorithm [17].We proceed with some definitions.
Let V be a linear subspace of F n 2 .The bicycle dimension and Brown's invariant are defined as follows.
Definition 14 (Bicycle dimension).The bicycle dimension of V is defined by Definition 15 (Brown's invariant).If |supp(x)| ≡ 0 (mod 4) for all x ∈ V ∩ V ⊥ , then Brown's invariant σ(V ) is defined to be the smallest integer such that The following theorem of Pendavingh [10] provides an explicit form for the Tutte polynomial of a binary matroid at (−i, i) in terms of the bicycle dimension and Brown's invariant.
As an immediate consequence of Theorem 11, we obtain an explicit form for Clifford circuit amplitudes in terms the bicycle dimension and Brown's invariant of the corresponding matroid.Furthermore, we obtain an efficient classical algorithm for computing the output probability amplitudes of Clifford circuits.For similar results of this flavour see Refs.[22,23].

VIII. ALGORITHM OVERVIEW
We shall now use the correspondence between quantum computation and evaluations of the Tutte polynomial to establish a heuristic algorithm for computing quantum probability amplitudes.To compute a probability amplitude, it is sufficient to compute the Tutte polynomial of a graphic matroid at x = −i cot π 4k and y = e iπ 2k for an integer k ≥ 2 [2,5,6].Our algorithm will use the deletion-contraction property to recursively compute the Tutte polynomial.At each step in the recursion, the algorithm will compute certain structural properties of the graph in order to attempt to prune the computational tree.Our algorithm can be seen an adaption of the work of Haggard, Pearce, and Royle [7] to special points of the Tutte plane.
We note that our approach differs from tensor networkbased methods, which involve the contraction of a graph with tensors assigned to its vertices.These methods have been used to simulate quantum computations while exploiting structural properties of the graph [4,[24][25][26][27].However, our approach allows us to exploit an alternative class of structural properties.We proceed by describing the key aspects of our algorithm.

A. Multigraph Deletion-Contraction Formula
To improve the performance of our algorithm, we shall use the following deletion-contraction formula for multigraphs.
Proposition 12. Let G = (V, E) be a multigraph and let e be a multiedge of G with multiplicity |e|.If e is a loop, then T(G; x, y) = y |e| T(G\{e}; x, y).
If e is a coloop, then Finally, if e is neither a loop nor a coloop, then is the golden ratio [28].A careful analysis shows that the number of recursive steps is bounded by O (τ (U ) • |E(U )|), where τ (U ) denotes the number of spanning trees in U [14].
At each step in the recursion, we use the multigraph deletion-contraction formula to remove all multiedges that correspond to either a loop or a coloop in the underlying graph.This process contributes a multiplicative factor to the proceeding evaluation.Notice that when G is a graph whose underlying graph is a looped forest, then every edge in the underlying graph is either a loop or a coloop.Hence, we obtain the following formula for the Tutte polynomial of G.
Corollary 13.Let G = (V, E) be a multigraph whose underlying graph U is a looped forest.Further, for each edge e in U , let |e| denote its multiplicity in G.Then, Proof.The proof follows immediately from Proposition 12.

B. Graph Simplification
There are a number of techniques that we can use to simplify the graph at each step in the recursion.Firstly, we may remove any isolated vertices, since they do not contribute to the evaluation.
Secondly, when x = −i cot π 4k and y = e iπ 2k for an integer k ∈ Z + , we may replace each multiedge with a multiedge of equal multiplicity modulo 4k.To account for this, we multiply the proceeding evaluation by a efficiently computable factor.Specifically, we invoke the following proposition.
Proposition 14. Fix k ∈ Z + .Let G = (V, E) be a multigraph and let G = (V , E ) be the graph formed from G by taking the multiplicity of each multiedge in G modulo 4k.Then, T(G ; x, y), We prove Proposition 14 in Appendix E.

C. Vertigan Graphs
The Tutte polynomial of a multigraph whose edge multiplicities are all integer multiples of an integer k ∈ Z + may be evaluated at the point x = −i cot π 4k and y = e iπ 2k in polynomial time.This can be seen by the following proposition.
Proposition 15.Fix k ∈ Z + .Let G = (V, E) be a multigraph whose edge multiplicities are all integer multiples of k.Further let G = (V , E ) be the graph formed from G by taking the multiplicity of each multiedge in G divided by k.Then, We prove Proposition 15 in Appendix F and note that this is a special consequence of the k-thickening approach of Jaeger, Vertigan, and Welsh [16].The Tutte polynomial may then be efficiently computed by Vertigan's algorithm [17]; we call such a multigraph a Vertigan graph.We may therefore prune the computational tree whenever the graph is a Vertigan graph with respect to k.Note that this corresponds to quantum circuits comprising gates from the Clifford group.

D. Connected Components
The Tutte polynomial factorises over components.
Proposition 16 can easily be proven from the deletioncontraction formula; we omit the proof.At each step in the deletion-contraction recursion, if the graph is disconnected, then we may use this property to prune the computational tree and hence improve performance.

E. Biconnected Components
An identical result holds for biconnected components.
Proposition 17 (Tutte [29]).Let G = (V, E) be a graph with biconnected components B = {B i } k i=1 , then, Proposition 17 can easily be proven from the deletioncontraction formula.For a proof, we refer the reader to Ref. [29,Section 3].Similarly to the connected component case, we may use this property to prune the computational tree and improve performance.Note that the biconnected components of a graph may be listed in time linear in the number of edges via depth-first search [30].

F. Multi-Cycles
The Tutte polynomial of a multigraph whose underlying graph is a cycle may be computed in polynomial time by invoking the following proposition.
Proposition 18 (Haggard, Pearce, and Royle [7]).Let G = (V, E) be a multigraph whose underlying graph U is an n-cycle with edges indexed by the positive integers.Further, for each edge e in U , let |e| denote its multiplicity in G.Then, where y x (j) := x + j−1 i=1 y i .Proposition 18 can easily be proven from the deletioncontraction formula.For a proof, we refer the reader to Ref. [7,Theorem 4].We may use this proposition to prune the computational tree whenever the underlying graph is a cycle.

G. Planar Graphs
The Tutte polynomial of a planar graph along the hyperbola (x − 1)(y − 1) = 2 may be evaluated in polynomial time via the Fisher-Kasteleyn-Temperley (FKT) algorithm [31][32][33].We may therefore use this algorithm to prune the computational tree whenever the underlying graph is planar.Note that we may test whether a graph is planar in time linear in the number of vertices [34].

H. Edge-Selection Heuristics
The performance of our algorithm depends on the heuristic used to select edges.We shall consider six edge-selection heuristics: vertex order, minimum degree, maximum degree, minimum degree sum, maximum degree sum, and non-Vertigan.These edge-selection heuristics were first studied by Pearce, Haggard, and Royle [8], with the exception of non-Vertigan, which is specific to our algorithm.
Vertex order : The vertices of the graph are assigned an ordering.A multiedge is selected from those incident to the lowest vertex in the ordering and whose other endpoint is also the lowest vertex of any incident in the ordering.For contractions, the vertex inherits the lowest of the positions in the ordering.
Minimum degree: A multiedge is selected from those incident to a vertex with minimal degree in the underlying graph.
Maximum degree: A multiedge is selected from those incident to a vertex with maximal degree in the underlying graph.
Minimum degree sum: A multiedge is selected from those whose sum of degrees of its endpoints is minimal in the underlying graph.
Maximum degree sum: A multiedge is selected from those whose sum of degrees of its endpoints is maximal in the underlying graph.
Non-Vertigan: A multiedge is selected from those whose multiplicity is not an integer multiple of k; we call such a multiedge non-Vertigan.Using this edgeselection heuristic, the number of recursive calls may be bounded by O 2 ν(G) , where ν(G) denotes the number of non-Vertigan multiedges in G.This is due to the fact that both the deletion and contraction operation reduce the number of non-Vertigan multiedges by at least one.We note that this is similar to the Sum-over-Cliffords approach studied in Refs.[35][36][37].

I. Other Methods
There are many other methods that may improve the performance of our algorithm, which we do not study.We shall proceed by discussing some of these.
Isomorphism testing: During the computation the graphs encountered and the evaluation of their Tutte polynomial is stored.At each recursive step, we test whether the graph is isomorphic to one already encountered, and if so, we use the evaluation of the isomorphic graph instead.Haggard, Pearce, and Royle [7] showed that isomorphism testing can lead to an improvement in the performance of computing Tutte polynomials.Note that this may not be as effective when the input is a multigraph.
Almost planar : At each step in the recursion, we may test whether the graph is close to being planar, and if so, select edges in such a way that the deletion and contraction operations give rise to a planar graph.For example, if the graph is apex, that is, it can be made planar by the removal of a single vertex, then we may select a multiedge incident to such a vertex.Similarly, if the underlying graph is edge apex or contraction apex [38], then we may select a multiedge such that the deletion or the contraction operation gives rise to a planar graph.
k-connected components: Similarly to the connected and biconnected component case, we may compute the Tutte polynomial in terms of its k-connected components [39,40].

IX. EXPERIMENTAL RESULTS
In this section we present some experimental results comparing the performance of the edge-selection heuristics described in Section VIII H on two classes of random quantum circuits.Our experiments were performed using SageMath 9.0 [41].The source code and experimental data are available at Ref. [42].
The first class we consider corresponds to random instances of IQP circuits induced by dense graphs.Specifically, an instance is an IQP circuit induced by a complete graph with edge weights chosen uniformly at random from the set { mπ 8 | m ∈ Z/8Z}.This class of IQP circuits is precisely that studied in Ref. [43], where it is conjectured that approximating the corresponding amplitudes up to a multiplicative error is #P-hard on average.
The second class we consider corresponds to random instances of IQP circuits induced by sparse graphs.Specifically, an instance is an IQP circuit induced by a random graph where each of the possible edges is included independently with probability 1/2 and with edge weights chosen uniformly at random from the set { mπ 8 | m ∈ Z/8Z}.We run our algorithm using each of the edge-selection heuristics to compute the principal probability amplitude of 64 random instances of both the dense and sparse class on 12 vertices.The performance of each edge-selection heuristic is measured by counting the number of leaves in the computational tree.Our experimental data is presented in Appendix G.We find that the non-Vertigan edge-selection heuristic performs particularly well for the dense class and the maximum degree sum edge-selection heuristic performs particularly well for the sparse class.

X. CONCLUSION & OUTLOOK
We established a classical heuristic algorithm for exactly computing quantum probability amplitudes.Our algorithm is based on mapping output probability amplitudes of quantum circuits to evaluations of the Tutte polynomial of graphic matroids.The algorithm evaluates the Tutte polynomial recursively using the deletioncontraction property while attempting to exploit structural properties of the matroid.We considered several edge-selection heuristics and presented experimental results comparing their performance on two classes of random quantum circuits.Further, we obtained an explicit form for Clifford circuit amplitudes in terms of matroid invariants and an alternative efficient classical algorithm for computing the output probability amplitudes of Clifford circuits.
Proof.By definition, This completes the proof.
Appendix F: Proof of Proposition 15

Definition 2 (
Oriented incidence matrix).Let G = (V, E) be a graph and let D(G) be an orientation of G. Then the oriented incidence matrix of G with respect to D(G) is the |V | × |E| matrix A D(G) = (a ve ) |V |×|E| whose entries are Proposition 12 can easily be proven from the deletioncontraction formula by induction; we omit the proof.If U is the underlying graph of G, then the number of recursive calls may be bounded by O 2 |E(U )| .Alternatively, we may bound the number of recursive calls in terms of the number of vertices plus the number of edges s = |V (U )| + |E(U )| in the underlying graph.The number of recursive calls R s is then bounded by R s ≤ R s−1 + R s−2 , which is precisely the Fibonacci recurrence.Hence the number of recursive calls is bounded by O φ |V (U )|+|E(U )| , where φ = 1+ √ 5 2