Skip to main content
Proceedings of the National Academy of Sciences of the United States of America logoLink to Proceedings of the National Academy of Sciences of the United States of America
. 2015 Oct 6;112(43):13161–13166. doi: 10.1073/pnas.1505664112

A complexity classification of spin systems with an external field

Leslie Ann Goldberg a, Mark Jerrum b,1
PMCID: PMC4629322  PMID: 26443859

Significance

Spin systems are a primary object of study in statistical physics. Computational complexity is the rigorous study of the computational resources required to achieve specified computational goals. We examine the problem of estimating the partition function of a q-state spin system from the point of view of computational complexity. There are just three possible levels of computational difficulty, depending on the interaction strengths between adjacent spins. Every nontrivial q-state spin system, irrespective of the number q of spins, is computationally equivalent to one of two fundamental two-state spin systems. We give a simple characterization of the classification.

Keywords: computational complexity, partition function, spin system

Abstract

We study the computational complexity of approximating the partition function of a q-state spin system with an external field. There are just three possible levels of computational difficulty, depending on the interaction strengths between adjacent spins: (i) efficiently exactly computable, (ii) equivalent to the ferromagnetic Ising model, and (iii) equivalent to the antiferromagnetic Ising model. Thus, every nontrivial q-state spin system, irrespective of the number q of spins, is computationally equivalent to one of two fundamental two-state spin systems.


Let Q={1,2,,q} denote a set of spins. A q-state spin system is specified by a nonnegative real symmetric interaction matrix A(0)q×q. The entries (aij) of A represent “interaction strengths” between spins in Q. An instance of such a spin system is a graph G=(V,E), where V is a set of vertices (sites) and E is a set of edges (bonds) together with a collection h={hw:Q0|wV} of functions, representing the action of an external field. The function hw represents the effect of the field on vertex w. The partition function of the system is then

ZA(G,h)=σ:VQwVhw(σ(w)){u,v}Eaσ(u),σ(v), [1]

a weighted sum over configurations σ:VQ.

The above setting encompasses all spin systems with uniform interactions between pairs of sites and includes many familiar models. For example, the interaction matrices

AIsingλ=(λ11λ)AIS=(1110)
A3Pottsλ=(λ111λ111λ)andAWR=(110111011)

capture the Ising, independent set (hard-core), three-state Potts, and Widom–Rowlinson models, respectively. In the case of the Ising and Potts models, λ>1 corresponds to a ferromagnetic system and λ<1 to an antiferromagnetic one.

The Problem and What Is Known

We study the following computational problem. Fix an interaction matrix A. Given an instance consisting of a graph G and field h, approximately evaluate the partition function ZA(G,h). An important point to note is that the interaction matrix A does not form part of the problem instance. By fixing A, we fix a particular model, say the hard-core model or the q-state ferromagnetic Potts model. We then ask, for that model, What is the computational complexity of approximately evaluating the partition function given the input pair (G,h)? We are interested in determining how that complexity depends on A.

It follows from a general result of Chen et al. (1) that there are only three possibilities that can arise for an interaction matrix A:

  • Possibility i: The partition function ZA can be evaluated exactly in polynomial time.

  • Possibility ii: The complexity of approximately evaluating ZA is equivalent to the complexity of approximately evaluating the partition function of the ferromagnetic Ising model.

  • Possibility iii: Approximating ZA is equivalent to approximating the partition function of the antiferromagnetic Ising model and hence is NP hard.

The purpose of this paper is to map the space of interaction matrices, delineating which case arises for each interaction matrix A. Before stating our result, we fill in some details about the three possibilities above (and approximation complexity in general), we say a little bit more about the result of ref. 1, and we present some matrix preliminaries.

The first possibility, that the partition function can be evaluated exactly in polynomial time, is straightforward. Unfortunately, as we shall see, it rarely arises. Let us turn to the second possibility. It will be helpful to introduce the problem #BIS, which plays an important role in the complexity theory of approximate counting problems (2). #BIS is the problem of counting the independent sets of a bipartite graph. It is essentially the same as the problem of evaluating ZABIS(G,h) for the interaction matrix

ABIS=(0011001011001000)

in the special case where, for all wV, hw is a constant function that assigns equal weight to all spins. A great number of problems have been shown to be equivalent to #BIS (and hence to each other) with respect to approximation complexity. We give a formal definition of this equivalence later, after stating our theorem. For now it suffices to know that if two problems are equivalent, then they are roughly equally difficult to approximate. The authors have shown (3) that the problem of evaluating the partition function of AIsingλ=4 is #BIS equivalent. (There is no significance in the particular choice of λ, beyond it being greater than 1 and being convenient for the proof.) Thus, for any interaction matrix A for which the second possibility applies, we can conclude that the complexity of approximately evaluating ZA is equivalent to that of approximating the partition function of the two-spin matrix AIsingλ=4 even though A itself may have many more than two spins.

