Manuscript Offprint
arXiv:2610.37630Approximate Counting for Mixed -Spin Glasses in Weak External Fields via Cluster Expansion
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
QIANG WU
ABSTRACT. We give algorithms for approximating the partition function of the Sherrington–Kirkpatrick (SK) model and finite mixed Ising p-spin models with . The algorithms apply at a fixed margin below the second-moment threshold with homogeneous weak external fields , for fixed . For any accuracy and failure parameter , they approximate to additive error . The number of exact operations is polynomial jointly in , , and . The disorder variables have i.i.d symmetric distribution with unit variance. The failure probability is at most plus an explicit disorder tail bound. This tail bound tends to zero under a finite fourth moment condition. Our approach builds on the cluster expansions of Aizenman–Lebowitz–Ruelle [1] and Dey–Wu [9,10]. For higher-order mixtures, we retain hypergraphs using few vertices and evaluate their total weight deterministically through local spin averages and inclusion–exclusion. For SK, we impose cutoffs on the number of vertices of degree at least three and on the total number of edges. We estimate the retained sum using randomized color coding [2]. A lower tail control based on reverse hypercontractivity [27] converts the mean-square approximation of the normalized partition function into logarithmic accuracy.
CONTENTS
- Introduction and main results 1
- Cluster expansion and second moment estimates 8
- Mixed p-spin models with 12
- The SK model 17
- Proof of the main results 32
References 37
DEPARTMENT OF MATHEMATICS, 1291 UNIVERSITY OF OREGON, 175 PRINCE LUCIEN CAMPBELL HALL, EUGENE, OR 97403-1205, USA
E-mail address: qiangwu@uoregon.edu.
Date: October 28, 2026.
2020 Mathematics Subject Classification. Primary: 82B44, 68W25; Secondary: 68Q87, 68W20.
Key words and phrases. Mixed p-spin glass, partition function, approximate counting, weak external fields, cluster expansion.
WU
related spin systems, this problem has been studied extensively, see a non-exhaustive list in [21, 25, 26, 30]. For spin glasses, this algorithmic problem has only been studied recently. Gamarnik and Kızılıdağ [15] established average case hardness results for “exact” evaluation of the SK partition function. Several recent works present various (quasi)-polynomial time approximation algorithms in high temperature regimes [6, 17, 20, 31]. Here we develop an alternative approach based on cluster expansion to this problem, we defer discussions on its relation to other works in Section 1.6 and 1.7.
1.1. Definitions. Let be a finite, nonempty set of spin interaction orders, with coefficients for . An interaction of order involves different sites. We consider the SK model, for which and , and higher-order mixtures, for which . Denote and .
For , let and be the spin configuration space. The interactions of order are the -element subsets . Set
The disorder variables has independent entries with common law . Write and for expectation and probability over the disorder. For with law , assume
Namely the disorder is symmetric about zero and has unit variance.
For inverse temperature and a homogeneous external field , define the Hamiltonian and partition function
These interaction conventions are consistent with [9] for SK and [10, (1)–(2)] for higher-order mixtures. Following [10, (6)], define the entropy function
and the structure function and second-moment threshold are respectively
For , we have and . The latter follows from and . Evaluating the ratio also at gives
For , we have for every . This entropy comparison plays a key role in the second moment estimates in Section 2. For SK, and as , it gives , which is the static phase transition threshold for SK model.
Fix and . We work in the following regime
The external field may depend on , and is included. Constants may depend on the fixed parameters , but not on or the particular in this range.
1.2. Approximate counting problem. The algorithmic input consists of , a disorder realization , the parameters , a relative accuracy , and a failure allowance . The goal is to return satisfying
with a failure probability bound of plus the disorder-dependent term in the main theorem. Accuracy is assessed over the disorder and, for SK, independent algorithmic randomness. We include this additional randomness in E and P whenever an algorithmic output is involved.
To obtain relative accuracy , it suffices to obtain such that for . The estimate satisfies
and hence (7). This needs a finer control than an approximation to the free energy , which determines only up to a factor .
Here the computational cost is measured by counting the number of exact operations, such as real arithmetic and evaluations of elementary functions. Our bounds do not account for bit complexity or the numerical precision needed to control roundoff errors.
1.3. Main result. The following main result gives the guarantee for the algorithm LOGAP-PROX, stated in Section 1.4.
Theorem 1.1. There are constants , depending only on , such that Algorithm 1, for every , specified satisfying (6), and , returns in at most
operations for every finite real input J and every realization of the internal randomness. For with the common disorder law , set
Under (1), the error satisfies
For mixtures with , the algorithm is deterministic and probability is over J. For SK, the algorithm is randomized and probability also includes its independent internal randomness.
The term is due to a union bound to control the probability of some exceeding . For any fixed parameter values within the stated ranges, the failure probability is at most . The event of success may depend on that choice, so we do not claim simultaneous accuracy over the entire parameter range. The cost exponent grows as approaches .
WU
Note that a second moment condition on disorder alone need not make the bound on the tail probability small. The high probability consequences require higher moments control, such as a finite fourth moment in the following Remark 1.2.
Remark 1.2 (Consequences under higher moments conditions). Under (1), bounds on give the following consequences.
(i) If , then as . Substituting the thresholds in (10) gives , including SK. For relative tolerance , apply the theorem with logarithmic tolerance and . Then satisfies
Since , the cost is at most after enlarging C.
(ii) Fix . If for some , then
Substituting the thresholds in (10), since and every exponent is at most , it gives . Taking gives logarithmic error at most with failure probability at most for all sufficiently large , at cost . The constant depends only on the fixed model, .
1.4. The algorithm. We first separate an explicitly computable factor from the partition function , which is basically the first step of cluster expansion in [1, 9, 10]. For each interaction e, let
Define
Here is a normalized partition function. The algorithm thus computes exactly and approximates .
For a target mean-square error in approximating the normalized partition function , the subroutine GRAPHAPPROX (Algorithm 4) returns an approximation satisfying in operations (Proposition 5.2). To obtain a logarithmic approximation, we also need to know that is unlikely to be very small. Proposition 5.5 provides fixed constants and such that, for every ,
Their explicit values are given in (20) and (67).
For these choices of and , the lower-tail bound and Markov's inequality imply that and hold together with probability at least . The error is then small relative to , consequently . Since is bounded by a polynomial in and , the computational cost is polynomial jointly in .
Algorithm 1 LOGAPPROX(N, , h, J, , )
Input: Disorder J with finite real entries, , parameters as in (6), additive logarithmic tolerance , and failure allowance .
1: .
2: and .
3: .
4: if then
5: .
6: else
7: .
8: end if
1.5. Ideas of the proof. The proof for Theorem 1.1 contains three major steps. The first step is using the cluster expansion in [1,9,10] to obtain estimates for the variance order of large (hyper)-graph clusters, which determines what graphs to be discarded. The second step is an efficient algorithmic procedure to sum the retained graphs. The last step is about controlling the lower tail probability of , which translates the approximation error into logarithmic accuracy.
Expansion and error estimate. Let and . For a graph , write the degree of vertex in as and let is odd} be the odd degree vertices. One can check that
where . Independence and symmetry of the disorder make the cross terms vanish when we square the error and take expectation. Thus, for a fixed family of graphs,
We later choose which graphs to keep so that the sum on the right is small. In the mean time, we also need to compute the total weight of retained sum in polynomial time.
Mixed p-spin analysis For an interaction of order , . Lemma 3.1, based on similar combinatorial analysis in [10], bounds the sum of second moments over all hypergraphs using vertices by for fixed . This bound decreases rapidly when is a small fraction of . We keep all hypergraphs using at most (to be chosen) vertices. The next step is how to efficiently compute the retained sum. For a fixed set with , let be the average of over independent spins on with mean . It sums the weights of all hypergraphs contained in . Some hypergraph might be counted more than once in different averages. We apply an inclusion-exclusion trick to avoid over-counting. For each set , will be evaluated once using spin configurations. In total, there are spin configurations, with polynomial work per configuration.
Analysis for SK In the SK case, for fixed cycle length , the number of cycles is of order , and each has second moment of order . The sum of their second moments therefore has constant order. We instead truncate by branching vertices, i.e. those of degree at least three. For , Lemma 4.1 bounds the sum of second moments for graphs with b branching vertices.
WU
by . We keep at most branching vertices and edges to exclude long paths and cycles. Fix the branching set and add an auxiliary vertex and join it to each odd-degree vertex by an edge of weight to account for the external field effects. Every used vertex outside this enlarged set now has degree two. Apart from edges within the enlarged set, the resulting graph consists of paths and cycles whose outside vertices do not overlap. Color coding [2] provides an efficient way to compute the sum of those graph structures. The cost per branching set and coloring is polynomial in and exponential in (Section 4).
Completing the proof. We finally choose a proper cutoff to obtain a mean-square error at most at a cost polynomial in and . Here counts all used vertices for higher-order mixtures and branching vertices for SK. For cutoffs below a small fixed fraction of , the mean-square truncation error bounds decrease exponentially in , while the number of vertex sets of size is at most . Balancing these two bounds gives the required cutoffs. For SK, the contribution from graphs with more than edges decreases exponentially in below the second moment threshold . Choosing large enough to make this contribution at most a fixed fraction of requires only . With independent colorings for each candidate branching set, the mean-square error in estimating the retained graph sum is at most . Taking makes this error at most . Therefore, the required number of colorings is also polynomial in .
To turn this absolute approximation into logarithmic accuracy, we must ensure that is unlikely to be very small. We obtain the required lower-tail bound via reverse hypercontractivity [27]. Combining this bound with the mean-square approximation gives the desired logarithmic accuracy with failure probability at most , while preserving polynomial cost.
1.6. Related work. Barvinok's interpolation method approximates the partition function of Ising models by computing a truncated Taylor series. Bounds on the locations of the complex zeros control the truncation error, which provides the basis for the zero-freeness approach to approximate counting. For applications to classical spin systems and related counting problems, see [4, 5, 26, 30]. In the spin glass setting, Bencs, Huang, Lee, Liu and Regts [6] first developed the zero-freeness approach and obtain deterministic algorithms with quasi-polynomial running time for finite Gaussian mixed Ising and spherical models at zero external field, with high probability over the disorder at a fixed margin below the second-moment threshold. Their models include mixtures of pair and higher-order interactions, indexed by ordered tuples with repeated sites allowed. After matching interaction normalizations, their Ising threshold agrees with .
Sampling also provides a route to approximate counting by estimating successive ratios of partition functions along a temperature schedule. For SK, functional inequalities yield efficient sampling at sufficiently high temperature, as shown by Eldan, Koehler, and Zeitouni [13] and Anari, Koehler, and Vuong [3]. For Gaussian SK at zero external field, the stochastic localization approach of El Alaoui, Montanari, and Sellke, together with the work of Celentano, gives efficient sampling in normalized Wasserstein distance throughout [8,12], see some recent progress on the sampling problem in [7,23,33].
To obtain accurate counts by annealing, one must control the sampling error at every temperature used in the schedule. Hou, Liu, and Yu [20, Theorem 1.2 and Corollary 1.3] provide such control through a weak Poincaré inequality and simulated annealing with Glauber dynamics for Gaussian SK at zero external field throughout . Their counting algorithm achieves prescribed inverse polynomial relative accuracy and failure probabilities in polynomial time for sufficiently large N. The polynomial exponent may depend on the prescribed accuracy and confidence powers.
The spectral-gap argument in the OpenAI mathematics release [28] provides another sampling-based route for Gaussian SK at zero external field. As noted by Harbuzova-Lepsveridze-Majid-Moitra [17, Section 1.2], making the estimates uniform on fixed subcritical temperature intervals and applying annealing yields randomized polynomial-time relative approximation at every fixed , with high probability over the disorder. These approaches obtain counts from Gibbs samples, whereas our algorithm directly sums retained graph weights. Conversely, the counting-to-sampling reduction of Jerrum–Valiant–Vazirani [22] requires counts for models obtained by fixing spins. Such conditioning can introduce site-dependent external fields and lower-order interactions outside our model class, so our theorem does not directly provide the required counting oracle.
For related algorithmic results in other disordered systems, see [11, 16, 18] for the random field Ising model and [19, 24] for the continuous random energy model.
1.7. Concurrent work. Few weeks before this work , Harbuzova et al. [17, Theorem 1.1] and Schmidhuber and Zlokapa [31, Theorems 26 and 31] obtained similar results. In particular, they have deterministic algorithms for approximate counting in Gaussian SK at zero external field throughout , with polynomial running time and high probability of success over the disorder. Our SK algorithm is randomized and allows symmetric disorder and homogeneous weak external fields, subject to an explicit disorder tail bound. For mixed p-spin case, [17] also covers models containing both pair interactions and interactions of higher order, which our results exclude. After matching interaction normalizations, their threshold agrees with . For mixtures whose orders are all at least three, [31] reaches the static phase transition threshold, which can lie above .
The complexity guarantees also differ. Similar to [17], we obtain a bound on the number of exact operations that is polynomial jointly in system size, inverse requested accuracy, and inverse failure allowance. Our failure bound includes the disorder tail term , while theirs includes a vanishing term from a zero-freeness estimate. The guarantees in [31] allow accuracy and failure targets given by any fixed inverse powers of N, with polynomial running time whose exponent may depend on those powers. They also establish polynomial bit complexity, whereas our operation bounds do not account for numerical precision.
For SK at zero external field, all three methods separate branching vertices from paths and cycles through vertices of degree two and use color coding to sum these pieces. The construction is particularly close to [17, Section 5], which also combines piece weights through polynomial multiplication. Both concurrent algorithms are deterministic. We average independent random colorings and introduce an auxiliary vertex to account for the weak external field effects. For mixtures whose orders are all at least three, our algorithm sums the retained hypergraphs exactly through local spin averages and inclusion-exclusion. The corresponding methods in [17, Appendix A] and [31, Section 7] use an extension of color coding and a Hermite expansion with cavity calculations, respectively. Our treatment of small partition function values also differs from [17]. We use reverse hypercontractivity for the coupling signs, rather than zero-freeness, to convert approximation in mean square into logarithmic accuracy.
A preliminary draft of this work and a companion Lean formalization were posted on GitHub on October 7, after OpenAI’s mathematical results release.
WU
1.8. AI disclosure. This work was developed through extensive interactions with GPT-5.6 Pro and GPT-6 Pro. The author originally proposed using the cluster expansion to obtain approximate counting algorithms by discarding large graph clusters, motivated by the work of Dey-Wu [9, 10]. In particular, the fast decay of the second moments of large hypergraph clusters in the higher-order models suggested that a relatively small retained sum might suffice. Starting from this idea, GPT-5.6 Pro proposed a polynomial time algorithm for the higher order case based on a cutoff on the number of hyperedges. However, the initial approach only gave a quasi-polynomial time algorithm for SK.
Further interactions with GPT-6 Pro focused on improving the SK case. The models suggested using the established color-coding method [2] and contributed to the development of the truncation schemes and key arguments in Sections 4 and 5, including the application of reverse hypercontractivity to lower-tail control. We also used Codex to assist with literature searches, figure generation, and the development of a companion Lean formalization (GitHub). The author checked all proofs, revised the manuscript, and takes responsibility for its mathematical claims.
2. CLUSTER EXPANSION AND SECOND MOMENT ESTIMATES
In this section, we establish second moment bounds for shared by the algorithms. Orthogonality of distinct graph clusters expresses the mean-square truncation error as a sum of expected squared graph weights. A bound at an inverse temperature below the threshold controls this sum and gives exponential decay in the number of edges. Throughout Sections 2–5, the assumptions of Section 1.1 hold, in particular , , and .
2.1. Expansion and orthogonality. Recall and . An interaction set is a graph for SK and a hypergraph otherwise. Let be the vertex set of and be its odd-degree vertices. Define the graph weights by
Unless restrictions are stated, sums over range over all subsets of , including the empty graph. Empty products and zeroth powers equal one.
For any external field , let be the law of independent spins with
and let be its expectation. In particular, . Applying to each interaction in , then using the normalization (13), gives . In the product expansion, selecting the interactions in contributes . Independence of the spins gives
The last equality uses and . Summing over gives the expansion of [9] and [10, (3)–(5), (38), and (40)]
Positivity follows from . Symmetry gives . For , denote the common second moment by . Since and ,
We allow random coefficients in the next identity because the SK evaluator uses colors drawn independently of the disorder.
Lemma 2.1. For ,
Let be square-integrable real random coefficients whose full array is independent of . With expectation over both and this array,
The coefficients may depend on one another.
Proof. If , at least an edge in their symmetric difference appears once in the product. Its centered weight is independent of the other edge weights, so the expectation vanishes. If , independence gives the second moments. Conditioning on the coefficient array and expanding the square proves (17).
In particular, for a deterministic family R of retained graphs,
Thus the error is determined by the expected squared weights of the discarded graphs. We next give the second moment estimates for those graphs.
2.2. Second moments and the edge tail. Choose a comparison inverse temperature strictly between and by setting
For , define the comparison weights by
Here is a deterministic upper bound, not the exact edge second moment at . Bounding the graph sum with these larger weights will leave a factor for each original edge. Let
Define
The proof follows the second-moment arguments of [9, Lemma 4.1] and [10, Lemma 3.1 and Proposition 3.3], with an explicit bound for every under (1).
WU
Proposition 2.2 (Second moments and edge tail). For every and ,
For every real ,
Proof. To prove (21), we rewrite the graph sum as a spin average. Its external field factor is , so the new spins should have mean . Define the tilted external field by
Then and , by . Applying the product expansion with external field and edge weights gives
To use the entropy comparison, we express the interaction sum in terms of . For , let be the sum of terms in indexed by ordered tuples with a repeated site. There are at most such tuples, each contributing a term of absolute value one. Thus
For each , divide by and use . Multiplying by gives
Summing over , the first terms give and the remainder terms give . Thus
All coefficients of are nonnegative, so . The definition of and evenness of therefore imply on . To bound the product by the exponential of this sum, we also need its factors to be nonnegative. The inequality gives . Since , we have . Define . For each spin configuration, all factors are positive. Applying to each factor gives
Taking bounds the graph sum in (21) by .
It remains to bound uniformly in . First change to the uniform spin measure . The probability of a configuration under is , so
We apply Hölder's inequality under to the numerator. Set
Since and , Hölder's inequality gives
Under , the spins are independent and uniform on , so
Substituting this identity and dividing by yields
To bound , we first estimate the tail probability of . Since is even, . Strict monotonicity of on gives, for ,
The two inequalities use symmetry of and the Chernoff bound, respectively. As ranges over , varies continuously from 0 to . Writing therefore gives for . For larger , the probability is zero because . Since , integrating this tail bound yields
The integral of is finite because . Since and , the first factor satisfies
For the second factor, note that , and the bound then gives , where the last step uses and . These estimates together prove (21).
To prove the bound (22), apply to every edge. For a graph with more than edges, the product of these factors is at most . Summing over these graphs and using (21) completes the proof.
WU
In particular, using the above results we have . The estimate (21) will also be used in the lower tail control of . For any , (18) and (22) show that we can approximate with mean-square error at most by retaining all graphs with at most edges, for a suitable choice of . Directly listing the retained graphs gives a cost bound , which does not establish polynomial dependence jointly on . The next two sections choose graph families that can be summed more efficiently for mixed -spin case and SK model respectively.
3. MIXED p-SPIN MODELS WITH
We truncate by the number of used vertices. Section 3.1 defines the truncation and bounds the discarded part. Section 3.2 evaluates the retained sum by local spin averages. The main estimate must account for both the small second moments of the edges and the number of ways to choose the vertex labels. For example, in the pure three-spin model, a fixed hypergraph shape with v vertices, all of degree two (if possible), has 2v/3 edges. The total contribution from hypergraphs of this shape is . Lemma 3.1 gives a bound after summing over all shapes and labels, including the external field factors. The idea is based on the combinatorial analysis in [10].
3.1. Restricting the number of vertices. For integers and , define
Here is the retained sum, and is the sum of expected squared weights over hypergraphs using exactly v vertices. Lemma 2.1 gives
Thus a bound on will control the truncation error. Recall , let , and define
Lemma 3.1. Let and define
If , then for every integer ,
At h = 0, the same bound holds with exponent .
Proof. There are two sources of decay. For a fixed number of used vertices, a low total degree forces many odd-degree vertices and therefore many small external field factors. A higher total degree instead gives decay through the edge second moments. We first bound this tradeoff for fixed edge counts, then sum over those counts. Fix and nonnegative integers . Consider hypergraphs with and exactly edges of order . For edge counts admitting such a graph, the total degree is . Every used even-degree vertex has degree at least two, so . Let , where . Then and . Since and ,
The last inequality uses , , and . There are at most choices of vertices and edges. This count may include edge selections that leave some chosen vertices unused, so it is an upper bound. For every graph under consideration, the edge second moments have product . Multiplying the count by this product and the upper bound in (25) gives a total contribution at most
Here we used (15), , and . The identity gives the displayed powers of . We next show that the exponent of is at least for every choice of nonnegative integers satisfying . The exponent of in the preceding bound on the sum of second moments is
For every , , so . This exponent is therefore at least , where we define
This function is affine on and increasing after . Its minimum is therefore the smaller of and , which is .
We now sum the bounds for graphs with fixed edge counts to estimate . Since , the preceding lower bound on the exponent gives
In the first inequality, each ranges over all nonnegative integers. This includes edge counts that cannot occur for a hypergraph with used vertices, which only increases the sum because every term is nonnegative. The first equality follows by summing the exponential series for each .
For the second inequality in (24), , since and . At , only graphs with no odd-degree vertices contribute. They have , which gives the stated exponent.
WU
The exponent reaches its value at zero external field when . The same transition threshold appears in the results of Dey and Wu [10, Corollary 2.4] on free energy fluctuations for mixed p-spin models. For , define . Then . The external field assumption (6) gives , hence . Applying the lemma with gives the following exponent, which is computable from the supplied .
Thus . To bound the mean-square truncation error given in (18), define
Lemma 3.1 gives , but this upper bound need not be small when is comparable to . Choose a fixed small enough that decreases geometrically for . We can then bound by a geometric series. To bound , we use the edge-tail estimate (22), since every hypergraph with more than vertices has more than edges. Specifically, choose such that
This ensures
giving the required geometric decrease. The upper bound 1/4 is only a convenient restriction. Section 5.1 gives an explicit choice of , depending only on the fixed model and .
Proposition 3.2. Let be chosen as above, for every integer , we have
Proof. By (18), the error is . We split this sum at . For , the derivative bound gives . Hence
Every remaining graph has more than vertices and hence more than edges, since each edge contains at most vertices. The edge-tail bound (22) gives the second term.
3.2. Exact summation on small vertex sets. We now evaluate without enumerating its hypergraphs. For , define the local spin average
Expanding the product gives
Note that and . Summing over can count the same hypergraph more than once. To correct this overcounting, we add and subtract the values using coefficients . For integers , define
The following Proposition 3.3 proves that these coefficients cancel the extra occurrences of each graph weight, so every hypergraph using at most vertices is counted exactly once. To evaluate , we sum over the spin configurations on . For each configuration, we multiply the factors over interactions and the probability of that configuration. Finally add the resulting weighted product to the sum. These products are evaluated numerically without expanding them into hypergraph terms. Algorithm 2 sums over all with .
Algorithm 2 SUPPORTSUM(N, h, , k)
Input: Cached interaction weights ( ), , external field h, integer .
1: if then
2: return from (28).
3: end if
4: Precompute for , and initialize .
5: for each with , generated by cardinality do
6: Evaluate and add to T.
7: end for
8: return T.
The identity stated in the following proposition is purely algebraic. For arbitrary finite real edge weights, define and by the same formulas for sums over graphs. No positivity or disorder assumption is needed for this identity.
Proposition 3.3. For every finite real weight array, external field , and integer ,
For , we have . Algorithm 2 returns exactly for every , using at most
operations, including set generation and weight lookup. The constant depends only on .
Proof. For , fix . We first establish the identity
WU
Expanding and interchanging the finite sums gives
For a fixed graph, write and . Since must contain , it can omit vertices only from . Omitting exactly of these vertices gives choices of , each with . Therefore,
If , this sum is zero by the binomial theorem. If , only contributes, giving one. Thus only graphs with remain, proving the identity. Summing this identity over gives , since each retained graph appears once. Interchanging the finite sums gives
For a fixed , write . A superset of size is obtained by adding vertices from , giving choices, each with sign . The multiplier of is therefore . Applying Pascal's identity and shifting the index in the second sum yields
The second sum is empty when . Substituting for the multiplier of proves (30). For , both and sum all graph weights, so they are equal.
It remains to bound the work of evaluating each local average once. Precompute the coefficients by Pascal's recurrence in operations. A standard fixed-size subset recursion generates all sets of size in operations, including their vertex lists. For each set, enumerate its spin assignments. Store membership and spins in an array indexed by , then scan the interaction list. It has at most entries, each involving at most sites. Computing the external field weight and normalization takes another operations per assignment. Thus the total cost is at most per assignment. Putting together proves (31).
Section 5.1 uses the mean-square error bound (27) and the bound (31) on the number of operations needed to compute to choose k so that the requested accuracy is achieved with a polynomial operation count.
4. THE SK MODEL
Building on the cycle expansion of Aizenman, Lebowitz, and Ruelle [1], Dey and Wu [9] identify simple cycles and paths as the leading clusters for at high temperature under weak external fields. For fixed , the total contribution of cycles of any fixed length remains of order one in as . Paths of any fixed length also have a total contribution of order one when with fixed . Thus graphs using a fixed number of vertices can still make a nonvanishing contribution, so the estimate in (24) is unavailable in SK.
We instead bound the number of branching vertices, those of degree at least three, and separately the number of edges. Section 4.1 gives the error control. Sections 4.2 and 4.3 decompose graphs with a fixed branching set into paths and cycles, then sum them by color coding. Section 4.4 averages the resulting estimates and bounds their error and cost.
4.1. Branching vertices truncation. Write for distinct and . Here is a selected set of pair interactions, and all its degrees are computed using only these edges. Define its branching set by
For integers and , define
For , define the sum of expected squared weights over graphs with exactly b branching vertices by
This sum fixes only the number of branching vertices and imposes no edge cutoff. The external field factor is squared. Thus two odd-degree vertices contribute to each expected squared weight.
Figure 1 illustrates the second-moment scales for three example graph shapes.
Recall the constants and defined in (20) and (19), respectively, where and for SK. For the branching bound, define
For SK, set and define
To estimate the mean-square error from the branching cutoff, we first bound for each number b of branching vertices.
Lemma 4.1. For every integer ,
WU
(a) Disjoint cycle and edge

