On the quantum computational complexity of the Ising spin glass partition function and of knot invariants

It is shown that the canonical problem of classical statistical thermodynamics, the computation of the partition function, is in the case of ±J Ising spin glasses a particular instance of certain simple sums known as quadratically signed weight enumerators (QWGTs). On the other hand, it is known that quantum computing is polynomially equivalent to classical probabilistic computing with an oracle for estimating certain QWGTs. This suggests a connection between the partition function estimation problem for spin glasses and quantum computation. This connection extends to knots and graph theory via the equivalence of the Kauffman bracket polynomial and the partition function for the Potts model.


Introduction
Feynman famously conjectured that, unlike classical computers, quantum computers should be efficient at simulating quantum mechanics [1,2]. This was verified by Lloyd [3], and further developed by several other authors, who demonstrated exponential speedup over the best known classical algorithms for a variety of quantum mechanical problems such as solution of the constant potential Schrödinger and Dirac equations using lattice gas automata [4]- [7], solution of the Schrödinger equation in the circuit model [8]- [10], simulation of fermionic systems [11,12], computation of the thermal rate constant of chemical reactions [13], computation of correlation functions [14], simulation of topological field theories [15], and simulation of pairing Hamiltonians such as the BCS model [16]. A naturally related question is whether quantum computers can efficiently solve problems in classical physics. This question was first raised, and partially answered, in the context of Ising spin glasses [17]. It has recently received renewed attention in the context of hydrodynamics [18,19] (with polynomial speedups), chaos [20]- [22] (with exponential speedups, though some of these have been challenged [23]), and knot theory [24] (so far without speedup), which has a deep connection to classical statistical mechanics [25].
Here we revisit classical Ising spin glasses and also address knot theory. The canonical problem of classical statistical thermodynamics is the calculation (either analytically or numerically) of the partition function Z. For a system in thermodynamic equilibrium, if the partition function is known, one can obtain exact results for all thermodynamic quantities such as the magnetization, susceptibility and specific heat. Models for which analytical calculations of this type can be performed include a variety of one dimensional (1D) models and the 2D Ising model on a lattice with nearest-neighbour interactions [26,27]. However, for most systems of interest, including the 3D Ising model on a lattice with nearest-neighbour interactions, and most Ising spin glass models, no analytical calculation of the partition function is available [28]. We consider classical spin systems, in particular the Ising model [29] in which each spin has two states σ i = ±1, and spins interact pairwise with an interaction energy of the form J ij σ i σ j . From a computational complexity perspective, this provides a rich class of problems. In particular, the problem of finding the ground state of the short range 3D Ising spin glass (quenched random J ij ), as well as the fully antiferromagnetic (all J ij = −|J|) 2D Ising model in the presence of a constant magnetic field was shown by Barahona to be NP-hard, by a mapping to problems in graph theory. 1 On the other hand, it is known that there exists a fully polynomial randomized approximation scheme for the ferromagnetic Ising model (all J ij = |J|), on arbitrary graphs [30].
The problem of sampling from the Gibbs distribution of the J ij = ±J (with random signs) spin glass on a quantum computer was addressed in [17]. A linear-time algorithm was found for the construction of the Gibbs distribution of configurations in certain Ising models, including partially frustrated models. A magnetic field can be incorporated as well without increase in the run-time. The algorithm was designed such that each run provides one configuration with a quantum probability equal to the corresponding thermodynamic weight. In other words, the probabilities of measuring states are ordered by the energies of the corresponding spin configurations, with the ground state having the highest probability. Therefore the partition function is approximated efficiently and statistical averages needed for calculations of thermodynamic quantities obtained from the partition function, are approximated in the fastest converging order in the number of measurements. Unlike Monte Carlo simulations on a classical computer, consecutive measurements on a quantum computer can be totally uncorrelated. Thus the algorithm neither suffers from critical slowing down (a polynomial slowdown in Monte Carlo moves associated with large correlated spin clusters forming near the critical temperature) [31], nor gets stuck in local minima. This uniform performance is an advantage over the best known classical algorithms, which are tailored to specific lattices or graphs [31]. However, the main problem of the algorithm is the limited control it offers in the construction of a specific realization of bonds on the Ising lattice. Indeed, since the run-time of the algorithm is linear, it is reasonable to suspect that it cannot simulate a hard instance of an Ising spin glass.
A completely different approach to sampling from the Gibbs distribution for the ferromagnetic Ising model was recently developed by Nayak, Schulman and Vazirani (NSV) [32], which however does not appear to provide a speedup over the best known classical algorithm [33]. The NSV algorithm for the ferromagnetic Ising model uses an interesting representation of the partition function as a Walsh-Hadamard transform (a type of discrete Fourier transform, with addition taken modulo 2), in conjunction with a Markov chain sampling procedure. Two of the main results of the present paper are (i) the generalization of this Walsh-Hadamard transform representation to the ±J spin glass case and (ii) (the central result) a connection of this representation to certain simple sums known as 'quadratically signed weight enumerators' (QWGTs). Let us now motivate the importance of result (ii).
In virtually all previous work on simulation of physical systems on quantum computers [3]- [24], the approach pursued was one of attempting to find a concrete algorithm for a specific simulation problem. A fruitful alternative is to consider instead the question of the complexity class that the simulation problem belongs to. We do this here by following a lead due to the Knill and Laflamme (KL) [34], who showed that quantum computing is polynomially equivalent to classical probabilistic computing with an oracle for estimating QWGTs. Combined with our results (i) and (ii), this suggests that the quantum computational complexity of sampling from the Gibbs distribution for the Ising spin glass problem can be understood in terms of QWGTs. However, unfortunately, we have not yet been able to establish the connection at this level. Nevertheless, the possibility of a (spin glass)-(QWGTs)-(quantum computation) connection is sufficiently tantalizing to point it out in detail. We hope that by expressing the partition function as a QWGT we have taken the first step in a direction that will allow future research to explore the important question of the quantum computational complexity of the Ising spin glass problem.
In fact, the connections do not end here. There is a rich inter-relation between classical statistical mechanics and topology, in particular the theory of classification of knots. The first such connection was established by Jones [35], who discovered knot invariants (the Jones' polynomial) during his investigation of topological properties of braids [36]. It is known that classical evaluation of the Jones' polynomial is #P-hard [37]. The connection between knots and models of classical statistical mechanics was greatly embellished by Kauffman [25]. Here we will exploit this connection to show (our result (iii)) that the evaluation of another knot invariant, the Kauffman bracket polynomial, can also be cast in some cases as a QWGT evaluation problem. Thus a quantum algorithm for QWGT evaluation should shed light on the quantum computational complexity of knot invariants, a subject which has been explored by Freedman et al [38] and by Kauffman and Lomonaco [39]. Knot invariants are, in turn, also closely related to graph theory; e.g., the graph colouring problem can be considered as an instance of evaluation of the Kauffman bracket polynomial, via the Tutte polynomial [25].
Mathematically, the reason that these seemingly unrelated subjects are all inter-related is due to the fact that key properties can be expressed, in all cases, in terms of certain polynomials. While these polynomials originate from widely distinct problems, from the point of view of computational complexity their evaluation is one and the same problem, much in the same spirit as the fact that solving one problem in the class of NP-complete problems solves them all [40]. The present work contributes to this unification.
The structure of this paper is as follows. In section 2 we derive our first main result: we rewrite the Ising spin glass partition function for an arbitrary graph as a Walsh-Hadamard transform. This motivates the consideration of the partition function evaluation problem in terms of its computational complexity, which we formalize in section 3. We then review QWGTs in section 4. In section 5 we derive our second main result: the connection between the evaluation of the Ising spin glass partition function and QWGTs. In section 6 we continue the program of connecting disparate objects to the problem of QWGT evaluation, and obtain our third main result: we show that the Kauffman bracket polynomial too can be expressed as a QWGT. We do this after first reviewing the connection between knots and classical statistical mechanics. Our conclusions are presented in section 7. Some further observations concerning the representation of the partition function are collected in appendix A.

Walsh-Hadamard transform representation of the partition function
Let G = (E, V) be a finite, arbitrary undirected graph with |E| edges and |V | vertices. Identify each vertex i ∈ V with a classical spin (σ i = ±1) and each edge (i, j) ∈ E with a bond (J ij = ±J). Denote a given spin configuration by σ = (σ 1 , σ 2 , . . . , σ |V | ) and a bond configuration by (J 12 , . . . , J ij , . . .). We assume that the bond configuration is chosen at random and then remains fixed ('quenched randomness'). The Hamiltonian of the system is (We remark on the case with a magnetic field in appendix A.1.) The probability of the spin configuration σ in thermal equilibrium at temperature T is given by the Gibbs distribution: where the Boltzmann weight is β = 1/kT is the inverse temperature, and Z is the partition function: Now note the identity and use it to rewrite the Boltzmann weight (3) as Let where q ij = ±1 is a quenched random variable. Since cosh(x) = cosh(−x) and tanh(x) = − tanh(−x) we find and λ = tanh(βJ ).
Next expand out the product to obtain Note that λ k is the coefficient in front of a sum containing k bonds q ij , which are not necessarily all connected. For example, the term q ij σ i σ j q kl σ k σ l where all indices differ represents two unconnected bonds ( figure 1(a)), whereas if j = k the same term represents two connected bonds sharing one spin ( figure 1(b)). Let b ⊆ E denote such a subgraph, with k = |b| edges. There are |E| |b| ways of choosing subgraphs with |b| edges. Thus the total number of subgraphs is: This suggests labelling the subgraphs in a binary fashion (to be explained below): Since the total number of subgraphs is 2 |E| , the above numbering scheme is a one-to-one covering of the subgraph space, and moreover, the subgraphs are labelled in increasing order of |b|.
Next note that in equation (11), a spin σ i may appear more than once in sums of order k 2, in fact as many times as the number of bonds emanating from σ i , which we denote by deg b (i). Then σ is the contribution of spin i in subgraph b to the product in the sum of order k = |b| in (11). Collecting all the observations above, it follows that (11) can be rewritten as Here V(b) denotes the set of vertices in subgraph b.
Next introduce the parity vector α At this point, it is more convenient to transform to a binary representation for the spins as well. Let be the components of the binary vector of spin values s = (s 1 , s 2 , . . . , s |V | ). We have σ i = (−1) s i so that σ where '·' stands for the (mod 2) bit-wise scalar product. The same change can be effected for the bonds by introducing: so that the binary vector w = (w 12 , w 13 , . . .) of length |E| specifies whether edge (i, j) supports a ferromagnetic (w ij = 0) or antiferromagnetic (w ij = 1) bond. Again, q ij = (−1) w ij , so that Using equations (15) and (17) in (13) it is now possible to rewrite the Boltzmann weight of a particular spin configuration s as Now, the partition function is just the sum over all spin configurations. Using (18) we thus find

Proposition 1. The spin-glass partition function is a Walsh-Hadamard transform (or discrete
Fourier transform with addition modulo 2), over the subgraph variables Note that the sum over s extends over 2 |V | terms, while the sum over b extends over 2 |E| terms. The sum over s can actually be carried out, since where δ is the Kronecker symbol. A systematic procedure for finding the parity vectors from the subgraphs vectors uses the incidence matrix A. For any graph G = (E, V ) this matrix is defined as follows (v ∈ V ) [41]: so A is a |V | × |E| matrix of 0's and 1's. It is well known that given G and a specific subgraph b [41], Combining equations (9), (10), (19), (20), (22), we finally have: In words, the sum over the subgraphs includes only those with zero overall parity, i.e., those having an even number of bonds emanating from all spins. This immediately implies that 'danglingbond' subgraphs are not included in the sum. We note that Z w (λ) can also be rewritten as a power series in λ, which is useful for a high-temperature expansion; this is discussed in appendix A.2. The representation (23) allows us to establish a direct connection with QWGTs, which is the subject of the quantum computational complexity of Z, to which we turn next.

Formulating the computational complexity of the Ising spin glass partition function
The most natural computational complexity class for quantum computation is BQP: the class of decision problems solvable in polynomial time using quantum resources (a quantum Turing machine, or, equivalently, a uniform family of polynomial-size quantum circuits) with bounded probability of error [42,43]. The class BQPP is the natural generalization of BQP to promise problems [34]. Relative to the polynomial hierarchy of classical computation, it is known that BPP ⊆ BQP ⊆ PP ⊆ PSPACE, but none of these inclusions is known to be proper [44]. In order to address the quantum computational complexity of the spin glass partition function we define: Definition 1. An instance of the Ising spin glass problem is the data ≡ (G, w). Now, let Z (λ) be the partition function for given data , and let be the kth digit of Z (λ). Following [38], let ( , k) be a quantum circuit that takes as input the data and the digit location k. Let W = i U i be an implementation of ( , k) in terms of some unitary operators U i . Let the circuit be designed so that the answer Z k (λ) is encoded into the state of the first qubit, and let 1 = |0 1 0| be the projection onto state |0 of this qubit. Then the probability of measuring the state |0 1 after the circuit was executed, starting from the 'blank' initial state |0 = |0 . . . 0 , is Pr [ ( , k)] = 0|W † 1 W |0 . We can now define We can then formulate the following open problem:

Problem 1. For which instances is the problem of evaluating the Ising spin glass partition function in BQP?
A particularly promising way to attack this problem appears to be the connection to QWGTs, which we address next.

Quadratically signed weight enumerators
Quadratically signed weight enumerators (QWGTs) were introduced by Knill and Laflamme in [34] (where 'QWGT' is pronounced 'queue-widget'). A general QWGT is 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, and all calculations involving A, B and b are done modulo 2. It should be noted that |S (A, B, x, y)| (|x| + |y|) n . In [34] it was shown that quantum computation is polynomially equivalent to classical probabilistic computation with an oracle for estimating the value of certain QWGTs with x and y rational numbers. In other words, if these sums could be evaluated, one could use them to generate the quantum statistics needed to simulate the desired quantum system. More specifically, let I be the identity matrix, diag(A) the diagonal matrix whose diagonal is the same as that of A, and ltr(A) a matrix formed from the lower triangular elements of A (the matrix obtained from A by setting to zero all the elements on or above the diagonal). Then for KL's strategy in showing the connection between QWGT evaluation and quantum computation was to show that, in general, expectation values of quantum circuits can be written as QWGTs.

The partition function-QWGT connection
We are now ready to prove our central result.

Theorem 2. The spin-glass partition function is a special case of QWGTs. Specifically,
Here dg(w) is the matrix formed by putting the elements of w on the diagonal and zeroes everywhere else, and A is the incidence matrix of G.
Note that one could also divide S(A, B, x, y) by y n instead of setting y = 1.
It is tempting to check the relation of theorem 2 to the KL promise problem (problem 2). It follows from equation (26), from Z > 0, and from 0 λ = tanh(βJ) 1, that sign[S(A, dg(w), λ, 1)] = +. Hence, unfortunately, the KL problem in its present form is of no use to us.
Further consideration reveals that, while the constraint that k and l are positive integers is easily satisfied, and the promise takes a nice symmetric form: We turn next to showing the connection between our discussion so far and problems in knot theory.

The partition function-knots connection
The canonical problem of knot theory is to determine whether two given knots are topologically equivalent. More precisely, in knot theory one seeks to construct a topological invariant which is independent of the knot shape, i.e., is invariant with respect to the Reidemeister moves [25]. This quest led to the discovery of a number of 'knot polynomials' (e.g., the Jones and Kauffman polynomials) [25]. These also play a major role in graph theory as instances or relatives of the dichromatic and Tutte polynomials [45], e.g., in the graph colouring problem. Roughly, two knots are topologically equivalent when they have the same knot polynomial. It is well known [35,25] that there is a connection between knot polynomials and the partition function of the Potts spin glass model, a generalization of the Ising spin glass model to q 2 states per spin: where s i ∈ {0, . . . , q − 1} and δ s i ,s j = 1 (0) if s i = s j (s i = s j ). We first briefly review this connection. Consider a knot embedded in 3D-space (imagine, e.g., a piece of rope). In the standard treatment [25], the knot is projected onto the plane and one obtains a '2D-knot diagram'. The essential topological information about the knot is contained in the pattern of 'crossings', the 2D image of where one rope segment went over or under another rope segment. A crossing takes values b k = ±1 according to figure 2 [46]. A connection to spin glasses can be made by assigning quenched random values to the crossing variables b k , so that the links cross above and below at random. It was shown by Nechaev (see equation (II.44) in [47]) that in this case the Kauffman bracket polynomial is identical, up to an irrelevant multiplicative factor, to the Potts model partition function, To explain this connection we need to introduce some terminology. The 2D-knot diagram lives on a lattice M composed of lines oriented at ±45 o , intersecting at the crossings b k , that carry the disorder. One can define a dual lattice L, rotated by 45 o , so that its horizontal and vertical edges (denoted b ij ) are in one-to-one correspondence with the vertices b k of M (figure 6 in [48]). Let The Potts spin states s i are connected to knot properties in an abstract manner; they are related to the Kauffman bracket polynomial variable A, which in turn is a weight for the manner in which 2D-knot diagram is disassembled into a set of microstates (and also related to the Jones' polynomial variable t: the Jones and Kauffman bracket polynomials coincide when t = A 1/4 ). Precise definitions can be found in [25]; for our purposes what matters is that the equivalence of the Kauffman bracket polynomial to the Potts spin glass partition function is established once one assigns to the Potts variables q and βJ ij the values With these identifications Nechaev has shown that the Kauffman bracket polynomial (knot invariant) K(A) = c(A, {b ij })Z Potts (q, J), where the constant c does not depend on the spin states [47]. Solving for A we find A = ±[(q 1/2 ± (q − 4) 1/2 )/2] 1/2 . Thus βJ ij can be real only for q 4. In the Ising spin glass case (q = 2) we obtain a complex-valued βJ ij , which in turn implies complex-valued λ = tanh(βJ), and hence the estimation of the QWGT polynomial with complex-valued x. Finally, we note that a physically somewhat unsatisfactory aspect of the knots-Potts connection is that now the (complex-valued) temperature cannot be tuned independently from the bonds J ij . However, this does not matter from the computational complexity perspective: we have established our third main result: Proposition 2. Computing the Kauffman bracket polynomial at q = 2 is equivalent to the problem of computing the QWGT polynomial with complex-valued x. 2 Hence an efficient quantum algorithm for estimating QWGTs will be decisive for knot and graph theory as well. 3

Conclusions
The connection between QWGTs and quantum computational complexity established by KL on the one hand, and the connection between QWGTs and the spin glass and knots problems established here on the other hand, suggests that the quantum computational complexity of spin glass and knots problems may be decided via the connection to QWGTs. Similar remarks apply to a number of combinatorial problems in graph theory, via their well-established connections to knot theory. In particular, it would be desirable to find out the quantum computational complexity of questions framed in terms of properties of S(A, dg(w), λ, 1), with λ real (Ising spin glass) or complex (Kauffman bracket polynomial with q = 2). We leave these as open problems for future research.