Finally, let us consider the third possibility, that approximating the partition function ZA is NP hard. This means that there is a constant α>0 such that even approximating ZA within a factor exp(α|V(G)|) is as hard as the famous NP-complete problems (which include problems such as determining whether a Boolean formula is satisfiable or determining whether a graph is three-colorable). It follows that the free energy per site, |V(G)|1lnZA(G), is NP hard to approximate within ±α.

It is worth mentioning that these partition function evaluation problems have a property called “self-reducibility.” This means (4) that if you cannot efficiently approximate the partition function, then it is also infeasible to sample approximately from the corresponding Gibbs measure.

To gain a better understanding of the result of ref. 1, consider the following method for deriving a new interaction matrix from the initial matrix A=AIsingλ=2=(2112). Take a graph Γ with three vertices, x, y, and z and edges connecting x to z and x to y. Suppose that hz satisfies hz(1)=1 and hz(2)=3 and that hx(1)=hx(2)=hy(1)=hy(2)=1. The total contribution to the partition function from configurations with σ(x)=σ(y)=1 is 10—the contribution is 2×2 (2 for each edge) if σ(z)=1, and it is 2×3 if σ(z)=2 [2 for the edge between x and y and 3 from hz(2)]. Similarly, the total contributions of the three other possibilities for spins σ(x) and σ(y) are 4, 7, and 14. Thus, we can view the overall effect of this system as being equivalent to a single edge (x,y) with effective interaction matrix

Aeff=(105714).

Note that Aeff is not even symmetric, so we have moved outside of the symmetric systems that we started with. Obviously, we can create an infinite collection of new interaction matrices from A by varying the graph Γ with specified vertices x and y (and allowing any possible field functions on the vertices). The result of ref. 1 states the following for any interaction matrix A:

  • Possibility i occurs for A if every single one of the (infinitely many) matrices Aeff that can be constructed from A is singular or is diagonal or off diagonal.

  • Possibility ii occurs if possibility i does not occur, but every single one of the matrices Aeff that can be constructed has a nonnegative determinant or is off diagonal.

  • Otherwise, possibility iii occurs.

Fortunately, it is not necessary to investigate an infinite collection of matrices Aeff to decide which of the three possibilities applies to a particular initial matrix A. In ref. 1 it is shown that distinguishing between the possibilities reduces to deciding whether a certain finite system (based on A) has a property called “balance”—a problem that is known (5) to be decidable—and to deciding whether A has an algebraic invariant called an STP-MJN multimorphism (6). This can be checked by brute force, given A. Nevertheless, the existence of a decision algorithm for determining which of the possibilities applies to A does not tell us much, qualitatively, about how and why the interaction matrices divide between the three possibilities. In fact, there is a nice clean characterization, which we describe in this paper.

Our Result

We start with some basic facts about matrices. We say that matrix A is log-supermodular if every 2×2 submatrix has a nonnegative determinant. The matrix A is irreducible if, for all i,jQ, there exists an integer L such that (AL)ij>0. If A is not irreducible, then it may be transformed, by simultaneous row and column permutations, into block diagonal form, after which the complexity of ZA is determined by the maximum complexity of any block. (We can pick out any desired block by setting hw, for every vertex wV, to be the characteristic function of that block.) A stronger condition than irreducibility is primitivity. A matrix A is primitive if there exists a number L with AL>0. Irreducibility and primitivity may be understood in terms of the “underlying graph” of A, i.e., the graph with vertex set Q and edge set {{i,j}:aij>0}. Specifically, A is irreducible if and only if (iff) the underlying graph is connected and is primitive iff it is connected and nonbipartite.

The distinction between a primitive and an imprimitive interaction matrix A is important for us. In the imprimitive case, A has the block form

A=(0BBT0), [2]

where B is (say) a q1×q2 matrix, with q1+q2=q. Thus, the set of spins may be partitioned as Q=Q1Q2, where Q1={1,,q1} and Q2={q1+1,q}, in such a way that spins in Q1 can be adjacent only to spins in Q2 and vice versa (v.v.).

An example of an imprimitive system is given by the interaction matrix ABIS. This matrix has the appropriate block structure where B=AIS. The imprimitive form of ABIS ensures that the partition function evaluates to 0 if the instance G is not bipartite. If G is bipartite, with bipartition V=LR, then the only configurations σ that contribute to the partition function are ones in which σ(L){1,2} and σ(R){3,4} or the same with L and R interchanged. Interpreting spins 2 and 4 as meaning “in the independent set” and 1 and 3 as meaning “out of the independent set,” we see that the nonzero terms in ref. 1 correspond to independent sets in G (two terms for each independent set).