(b) Attached edge

(c) Two cycles, one shared vertex

● branching vertex
© odd-degree vertex
FIGURE 1. Branching and second-moment decay. Here . Each bound concerns the sum of expected squared weights over all labeled copies of the displayed shape, under . Attaching the separate edge to the triangle removes one free vertex label without changing the two odd-degree vertices, whose squared external field factor is . Two triangles sharing one vertex have one more edge than vertices and also give .
Proof. We first count graphs with prescribed degrees, then sum over the permitted degrees. The calculation is related to [9, Lemma 4.1]. For any nonnegative integer d, write
Fix with . Consider simple graphs with branching set and prescribed degrees , and let be their number of edges. Then
The counting argument in [14, Lemma 11.1 and (11.1)] bounds the number of simple graphs with these degrees by . Each such graph contributes to .
To sum the counting bound over degree sequences, we write it as the expectation of a product with one factor for each vertex. Let be an auxiliary standard Gaussian, and write for its expectation. Since , the contribution of graphs with this degree sequence is bounded by
We now sum over all for and all for , without requiring an even total degree or a sequence realized by a simple graph. This only adds nonnegative terms. Tonelli's theorem allows us to interchange the degree sums with and sum separately over the degree at each vertex. To bound these sums at , we use the following inequalities, valid for every . For a vertex in ,
For a vertex in A, separating odd and even degrees gives
Here we used and . Applying the bounds for the two degree sums, using , and summing over the choices of , we obtain
We next estimate this expectation. The bounds and imply
where we used . To keep the Gaussian integral finite, we bound the exponent by a constant plus a quadratic term whose coefficient is below 1/2. Set
Completing the square gives
Multiplying the Gaussian density by leaves . Rescaling the integral therefore yields
The inequalities use for , the Gaussian moment formula, and , together with and . Combining these estimates and using the definition of , we have
Now and , so . Finally, gives
the proof is complete.
We now combine the branching bound with the edge-tail estimate. Choose with . Then on , so the branching bounds can be summed geometrically in this range. More than branching vertices force more than edges, where we use the edge-tail bound instead.
WU
Proposition 4.2 (SK truncation). For integers and , let be the sum in (32), retaining exactly the graphs with at most D branching vertices and at most L original edges. Then
Proof. Let . A graph is discarded if it has more than edges, or if it has at most edges but more than branching vertices. These alternatives are disjoint. Orthogonality therefore gives
In the inequality we removed the edge restriction from the second sum and split it at branching count B. All summands are nonnegative.
The first sum is at most by (22). For the middle sum, and give . Lemma 4.1 consequently yields
For the last sum, the integer inequality implies . Each branching vertex has degree at least three, so
Thus this family is contained in , whose total expected squared weight is at most by (22). Adding the three estimates proves (35).
4.2. Augmented graphs. To evaluate , we group graphs by their exact branching set. We first represent the external field factor by extra auxiliary edges. Adjoin an auxiliary vertex 0, assign for , and define the augmented graph on by
All original edges are kept. The added edges give
The degree in of every original vertex is even. The degree at 0 is , which is even by the sum-of-degrees identity. Conversely, evenness at each original vertex uniquely determines whether its edge to 0 is present. Thus augmentation is a bijection between simple graphs on and simple graphs on in which every degree is even, allowing isolated vertices in both cases. An original vertex is branching exactly when its augmented degree is at least four. Only original edges count toward .
Fix and define
We call each vertex of an outside vertex. If , then for . Augmentation changes these degrees to 0, 2, 2, respectively, so
This degree constraint yields a decomposition into the following two types of edge sets.
-Path pieces. The collection of path pieces consists of the edge sets
where are pairwise distinct and satisfy
Thus the endpoints are , and the internal vertices are . The case gives the singleton edge set with and . We call a direct edge.
-Cycle pieces. The collection of cycle pieces consists of the edge sets
where are pairwise distinct and
Members of and are undirected edge sets. Reversing a path, or changing the starting vertex or orientation of a cycle, gives the same piece. Figure 2(c) shows two path pieces and two cycle pieces for .