In stating the main result, we treat the primitive and imprimitive cases separately. We first state the result and give examples, and then we give the formal definitions that clarify the notion of “equivalence” that is used in the #BIS-equivalent case.

Theorem 1.

First, suppose A is primitive.

  • If A has rank 1, then there is a polynomial-time algorithm for evaluating ZA.

  • Otherwise, if there is a simultaneous permutation of the rows and columns of A that renders A log-supermodular, then evaluating ZA is equivalent to #BIS under approximation-preserving reductions.

  • Otherwise, there is a constant α>0 such that approximating ZA within a factor exp(α|V(G)|) is NP hard.

Now suppose A is imprimitive. Write A in the form of Eq. 2.

  • If B has rank 1, then there is a polynomial-time algorithm for evaluating ZA.

  • Otherwise, if there are independent permutations of the rows and columns of B that render B log-supermodular, then evaluating ZA is equivalent to #BIS under approximation-preserving reductions.

  • Otherwise, there is a constant α>0 such that approximating ZA within a factor exp(α|V(G)|) is NP hard.

In both primitive and imprimitive cases there are three possibilities. In the first, matrix A (or B, as appropriate) has rank 1, and the partition function factorizes. Thus, it is trivially possible to evaluate ZA exactly in polynomial time. In the second, the matrix A has a particular form, which allows the q-state system with interaction matrix A to be coded up as an instance of #BIS and v.v. Because, in particular, ZAIsingλ=4 is in this class, we see that all these spin systems are computationally equivalent to the ferromagnetic Ising model with an external field. Finally, in the third situation, the antiferromagnetic Ising model can be coded up as an instance of a spin system with interaction matrix A. Because the partition function of the antiferromagnetic Ising model is NP hard to approximate (even finding the ground state is a hard problem), ZA is hard to approximate for all such spin systems also. The striking feature of this result is that q-state spin systems for arbitrary q are computationally equivalent to very familiar two-spin systems.

Example Applications of Theorem 1.

Assuming λ>0, the interaction matrix AIsingλ for the Ising model is primitive. Its determinant is positive, zero, or negative according to whether λ is greater than, equal to, or less than 1. Thus, Theorem 1 shows that ZAIsingλ has a polynomial-time algorithm when λ=1, is equivalent to #BIS when λ>1, and is NP hard to approximate when λ<1. Now consider the interaction matrix A3Pottsλ for the three-state Potts model, which is primitive for all λ0. The matrix is of course invariant under simultaneous row and column permutations. If λ=1, then the matrix has rank 1; if λ>1, then the submatrix (11λ1) has a negative determinant; and if λ<1, then the submatrix (λ11λ) has a negative determinant. Thus, Theorem 1 shows that ZA3Pottsλ is NP hard to approximate except when λ=1, when it is trivial. Theorem 1 also shows that approximating ZAIS, the partition function of the independent set (hard-core) model on a general graph, is NP hard. Also, approximating ZAWR, the partition function of the Widom–Rowlinson model, is equivalent to #BIS, as its interaction matrix AWR is log-supermodular.

Finally, we consider an imprimitive example. Consider the matrix ABIS. Applying Theorem 1 to this matrix shows us what we already knew—namely, that approximating ZABIS is equivalent to #BIS. To apply Theorem 1, write ABIS in form [2], so that B=(1110). Now transpose the rows of B and note that the resulting matrix is log-supermodular.

The Formal Definition of Equivalence.

To prove Theorem 1 we have to give a formal meaning to the phrase “evaluating ZA is equivalent to #BIS under approximation-preserving reductions.”

For this we need the notion of a “randomized approximation scheme” [Mitzenmacher and Upfal (ref. 7, definition 10.2)]. A randomized approximation scheme for ZA is a (randomized) algorithm that takes both an input (G,h) and an accuracy parameter ε and produces an output Z^ that is an approximation to ZA(G,h). The algorithm is randomized, so with some probability (say at most 1/4, to be precise), it may fail, but the requirement is that, with probability at least 3/4, the output must satisfy

(1ε)ZA(G,h)Z^(1+ε)ZA(G,h).

Thus, with high probability (with probability at least 3/4), the algorithm must give a good approximation (within a factor of 1±ε of the right answer).

The value “3/4” in the definition is not very important. It may be changed to any value strictly between 1/2 and 1 without any complexity-theoretic consequences. Essentially, the algorithm can be repeated, taking the median over various runs to decrease the failure probability.

An important kind of randomized approximation scheme is a so-called “fully polynomial” randomized approximation scheme (FPRAS), which is a randomized approximation scheme that runs quickly, as a function both of its input size and of the desired accuracy. In particular, for an n-vertex graph G, the running time must be bounded from above by a polynomial in n and ε1. Thus, the algorithm is allowed more time as the amount of tolerable error ε becomes smaller, but it is allowed only polynomially more time.

By analogy with ZA, a randomized approximation scheme for #BIS is a (randomized) algorithm that takes both an input (in this case a bipartite graph H) and an accuracy parameter δ and produces an output that, with probability at least 3/4, is within (1±δ) of the number of independent sets of H. It is an FPRAS if the running time is at most a polynomial in |V(H)| and δ1.

Now we need the idea of an approximation-preserving (AP) reduction (2), which is a way of showing that one approximation problem, say the problem of approximating ZA, is at least as easy as another approximation problem, say #BIS. Specifically, an AP reduction from ZA to #BIS is a randomized algorithm A for approximating ZA, using a subroutine called an “oracle” for approximating #BIS. The input to A is of course an instance (G,h) together with an accuracy parameter ε. Using these, algorithm A computes an approximation Z^ to ZA(G,h). It is allowed to make subroutine calls to the #BIS oracle with inputs of the form (H,δ), where H is a bipartite graph and 0<δ<1 is an error bound with δ1poly(n,ε1), where n=|V(G)|. The reduction must have the property that A is a randomized approximation scheme for ZA whenever the oracle is a randomized approximation scheme for #BIS. Also, the run time of A must be a polynomial in n and in ε1. The main point is that an AP reduction from ZA to #BIS turns an FPRAS for #BIS into an FPRAS for ZA.

We say that the problem of approximating ZA is AP reducible to #BIS if an AP reduction from ZA to #BIS exists. We can similarly define an AP reduction from #BIS to ZA. If reductions in both directions exist, then we say that ZA and #BIS are equivalent under AP reductions. This is the case for all interaction matrices A in our second category.

The Proof of Theorem 1

The proof of Theorem 1 is in three parts. First, we show how to separate the NP-hard cases from the #BIS-equivalent cases. Then we show how to separate the #BIS-equivalent cases from the polynomial-time computable cases. The final section puts the pieces together to complete the proof.

The Proof: NP Hardness

In this section, we separate NP-hard spin systems from those that are computationally equivalent to #BIS. As usual in the theory of NP completeness, we use carefully designed gadgets, but in this case they have a simple form.

Gadgets.

A gadget Γ is a path of length L together with a set of allowed spins for each vertex that is not an endpoint of the path. Let the vertices of the path be {0,1,,L} and the set of allowed spins at vertex k be SkQ, for all 1kL1. Note that restricting the spins at k to a set Sk is equivalent to applying the field hk to the vertex, where hk is the characteristic function of the set Sk. So a gadget is an instance of a spin system of the kind we are studying. The matrix AΓ of effective interaction strengths for Γ is given by

AΓ=AD1AD2AADL1A, [3]

where Dk is the diagonal matrix with 1s at positions {(i,i):iSk} and 0s elsewhere. Thus, for all i,jQ, the entry (AΓ)ij represents the multiplicative contribution made by the gadget to the partition function when σ(0)=i and σ(L)=j. If Sk=Q for all 1kL1, we say that the gadget is free; if |Sk|=2 for all 1kL1, we say that the gadget is tight. Note that it does not make sense to restrict a tight gadget further: If any Sk is a singleton, then AΓ has rank 1, and there is no correlation between spins σ(0) and σ(L).

Here is some useful notation. M[i,i;j,j] is the 2×2 matrix obtained from a matrix M by deleting all rows except i,i and all columns except j,j. We regard the indexes in the notation M[i,i;j,j] as ordered; thus the first row of this 2×2 matrix comes from row i of M and the second from row i.

We are interested in how gadgets interact with (ordered) pairs of spins. We use Q2¯ to denote the set of all ordered pairs of distinct elements of a set Q. Thus, for a primitive matrix A the relevant set of ordered pairs is P=Q2¯ whereas for imprimitive A the relevant set is P=Q12¯Q22¯. We do not consider mismatched pairs that mix elements of Q1 and Q2.

We now give some definitions concerning the properties of gadgets. We say that the gadget Γ is ferromagnetic (respectively, antiferromagnetic, neutral) between ordered pairs of spins (i,i)P and (j,j)P if detAΓ[i,i;j,j]>0 (respectively, <0, =0). If, in addition, the matrix AΓ[i,i;j,j] has at most one zero entry, then we say that Γ is permissive ferromagnetic, permissive antiferromagnetic, or permissive neutral between (i,i) and (j,j). Finally, we say that a pair of spins (i,i) is antiferromagnetic if there exists a gadget that is antiferromagnetic between (i,i) and (i,i). There is no need to define a similar concept of a ferromagnetic pair of spins, because all pairs of spins are “ferromagnetic” via the gadget of length L=0. However, we say that a pair of spins (i,i) is permissive ferromagnetic if there exists a gadget that is permissive ferromagnetic between (i,i) and (i,i).