(a) Original graph

(b) Augmented graph

Direct edge

Attached cycle

Path

Outside cycle
(c) The four pieces of
FIGURE 2. Augmentation and the edge partition in Lemma 4.3. In (a), the branching set is and the odd-degree set is , marked by rings. In (b), two dashed edges to the auxiliary vertex 0 supply the factor . Row (c) contains exactly the same edges, separated into four pieces. Repeated labels 0 and 1 denote the same vertices of , not new vertices. The outside vertex sets are disjoint. Only solid, original edges count toward .
WU
Lemma 4.3 (Path and cycle decomposition). Let satisfy . There is a unique collection such that
The disjoint union means that each edge of belongs to exactly one piece. Conversely, let satisfy
and set . Then for a unique with if and only if
The first part gives the unique path and cycle decomposition of when . The second converse part considers pieces that share no edges and meet only in . It shows that their union equals for a graph with if and only if (38) holds. These conditions require every degree to be even and each vertex of to have degree at least four. In Section 4.3, we sum over these collections and impose the degree conditions. Uniqueness ensures that each graph is counted once.
Proof. Set
and let K be the collection of vertex sets of the connected components of G, including isolated vertices. By (36), every vertex of G has degree at most two. Each component is therefore a cycle, a path of positive length, or an isolated vertex. For , define
If the component on K is a cycle, its vertices already have degree two within K, so
Otherwise, write in path order, allowing for an isolated vertex. Equation (36) supplies exactly two edges from to , giving
When , the two neighbors are distinct because is simple. Hence if , and if . The latter case necessarily has . In Figure 2(b), the component sets , , and give, respectively, the cycle 1, 2, 3, 1, the path 1, 4, 0, and the cycle 5, 6, 7, 5 in part (c).
Define
Every edge either has both endpoints in or meets exactly one component set . Also , and distinct component sets are disjoint. These facts prove (37). In Figure 2, the only direct edge is .
For uniqueness, consider any collection satisfying (37). Both edges incident to a vertex must belong to the same piece, since has degree two in every piece containing it. It follows along each component of that all edges of belong to one piece. For a piece meeting , the subgraph induced by its vertices in is connected. Thus this piece cannot contain vertices from two different component sets and is exactly . Every remaining edge has both endpoints in and can only be a singleton path piece. Thus is unique.
For the converse, the pieces have disjoint edge sets and no common vertex in , so H is simple and
The stated degree conditions are necessary by the augmentation identities. Suppose they hold and put . For ,
Since is even, this gives if and only if , and hence . Moreover,
Thus . The identity also proves uniqueness.
4.3. Color-coded summation. Fix a candidate branching set and an edge cut-off . Lemma 4.3 reduces the graph sum to collections of paths and cycles, but listing all possible vertex sequences of these pieces would be too expensive.
Color coding was introduced by Alon, Yuster, and Zwick [2] to find simple paths and cycles of a prescribed length in a graph. The difficulty is to extend a path without revisiting a vertex. Their idea is to color vertices randomly and consider paths whose vertices have distinct colors. Extending such a path to an unused color preserves simplicity, so one only needs to remember the colors already used. Here we sum together the weights of paths with the same endpoint and color set. This avoids enumerating their vertex sequences. The number of colors is controlled by L. Cycles are handled similarly, as detailed below.
Lemma 4.3 allows different pieces to share vertices in , but not in . We therefore leave uncolored and fix a coloring . We use 2L colors because any graph with at most original edges uses at most 2L vertices in . A graph or piece is called colorful if the vertices it uses in have distinct colors. To illustrate how we sum path weights, fix and with . Consider all paths with and . If has a color other than 1, 2, every such path extends to a simple path . Their total weight is
The sum in parentheses is the total weight of the original paths. Multiplying it by computes the total weight of their extensions without processing each path separately.
We combine colorful pieces only if their vertices in use no common color. This prevents different pieces from sharing a vertex in . For a fixed coloring, we thus count only colorful graphs. In Section 4.4, we divide each included graph's weight by its probability of being colorful under a uniformly random coloring. Averaging over independent colorings gives an unbiased estimate of the full retained sum. Here we compute the colorful graph sums exactly for a fixed coloring .
We group colorful graphs by their branching set, number of edges, and colors used in . The weights of graphs in the same group will be added together. For and , let be the set of colorful graphs satisfying
WU
Thus this set contains exactly the colorful graphs with branching set A, k edges, and colors S on their used vertices in . Define their total weight by
Summing these quantities over , gives the colorful part of the contribution from to when .
Proposition 4.4. Let be the external field, and let be the weight of the edge for . For any candidate branching set , integer , and coloring , the construction described below computes all sums in (39), for and , exactly and deterministically. The total number of operations for all these sums is at most
where is an absolute constant.
This exact evaluation holds for any external field and any real edge weights. The restriction on the external field is used in the truncation and mean-square error estimates. To compute these sums, we first sum the weights of individual path and cycle pieces. We combine pieces only if their vertices in use no common color. We keep only unions satisfying (38).
Weights of paths and cycles. Here we compute the total weights of colorful path and cycle pieces that meet . We group the pieces by the colors of their vertices in and the vertices they meet in . Recall from Section 4.2 that a direct edge joins two distinct vertices of and therefore has no vertex in . These sums, together with the weights of direct edges, will be used in the next part to compute by combining pieces.
Give each auxiliary edge weight . The weight of a path or cycle is the product of its edge weights. For , , and , define to be the sum of weights of paths from to whose vertices after lie in and have exactly the colors in , each once. The preceding example with two colors is the entry .
The initial entries are . Entries with or are zero. For and , compute
Deleting the last vertex of a path removes its color and the edge from its penultimate vertex . Conversely, appending to a path using cannot repeat a vertex. This proves the recurrence by induction on . For each fixed starting vertex , the values form a table indexed by color sets and endpoints . This table has entries.
The table only counts paths starting at . To construct cycles contained entirely in , we also need paths whose starting vertex lies in . We therefore introduce a second path table. For , let sum the weights of paths from to contained in , with vertex colors exactly , each once. Thus includes . Initialize , corresponding to the path with no edges. All other singleton entries are zero. For ,
, and , compute
All other entries are zero. Deleting or appending the last vertex gives the same induction as for (41). Both tables are computed in increasing order of .
Both tables sum weights of paths ending in . Lemma 4.3 requires path pieces to have two distinct endpoints in . Its cycle pieces meet in at most one vertex. To obtain a path piece from a path counted by , we append the edge with . To obtain a cycle, we add to a path counted by , or to a path counted by . The size restrictions below ensure that each resulting cycle has at least three edges. For , define the following sums.
• For in , let be the total weight of colorful paths between and with nonempty interior in and interior color set .
• For , let be the total weight of colorful cycles meeting only at , with all other vertices in and their colors forming .
• Let be the total weight of colorful cycles contained in and having outside color set S.
Multiplying by the added edge weights, summing the table entries, and correcting for repeated counts gives
Set these sums to zero outside the stated size ranges. Starting at the smaller endpoint counts each undirected path once. A cycle through a is counted in two orientations, while a cycle contained in is counted in two orientations from each of its roots. The denominators remove these multiplicities. The size restrictions exclude traversing a single edge twice.
Combining the pieces. The preceding part gives weight sums for individual path and cycle pieces, whereas our target sums weights of whole graphs. The second part of Lemma 4.3 specifies which collections of pieces form the required augmented graphs. For each such collection, the product of its piece weights equals the weight of the corresponding original graph.
For example, if and , then sums the weights of unions of two cycles whose only common vertex is , as in Figure 3(a). In general, we must exclude shared vertices in and unions with more than original edges. We must also check the final degrees and count each graph once. We proceed in three steps.
(1) Combine the path and cycle weight sums using disjoint outside color sets, and discard collections with more than L original edges.
(2) Correct for the different orders in which the same pieces can be selected. Then add direct edges within , selecting each at most once.
WU
(3) After all pieces and direct edges have been chosen, keep only collections satisfying the degree conditions (38) in Lemma 4.3.
We implement this construction using polynomial multiplication. Introduce formal variables , for , and for , and write . A colorful piece with original edges and outside color set contributes the weighted monomial
Its coefficient is the piece's weight. The exponents record the original edge count, outside colors, and degrees at . These degrees include auxiliary edges.
Let sum these monomials over colorful pieces containing a vertex in . We construct it directly from the previously computed sums:
| Piece | Contribution to | Range |
|---|---|---|
| Cycle in | ||
| Path between in | ||
| Cycle through , with all other vertices in | ||
| Path from 0 to | ||
| Cycle through 0, with all other vertices in |
(46)
Sum these contributions over the indicated endpoints and color sets . The powers of count only original edges; in particular, a cycle through 0 has two auxiliary edges and hence original edges. Multiplying piece monomials multiplies their weights and adds their exponents. To exclude repeated outside colors and more than original edges, we impose
The first relation excludes pieces sharing an outside vertex. It also excludes distinct outside vertices with the same color, because the desired graph must be colorful, see Figure 3 for an example. The second relation enforces the original edge cutoff.
The expansion of gives ordered choices of pieces. Since every piece uses a nonempty outside color set, the color restriction prevents repeated selection of a piece. Each permitted collection therefore appears in exactly orders. We count it once by defining
Every piece contains at least one original edge, so collections with at most original edges contain at most pieces. So far, the exponent of records the exact degree at . We now replace these exponents by degree states to reduce the number of coefficients stored.
At a vertex of , the final augmented degree must be even and at least four. Once the current degree is at least four, further additions cannot lower it below four, so only parity matters for the final check. We keep degrees 0, 1, 2, 3 separately to determine whether subsequent additions reach the required threshold. For a union of selected pieces and direct