Given a tight gadget Γ, with Sk={ik,ik} for all 1kL1, we may write AΓ[i,i;j,j] as the following product of 2×2 submatrices of A:

AΓ[i,i;j,j]=A[i,i;i1,i1]×A[i1,i1;i2,i2]×···×A[iL1,iL1;j,j]. [4]

Note that the ordering we impose on the elements {ir,ir} of each Sr is irrelevant. Then the earlier definitions can be phrased in terms of the determinants of the 2×2 matrices in product [4]. Thus, AΓ is antiferromagnetic between (i,i) and (j,j) iff none of the matrices in [4] is singular and an odd number of them have a negative determinant. Furthermore, Γ is permissive antiferromagnetic iff, in addition, at least one of the matrices has at most one zero entry. This observation is useful for avoiding calculation.

Here is an illustrative example based on the interaction matrix A=A3Pottsλ=2 of a ferromagnetic three-state Potts model. Recall that A has 2s on the diagonal and 1s elsewhere. Consider the gadget Γ of length L=3 with S1={1,3} and S2={3,2}. Then

AΓ[1,2;1,2]=A[1,2;1,3]×A[1,3;3,2]×A[3,2;1,2]=(2111)(1121)(1112)=(71057).

So det(AΓ[1,2;1,2])=1, and the pair (1,2) is antiferromagnetic. The point to note is that, although we started with a ferromagnetic model, it is possible to use the external field to simulate an edge of an antiferromagnetic two-spin system. By Lemma 3 below, we are able to conclude that approximating the partition function of the ferromagnetic three-state Potts model is intractable (NP hard).

Our strategy in the remainder of this section is to provide a systematic approach to constructing such antiferromagnetic gadgets, which fails only when the interaction matrix A has a special form. In the following section, we indicate how a spin system whose interaction matrix has this special form can be simulated by an instance of #BIS or, equivalently, an instance of the ferromagnetic Ising model. We start with some technical lemmas concerning gadgets and their properties. The proofs are included in SI Appendix.

Lemma 1.

If the pair (i,i)P is antiferromagnetic, then there is a tight, permissive gadget that is antiferromagnetic between (i,i) and (i,i).

Lemma 2.

Suppose that the free gadget of odd length L is neutral between (i,i)P and (j,j)P, but that detA[i,i;j,j]0. Then the pair (i,i) is antiferromagnetic.

Lemma 3.

If there exists an antiferromagnetic pair (i,i)P, then there is a constant α>0 such that approximating ZA within a factor exp(α|V(G)|) is NP hard.

Lemma 3 gives a sufficient condition for it to be NP hard to approximate ZA. Note that, by Lemma 1, the condition may be tested by dynamic programming in polynomial time. Roughly, the method is as follows. Fix a pair (i,i). Let ΩLa be the set of pairs (j,j) such that there exists a tight gadget of length less than or equal to L that is antiferromagnetic between (i,i) and (j,j) and let ΩLf be the set of pairs (j,j) such that there exists a tight gadget of length less than or equal to L that is ferromagnetic between (i,i) and (j,j). We can compute (Ω1a,Ω1f),(Ω2a,Ω2f), in turn, using (Ωia,Ωif) as data to compute (Ωi+1a,Ωi+1f). (In fact, the set Ωif is just the reversal of all pairs in Ωia, so technically, it does not need to be explicitly stored.) The sequence Ω1aΩ2a is monotonic and must converge before L=n2. We now show that if the condition in Lemma 3 fails, then A has a particular form. There are two cases to our analysis, depending on whether or not A is primitive.

The Primitive Case.

A tournament is a complete graph with orientations assigned to the edges. A Hamiltonian path in a tournament is a directed path that visits all of the vertices of the tournament exactly once and respects the orientations of the edges. It is a standard graph theoretic fact that every tournament has a Hamiltonian path (8) (or ref. 9, theorem 2.3).

Lemma 4.

Suppose the matrix A is primitive and that it does not support an antiferromagnetic pair of spins [i.e., there does not exist a pair (i,i)P and a gadget Γ such that detAΓ[i,i;i,i]<0]. Then there is a simultaneous permutation of the rows and columns of A such that the resulting matrix is log-supermodular.

Proof:

Let L be the minimum odd number such that AL>0. Note that AL is the interaction matrix of the free gadget of length L. Consider the graph with vertex set Q2¯, whose adjacency relation is defined by the condition (i,i)(j,j) iff detAL[i,i;j,j]>0. Note the obvious symmetry (i,i)(j,j) iff (i,i)(j,j). Note also that if (i,i) and (j,j) are in the same component of (Q2¯,), then there is a ferromagnetic gadget between (i,i) and (j,j). To see this, take a shortest path from (i,i) to (j,j) in (Q2¯,). Each edge in the path corresponds to a ferromagnetic gadget; concatenate these to obtain a ferromagnetic gadget between (i,i) and (j,j). More formally, suppose the path is (i,i)=(i0,i0),(i1,i1),,(i,i)=(j,j). Then

det(AL[i0,i0;i1,i1]×···×AL[i1,i1;i,i])=detAL[i0,i0;i1,i1]×···×detAL[i1,i1;i,i]>0,

from which a gadget of length L that is ferromagnetic between (i,i)=(i0,i0) and (j,j)=(i,i) may be read off.

By assumption, for every pair (i,i)Q2¯ it is the case that (i,i) and (i,i) are in different components of (Q2¯,). [If they were in the same component, then there would be a ferromagnetic gadget between (i,i) and (i,i), and this would imply that the pair (i,i) is antiferromagnetic.] Thus, the components of (Q2¯,) come in symmetric pairs C,C, where C contains exactly the reversals of all of the pairs in C. We can then construct a tournament on Q by the following procedure. For each pair of matched components C and C, choose one, say C, and add a directed edge from i to i for every pair (i,i)C. Note that this procedure runs into no conflicts and determines a direction for every edge in the complete graph on vertex set Q. Let the resulting tournament be T. [The construction of T and the use we are about to make of it are a simplified version of a similar line of proof used in a more general situation by Cohen et al. (10).]

Take any Hamiltonian path in the tournament T and form the linear order on Q such that the vertices/spins along the path appear in increasing order in (Q,). By renumbering Q we may assume that 12q; note that this operation is equivalent to applying a permutation simultaneously to the rows and columns of AL (and A itself). In this permuted matrix, every 2×2 submatrix of the form AL[i,i+1;j,j+1] has a nonnegative determinant. [Suppose to the contrary that detAL[i,i+1;j,j+1]<0. Then (i,i+1)(j+1,j) and hence either ii+1 and j+1j or i+1i and jj+1, by construction of . Both possibilities contradict the fact that the rows and columns of AL are ordered by .] Because AL>0, this implies [a standard fact about finite Monge matrices (ref. 11, observation 2.2)] that every 2×2 submatrix AL[i,i;j,j] with i<i and j<j has nonnegative determinant; i.e., the matrix AL is log-supermodular. (See the end of the Proof for an illustration of this construction.)

Finally we argue that A itself must be log-supermodular. Assume to the contrary that it is not, i.e., that there are i<i and j<j such that detA[i,i;j,j]<0. Then the free gadget of length 1 is antiferromagnetic between (i,i) and (j,j). Recall that the matrix AL is realized by the free gadget of length L. If detAL[j,j;i,i]>0, then we immediately obtain a gadget of length L+1 that is antiferromagnetic between (i,i) and (i,i), a contradiction. [Explicitly, the gadget is obtained from the free gadget of length L+1 by restricting the spin on the second vertex to be in the set {j,j}.] The only other possibility is that detAL[j,j;i,i]=0, but this is ruled out by Lemma 2.

An Example to Illustrate the Tournament Construction.

Consider the Widom–Rowlinson interaction matrix, but permute the rows and columns to hide the log-supermodular structure. To obtain matrix A below we transposed rows 1 and 2 and columns 1 and 2. The third power of A (corresponding to L=3) is strictly positive:

A=(111110101)andAL=A3=(755543534).

The graph (P,), together with one of the two possible tournaments T arising from it, is depicted in Fig. 1.

Fig. 1.

Fig. 1.

The graph (P,) and one of two tournaments T arising from it.

The (unique) Hamilton path in T is 213, corresponding to the linear order 213. This order indicates that we need to transpose rows 1 and 2 and columns 1 and 2; if we do this, then we recover the original log-supermodular matrix AWR. (If we take the other tournament, then the linear order is 312, but we arrive at the same end result.)

The Imprimitive Case.

Recall that in this case A has the block form [2].

Lemma 5.

Suppose the matrix A is imprimitive and that it does not support an antiferromagnetic pair of spins [i.e., there is no pair (i,i)P and gadget Γ such that detAΓ[i,i;i,i]<0]. Write A in the form [2]. Then there are independent permutations of the rows and columns of B such that the resulting matrix is log-supermodular.

Proof:

Let L be the smallest odd integer such that the matrix

AL=(0B*(B*)T0)