(a) Four distinct outside colors

(b) Color 2 used at two vertices
FIGURE 3. The color test when combining two cycle pieces. Both cases show the same graph, with and . Vertex names are outside the circles, and the numbers inside are their colors. The isolated auxiliary vertex 0 is omitted. In (a), all four outside colors are distinct, so the two cycles can be combined. In (b), the distinct vertices v and w both have color 2. Each cycle is colorful by itself, but their product contains and is discarded. The graph itself is valid. Section 4.4 corrects this coloring restriction by reweighting and averaging.
edges, define the degree state
for nonnegative integers d.
From now on, the factor records this degree state. After each multiplication, replace by , leaving the coefficient unchanged, and add coefficients of terms with the same monomial. Subsequent updates can use the stored states because
Thus each degree exponent has only six possible values. Algebraically, this replacement is implemented by simply setting
The polynomial does not yet include direct edges, whose endpoints both lie in . Such edges use no outside colors, so the relations cannot prevent their repeated selection. Consider an original direct edge . To account for collections both with and without this edge, let
The first summand keeps the collections unchanged. In the second, every collection gains the edge : its weight is multiplied by , its original edge count increases by one, and the two endpoint exponents increase by one before degree reduction. Apply this operation to the current polynomial once for each original direct edge. For an auxiliary edge , use instead, in the way, adding it does not increase the original edge count.
WU
Processing each edge once prevents repeated selection. The resulting polynomial is
Apply the color, edge-count, and degree reductions after every multiplication.
To select graphs whose branching set is exactly A, Lemma 4.3 requires the completed union H to have even degree at least four at every vertex of A, and even degree at 0. Every used vertex in already has degree two. We therefore select coefficients with
State 4 includes degrees 4, 6, 8, ...; state 5 represents odd degrees and is excluded only at this final selection. These are augmented degrees, an original degree of five becomes six after augmentation and has state 4. For a reduced polynomial F and a monomial M, let coeff(F; M) denote the coefficient of M in F. We claim that
The extracted coefficients sum the weights with the specified edge count, color set, and degree states.
For computation, store each polynomial by its coefficients, indexed by , , and for . Writing , this requires
entries. Compute and for , and the sum , and then perform the direct-edge updates. Each multiplication of two coefficients computes all pairwise products of the weights they represent.
Proof of Proposition 4.4. For a piece Q, write
Let consist of the colorful pieces that contain at least one vertex in and satisfy . The path recurrences and formulas (43)–(45) count each such piece once, so
This expansion verifies the coefficients computed from the path tables. The algorithm does not enumerate Q.
Expanding gives ordered choices of pieces. The relations and discard choices with a repeated color on vertices in or more than original edges. The remaining pieces have nonempty, pairwise disjoint color sets and are therefore distinct. Each collection appears in exactly orders, so division by counts it once. Each piece has at least one original edge. Hence a collection with at most original edges contains at most pieces and occurs in .
The direct edge factors select a subset . Together with a retained collection , they give
Distinct pieces have disjoint vertex sets in , and each of their edges has at least one endpoint in . They therefore share no edges with one another or with , so is simple and degrees add. If , its contribution is
Otherwise it vanishes.
The coefficient selection in (50) requires even degree at 0 and even degree at least four at every . Every used vertex in has degree two, so satisfies (38). The second part of Lemma 4.3 then gives
A vertex in loses at most one edge when 0 is deleted, so . Each contribution selected by therefore gives a graph with weight . Conversely, each has the unique decomposition of Lemma 4.3. At most pieces in this decomposition contain at least one vertex in . The contribution of satisfies the color, edge count, and degree restrictions and is counted once. This proves (50), including the empty graph when , , and . The argument counts contributions before summing weights, so it also covers zero and negative weights.
For the operation bound, let and . Store pair weights in an array and color sets as 2L binary flags. There are tables and tables , hence tables in total. Each has at most entries, and each recurrence has at most summands. Computing all tables therefore requires evaluating at most summands. Including color tests, set generation, indexing, and the sums in costs .
Each coefficient array multiplication examines at most pairs of entries, using operations per pair for color tests, degree reduction, and indexing. Computing and multiplying the direct edge factors requires at most such multiplications. Since and , the total cost is
Input preparation, initialization, scalar operations, and coefficient extraction fit the same bound, proving (40).
4.4. Unbiased estimation and cost. Proposition 4.4 computes the colorful part exactly. A plain average over random colorings would multiply each graph's weight by its probability of being colorful. We correct this bias by dividing each included contribution by its inclusion probability. We then average independent trials to reduce the error.
Fix integers and , where is the number of trials for each candidate branching set. We use , , and for disorder, color, and joint expectations, respectively. For a fixed candidate , draw with independent uniform colors. A fixed set of outside vertices receives distinct colors with probability
Every graph with at most L edges has at most 2L outside vertices, so these probabilities are positive. For fixed J, consider a retained graph with branching set A and m outside vertices. Its coefficient is one when the graph is colorful and zero otherwise, with mean . Dividing
WU
that coefficient by makes its mean one. This corrects each signed graph weight, without requiring it to be positive.
The correction is computable from the stored indices. Every graph in has exactly used vertices in , so all these graphs have the same inclusion probability . We divide the whole entry by this probability, without identifying its individual graphs. Summing the corrected entries gives, for one trial and fixed ,
The right side is the contribution of the candidate to . For each with and each trial , let assign independent uniform colors to the vertices. Take these colorings independently of one another and of . Define the randomized estimate of by
Thus we average R corrected color sums for each candidate A, then add the results over all candidates. Algorithm 3 computes this quantity.
Algorithm 3 SKSUM(N, h, , D, L, R)
Input: Cached pair weights ( ), external field h, integers and .
1: Compute , set for , compute for , and initialize .
2: for each with , generated by cardinality do
3: and .
4: for do
5: Draw with independent uniform colors, independently of J and all previous colorings.
6: Initialize the path tables and coefficient arrays to zero for this trial.
7: Compute in increasing , using their initial states and (41)–(42).
8: Compute , , by (43)–(45), then form by (46).
9: and .
10: for do
11: and then , using (47) and (48).
12: end for
13: Form from E using the factors for direct edges in (49).
14: Extract by (50) and add to .
15: end for
16: .
17: end for
18: return T.
Proposition 4.5. For integers and , the estimate defined in (53) and computed by Algorithm 3 satisfies
(54) for every fixed realization of J. Under (1),
If, in addition, , then
For an absolute constant , the operation count on every finite input and every color outcome is at most
Proof. The probability correction gives unbiasedness for fixed , but rare inclusions can have large corrected coefficients. We first bound the variance of each coefficient after trials. We then use disorder orthogonality to control the error of the complete signed sum. Fix a retained graph and let . Let indicate that its outside colors are distinct in trial for . This is the only candidate set at which can appear, and its coefficient in the output is
The indicators are independent across trials and each has mean . The bound gives . Therefore
Summing the first identity against the fixed graph weights proves (54). To estimate the error, first write the difference of the two graph sums as
Graphs with the same candidate branching set are tested using the same random coloring, so their coefficients can be dependent. Their covariance terms need not vanish when J is held fixed. Instead, average also over J. The full array is independent of J, and Lemma 2.1 removes the cross terms between different graph weights. Applying it to this sum gives
where the last step uses (21) and .
To obtain the total approximation error, separate the error in evaluating the retained sum from the error of truncating the expansion. Given J, the first has color mean zero by (54), while the second is fixed. The cross term therefore vanishes, giving
WU
Combining Propositions 4.2 and 4.5 gives (56), where the first three terms are truncation errors, while the last term is the error from random coloring.
For the operation count, fix a candidate set of size and one trial. Proposition 4.4 bounds the computation for a fixed coloring by . Computing inclusion probabilities, drawing colors, and accumulating the corrected entries fit the same bound. The candidate sets can be generated in operations as in Proposition 3.3. Summing the bound for one trial over these sets and the trials, one obtains (57).
5. PROOF OF THE MAIN RESULTS
This section, by specifying the relevant constants, turns the truncation estimates into mean square approximation for , combining with a lower tail bound for , we prove Theorem 1.1.
5.1. Choosing the cutoffs. Given a requested mean-square error , we use (27) and (56) to choose parameters that make the corresponding error bound at most . We also need the evaluation cost to be polynomial in and . Let denote the cutoff on used vertices for higher-order mixtures and on branching vertices for SK, where we take . The number of edges and colorings in SK case will be chosen afterwards in Proposition 5.2.
The dependence on k in these error bounds is through . Recall
with the constants from Section 3.1 for higher-order mixtures and Section 4.1 for SK. For higher-order mixtures, may depend on , but . For SK, .
It suffices to bound , the powers of in (27) and (56), and, for SK, by , where
the two mean-square bounds are then at most and , respectively. We first choose the cutoff so that .
Lemma 5.1 (Choosing the vertex cutoff). There exist constants , , and an integer , depending only on the fixed model and such that the following holds. For every and , one can choose an integer satisfying the truncation requirement and the enumeration bound
for every fixed . Here depends only on the fixed model, , and .
Proof. Choose
and . For , we have . Thus is increasing on . For , the inequality gives
The terms and in (27) and (56), respectively, equal , where
Set
Let and . With , we have and . Consequently, there is an integer satisfying . Choose the least such integer. Then . Minimality gives for . The same inequality holds for , since . The choice of also gives , so
Fix . If , the sum in (61) equals one, so the claimed bound holds. Suppose . The bound for and the monotonicity of on give
Since and , we have . Define . Using this lower bound on and , we obtain
The enumeration sum is therefore at most , proving (61). The cutoff can be found by testing at most successive integers, using operations.
Fix the constants constructed in the proof, and write for the rest of this subsection. For higher-order mixtures, we evaluate the retained sum exactly. For SK, we must also control the edge error and the coloring error . Algorithm 4 specifies edge cutoff and coloring trial cutoff . The algorithm uses these truncations when and . Otherwise it evaluates the sum exactly. The following Proposition verifies the resulting error and cost bounds.
Algorithm 4 GRAPHAPPROX(N, , h, J, u)
Input: Finite disorder array , , parameters satisfying (6), and .
1: Compute and set .
2: if or then
3: return the exact spin average in (28).
4: end if
5: Compute by (26) for higher-order mixtures, or set for SK.
6: Find the smallest satisfying .
7: if then
8: return SUPPORTSUM(N, h, , k).
9: else
10: , , and .
11: return SKSUM(N, h, , D, L, R).
12: end if
WU
Proposition 5.2. Suppose the disorder variables are independent and have a common symmetric law with unit variance, as in (1). For every , specified , external field , and , Algorithm 4 returns T satisfying
There is a constant , depending only on the fixed model and , such that the algorithm uses at most operations on every finite input and every random outcome. It is deterministic for higher-order mixtures and randomized for SK.
Proof. Recall that are the fixed constants constructed in Lemma 5.1 and . First consider the case in which the above algorithm uses truncation, namely and . The latter condition is equivalent to . The algorithm uses the cutoff constructed in the proof of Lemma 5.1. The cutoffs depend only on and the fixed parameters, so the earlier mean-square estimates apply with cutoffs independent of the disorder.
For higher-order mixtures, Proposition 3.3 evaluates the retained sum exactly. Proposition 3.2, Lemma 5.1, and (63) give
The cost bound (31) and Lemma 5.1 with give at most operations.
For SK, the choices of and ensure and . The combined error estimate (56), Lemma 5.1, and (63) therefore give
By (57) and Lemma 5.1 with , the cost is at most
Since and , we have . Also, gives
for fixed constants . The SK cost is consequently at most . In both models, the identity converts these estimates into polynomial bounds in and .
It remains to consider exact enumeration. Here , so the error is zero. Its cost is at most . If , then is bounded by a fixed constant. Otherwise , and
Thus exact enumeration also satisfies the claimed polynomial bound. Computing the input weights and searching for k add only polynomial work in N. Computing the SK integer ceilings by comparisons and increments costs , which is covered by the preceding estimates.
5.2. Lower tail bound for . To obtain logarithmic accuracy, we need to control the probability that is close to zero. On a suitable event determined by the coupling magnitudes, we will express as a noise average of a positive function of the independent coupling signs, then use reverse hypercontractivity to derive the lower tail bound.
We first recall the reverse hypercontractive inequality of Mossel, Oleszkiewicz, and Sen [27]. Let , be finite probability spaces, and equip with the product measure . For a function on , let denote averaging over its th coordinate while keeping the other coordinates fixed. Consider the operators
Thus for each , is obtained by independently retaining each coordinate of with probability , and otherwise resampling that coordinate from , before evaluating and taking the expectation. To be precise,
These operators are precisely the tensor product of the simple Markov semigroups considered in [27]. For a strictly positive function , denote for and . We restate the Corollary 1.11 of [27].
Lemma 5.3 ([27, Corollary 1.11]). For every strictly positive function f on and every pair of exponents ,
We apply this result to the uniform measure on the sign cube , and write for expectation under this measure. For , define
This is precisely the preceding operator with , equivalently, .
The action of on sign monomials is particularly simple. For , let , we have using the following identities
We will use this identity to express the normalized partition function as the noise average of a function with rescaled interaction weights. Before that, we state the following result as a direct application of the above lemma.
Lemma 5.4. Let and . Every function with satisfies
Proof. Set and , since , applying Lemma 5.3 gives
WU
Hölder's inequality gives
Hence , and since .
For the normalized partition function , the cube has one coordinate per interaction, so . We will use from (19). Define the exponent in Algorithm 1 and the tail constant in Theorem 1.1 by
The event
implies and hence for every edge. A union bound gives . This event will ensure positivity of the function to which we apply Lemma 5.4. It is used only in the proof, and the algorithm does not modify the disorder.
Proposition 5.5. For every , specified , and , we have
where s is defined above in (67) and is the disorder tail bound.
Proof. By symmetry, represent the disorder in law as , where the are independent uniform signs, independent of the magnitudes, then . Fix the magnitudes and let denote uniform expectation on . The event depends only on the magnitudes, so restricting to this event does not change the conditional sign law.
To construct a function whose noise average is , we divide each edge weight by to cancel the factor produced by the noise. Define
Here averages the spins with fixed. On , every factor in the product is at least , so . Averaging over the signs leaves only the empty graph, giving . The monomial identity above yields
Lemma 5.4 therefore gives, on , . Orthogonality of the sign monomials gives, for every magnitude array,
Averaging over the magnitudes, whose expectation we denote by , and using , we obtain
For the last inequality, , and Proposition 2.2 bounds the sum with these comparison weights. Markov's inequality on and give
5.3. Proof of the main theorem. It remains to combine the mean-square and lower-tail estimates with Algorithm 1.
Proof of Theorem 1.1. Let be as in Algorithm 1, and let be its output from GRAPHAP-PROX. Since and , so Proposition 5.2 applies. We first identify an event on which is positive and its logarithm has the required accuracy. On the event
we have and . The bound for gives . The other factors in are computed exactly, so the output has the same error for .
We now bound the probability that this event fails. Proposition 5.5 controls small values of , and Markov's inequality controls the absolute error of . In Algorithm 1, we have and . Consequently,
The fallback when occurs only outside the event above and is covered by this bound. To conclude, substitute into the cost bound of Proposition 5.2. This gives . Computing and the other explicit terms adds only polynomial work in . All constants have the stated dependence.
REFERENCES
[1] M. Aizenman, J. L. Lebowitz, and D. Ruelle, Some rigorous results on the Sherrington–Kirkpatrick spin glass model, Communications in Mathematical Physics 112 (1987), no. 1, 3–20.
[2] N. Alon, R. Yuster, and U. Zwick, Color-coding, Journal of the ACM 42 (1995), no. 4, 844–856.
[3] N. Anari, F. Koehler, and T.-D. Vuong, Trickle-down in localization schemes and applications, Proceedings of the 56th annual ACM symposium on theory of computing, 2024, pp. 1094–1105. Full version: arXiv:2407.16104.
[4] A. Barvinok, Computing the partition function of a polynomial on the Boolean cube, A journey through discrete mathematics, 2017, pp. 135–164.
[5] A. Barvinok and N. Barvinok, More on zeros and approximation of the Ising partition function, Forum of Mathematics, Sigma 9 (2021), e46.
[6] F. Bencs, B. Huang, D. Z. Lee, K. Liu, and G. Regts, On zeros and algorithms for disordered systems: Mean-field spin glasses, 2025. arXiv:2507.15616v2.
[7] M. Boban, A. Li, and S. Oveis Gharan, Rank-1-perturbed trickledown theorems: Mixing time of Glauber dynamics for the Sherrington–Kirkpatrick model up to , 2026.
[8] M. Celentano, Sudakov–Fernique post-AMP, and a new proof of the local convexity of the TAP free energy, The Annals of Probability 52 (2024), no. 3, 923–954.
[9] P. S. Dey and Q. Wu, Mean field spin glass models under weak external field, Communications in Mathematical Physics 402 (2023), no. 2, 1205–1258.
[10] P. S. Dey and Q. Wu, Hypergraph counting and fluctuations of mixed p-spin glass models at high temperature, Communications in Mathematical Physics 407 (2026), 230.
[11] A. El Alaoui, R. Eldan, R. Gheissari, and A. Piana, Fast relaxation of the random field Ising dynamics, The Annals of Probability 54 (2026), no. 1, 99–136.
WU
[12] A. El Alaoui, A. Montanari, and M. Sellke, Sampling from mean-field Gibbs measures via diffusion processes, Probability and Mathematical Physics 6 (2025), no. 3, 961–1022.
[13] R. Eldan, F. Koehler, and O. Zeitouni, A spectral condition for spectral gap: fast mixing in high-temperature Ising models, Probability Theory and Related Fields 182 (2022), 1035–1051.
[14] A. Frieze and M. Karoński, Introduction to random graphs, 2024. Authors' online version dated September 9, 2024.
[15] D. Gamarnik and E. C. Kizildag, Computing the partition function of the Sherrington–Kirkpatrick model is hard on average, The Annals of Applied Probability 31 (2021), no. 3, 1474–1504.
[16] Y. Han, Glauber dynamics for random field Ising models on bounded degree graphs, Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2026), 2026, pp. 42:1–42:18.
[17] A. Harbuzova, S. Lepsveridze, M. Majid, and A. Moitra, Color coding for the Sherrington–Kirkpatrick model, 2026. Preprint, arXiv:2610.10443v1.
[18] T. Helmuth, H. Lee, W. Perkins, M. Ravichandran, and Q. Wu, Approximation algorithms for the random field Ising model, SIAM Journal on Discrete Mathematics 37 (2023), no. 3, 1610–1629.
[19] F.-H. Ho, Efficient approximation of the CREM Gibbs measure and the hardness threshold, Journal of Statistical Physics 192 (2025), 36.
[20] Z. Hou, J. Liu, and Y. Yu, Simulated annealing and weak Poincaré inequalities with inverse-polynomial accuracy for the Sherrington–Kirkpatrick model, 2026. Preprint, arXiv:2610.09882v1.
[21] M. Jerrum and A. Sinclair, Polynomial-time approximation algorithms for the Ising model, SIAM Journal on Computing 22 (1993), no. 5, 1087–1116.
[22] M. R. Jerrum, L. G. Valiant, and V. V. Vazirani, Random generation of combinatorial structures from a uniform distribution, Theoretical Computer Science 43 (1986), 169–188.
[23] H. Lee, J. S. Sandhu, and J. Shi, Potential Hessian ascent IV: sampling the Sherrington–Kirkpatrick model at , 2026. Preprint, arXiv:2609.30590v1.
[24] H. Lee and Q. Wu, Sampling from the continuous random energy model in total variation distance, 2025. To appear in The Annals of Applied Probability. arXiv:2407.00868v2.
[25] L. Li, P. Lu, and Y. Yin, Correlation decay up to uniqueness in spin systems, Proceedings of the 24th annual ACM-SIAM symposium on discrete algorithms, 2013, pp. 67–84.
[26] J. Liu, A. Sinclair, and P. Srivastava, The Ising partition function: Zeros and deterministic approximation, Journal of Statistical Physics 174 (2019), 287–315.
[27] E. Mossel, K. Oleszkiewicz, and A. Sen, On reverse hypercontractivity, Geometric and Functional Analysis 23 (2013), no. 3, 1062–1097.
[28] OpenAI, A spectral gap throughout the high-temperature Sherrington–Kirkpatrick phase, 2026. OpenAI mathematics release preprint, September 24, 2026. Repository snapshot 1581d4c, accessed October 14, 2026.
[29] D. Panchenko, The Parisi formula for mixed p-spin models, The Annals of Probability 42 (2014), no. 3, 946–958.
[30] V. Patel and G. Regts, Deterministic polynomial-time approximation algorithms for partition functions and graph polynomials, SIAM Journal on Computing 46 (2017), no. 6, 1893–1919.
[31] A. Schmidhuber and A. Zlokapa, Polynomial-time classical algorithms for mean-field models up to the glass transition, 2026. Preprint, arXiv:2610.06807v1.
[32] M. Talagrand, The Parisi formula, Annals of Mathematics 163 (2006), no. 1, 221–263.
[33] S. Wang, Optimal mixing of Glauber dynamics for the Sherrington–Kirkpatrick model at β < 1/2, 2026.