has the property that B*>0. [Explicitly, B*=B(BB)(L1)/2.] We construct a graph on vertex set P=Q12¯Q22¯. The adjacency relation of this graph is defined as follows: (i,i)(j,j) iff detAL[i,i;j,j]>0. [Necessarily (i,i)Q12¯ and (j,j)Q22¯, or v.v.] Note the obvious symmetry (i,i)(j,j) iff (i,i)(j,j). Note also that if (i,i) and (j,j) are in the same component of (P,) then there is a ferromagnetic gadget between (i,i) and (j,j).

As in the primitive case, for every pair (i,i)P it is the case that (i,i) and (i,i) are in different components of (P,). Thus, the components of (P,) come in symmetric pairs C,C, where C contains exactly the reversals of all of the pairs in C. Using the same procedure as before, we may construct two tournaments, T1 on Q12¯ and T2 on Q22¯.

Also as before, we may use Hamiltonian paths in T1 and T2 to define linear orders 1 on Q1 and 2 on Q2. By renumbering Q1 and Q2 (within themselves) we may assume that 11211q1 and q1+12q1+222q; note that this operation is equivalent to applying independent permutations to the rows and columns of B* (and B). In this permuted matrix, every 2×2 submatrix of the form B*[i,i+1;j,j+1] has a nonnegative determinant. Because B*>0, this implies as before that every 2×2 submatrix B*[i,i;j,j] with i<i and j<j has a nonnegative determinant; i.e., the matrix B* is log-supermodular.

The argument that B itself is log-supermodular goes through exactly as in the primitive case.

We have now completed the NP-hardness section. Lemma 3 gave a sufficient condition for it to be NP hard to approximate ZA and we showed (shortly after the statement of Lemma 3) how to use Lemma 1 to test the condition in polynomial time. If the condition fails (so there is no antiferromagnetic pair), then Lemmas 4 and 5 show that there is a permutation of rows and columns such that the resulting matrix is log-supermodular. We will soon see that this means that approximating ZA is #BIS easy. First, however, we examine how to identify #BIS hardness.

The Proof: Equivalence to #BIS

Lemma 6.

Suppose the interaction matrix A satisfies one of the following two conditions: A is primitive and has rank greater than 1 or A is imprimitive and has rank greater than 2 (equivalently, the matrix B in the block decomposition [2] of A has rank greater than 1). Then there exists a pair of spins (i,i)P such that A supports a gadget that is permissive ferromagnetic between (i,i) and (i,i).

Proof:

In the primitive case, let L be the smallest integer such that AL>0. Because A is symmetric and hence diagonalizable, the rank of A is equal to the number of nonzero eigenvalues of A (counted according to multiplicity). The eigenvalues of AL are just the Lth powers of the eigenvalues of A, and so the rank of AL is equal to the rank of A, which it is greater than 1 by assumption. We argue that this implies that some principal 2×2 submatrix AL[i,i;i,i] of AL has full rank. Suppose to the contrary that every submatrix AL[i,i;i,i] has rank 1. Let the diagonal entries of AL be d=(d1,,dn). Then by considering the submatrix AL[i,i;i,i] we see that (AL)ii=(AL)ii=didi, for all i,i. This gives an explicit expression for AL as a rank 1 matrix; namely AL=(d1,,dn)(d1,,dn). A submatrix AL[i,i;i,i] of full rank provides a gadget that is permissive but not neutral between (i,i) and (i,i). If the gadget is antiferromagnetic, we can concatenate it with itself to produce a ferromagnetic one.

In the imprimitive case, let L be the smallest even number such that, for some A11>0 and A22>0, AL has the form

AL=(A1100A22).

Arguing as before, A has rank greater than 2, so either A11 or A22 has rank greater than 1. It follows that either A11 or A22 has a principal 2×2 submatrix of full rank.

The Proof: Putting the Pieces Together

Theorem 1 follows quickly. Consider first the primitive case. If A has rank 1, then the partition function factorizes, giving an easy polynomial-time (exact) algorithm for evaluating ZA. [This is similar to the trivial direction of the dichotomy result of Bulatov and Grohe (12)—the external fields do not cause any added difficulty.] Otherwise, by Lemma 6, there is a gadget that is permissive ferromagnetic, from which it follows (ref. 13,theorem 10.2) that #BIS is AP reducible to the evaluation of ZA. If A can be permuted to be log-supermodular, then, by ref. 1, theorem 47, evaluating ZA is AP reducible to #BIS. (The reduction and its verification are the essential content of ref. 1, lemma 46.) Finally, if A cannot be so permuted, then there is an antiferromagnetic pair by Lemmas 4 and 5, and evaluating ZA is NP hard to approximate by Lemma 3. The argument in the imprimitive case is identical.

Discussion

We have now seen exactly what causes the approximate evaluation of the partition function ZA to be NP hard—namely, an antiferromagnetic pair (i,i) that can easily be demonstrated via a tight permissive gadget. If no such gadget exists, then approximating ZA is #BIS easy. We have also seen exactly what causes the approximate evaluation of ZA to be #BIS hard—namely, the existence of a block with rank greater than 1. Without such a block, ZA can be evaluated exactly in polynomial time.

Another interesting question is the complexity of approximately evaluating ZA when the external field acts in a restricted manner. For example, the algorithm of Jerrum and Sinclair (14) gives an FPRAS for ZAIsingλ in the ferromagnetic case λ>1 as long as the field acts in a consistent manner in the sense that the sign of hw(2)hw(1) is the same for all vertices (15). In the antiferromagnetic regime it is known that tractability corresponds to the uniqueness threshold when there are just two spins (16). The ferromagnetic regime is not fully understood (17), even with just two spins, and the multispin case is open.

Supplementary Material

Supplementary File
pnas.1505664112.sapp.pdf (186.4KB, pdf)

Acknowledgments

The research leading to these results has received funding from the European Research Council (ERC) under the European Union’s Seventh Framework Programme (FP7/2007-2013) ERC Grant 334828.

Footnotes

The authors declare no conflict of interest.

This article is a PNAS Direct Submission. J.T.C. is a guest editor invited by the Editorial Board.

This article contains supporting information online at www.pnas.org/lookup/suppl/doi:10.1073/pnas.1505664112/-/DCSupplemental.

References

  • 1.Chen X, et al. The complexity of approximating conservative counting CSPs. J Comput Syst Sci. 2015;81(1):311–329. [Google Scholar]
  • 2.Dyer M, Goldberg LA, Greenhill C, Jerrum M. The relative complexity of approximate counting problems. Algorithmica. 2004;38(3):471–500. [Google Scholar]
  • 3.Goldberg LA, Jerrum M. The complexity of ferromagnetic Ising with local fields. Combin Probab Comput. 2007;16(1):43–61. [Google Scholar]
  • 4.Jerrum M, Valiant LG, Vazirani VV. Random generation of combinatorial structures from a uniform distribution. Theor Comput Sci. 1986;43(2-3):169–188. [Google Scholar]
  • 5.Cai J, Chen X, Lu P. Proceedings of the 26th Annual IEEE Conference on Computational Complexity. IEEE; New York: 2011. Non-negatively weighted #CSP: An effective complexity dichotomy; pp. 45–54. [Google Scholar]
  • 6.Kolmogorov V, Zivny S. The complexity of conservative valued csps. J Assoc Comput Mach. 2013;60(2):10. [Google Scholar]
  • 7.Mitzenmacher M, Upfal E. Probability and Computing. Cambridge Univ Press; Cambridge, UK: 2005. [Google Scholar]
  • 8.Rédei L. Ein kombinatorischer Satz. Acta Litt. Sci. Szeged. 1934;7:39–43. German. [Google Scholar]
  • 9.Bondy JA, Murty USR. Graph Theory, Graduate Texts in Mathematics. Vol 244 Springer; New York: 2008. [Google Scholar]
  • 10.Cohen DA, Cooper MC, Jeavons PG. Generalising submodularity and Horn clauses: Tractable optimization problems defined by tournament pair multimorphisms. Theor Comput Sci. 2008;401(1–3):36–51. [Google Scholar]
  • 11.Rudolf R, Woeginger GJ. The cone of Monge matrices: Extremal rays and applications. Math Methods Oper Res. 1995;42(2):161–168. [Google Scholar]
  • 12.Bulatov A, Grohe M. The complexity of partition functions. Theor Comput Sci. 2005;348(2–3):148–186. [Google Scholar]
  • 13.Bulatov AA, Dyer ME, Goldberg LA, Jerrum M, McQuillan C. The expressibility of functions on the Boolean domain, with applications to counting csps. J Assoc Comput Mach. 2013;60(5):32. [Google Scholar]
  • 14.Jerrum M, Sinclair A. Polynomial-time approximation algorithms for the Ising model. SIAM J Comput. 1993;22(5):1087–1116. [Google Scholar]
  • 15.Goldberg LA, Jerrum M, Paterson M. The computational complexity of two-state spin systems. Random Structures Algorithms. 2003;23(2):133–154. [Google Scholar]
  • 16.Li L, Lu P, Yin Y. Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms. SIAM; Philadelphia: 2013. Correlation decay up to uniqueness in spin systems; pp. 67–84. [Google Scholar]
  • 17.Liu J, Lu P, Zhang C. Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques. Leibniz-Zentrum für Informatik GmbH, Wadern; Germany: 2014. The complexity of ferromagnetic two-spin systems with external fields; pp. 843–856. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplementary File
pnas.1505664112.sapp.pdf (186.4KB, pdf)

Articles from Proceedings of the National Academy of Sciences of the United States of America are provided here courtesy of National Academy of Sciences

RESOURCES