We study deterministic relative approximation of the total variation distance between two Gibbs distributions induced by spin systems on the same bounded-degree graph. For the hard-core model, we give a deterministic polynomial-time ε-relative-error approximation when both external-field vectors lie in [b,(1−η)λc(Δ)]V, where b>0 and η∈(0,1) are fixed and λc(Δ) is the hard-core uniqueness threshold. For the Ising model, we obtain deterministic polynomial-time algorithms in two settings: the ferromagnetic Lee–Yang regime and the antiferromagnetic correlation-decay regime. We develop a new deterministic framework that reduces this task to estimating suitably chosen partition functions.
1 Introduction
The total variation distance is a fundamental measure of the difference between two probability distributions. For distributions μ and ν on a finite set Ω, it is defined by
dTV(μ,ν)=21σ∈Ω∑∣μ(σ)−ν(σ)∣.
It can be evaluated in O(∣Ω∣) time when both probability tables are given explicitly. The problem becomes interesting when both high-dimensional distributions admit succinct descriptions. This setting, however, already gives rise to strong complexity barriers. Sahai and Vadhan [SV03] proved that the statistical-difference problem for circuit-generated distributions is complete for statistical zero knowledge. Bhattacharyya et al. [BGM +23] showed that exact TV-distance computation is #P-complete even for Boolean product distributions, and that relative approximation is NP-hard for Bayesian networks. More recently, Bhattacharyya et al. [BGM +25] proved that, unless NP ⊆ RP, no FPRAS exists for the TV-distance problem over arbitrary Ising-model inputs.
These barriers make structured distribution families the natural setting in which to design approximation algorithms. Product distributions provide the first example: Bhattacharyya et al. [BGM +23] obtained an FPTAS for a restricted Boolean case. This restriction was later removed, first through an FPRAS for general product distributions [FGJW23] and then through an FPTAS [FLL24]. For two Bayesian networks defined over the same DAG, Bhattacharyya et al. [BGM +24] reduced relative TV-distance approximation to probabilistic inference, yielding an FPRAS whenever exact inference is efficient. For mixtures of product distributions, Bhattacharyya et al. [BGM +25] gave a polynomial-time algorithm to decide whether the TV distance is zero, and Feng et al. [FFYZ26] further gave an FPRAS for relative TV-distance approximation for a constant number of mixture components.
For spin systems, Feng et al. [FLY25] reduced relative TV-distance approximation to sampling and approximate counting. The resulting FPRAS applies to the hard-core model throughout the
*School of Computer Science and Technology, University of Science and Technology of China, email: meguru@mail.ustc.edu.cn.
†School of Computing and Data Science, The University of Hong Kong, email: ymjessen02@connect.hku.hk.
constant-gap uniqueness regime and, under a constant marginal lower bound, to Ising models in the spectral, ferromagnetic consistent-field, and antiferromagnetic uniqueness regimes. Feng and Fu [FF26] gave randomized polynomial-time algorithms for relative approximation of several f-divergences between Ising models in suitable parameter regimes.
In this paper, we study deterministic polynomial-time ε-relative-error approximation of the TV distance between two bounded-degree spin systems, including the hard-core model and the Ising model. Our framework reduces the problem to deterministically approximating suitable partition functions at real and complex activities.
1.1 Main results
1.1.1 Models and problems
Let G=(V,E) be a finite simple graph, write n=∣V∣, and set ΣV={−1,+1}V. A binary spin system S on G assigns a nonnegative weight wS(σ) to each configuration σ∈ΣV. If at least one configuration has positive weight, its partition function and Gibbs distribution are defined by
ZS=τ∈ΣV∑wS(τ),μS(σ)=ZSwS(σ),σ∈ΣV.
We consider the following two spin systems.
Hard-core model. Let λ=(λv)v∈V∈R≥0V be a vector of vertex activities. For σ∈ΣV, define
I(σ)={v∈V:σv=+1}.
The configuration σ is feasible if I(σ) is an independent set of G. The hard-core model (G,λ) has weight function
Ising model. Let β>0 be an edge activity and let λ=(λv)v∈V∈R>0V be a vector of vertex activities. For σ∈ΣV, let
DG(σ)={{u,v}∈E:σu=σv}.
The Ising model (G,β,λ) has weight function
wβ,λ(σ)=β∣DG(σ)∣v:σv=+1∏λv,σ∈ΣV.
For z∈CV, the notation ZG(β,z) denotes the same partition function polynomial with the vertex activities replaced by z. Under this parametrization, the model is ferromagnetic for 0<β<1, has independent spins for β=1, and is antiferromagnetic for β>1.
We compare two systems of the same type on the same graph and consider the following two problems.
Problem 1.1 (Hard-core TV-distance approximation).
Input: A finite simple graph G=(V,E), two activity vectors λμ,λν∈R>0V, and an error bound ε∈(0,1). These specify two hard-core Gibbs distributions μ=μG,λμ and ν=μG,λν.
• Output: A nonnegative real number d^ such that
(1−ε)dTV(μ,ν)≤d≤(1+ε)dTV(μ,ν).
Problem 1.2 (Ising TV-distance approximation).
Input: A finite simple graph G=(V,E), an edge activity β>0, two vertex-activity vectors λμ,λν∈R>0V, and an error bound ε∈(0,1). These specify two Ising Gibbs distributions μ=μG,β,λμ and ν=μG,β,λν.
• Output: A nonnegative real number d such that
(1−ε)dTV(μ,ν)≤d≤(1+ε)dTV(μ,ν).
1.1.2 Our results
Hard-core model. For Δ≥3, write
λc(Δ)=(Δ−2)Δ(Δ−1)Δ−1
for the hard-core uniqueness threshold on the infinite Δ-regular tree.
Theorem 1.3 (Main theorem). Fix Δ≥3, η∈(0,1), and b>0, and let r=(1−η)λc(Δ). If b<r, then there is a deterministic algorithm for Problem 1.1 on instances in which G has maximum degree at most Δ and
λμ,λν∈[b,r]V.
Its running time is
polyΔ,η,b(n,ε1),n=∣V∣.
An explicit running-time bound is given in (41). The output is 0 if and only if λμ=λν.
Ising model. The first result for the Ising model uses the multivariate Lee–Yang zero-free region [LY52, LSS17].
Theorem 1.4 (Lee–Yang zero-free regime). Fix an integer Δ≥1 and constants 0<β≤1 and 0<b<r<1. There is a deterministic algorithm for Problem 1.2 on instances in which G has maximum degree at most Δ and either
λμ,λν∈[b,r]V
or
λμ,λν∈[r−1,b−1]V.
Its running time is
polyΔ,β,b,r(n,ε1),n=∣V∣.
An explicit running-time bound is given in (24). The output is 0 if and only if λμ=λν.
We next describe the antiferromagnetic parameter region. Fix Δ≥3 and β>1 with β=Δ/(Δ−2). Following Sinclair et al. [SST12] and Liu et al. [LSS25], let
be the strict correlation-decay region on the infinite Δ-regular tree, where λc(β,Δ)>1 is the critical external field in the second case. For the critical-field characterization, see [Geo11, pp. 254–255] and its complete definition in [SST12].
Theorem 1.5 (Antiferromagnetic correlation-decay regime). Fix an integer Δ≥3 and a constant β>1 with β=Δ/(Δ−2). Let [λ−,λ+] be a fixed nonempty closed interval contained in one connected component of Uβ,Δ. There is a deterministic algorithm for Problem 1.2 on instances in which G has maximum degree at most Δ and
λμ,λν∈[λ−,λ+]V.
Its running time is
polyΔ,β,λ−,λ+(n,ε1),n=∣V∣.
An explicit running-time bound is given in (64). The output is 0 if and only if λμ=λν.
1.2 Related work
TV-distance approximation. Earlier work [BGMV20, CK14, Kie18, CR14] studied algorithms and hardness for additive-error approximation of TV distance, a weaker guarantee than relative accuracy when the distance may be small. A separate line of work [DMR18, AAL23, Kon24, AK24] obtained explicit estimates with fixed relative-accuracy guarantees for structured high-dimensional distributions.
Partition-function approximation. Our reduction uses deterministic partition-function approximation. For the hard-core model, Weitz [Wei06] introduced the self-avoiding-walk tree and correlation-decay method and obtained an FPTAS for uniform activity below λc(Δ). Harvey et al. [HSV18] gave a deterministic algorithm for complex external fields lying a fixed multiplicative distance inside the Shearer region; in particular, it applies when ∣zv∣≤(1−η)λs(Δ) for every vertex and a fixed η>0. However, Bezáková et al. [BGGŠ18] showed that, for some complex activities with modulus between λs(Δ) and λc(Δ), approximating the hard-core partition function is #P-hard. More generally, Patel and Regts [PR17] showed how zero-free regions for a broad class of bounded-degree graph polynomials lead to deterministic approximation algorithms. Liu et al. [LSS25] further connected real correlation decay with zero-freeness in scalar complex neighborhoods; the nonuniform complex approximation used here is obtained by the coordinatewise extensions developed in later sections.
For the Ising model, Jerrum and Sinclair [JS93] gave the classical FPRAS for the ferromagnetic partition function. Sinclair et al. [SST12] and Li et al. [LLY13] developed deterministic correlation-decay algorithms for antiferromagnetic two-spin systems throughout the interior of the tree-uniqueness region. In the ferromagnetic setting, Liu et al. [LSS17] used Lee–Yang zero-freeness to obtain a deterministic FPTAS on bounded-degree graphs away from zero field.
2 Technical overview
We use the hard-core model to illustrate the common reduction. Fix 0<b<r<∞, let G=(V,E) have maximum degree at most Δ, write n=∣V∣, and let λμ,λν∈[b,r]V be two distinct activity vectors. Let μ=μG,λμ and ν=μG,λν, and write Ω for their common feasible support. We abbreviate Z(λ)=ZG(λ), interpret vector logarithms coordinatewise, and, for x∈R, write x+=max{x,0}. The total variation distance can be expressed as
Combining (1) and (2) gives the normalized identity
sdTV(μ,ν)=Eσ∼μgs(A(σ)−c).(3)
This normalization is important when the two activity vectors are very close. The function gs is 1-Lipschitz, uniformly in s, and 0≤gs(x)≤(−x)+.
The common deterministic reduction. There are two quantities to estimate in (3): the unknown center c and the expectation Eμ[gs(A−c)]. Consider the coordinatewise geometric path
λv(t)=(λvμ)1−t(λvν)t=λvμetsav,t∈[0,1],
and let πt=μG,λ(t). Differentiating the log partition function along this path gives
Consequently, if we can deterministically approximate the marginal probabilities Pσ∼πt(σv=+1) for all v∈V and t∈[0,1] to additive error δ, then we can choose a polynomial number of uniformly spaced points t in [0,1] and take the average of the corresponding m(t)-values. This gives a deterministic additive approximation c to c with additive error O(δn). Projecting c onto [−n,n] cannot increase this error.
To implement the marginal oracle, we use deterministic partition-function approximation for positive real external fields. Correlation-decay algorithms provide the required relative approximations when all activities lie a fixed distance below the uniqueness threshold [Wei06, LLY13].
To estimate the remaining expectation deterministically, apply the constructive Jackson approximation from [DL93] to
F(x)=gs(x−c),x∈[−n,n].
For any desired additive accuracy δ∈(0,1), we construct a trigonometric polynomial
P(x)=∣k∣≤K∑αkeitkx,K=O(n/δ),tk=2nπk,
which uniformly approximates F and whose coefficients have ℓ1-norm polynomially bounded in n and 1/δ. We also compute an estimate αk of each αk for ∣k∣≤K. Recall that Φμ,A(t)=Eσ∼μeitA(σ) is the characteristic function of A under μ. Expanding P and interchanging the two finite sums gives
The required characteristic-function values are themselves ratios of partition functions:
ΦμG,λ,A(t)=ZG(λ)ZG((λveitav)v∈V).(6)
For the Ising model, the same identity holds with the common edge activity β fixed in the numerator and denominator. The error in estimating the expectation in (3) comes from four sources:
The O(δn) additive error in the estimate c of c.
The additive error between F(x) and its trigonometric approximation P(x) for all possible x, which is guaranteed by the constructive Jackson approximation.
The additive error in estimating the coefficients αk by αk, which is also guaranteed by the constructive Jackson approximation.
The additive error in estimating the characteristic-function values.
To convert this additive guarantee into a relative one, in each of the parameter regimes in our theorems, our parameter-separation bounds show that
dTV(μ,ν)≥κs
for a positive constant κ depending only on the fixed model parameters. For the hard-core model one may take κ=b/5000; for the Ising model, uniform lower bounds on conditional spin probabilities give such a constant depending on Δ,β,b,r. Hence the normalized target
q=sdTV(μ,ν)
is at least κ, so additive accuracy O(εκ) suffices for an ε-relative approximation. Identical inputs are detected exactly and mapped to zero; otherwise we return d=smax{0,q}. It remains only to show how to implement the characteristic-function oracle in Item 4.
Regimes with a global complex oracle. To implement the characteristic-function oracle, we need to deterministically approximate the partition function at complex external fields. In the strict Shearer regime for the hard-core model, the known complex partition-function algorithm in [HSV18] applies to every z∈CV satisfying ∣zv∣≤r for all v∈V, where r=(1−η)λs(Δ). λs(Δ)=ΔΔ(Δ−1)Δ−1 is the Shearer threshold. Here η>0 is fixed, so the running-time dependence on the distance from the boundary is absorbed into the model-parameter dependence. Therefore, applying the algorithm directly to the complex vector gives a deterministic characteristic-function oracle. For the ferromagnetic Ising model, the multivariate Lee–Yang theorem gives zero-freeness whenever all complex activities have modulus at most a fixed r<1. The coefficient method of [LSS17] then supplies the same type of oracle; Section 5 gives the details.
From a local complex oracle to arbitrary phases. The main difficulty for the hard-core uniqueness regime is that the global polydisc oracle is restricted to moduli strictly below λs(Δ), whereas
λc(Δ)λs(Δ)=(ΔΔ−2)Δ<1.
It therefore does not in general cover the whole interval [b,(1−η)λc(Δ)]. In fact, Bezáková et al. [BGGŠ18] showed that, for some complex activities with modulus between λs(Δ) and λc(Δ), approximating the hard-core partition function is #P-hard.
We first obtain a local complex oracle: there is a constant θ0>0 such that, if
zv=λveiθv,λv∈[b,(1−η)λc(Δ)],∣θv∣≤θ0,
then the partition function is zero-free throughout this region and can be deterministically approximated to any prescribed relative error, uniformly over induced subgraphs. To prove this, we extend a result of Liu et al. [LSS25] to nonuniform external fields. We compute occupation ratios on the pruned Weitz self-avoiding-walk tree [Wei06]. For a tree vertex x, π(x) is the endpoint in G of the walk represented by x. Let Zx(s)(z) be the partition function of the subtree rooted at x, with inherited boundary conditions and x fixed to be occupied ( s=1) or unoccupied ( s=0). The occupation ratio and its update map are
If x is unpinned with children x1,…,xd, then Rx=Fzπ(x),d(Rx1,…,Rxd).
To control how errors propagate, set yx=φ(Rx), where φ(t)=2arcsinht and φ−1(y)=sinh2(y/2). The update becomes
Fz,dφ(y):=φ(Fz,d(φ−1(y1),…,φ−1(yd))).
Put r=(1−η)λc(Δ) and I=[0,φ(r)]. By the real contraction of Li et al. [LLY13] and compactness, there is a uniform η0>0 such that
Fa,dφ(y)−Fa,dφ(y′)≤(1−η0)∥y−y′∥∞
for a∈[b,r], y,y′∈Id, and d≤Δ−1. Thus, for a fixed activity, each non-root update reduces the largest error in its child values.
Following Liu et al. [LSS25], analyticity and compactness give a common complex neighborhood of [b,r] where contraction holds even when activities differ between vertices. For sufficiently small phases, the root perturbation bound gives ∣1+Rroot∣≥1/2 uniformly over induced subgraphs. Induction using the deletion identity then proves zero-freeness. Truncating the tree and reconstructing the partition function from these ratios yields deterministic relative approximation.
The characteristic-function queries, however, may contain arbitrary phases. Reduce a given phase vector θ coordinatewise modulo 2π to θ∈[−π,π]V. This reduction leaves the characteristic function unchanged. Set
zv=λveiθv(v∈V),
and define
W={v∈V:θv≥θ0/2}.
Our phase-damping lemma (Lemma 6.4) gives a constant γ>0, depending only on the fixed model parameters, such that
Eσ∼μG,λexp(iv∈V∑θv1{σv=+1})≤e−γ∣W∣.(7)
The intuition is that many large phases force cancellation. We select a constant fraction of the vertices in W whose neighborhoods do not interact. After conditioning on all spins outside these neighborhoods, the remaining blocks are independent. In each block, two configurations each have probability at least a fixed positive constant. Their complex contributions point in directions separated by at least a fixed positive angle, so they partially cancel. Repeating this over all selected blocks gives the exponential decay in (7).
To approximate the characteristic function to additive error δ, we consider two cases. If ∣W∣>γ−1log(8/δ), then (6) and (7) show that the numerator satisfies
∣ZG(z)∣<8δZG(λ).
Hence the characteristic function is close to zero, so we simply return zero. Otherwise, ∣W∣=O(log(1/δ)), and we approximate the numerator ZG(z) using the following decomposition. For each J∈I(G[W]), set HJ=G−(W∪NG(J)). Then
ZG(z)=J∈I(G[W])∑zJZHJ(z∣V(HJ)).(8)
Here I(G[W]) is the family of independent subsets of W, NG(J) is the open neighborhood of J, and zJ=∏v∈Jzv. All fields in the residual partition functions have phase magnitude less than θ0/2, so the local oracle applies to every term. Cancellation does not amplify the accumulated error, because positivity at the corresponding real activities gives
J∈I(G[W])∑zJZHJ(z∣V(HJ))≤ZG(λ).
There are at most
2∣W∣≤(8/δ)(log2)/γ≤polyΔ,η,b(1/δ)
terms. Relative approximation of the residual terms yields a numerator error of O(δ)ZG(λ). Dividing by a relative approximation to the positive-real denominator therefore yields the required additive all-frequency characteristic-function oracle. This damping-and-enumeration step is what allows us to use only local complex approximation while still reaching the full constant-gap uniqueness regime, proving Theorem 1.3.
3 Preliminaries
Let G=(V,E) be a finite simple graph, and write n=∣V∣. The family of independent sets of G is denoted by I(G). For U,S⊆V, let G[U] be the induced subgraph and write G−S=G[V∖S] (in particular, G−u=G−{u}). We write NG(u) for the open neighborhood of u, NG[u]=NG(u)∪{u}, and NG(S)=⋃u∈SNG(u). The edge boundary of S is
δG(S)={{u,v}∈E:∣{u,v}∩S∣=1}.
For a complex vector z=(zv)v∈V∈CV and S⊆V, write zS=∏v∈Szv. The independence polynomial is
ZG(z)=I∈I(G)∑zI.
For two probability distributions μ and ν on the same finite space Ω, their total variation distance is
dTV(μ,ν)=21x∈Ω∑∣μ(x)−ν(x)∣=A⊆Ωsup∣μ(A)−ν(A)∣.
For a probability distribution μ on Ω and a function A:Ω→R, the characteristic function of A under μ is
Φμ,A(t)=EX∼μeitA(X),t∈R.
For D⊆R and ℓ≥0, a function f:D→C is ℓ-Lipschitz if
∣f(x)−f(y)∣≤ℓ∣x−y∣(x,y∈D).
Throughout, we use the unit-cost real/complex arithmetic-oracle model: arithmetic and elementary-function evaluations have unit cost, and oracle calls are charged their stated running times. We do not consider bit complexity.
4 The deterministic framework
In this section, we isolate the part of the argument shared by the hard-core and Ising models. For the empty graph, both Gibbs distributions are concentrated on the unique empty configuration, so the algorithm returns zero in constant time. Henceforth in this section, assume n=∣V∣≥1. Throughout Sections 4.1 to 4.4, fix a graph G=(V,E) and, for the Ising model, also fix the edge activity β. Write Ω for the common support of the two measures: the feasible configurations for the hard-core model and {−1,+1}V for the Ising model. According to the model under consideration, write
wλ(σ),Z(λ),πλ(σ)=Z(λ)wλ(σ)
for wλ,ZG,μG,λ or for wβ,λ,ZG(β,⋅),μG,β,λ, respectively. In either case, changing only the external fields gives
wλ(σ)wλ′(σ)=v:σv=+1∏λvλv′.(9)
No additional representation of a configuration will be needed.
4.1 A deterministic Fourier expectation oracle
Lemma 4.1. Let y>0, x∈C, and ∣x∣≤y. If ε∈(0,1) and
∣x−x∣≤εy,∣y−y∣≤εy,
then
yx−yx≤1−ε2ε.
Proof. The lower bound ∣y∣≥(1−ε)y and the triangle inequality give
yx−yx≤∣y∣∣x−x∣+y∣y∣∣x∣∣y−y∣≤1−ε2ε.
For λ∈R>0V and real coefficients (av)v∈V, define
A(σ)=v:σv=+1∑av.
For every t∈R, expanding the partition function gives the common characteristic-function identity
Φπλ,A(t)=Z(λ)Z((λveitav)v∈V).(10)
Following the Jackson-kernel construction in [DL93, Chapter 7, Section 2], we give and analyze a deterministic algorithm for computing the coefficients needed in our application.
Lemma 4.2 (Constructive Jackson approximation). Let n≥1, let ε∈(0,1), and let F:[−n,n]→[0,2n] be 1-Lipschitz. Suppose that F can be evaluated exactly in time TF(n). Set
K=⌈ε24n⌉,tk=2nπk,∣k∣≤K.
There are coefficients αk for which
P(x)=∣k∣≤K∑αkeitkx
is real-valued and satisfies
x∈[−n,n]sup∣P(x)−F(x)∣≤4ε,∣k∣≤K∑∣αk∣≤6nK.(11)
Moreover, one can deterministically compute coefficients αk such that
∣k∣≤K∑∣αk−αk∣≤8ε.(12)
This takes
O(ε3n3[TF(n)+log(ε2n)])
time. In particular, the running time is poly(n,1/ε) whenever TF(n)=poly(n).
The proof is deferred to Appendix A.
The next lemma is the deterministic replacement for sampling.
Lemma 4.3. Let n=∣V∣≥1, let λ∈R>0V, write π=πλ, and let A(σ)=∑v:σv=+1av with ∣av∣≤1. Suppose that, for every t∈R and ε′∈(0,1), a deterministic characteristic-function oracle returns Φπ,A(t) satisfying
Φπ,A(t)−Φπ,A(t)≤ε′
in time Tϕ(n,ε′). Let F:[−n,n]→[0,2n] be 1-Lipschitz and exactly evaluable in time TF(n). Then, for every ε∈(0,1), one can deterministically compute M such that
M−Eσ∼πF(A(σ))≤ε
in time
O(ε3n3TF(n)+εnTϕ(n,96n⌈24n/ε⌉+2εε)).
Here O hides logarithmic factors in n and 1/ε.
Proof. Since ∣A(σ)∣≤n, we have A(σ)∈[−n,n]. Apply Lemma 4.2 with accuracy ε, and let K, tk, αk, and αk be as in that lemma. By (11) and (12),
Sα=∣k∣≤K∑∣αk∣≤6nK+ε/8.
Let ε′=ε/[16(6nK+ε/8)]. For every ∣k∣≤K, invoke the characteristic-function oracle with inputs tk and ε′. Define
where we used the fact that ∣Φπ,A(tk)∣≤1 for all k. By Lemma 4.2, computing the coefficients takes O(n3TF(n)/ε3) time. Since K=⌈24n/ε⌉, there are 2⌈24n/ε⌉+1=O(n/ε) oracle calls, each taking time Tϕ(n,ε′), and the remaining computation takes O(n/ε) time. The total running time is therefore
O(ε3n3TF(n)+εnTϕ(n,96n⌈24n/ε⌉+2εε)).
11
☐
4.2 Normalization and thermodynamic integration
Throughout this subsection, let n=∣V∣, let 0<b<r<∞, and let λμ,λν∈[b,r]V. Define μ=πλμ and ν=πλν. If the two vectors agree, then μ=ν and the algorithm returns 0. Hence assume they differ and define
esc lies between esminσ∈ΩA(σ) and esmaxσ∈ΩA(σ). Consequently,
c∈[σ∈ΩminA(σ),σ∈ΩmaxA(σ)]⊆[−n,n].(15)
Directly subtracting two approximate log partition functions would require precision proportional to s. The following lemma avoids this problem by giving a procedure for estimating c.
Lemma 4.4. For t∈[0,1], define the coordinatewise geometric path
Suppose in addition that G has maximum degree at most Δ and that, for every λ′∈[b,r]V, v∈V, and ε′∈(0,1), a deterministic marginal-probability oracle returns pv(λ′) satisfying
pv(λ′)−Pσ∼πλ′(σv=+1)≤ε′
in time Tp(n,ε′), with constants depending only on the fixed model parameters. Then, for every ε∈(0,1), one can deterministically compute c∈[−n,n] such that
∣c−c∣≤ε
in time
O(εn3Tp(n,8nε)),
with the same parameter dependence.
Proof. Let Z(t)=Z(λ(t)). Differentiating its finite sum gives
dtdlogZ(t)=sEσ∼πtA(σ).
Integration from 0 to 1, followed by division by s, proves (16). To see the second-derivative identity, define
Since ∣A(σ)∣≤n for every σ∈Ω, Varπt(A)≤n2. Finally, s≤log(r/b), which proves the stated derivative bound.
For the algorithmic assertion, let
Lm=log(r/b)n2,M=max{1,⌈ε2Lm⌉},tj=Mj,
for 0≤j<M. Let ε′=ε/(8n). For 0≤j<M and v∈V, use the marginal-probability oracle with inputs λ(tj), v, and ε′ to obtain pj,v satisfying
pj,v−Pσ∼πtj(σv=+1)≤ε′.
Define
mj=v∈V∑avpj,v,c0=M1j=0∑M−1mj.
The geometric path lies in [b,r]V, so every oracle call is valid. Since m is Lm-Lipschitz by (17), we have
∫01m(t)dt−M1j=0∑M−1m(tj)≤2MLm≤4ε.
Moreover, ∣av∣≤1 gives
∣mj−m(tj)∣≤nε′=8ε.
Consequently,
∣c0−c∣≤4ε+8ε=83ε<ε.
Projecting c0 onto [−n,n] gives c and cannot increase the error by (15).
The algorithm makes nM marginal-oracle calls, where
nM≤n+ε2log(r/b)n3=O(n3/ε).
Each call takes time Tp(n,ε/(8n)). Constructing the field vectors and computing the weighted sums take another O(nM) arithmetic operations. The total running time is therefore
O(εn3Tp(n,8nε)),
with the same parameter dependence.
13
☐
For s > 0, define
gs(x)=s(1−esx)+.
Lemma 4.5. The function gs is 1-Lipschitz on R and satisfies 0≤gs(x)≤(−x)+. Furthermore,
sdTV(μ,ν)=Eσ∼μgs(A(σ)−c).(18)
The random argument A(σ)−c lies in [−2n,2n], and the integrand lies in [0,2n].
Proof. Both Gibbs distributions are positive on their common support Ω, and hence
Substitution proves (18). If x<0, then gs′(x)=−esx, whose absolute value is at most one; if x>0, then gs(x)=0. Continuity at zero proves the Lipschitz claim. The inequality 1−e−u≤u for u≥0 gives gs(x)≤(−x)+. The range statements follow from (15) and A(σ)∈[−n,n].
4.3 A uniform lower bound after normalization
The normalized expectation in (18) must be bounded away from zero. The strict lower bound on the external fields supplies this fact.
Lemma 4.6. Let μ and ν be the two hard-core measures defined above. Suppose Δ≥3, G has maximum degree at most Δ, and all external fields in both systems lie in [b,r], where 0<b<r<λc(Δ). Then
dTV(μ,ν)≥κ0s,κ0=5000b.(19)
Consequently, the expectation in (18) is at least κ0.
Lemma 4.7 (Ising parameter separation). Fix an integer Δ≥0, β>0, and 0<b<r<∞. Set
β^=min{β,β−1},ρ=min{1+bβ^Δbβ^Δ,1+rβ^−Δ1}.
Suppose that G has maximum degree at most Δ and that λμ,λν∈[b,r]V. For the two corresponding Ising measures with the same edge activity β,
dTV(μ,ν)≥κIs,κI=4(Δ+1)ρ2.(20)
The following is the specialization of [FLY25, Lemma 15] to our parametrizations. Indeed, up to a configuration-independent factor, our Ising weights have Juv=−21logβ and hv=21logλv; hence the ρ2/2 bound there becomes the ρ2/4 bound below.
Lemma 4.8 ([FLY25], Lemma 15). (i) Under the assumptions of Lemma 4.6,
dTV(μ,ν)≥50001v∈Vmax∣λvμ−λvν∣.
(ii) Let μ=μG,β,λμ and ν=μG,β,λν be two Ising measures with the same edge activity β>0. Suppose that, for some ρ∈(0,1], after every partial pinning and for every vertex v left unpinned, both measures satisfy
Under any partial pinning that leaves v unpinned, its conditional spin probabilities are convex combinations of the displayed full-neighborhood conditional probabilities over the compatible configurations of NG(v). Thus both conditional spin probabilities remain at least ρ after every partial pinning. Applying Lemma 4.8(ii) with this value of ρ and using the definition of s gives
Proposition 4.9. Fix real numbers 0<b<r<∞ and one of the two model families described above. Suppose that there is a constant κ∈(0,1] such that, for every λμ,λν∈[b,r]V,
dTV(πλμ,πλν)≥κ∥logλν−logλμ∥∞.(21)
Suppose also that, for every λ∈[b,r]V and ε′∈(0,1), the following deterministic oracles are available, running in time Tp(n,ε′) and Tϕ(n,ε′), respectively, with constants depending only on the fixed model parameters.
(i) Given u∈V, the marginal-probability oracle returns p satisfying
∣p−Pσ∼πλ(σu=+1)∣≤ε′.
(ii) Given coefficients av∈[−1,1] and t∈R, define A(σ)=∑v:σv=+1av. The characteristic-function oracle returns Φπλ,A(t) satisfying
Φπλ,A(t)−Φπλ,A(t)≤ε′.
Then, for every λμ,λν∈[b,r]V and ε∈(0,1), the distance dTV(πλμ,πλν) can be deterministically approximated within relative error ε. The running time is
with the same dependence on the fixed model parameters. The output is zero if and only if λμ=λν.
Proof. The deterministic algorithm is as follows.
Compare λμ and λν exactly. If they agree, return 0.
Compute s, the coefficients av, and the statistic A as in Section 4.2. Let
ε′=16εκ.
Since 0<κ≤1, we have ε′∈(0,1).
Use the algorithmic assertion of Lemma 4.4, with the marginal-probability oracle in assumption (i), to compute c∈[−n,n] satisfying
∣c−c∣≤ε′.
Define
F(x)=gs(x−c),x∈[−n,n].
By Lemma 4.5, F is 1-Lipschitz and nonnegative, and F(x)≤(c−x)+≤2n. It is exactly evaluable in constant time in the stipulated arithmetic model. Apply Lemma 4.3, using the characteristic-function oracle in assumption (ii), to compute q satisfying
∣q−Eσ∼μgs(A(σ)−c)∣≤ε′.
Return
d=smax{0,q}.
For the analysis, define
q=Eσ∼μgs(A(σ)−c)=sdTV(μ,ν).
By (21), q≥κ. The 1-Lipschitz property of gs and the guarantee for c give
∣Eσ∼μgs(A(σ)−c)−q∣≤ε′.
Consequently,
∣q−q∣≤2ε′=8εκ≤8εq.
If the input vectors are distinct, then ε<1 and q≥κ imply q>0. Therefore
dTV(μ,ν)d−1=qq−1≤8ε≤ε.
Finally, applying Lemma 4.4 with ε′=εκ/16 gives O(n3/(εκ)) marginal-oracle calls, each with accuracy εκ/(128n). Since TF(n)=O(1), Lemma 4.3 uses O(n3/(εκ)3) time for the coefficients and O(n/(εκ)) characteristic-function oracle calls, each with accuracy 1536n⌈384n/(εκ)⌉+2εκεκ. The remaining operations take O(n) time. The complete algorithm therefore runs in time
We apply the framework of Section 4 to the ferromagnetic Ising model. The following lemma extends the deterministic approximation result of Liu, Sinclair, and Srivastava [LSS17, Theorem 1.1] from a uniform activity to nonuniform complex vertex activities.
Lemma 5.1. Fix an integer Δ≥1 and constants 0<β≤1 and 0<r<1. There are constants aLY,bLY≥1, depending only on Δ and r, and a deterministic algorithm with the following guarantee. Let H be any graph of maximum degree at most Δ, let z∈CV(H) satisfy
0<∣zv∣≤r(v∈V(H)),
and let ε∈(0,1). The algorithm returns a complex number ZH(β,z) satisfying
ZH(β,z)−ZH(β,z)≤ε∣ZH(β,z)∣
in time
OΔ,β,r((1+∣V(H)∣)aLYε−bLY).
The proof restricts the multivariate partition function to the univariate polynomial
Q(t)=ZH(β,(tzv)v∈V(H)).
It then combines the multivariate Lee–Yang theorem with the coefficient algorithm of Liu et al. For completeness, the details are given in Appendix B.
Corollary 5.2. Fix the constants in Lemma 5.1, let H have maximum degree at most Δ, and let λ∈[b,r]V(H), where 0<b<r<1. For every ε′∈(0,1), each of the following quantities can be deterministically approximated to additive error ε′ in time
OΔ,β,r((1+∣V(H)∣)aLY(ε′)−bLY):
(i) given u∈V(H), the positive-spin marginal
Pσ∼μH,β,λ(σu=+1);
(ii) given coefficients av∈[−1,1] and t∈R, the characteristic function
ΦμH,β,λ,A(t),A(σ)=v:σv=+1∑av.
Proof. For the first assertion, condition on σu=−1 and delete u. This replaces the external field λv of each neighbor v∈NH(u) by βλv. More precisely, for v∈V(H)∖{u}, set
λvu,−={βλv,λv,v∈NH(u),v∈/NH(u).
Then
Pσ∼μH,β,λ(σu=−1)=ZH(β,λ)ZH−u(β,λu,−).(22)
Since 0<β≤1, every coordinate of λu,− has modulus at most r. Apply Lemma 5.1 to the two partition functions in (22), with relative accuracy ε′/8. The exact ratio is a probability, so Lemma 4.1 gives additive error less than ε′. Taking the real part and projecting onto [0,1] cannot increase this error; if the resulting estimate is p−, return 1−p− for the positive-spin marginal in assertion (i).
Every twisted coordinate has modulus λv≤r. Relative approximations with accuracy ε′/8, followed by Lemma 4.1, therefore give the claimed additive approximation.
For the running time, let n=∣V(H)∣ and let TZ(n,δ) be a worst-case running-time upper bound for the partition-function algorithm in Lemma 5.1 on graphs with at most n vertices. Each marginal query uses two partition-function calls at relative accuracy ε′/8, together with OΔ(n+1) operations to construct the deleted graph and its fields. Each characteristic-function query likewise uses two calls at accuracy ε′/8, with O(n+1) operations to construct the twisted fields. Thus both oracle costs are bounded by
using the stated upper bound for TZ and aLY,bLY≥1. The bound for the characteristic-function oracle is uniform in t in the stipulated arithmetic model.
Proof of Theorem 1.4. First suppose that λμ,λν∈[b,r]V. Lemma 4.7 supplies a positive separation constant κI, while Corollary 5.2 supplies the marginal-probability and characteristic-function oracles along the entire geometric interpolation path. The common reduction gives the claimed multiplicative approximation. For the running time, write n=∣V∣≥1; the empty graph is handled in constant time. The marginal and characteristic-function accuracies in Proposition 4.9 are respectively Θ(εκI/n) and Θ((εκI)2/n2). Since κI is a positive constant depending only on Δ,β,b,r, substituting the bounds of Corollary 5.2 into that proposition gives
The two terms account for thermodynamic integration and characteristic-function queries, respectively. The Jackson coefficient cost O(n3/ε3) is absorbed by the second term, since aLY,bLY≥1. If bLY≥2, the second term also dominates the first.
Now suppose that λμ,λν∈[r−1,b−1]V. Global spin reversal satisfies
wβ,λ(−σ)=(v∈V∏λv)wβ,λ−1(σ).
It therefore maps μG,β,λ to μG,β,λ−1 and preserves total variation distance. The reciprocal external fields lie in [b,r]V, so the first case applies. Computing these reciprocal fields takes O(n) operations, which are absorbed by (24). The zero-output characterization follows from the common reduction in both cases.
6 The algorithm in the uniqueness regime
In this section, we verify the two oracle assumptions of Proposition 4.9 for
r=(1−η)λc(Δ).
Vertex-occupation marginals are obtained from a local complex neighborhood of the positive-real interval. Additive approximations to characteristic functions are obtained by combining phase damping with an enumeration of occupation patterns on the large-phase coordinates.
6.1 Local complex partition-function oracle
Lemma 6.1. Fix Δ≥3, η∈(0,1), and b>0, and let r=(1−η)λc(Δ). Assume b<r. There exist constants θ0=θ0(Δ,η,b)∈(0,π] and η0=η0(Δ,η,b)∈(0,1/2) and a deterministic algorithm with the following guarantee. Let H be any induced subgraph of a graph of maximum degree at most Δ, let λ∈[b,r]V(H), and suppose
zv=λveiθv,∣θv∣≤θ0(v∈V(H)).
Then ZH(z)=0, and, for every ε′∈(0,1), the algorithm returns a complex number ZH(z) such that
ZH(z)−ZH(z)≤ε′∣ZH(z)∣.
For m=∣V(H)∣≥1, its running time is
OΔ,η,b(m(ε′m)αHC),
where αHC=log(Δ−1)/[−log(1−η0)]>1. If m=0, the algorithm returns 1 in constant time.
We first introduce the self-avoiding-walk tree of Weitz [Wei06].
Lemma 6.2 ([Wei06]). Fix a finite graph G, an ordering of the neighbors of every vertex, and v∈V(G). One can construct a finite tree T=TSAW(G,v), rooted at x0, with the standard Weitz boundary condition and an endpoint map
π:V(T)⟶V(G),π(x0)=v,
so every tree vertex, and in particular every leaf, corresponds to a vertex of G and inherits its external field. Given a feasible pinning τ∈{−1,+1}Λ on Λ⊆V(G)∖{v}, stop a branch when it first reaches a vertex x with π(x)∈Λ and pin x to τ(π(x)). Denote this induced leaf pinning, together with the standard Weitz boundary condition, by τ. Then, for every vector λ of positive external fields, under the hard-core measures with the corresponding external fields,
P(visoccupiedinG∣τ)=P(x0isoccupiedinT∣τ).
Equivalently, the corresponding root occupation ratios RG,vτ and RT,x0τ satisfy RG,vτ=RT,x0τ. Indeed, the neighbor-by-neighbor telescoping argument is an identity of rational functions in formal vertex activities, so it also holds after nonuniform complex substitutions whenever all relevant denominators are nonzero. If G has maximum degree at most Δ, every non-root vertex of T has at most Δ−1 children.
Li et al. [LLY13] established correlation decay for the hard-core model throughout the uniqueness regime. Liu et al. [LSS25, Section 2.3] subsequently lifted this analysis to a small complex neighborhood, obtaining both zero-freeness and complex correlation-decay estimates. Building on these results, we derive below a deterministic approximation algorithm for the partition function, uniformly for the nonuniform external fields considered here.
Proof of Lemma 6.1. For positive real external fields, consider the pruned SAW tree. We use the standard convention that an occupied boundary leaf forces its parent to be unoccupied, after which that parent's descendants are discarded; hence every remaining pinned vertex has occupation ratio Rx=0. For each remaining tree vertex x, let Tx be the descendant subtree rooted at x, with the inherited external fields and boundary condition, and let pxTx(s) be the marginal probability that the occupation indicator of x equals s∈{0,1} in Tx. Thus s=1 corresponds to spin +1 (occupied), and s=0 corresponds to spin -1 (unoccupied). Its occupation ratio Rx is
Rx:=pxTx(0)pxTx(1).
If an unpinned vertex x has children x1,…,xd, then
Put I=[0,φ(r)]. By [LSS25, Theorem 2.14], for each a∈[b,r] and d≤Δ−1,
∇Fa,dφ(y)1<1−ηa,d(y∈Id),
where the case d=0 is immediate. The function on the left is continuous, [b,r]×Id is compact, and there are only finitely many d. Consequently, there is a single η0=η0(Δ,η,b)∈(0,1/2) for which
∇Fa,dφ(y)1≤1−2η0(a∈[b,r],y∈Id,d≤Δ−1).(27)
Notice that this is a local estimate: a is the external field of the current vertex, so the children may have different external fields.
For real a∈[b,r], yj∈I, and d≤Δ, we also have
(1+r)db≤Fa,d(φ−1(y1),…,φ−1(yd))≤r.
For 0≤d≤Δ, put
Kd:=[b,r]×Id.
Each Kd is compact, and there are only finitely many d. Since φ−1(I)=[0,r], for (a,y)∈Kd we have
Thus the square-root and arcsinh arguments in (26) lie in compact subsets of (0,∞) on the real sets Kd, while the denominators cosh(yj/2) are bounded away from zero. After shrinking the neighborhoods of these sets, the arguments remain in the open right half-plane, where we take the principal square root and the principal arcsinh. Hence the maps Fz,dφ are jointly analytic on a common open neighborhood of the finitely many sets Kd.
With η0 fixed as in (27), continuity of the gradients, the compactness of each Kd, and the finite number of possible values of d allow us to choose uniform constants ρ,δ>0 so that the corresponding closed tubes remain in this common analytic neighborhood and the first bound below holds. Let
Dρ:={y∈C:dist(y,I)≤ρ}.
After fixing ρ and δ, choose C=C(Δ,η,b)≥1 large enough to bound uniformly the relevant z-derivatives and message derivatives of Fz,dφ, as well as (φ−1)′. If a∈[b,r], ∣z−a∣≤δ, and y∈Dρd, the maps in (26) are analytic on a neighborhood of these points and
After decreasing ρ if necessary, φ−1 is C-Lipschitz on Dρ and
1+φ−1(y)=cosh2(y/2)=0(y∈Dρ).(31)
This establishes the uniform compactness-and-analyticity step needed for the nonuniform external fields and the boundary message 0.
Fix u∈V(H), construct TSAW(H,u), and denote its root by x0, so that π(x0)=u. Starting at its leaves, let yxR and yx be the transformed recursion values obtained from (26) using, respectively, λπ(x) and zπ(x); a remaining pinned leaf has transformed recursion values yx=yxR=0. Set
ξ:=v∈V(H)max∣zv−λv∣≤rθ0,t:=η0Cξ.
Choose θ0∈(0,π] so small that
rθ0≤δ,η0Crθ0≤2ρ.
Proceed by induction from the leaves. Let x be a non-root vertex and assume that yxj∈Dρ and yxj−yxjR≤t for every child xj. Set
Here and below, a maximum over no children is understood to be zero. The last equality uses t=Cξ/η0. Moreover, t≤ρ/2 and yxR∈I, so yx∈Dρ. This completes the induction.
The root may have Δ children. Using (29) and (30) at this final update gives
yx0−yx0R≤C(t+ξ).
Decrease θ0, if necessary, so that
Crθ0(η0C+1)≤ρ.
Then the displayed root error is at most ρ; since yx0R∈I, it follows that yx0∈Dρ. We may now use the Lipschitz property of φ−1 to obtain a constant C0=C0(Δ,η,b) such that the recursive root ratios Rx0(z):=φ−1(yx0) and Rx0(λ):=φ−1(yx0R) satisfy
Rx0(z)−Rx0(λ)≤C0ξ.
Decrease θ0 once more so that C0rθ0≤1/2. Equations (31) and (26) show that all recursive ratios Rx(z) at unpinned vertices satisfy the ordinary ratio recurrence with nonzero denominators. Moreover, since Rx0(λ)≥0,
We now use the induction pattern underlying [LSS25, Theorem 2.16]. That theorem is stated for a common external field; the following argument proves the coordinatewise extension. The only change is to replace the scalar pair at a tree vertex x by (λπ(x),zπ(x)), for which the uniform estimates above give (32).
For completeness, induct on the number of vertices of an induced subgraph J. If J is nonempty and u∈V(J), again denote the root of the SAW tree for (J,u) by x0. The induction hypothesis makes
RJ,u(z):=zuZJ−u(z)ZJ−NJ[u](z)
well defined. For every recursive state (K,w) below the root of this SAW tree, K,K−w, and K−NK[w] are proper induced subgraphs of J. Hence the induction hypothesis gives ZK(z),ZK−w(z),ZK−NK[w](z)=0, and
1+RK,w(z)=ZK−w(z)ZK(z)=0.
Thus every denominator in the complex SAW recurrence is nonzero, and its boundary values and updates agree with those defining the recursive ratios Rx(z). The complex SAW-tree identity therefore identifies RJ,u(z) with Rx0(z). Hence (33) and the deletion identity give
ZJ(z)=ZJ−u(z)(1+RJ,u(z))=0.
The empty graph starts the induction. Thus the same θ0 gives zero-freeness for every admissible induced subgraph.
It remains to describe the approximation algorithm. To approximate RH,u(z), truncate the pruned SAW tree at depth L≥1. Set yx=yxR=0 at every new leaf and apply the recursions toward the root. The real values stay in I. The preceding comparison with the real recursion therefore shows that all complex values stay in Dρ; the root is again handled separately. Put
B:=y∈Dρsup∣y∣<∞.
At each new leaf created by the truncation, setting its transformed recursion value to zero introduces an error of at most B. From these leaves up to the root, the exact and truncated recursions use the same external fields, so there is no external-field perturbation term: each of the L−1 non-root levels contracts the discrepancy by 1−η0, while the root map and φ−1 are uniformly Lipschitz. Thus the error is bounded by a constant times (1−η0)L−1. Absorbing (1−η0)−1 into the constant, we obtain an A=A(Δ,η,b)≥1 such that
RH,u(z)−RH,u(z)≤A(1−η0)L.(34)
Let m=∣V(H)∣. If m=0, return 1. Otherwise, order the vertices as v1,…,vm and let Hj=H−{v1,…,vj−1}. Repeated use of the deletion identity gives
vertices before pruning. Generate the truncated tree directly by a depth-first traversal, keeping the current path and fixed neighbor orders. At each node, scanning the path to detect closed cycles and determine their Weitz boundary conditions takes OΔ(L) time. An occupied boundary leaf pins its parent to zero, so that parent's descendants need not be generated. Each recursion update takes OΔ(1) arithmetic operations. Preparing each induced subgraph Hj costs OΔ(m) time even if it is built afresh. Thus the m ratio computations and the final product take
OΔ(m2+mL(Δ−1)L)
time. Put
αHC=−log(1−η0)log(Δ−1)>1.
By the choice of L,
(Δ−1)L≤(Δ−1)(ε′8Am)αHC.
Since A and η0 depend only on Δ,η,b, L=OΔ,η,b(log((m+1)/ε′)), and αHC>1, the total running time is
OΔ,η,b(m(ε′m)αHC),
as claimed.
Corollary 6.3. Under the hypotheses and notation of Lemma 6.1, let u∈V(H), write m=∣V(H)∣≥1, and let λ∈[b,r]V(H). For every ε′∈(0,1), the occupation probability Pσ∼μH,λ(σu=+1) can be approximated to additive error ε′ in time
OΔ,η,b(m1+αHC(ε′)−αHC).
Proof. For positive external fields,
p=Pσ∼μH,λ(σu=+1)=λuZH(λ)ZH−NH[u](λ).
Set
x:=λuZH−NH[u](λ),y:=ZH(λ),
so that p=x/y. Apply Lemma 6.1, with all phases zero, to the two partition functions with relative accuracy ε′/8. Let x be λu times the approximation to ZH−NH[u](λ), and let y be the approximation to ZH(λ). Then ∣x−x∣≤(ε′/8)x≤(ε′/8)y and ∣y−y∣≤(ε′/8)y. Since p≤1, Lemma 4.1 gives error less than ε′. Taking the real part and projecting it onto [0,1] cannot increase the error. Constructing H−NH[u] and the restricted field vector takes OΔ(m) time. There are two partition-function oracle calls, each with relative accuracy ε′/8 on a graph with at most m vertices; an empty residual graph is handled in constant time. By Lemma 6.1, these calls take total time
OΔ,η,b(m(ε′8m)αHC).
The remaining arithmetic takes constant time, so the preprocessing and both oracle calls are covered by the stated bound.
6.2 All-phase characteristic-function oracle
Lemma 6.4. Fix an integer Δ≥0 and real numbers 0<b<r<∞. Let G=(V,E) have maximum degree at most Δ, let λ∈[b,r]V, and let θ=(θv)v∈V∈[−π,π]V. Fix α∈(0,π] and let Wα={v∈V:∣θv∣≥α}. There is a constant γ=γ(Δ,b,r,α)>0 such that
Proof. Greedily choose a maximal set S⊆Wα in which every pair of distinct vertices is at graph distance at least four. A radius-three ball contains at most
DΔ=1+Δ+Δ(Δ−1)+Δ(Δ−1)2
vertices, so maximality gives ∣S∣≥∣Wα∣/DΔ.
For v∈S, let Bv=NG[v]. These blocks are pairwise disjoint, and no edge joins two different blocks; otherwise their centers would be at distance at most three. Let σ∼μG,λ, and let Fout be the sigma-algebra generated by the spins outside ⋃v∈SBv. Conditional on any feasible configuration of these outside spins, the conditional Gibbs distribution factors across the blocks. Inside Bv, both the all-negative configuration and the configuration in which only v is positive remain feasible. The conditional block partition function is at most (1+r)∣Bv∣≤(1+r)Δ+1, so each of these two configurations has conditional probability at least
p0=(1+r)Δ+1min{1,b}.
For the conditional spins in Bv, define
Uv=exp(iu∈Bv:σu=+1∑θu),
and, conditional on Fout, let Uv′ be an independent copy of Uv. Let Av be the event that all spins in Bv are negative, and let Cv be the event that v is positive and every other spin in Bv is negative. By the preceding paragraph,
P(Av∣Fout),P(Cv∣Fout)≥p0.
Moreover, Uv=1 on Av and Uv=eiθv on Cv. Since ∣Uv∣=1 and the two copies are conditionally independent,
Indeed, the inequality keeps only the two ordered cases in which one copy is in Av and the other is in Cv. The last inequality follows from v∈S⊆Wα and θv∈[−π,π]. Since p0<1/2, every conditional characteristic-function factor has modulus at most
ρ=1−4p02sin2(α/2),0<ρ<1.
Conditional independence shows that the conditional product of all block factors has modulus at most ρ∣S∣. The phase outside the blocks is Fout-measurable and has modulus one, and averaging over Fout cannot increase the bound. Hence (36) holds with γ=−log(ρ)/DΔ.
Lemma 6.5. Fix Δ≥3, η∈(0,1), and b>0, and let r=(1−η)λc(Δ). Assume b<r. Let G=(V,E) have maximum degree at most Δ, write n=∣V∣, let λ∈[b,r]V, and let θ=(θv)v∈V be a vector of real phases. For every ε′∈(0,1), there is a deterministic algorithm returning a complex number Φλ(θ) such that
Let T(n,δ)≥n bound the running time of the algorithm in Lemma 6.1 on graphs with at most n vertices and relative accuracy δ. For n≥1, the running time is
OΔ,η,b((ε′1)(log2)/γT(n,64ε′)),
where θ0 is as in Lemma 6.1, and γ>0 is the damping constant from Lemma 6.4 with α=θ0/2. If n=0, the algorithm returns 1 in constant time.
Proof. If n=0, return 1. Otherwise, assume n≥1. Write
Φλ(θ)=Eσ∼μG,λexp(iv∈V∑θv1{σv=+1}).
Let θ=(θv)v∈V∈[−π,π]V be the coordinatewise principal representative of θ. Since the integrand is 2π-periodic in every coordinate, Φλ(θ)=Φλ(θ). Define the large-phase set
W={v∈V:θv≥θ0/2},
where θ0 is the local-tube radius from Lemma 6.1. Thus the phase at every vertex outside W has modulus strictly less than θ0/2, whereas the phases at vertices in W have distance at least θ0/2 from 2πZ.
Apply Lemma 6.4 with θ and α=θ0/2, and let γ>0 be its damping constant. Define
K=⌈γ−1log(8/ε′)⌉.
If ∣W∣>K, the algorithm returns zero. By (36) and the equality Φλ(θ)=Φλ(θ),
∣Φλ(θ)∣≤e−γ∣W∣<ε′/8.
It remains to consider ∣W∣≤K. Define zv=λveiθv and partition the feasible configurations according to J={v∈W:σv=+1}. For every J∈I(G[W]), define
HJ=G−(W∪NG(J)).
Then the exact decomposition is
ZG(z)=J∈I(G[W])∑zJZHJ(z∣V(HJ)).(38)
Every vertex of HJ is outside W, so its phase is at most θ0/2 in modulus. The safety margin in Lemma 6.1 therefore applies to every internal partition function in (38).
Relative errors in these terms are not amplified by cancellation. Indeed,
The equality is the positive-real version of the same decomposition according to the positive spins in W. Approximate every internal complex partition function to relative error ε′/64. Summing these errors and using (39) bounds the total additive error in the numerator by (ε′/64)ZG(λ). Approximate the positive denominator ZG(λ) to the same relative accuracy. More explicitly, define
Zθ=ZG(z),Z0=ZG(λ),
let Zθ be the enumerated sum of the approximate internal partition functions, and let Z0 be the denominator approximation. Since Φλ(θ)=Zθ/Z0, the algorithm returns Φλ(θ)=Zθ/Z0. Then Zθ−Zθ≤(ε′/64)Z0, Z0−Z0≤(ε′/64)Z0, and ∣Zθ∣≤Z0. Lemma 4.1 bounds the quotient error by 2(ε′/64)/(1−ε′/64)≤ε′/16.
There are at most
2∣W∣≤2K=2⌈γ−1log(8/ε′)⌉≤2(ε′8)(log2)/γ
(40) subsets to inspect. The algorithm enumerates them, discards those that are not independent, constructs HJ, and invokes the local partition-function oracle. The principal-phase reduction and construction of W take OΔ(n) time. Inspecting each subset, constructing HJ, and computing zJ take OΔ(n) time per subset. There are at most 2∣W∣ internal oracle calls and one denominator call. Each call uses relative accuracy ε′/64 on a graph with at most n vertices, and therefore takes at most T(n,ε′/64) time, with empty graphs handled in constant time.
The work outside the oracle calls takes OΔ(n2∣W∣) time. By (40), the total running time is
OΔ,η,b((ε′1)(log2)/γT(n,64ε′)).
Corollary 6.6. Fix Δ≥3, η∈(0,1), and b>0, and let r=(1−η)λc(Δ). Assume b<r. Let G=(V,E) have maximum degree at most Δ, write n=∣V∣, let λ∈[b,r]V, let μ=μG,λ, and let av∈[−1,1] and A(σ)=∑v:σv=+1av. For every real frequency t and every ε′∈(0,1), one can deterministically compute Φμ,A(t) satisfying
Φμ,A(t)−Φμ,A(t)≤ε′
in time
OΔ,η,b(n1+αHC(ε′)−(αHC+χHC))(n≥1),
where
αHC:=−log(1−η0)log(Δ−1)>1,χHC:=γlog2
and η0 is as in Lemma 6.1, while γ is the damping constant in Lemma 6.5. Both exponents depend only on Δ, η, b. If n=0, the algorithm returns 1 in constant time.
Proof. Use Lemma 6.5 with θv=tav and denote its output by Φμ,A(t). (10) identifies the requested characteristic function with the corresponding partition-function ratio. The all-phase oracle reduces the phases modulo 2π internally. For n≥1, constructing the phase vector takes O(n) time, followed by one call to the all-phase oracle with additive accuracy ε′. Combining its enumeration bound with Lemma 6.1 gives total time
O(n)+OΔ,η,b((ε′)−χHCn(ε′64n)αHC),
which is the claimed bound. When n=0, the statistic is identically zero, so its characteristic function is 1.
6.3 Proof of Theorem 1.3
Proof of Theorem 1.3. Let r=(1−η)λc(Δ). Corollary 6.3, obtained by specializing Lemma 6.1 to zero phase, supplies the marginal-probability oracle required by Proposition 4.9. Corollary 6.6, based on the all-phase construction in Lemma 6.5, supplies the characteristic-function oracle required there. Both guarantees are uniform for graphs of maximum degree at most Δ and external fields in [b,r]. The separation hypothesis holds with κ=b/5000 by Lemma 4.6.
Applying Proposition 4.9 now gives the stated deterministic multiplicative approximation. For its running time, assume n≥1 and put q=εκ. The two oracle accuracies in that proposition are
The thermodynamic-integration and Fourier-coefficient costs are OΔ,η,b(n4+2αHC/ε1+αHC) and O(n3/ε3), respectively. Both are dominated by the cost of the characteristic-function queries. Indeed, with the phase threshold θ0/2≤π/2, the choice in the proof of Lemma 6.4 has ρ>1/2 and hence γ=−log(ρ)/DΔ<log2, so χHC>1. Together with αHC>1, n≥1, and ε<1, this gives the total running time
OΔ,η,b(ε1+2αHC+2χHCn2+3αHC+2χHC),(41)
where κ=b/5000 has been absorbed into the dependence on the fixed parameters. Since αHC and χHC also depend only on these parameters, this is polyΔ,η,b(n,1/ε). If n=0, the two input field vectors are empty and the algorithm returns 0 in constant time. The positivity argument in the proof of Proposition 4.9 gives the zero-output characterization. This completes the proof.
7 The antiferromagnetic Ising correlation-decay regime
Throughout this section, fix Δ≥3 and β>1 with β=Δ/(Δ−2), and let [λ−,λ+] be the fixed interval in Theorem 1.5. Thus this interval is contained in one connected component of Uβ,Δ.
For a graph H=(V(H),E(H)), a set W⊆V(H), and a pinning τ∈{−1,+1}W, define the pinned partition function, with the external fields at the pinned vertices omitted, by
Lemma 7.1. Fix the constants above. There exist constants θ0∈(0,π] and η0∈(0,1/2), depending only on Δ,β,λ−,λ+, and a deterministic algorithm with the following guarantee. Let H be any graph of maximum degree at most Δ, write n=∣V(H)∣, let W⊆V(H), and let τ∈{−1,+1}W. Suppose that
zv=λveiθv,λv∈[λ−,λ+],∣θv∣≤θ0(v∈V(H)∖W).
Then ZHτ(β,z)=0, and, for every ε′∈(0,1), the algorithm returns a complex number ZHτ(β,z) such that
ZHτ(β,z)−ZHτ(β,z)≤ε′∣ZHτ(β,z)∣.
For n≥1, its running time is
OΔ,β,λ−,λ+(n2(ε′n)αI).
Here αI:=log(Δ−1)/[−log(1−η0)]>1. The guarantee is uniform over H, W, and τ, with n counting both pinned and unpinned vertices. If n=0, the algorithm returns 1 in constant time.
Proof. Put Λ=[λ−,λ+]. By the reduction preceding [LSS25, Lemma 2.8], we may split each pinned vertex of degree d into d leaves of the same pinned spin, one on each incident edge. Since pinned vertices carry no external-field factors, this preserves ZHτ(β,z) and the maximum-degree bound, while increasing the graph size by at most a factor of Δ. We apply the same convention after each subsequent pinning and continue to use the same graph notation. Thus all pinned vertices may be assumed to be leaves.
For a pinned instance (G,W,τ) and an unpinned vertex u, define, whenever the denominator is nonzero,
Suppose that u has unpinned neighbors v1,…,vd. Let
du±:=#{v∈W:v∼u,τv=±1},ιu:=du−−du+.
Although [LSS25, Lemma 2.8] is stated with a common scalar external field, its telescoping proof establishes an identity in the vertex activities and therefore gives, coordinatewise,
Here rj is the ratio at vj in the split instance G(j), which has one fewer unpinned vertex and degG(j)(vj)≤Δ−1; each node uses its own field.
For x≥0 and β>1,
β−1≤gβ(x)≤β.
Since d+∣ιu∣≤Δ, every positive-real recursion value with fields in Λ consequently lies in the fixed interval
rmin≤R≤rmax,rmin:=λ−β−Δ>0,rmax:=λ+βΔ.(45)
Using the potential underlying [LSS25, Theorem 2.9], expressed in our ratio coordinate, set
ψ(R):=logζR+1+ζ(1+ζ)R+ζ,R>0,
where ζ=ζ(β,Δ)>0 is independent of the field, as in [SST12, Section 3]. This field-independence allows the same potential to be used at vertices with different activities. This map is real analytic and strictly increasing. It is the odds-ratio form of the probability-coordinate potential of Sinclair et al. [SST12]: substituting p=R/(1+R) into log((p+ζ)/(1−p+ζ)) gives ψ(R). Use the analytic branches agreeing with the positive-real functions, and set
For (d,ι)∈AΔ−1, the pinned inputs can be included in the full (Δ−1)-input probability recursion: insert ∣ι∣ inputs equal to 0 if ι>0 and to 1 if ι<0, and set any remaining dummy inputs to 1/2. Indeed, gβ(0)=β, gβ(∞)=β−1, and gβ(1)=1, so this reproduces the factor βι without changing the free-input recursion. After applying the potential, the gradient in the free coordinates is a subvector of the full transformed gradient. Therefore, by [LSS25, Theorem 2.9], the probability-ratio change of coordinates above, the compactness of Λ×Yd for each fixed (d,ι)∈AΔ−1, and the finiteness of AΔ−1, we have
Γ:=(d,ι)∈AΔ−1a∈Λ,y∈Ydmax∥∇Sa,d,ι(y)∥1<1,
where the gradient is zero when d=0. Fix η0∈(0,1/2) such that Γ≤1−2η0. With this choice of η0, the exponent in the statement is
αI:=−log(1−η0)log(Δ−1)>1.(46)
Thus
∥∇Sa,d,ι(y)∥1≤1−2η0(a∈Λ,y∈Yd,d+∣ι∣≤Δ−1).(47)
We next give arguments similar to those in [LSS25, Corollary 2.10]. On the common real message interval Y, the inverse potential is
ψ−1(y)=1+ζ−ζey(1+ζ)ey−ζ.
Hence ψ−1(Y)=[rmin,rmax]. In particular, for every (d,ι)∈AΔ, a∈Λ, and y∈Yd,
all denominators in ψ−1 and Sz,d,ι are bounded away from zero, while all logarithm arguments lie in a compact subset of (0,∞). After shrinking the neighborhoods, these arguments remain in the open right half-plane, where we take the principal logarithm. Thus the resulting maps are jointly analytic on a common open neighborhood of the sets Kd,ι. With η0 fixed as above, continuity of the gradients, the compactness of each Kd,ι, and the finiteness of AΔ allow us to choose uniform constants ρ,δ>0 so that the corresponding closed tubes remain in this common neighborhood and the first bound below holds. After fixing such ρ and δ, choose C≥1 large enough to bound the relevant z-derivatives and message derivatives, as well as (ψ−1)′. Let
Yρ:={y∈C:dist(y,Y)≤ρ}.
After decreasing ρ and δ if necessary, whenever a∈Λ, ∣z−a∣≤δ, and y∈Yρd, we have
Moreover, ψ−1 is C-Lipschitz on Yρ. Shrinking ρ if necessary,
1+βψ−1(y)=0(y∈Yρ).(51)
Iterating the recurrence (44) from [LSS25, Lemma 2.8] gives a finite computation tree because each step removes an unpinned vertex. Here d+∣ι∣≤Δ−1 at non-root nodes, while the root may have d+∣ι∣=Δ. Denote the root by x0. For each node x, let π(x) be the graph vertex it represents; in particular, π(x0)=u. Let yxR and yx be its transformed messages under fields ax=λπ(x) and zx=zπ(x), respectively. For real fields, all restricted partition functions are positive, so ψ−1(yxR) is the corresponding graph ratio. Put
ξ:=v∈V(G)\Wmax∣zv−λv∣≤λ+θ0,t:=η0Cξ.
Choose θ0∈(0,π] small enough that
λ+θ0≤δ,η0Cλ+θ0≤2ρ.(52)
Starting at the leaves, the mean-value formula on the convex set Yρ, together with (48) and (49), gives at every non-root node
Here the maximum is 0 at a leaf. Since yxR∈Y and t≤ρ/2, this also keeps every non-root complex message in Yρ.
At the root, (49) and (50) instead yield
yx0−yx0R≤C(t+ξ).(54)
After shrinking θ0, this bound is at most ρ/2, so the root message also lies in Yρ. Since ψ−1 is Lipschitz there, the formal root ratio RG,u(β,z):=ψ−1(yx0) satisfies, for some parameter-dependent constant C0,
RG,u(β,z)−RG,uτ(β,λ)≤C0ξ.(55)
The real ratio is well defined. Decreasing θ0 once more so that C0λ+θ0≤rmin/2, and using (45),
ℜRG,u(β,z)≥2rmin>0,1+RG,u(β,z)≥1.(56)
We now use simultaneous induction on the number m of unpinned vertices to show that every pinned partition function is nonzero and every ratio (43) equals its formal computation-tree value (hence satisfies (56)). For m=0, the partition function is the nonzero monomial βq.
Assume both claims through m−1 and take an instance with m≥1 and root u. Pinning u leaves m−1 unpinned vertices, so the two restricted partition functions in (43) are nonzero. Each child instance in (44) also has m−1 unpinned vertices. Substituting the inductively identified child ratios into (44), which is well defined by (51), identifies the parent ratio with its formal root value. Finally,
ZGτ(β,z)=ZGτ∪{u=−1}(β,z)(1+RG,uτ(β,z)),(57)
where the fields are restricted to the still-unpinned vertices. Its first factor is nonzero by induction and its second by (56), completing the induction and proving zero-freeness for every H,W,τ.
To approximate a ratio at u, truncate its computation tree at depth L and assign every new leaf the fixed transformed message
y⋆:=ψ(rmin)∈Y.
The real truncated messages stay in Y by (45); the stability argument above, including the root estimate, then keeps the complex truncated messages in Yρ. Comparing the exact and truncated recursions, we find that each non-root level contracts by 1−η0, while the root map and ψ−1 have bounded derivatives. The leaf discrepancy is uniformly bounded because Yρ is bounded. Hence, for some A=A(Δ,β,λ−,λ+)≥1,
RG,u(β,z)−RG,uτ(β,z)≤A(1−η0)L.(58)
Finally, enumerate the m=∣V(H)∖W∣ unpinned vertices as u1,…,um. Put τ0=τ, and for 1≤j≤m let
τj=τj−1∪{uj=−1},Rj:=RH,ujτj−1(β,z),
with the fields restricted to the still-unpinned vertices as in (43). Repeated use of (57) gives
(59) where q(τm) is the number of disagreeing edges in the unique fully pinned configuration.
If m=0, the algorithm counts the disagreeing edges in OΔ(n) time and returns this exact value; the empty graph is handled in constant time. Otherwise, choose
L=max{1,⌈−log(1−η0)log(8Am/ε′)⌉}.
Approximate every Rj by the depth-L recursion and return
nodes. Throughout the successive pinnings and splittings, each original vertex either remains unpinned or contributes at most Δ pinned leaves. Thus every recursive instance has OΔ(n) vertices and edges. Preparing the initial instance takes OΔ(n) time; even if we copy the entire instance at every tree node, constructing its child instances and evaluating its recurrence take OΔ(n) time per node. We construct at most m trees, and counting q(τm) and forming the final product take OΔ(n+m) additional time. Hence the total running time is
using 1≤m≤n. The case m=0 also satisfies the claimed bound for n≥1.
Corollary 7.2. Fix the constants above. Let H have maximum degree at most Δ, and let λ∈[λ−,λ+]V(H). Write n=∣V(H)∣. For every u∈V(H) and ε′∈(0,1), the positive-spin marginal
Pσ∼μH,β,λ(σu=+1)
can be deterministically approximated to additive error ε′ in time
Apply Lemma 7.1, with all phases zero, to the pinned numerator and the unpinned denominator, using relative accuracy ε′/8. Multiplication by the exact factor λu preserves the relative error. Since the exact ratio is a probability, Lemma 4.1 gives additive error less than ε′. Taking the real part and projecting onto [0,1] cannot increase the error. Preparing the two instances takes OΔ(n) time. The two partition-function calls each use relative accuracy ε′/8, and the remaining arithmetic takes constant time, giving the displayed bound by Lemma 7.1.
7.2 All-phase characteristic-function oracle
Lemma 7.3. Fix the constants above, let H=(V,E) have maximum degree at most Δ, and let λ∈[λ−,λ+]V. For θ∈[−π,π]V and α∈(0,π], let
Wα={v∈V:∣θv∣≥α}.
There is a constant γ>0, depending only on Δ,β,λ−,λ+, and α, such that
By conditional independence, the modulus of the conditional characteristic function is bounded by (1−4ρ2sin2(α/2))∣S∣/2. Averaging over the spins outside S cannot increase this bound. Hence (60) holds with
γ=−2(Δ+1)1log(1−4ρ2sin2(α/2))>0.
Lemma 7.4. Let H=(V,E) have maximum degree at most Δ, write n=∣V∣, let λ∈[λ−,λ+]V, and let θ=(θv)v∈V be a vector of real phases. For every ε′∈(0,1), there is a deterministic algorithm returning a complex number Φλ(θ) such that
Let T(n,δ)≥n bound the running time of the algorithm in Lemma 7.1 on graphs with at most n vertices and relative accuracy δ, uniformly over all pinnings. For n≥1, its running time is
OΔ,β,λ−,λ+((ε′1)(log2)/γT(n,64ε′)),
where θ0 is as in Lemma 7.1, and γ>0 is the damping constant from Lemma 7.3 with α=θ0/2. If n=0, the algorithm returns 1 in constant time.
Proof. If n=0, return 1. Otherwise, assume n≥1. Let θ∈[−π,π]V be the coordinatewise principal representative of θ. The characteristic function is unchanged by this reduction. Define
W={v∈V:θv≥θ0/2},
where θ0 is supplied by Lemma 7.1. Apply Lemma 7.3 with α=θ0/2, and let γ>0 be the resulting constant. Set
L=⌈γ−1log(8/ε′)⌉.
If ∣W∣>L, the algorithm returns zero. In this case (60) bounds the additive error by ε′/8.
Suppose now that ∣W∣≤L, and set
zv=λveiθv(v∈V).
For every τ∈{−1,+1}W, write
cτ=v∈W:τv=+1∏zv.
Partitioning the configurations according to their spins on W gives
ZH(β,z)=τ∈{−1,+1}W∑cτZHτ(β,z∣V∖W).(62)
Every field supplied to the pinned partition functions on the right-hand side has phase magnitude less than θ0/2. Hence Lemma 7.1 applies to every term.
Moreover, the triangle inequality and positivity of all coefficients give
Approximate every pinned partition function in (62) to relative error ε′/64, and let Zθ be the resulting sum. Also approximate ZH(β,λ) to the same relative accuracy using the empty pinning, and denote the result by Z0. Then
The algorithm returns Φλ(θ)=Zθ/Z0. By (63), ∣ZH(β,z)∣≤ZH(β,λ), so Lemma 4.1 gives the claimed additive error.
Finally,
2∣W∣≤2L=2⌈γ−1log(8/ε′)⌉≤2(ε′8)(log2)/γ.
The construction of W takes OΔ(n) time. For each assignment τ, preparing the pinned instance and computing cτ take OΔ(n) time. There are 2∣W∣ pinned oracle calls and one denominator call with empty pinning. Each call uses relative accuracy ε′/64 on a graph with n vertices and therefore takes at most T(n,ε′/64) time. Including the enumeration, weighted sum, and final division, the displayed enumeration bound and T(n,ε′/64)≥n give total running time
OΔ,β,λ−,λ+((ε′1)(log2)/γT(n,64ε′)).
Corollary 7.5. Fix the constants above. Let H=(V,E) have maximum degree at most Δ, write n=∣V∣, let λ∈[λ−,λ+]V, and let
A(σ)=v:σv=+1∑av,av∈[−1,1].
For every t∈R and ε′∈(0,1), ΦμH,β,λ,A(t) can be deterministically approximated to additive error ε′. For n≥1, its running time is
OΔ,β,λ−,λ+((ε′)αI+χIn2+αI),
where
αI:=−log(1−η0)log(Δ−1)>1,χI:=γlog2>0,
and η0 is as in Lemma 7.1, while γ is the damping constant in Lemma 7.4. If n=0, the algorithm returns 1 in constant time.
Proof. Apply Lemma 7.4 with θv=tav. The identity (10) identifies its target with ΦμH,β,λ,A(t). Constructing the phases takes O(n) time. Substituting the bound from Lemma 7.1 for T(n,ε′/64) in Lemma 7.4 gives the displayed running time.
7.3 Proof of Theorem 1.5
Proof of Theorem 1.5. If λ−=λ+, then the two input vectors agree and the algorithm returns zero. Hence assume λ−<λ+ and set b=λ− and r=λ+. For the coordinatewise geometric interpolation used in Section 4.2,
logλv(t)=(1−t)logλvμ+tlogλvν∈[logλ−,logλ+]
for every v∈V and t∈[0,1]. Thus every coordinate remains in [λ−,λ+] throughout the path, and this interval is contained in one connected component of Uβ,Δ.
Corollary 7.2 supplies the marginal-probability oracle required by Proposition 4.9, and Corollary 7.5 supplies the characteristic-function oracle required there. The separation hypothesis follows from Lemma 4.7; its constant κI>0 depends only on Δ,β,λ−,λ+. Set κ=min{1,κI}. For n≥1, Proposition 4.9 uses marginal accuracy δp=Θ(εκ/n) and characteristic-function accuracy δϕ=Θ((εκ)2/n2). The two oracle bounds above give
After absorbing the fixed constant κ, the thermodynamic-integration and Fourier-coefficient costs are OΔ,β,λ−,λ+(n5+2αI/ε1+αI) and O(n3/ε3), respectively. The damping constant in Lemma 7.3, evaluated at α=θ0/2, satisfies γ≤log2/[2(Δ+1)], since ρ≤1/2 and θ0≤π. Thus χI>1;
combined with αI>1, this shows that both costs are dominated by the characteristic-function queries. Substitution into Proposition 4.9 therefore gives total running time
OΔ,β,λ−,λ+(ε1+2αI+2χIn3+3αI+2χI).(64)
This is polynomial in n and 1/ε for the fixed model parameters. The empty graph returns zero in constant time. The zero-output characterization in Proposition 4.9 shows that the output is zero if and only if λμ=λν.
AI Disclosure We used the GPT-5.6 Sol model to assist in designing the overall methodology underlying the deterministic approximation algorithm and developing the corresponding mathematical analysis. This materially influenced Sections 3–7. The authors critically reviewed and independently verified all material retained in the manuscript, including the algorithms, proofs, citations, and bibliographic entries, and take full responsibility for the correctness and originality of the paper.
References
[AAL23] Jamil Arbas, Hassan Ashtiani, and Christopher Liaw. Polynomial time and private learning of unbounded Gaussian mixture models. In ICML, volume 202 of Proceedings of Machine Learning Research, pages 1018–1040. PMLR, 2023.
[AK24] Ariel Avital and Aryeh Kontorovich. Sharp bounds on aggregate expert error. arXiv preprint arXiv:2407.16642, 2024.
[BGGŠ18] Ivona Bezáková, Andreas Galanis, Leslie Ann Goldberg, and Daniel Štefankovič. Inapproximability of the independent set polynomial in the complex plane. In Proceedings of the 50th annual ACM SIGACT symposium on theory of computing, pages 1234–1240, 2018.
[BGM +23] Arnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, Dimitrios Myrisiotis, A. Pavan, and N. V. Vinodchandran. On approximating total variation distance. In IJCAI, pages 3479–3487. ijcai.org, 2023.
[BGM +24] Arnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, Dimitrios Myrisiotis, A. Pavan, and N. V. Vinodchandran. Total variation distance meets probabilistic inference. In ICML, volume 235 of Proceedings of Machine Learning Research, pages 3776–3794. PMLR, 2024.
[BGM +25] Arnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, Dimitrios Myrisiotis, A. Pavan, and N. V. Vinodchandran. Computational explorations of total variation distance. In ICLR. OpenReview.net, 2025.
[BGMV20] Arnab Bhattacharyya, Sutanu Gayen, Kuldeep S. Meel, and N. V. Vinodchandran. Efficient distance approximation for structured high-dimensional distributions via learning. In NeurIPS, 2020.
[CK14] Taolue Chen and Stefan Kiefer. On the total variation distance of labelled Markov chains. In LICS, pages 33:1–33:10. ACM, 2014.
[CR14] Clément L. Canonne and Ronitt Rubinfeld. Testing probability distributions underlying aggregated data. In ICALP, volume 8572 of Lecture Notes in Computer Science, pages 283–295. Springer, 2014.
[DL93] Ronald A. DeVore and George G. Lorentz. Constructive Approximation, volume 303 of Grundlehren der mathematischen Wissenschaften. Springer, Berlin, 1993.
[DMR18] Luc Devroye, Abbas Mehrabian, and Tommy Reddad. The total variation distance between high-dimensional Gaussians with the same mean. arXiv preprint arXiv:1810.08693, 2018.
[FF26] Weiming Feng and Yucheng Fu. On Approximating the f-Divergence Between Two Ising Models. In Shubhangi Saraf, editor, 17th Innovations in Theoretical Computer Science Conference (ITCS 2026), volume 362 of Leibniz International Proceedings in Informatics (LIPIcs), pages 59:1–59:23, Dagstuhl, Germany, 2026. Schloss Dagstuhl – Leibniz-Zentrum für Informatik.
[FFYZ26] Weiming Feng, Yucheng Fu, Minji Yang, and Anqi Zhang. On computing total variation distance between mixtures of product distributions. arXiv preprint arXiv:2605.03839, 2026.
[FGJW23] Weiming Feng, Heng Guo, Mark Jerrum, and Jiaheng Wang. A simple polynomial-time approximation algorithm for the total variation distance between two product distributions. TheoretiCS, 2, 2023.
[FLL24] Weiming Feng, Liqiang Liu, and Tianren Liu. On deterministically approximating total variation distance. In SODA, pages 1766–1791. SIAM, 2024.
[FLY25] Weiming Feng, Hongyang Liu, and Minji Yang. Approximating the total variation distance between spin systems. In COLT, volume 291 of Proceedings of Machine Learning Research, pages 1974–2025. PMLR, 2025.
[Geo11] Hans-Otto Georgii. Gibbs measures and phase transitions, volume 9. Walter de Gruyter, 2011.
[HSV18] Nicholas J. A. Harvey, Piyush Srivastava, and Jan Vondrák. Computing the independence polynomial: From the tree threshold down to the roots. In SODA, pages 1557–1576. SIAM, 2018.
[Jac12] Dunham Jackson. On approximation by trigonometric sums and polynomials. Transactions of the American Mathematical Society, 13(4):491–515, 1912.
[JS93] Mark Jerrum and Alistair Sinclair. Polynomial-time approximation algorithms for the Ising model. SIAM Journal on Computing, 22(5):1087–1116, 1993.
[Kie18] Stefan Kiefer. On computing the total variation distance of hidden Markov models. In ICALP, volume 107 of LIPIcs, pages 130:1–130:13. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2018.
[Kon24] Aryeh Kontorovich. On the tensorization of the variational distance. arXiv preprint arXiv:2409.10368, 2024.
[LLY13] Liang Li, Pinyan Lu, and Yitong Yin. Correlation decay up to uniqueness in spin systems. In SODA, pages 67–84. SIAM, 2013.
[LSS17] Jingcheng Liu, Alistair Sinclair, and Piyush Srivastava. The Ising partition function: Zeros and deterministic approximation. In FOCS, pages 986–997. IEEE, 2017.
[LSS25] Jingcheng Liu, Alistair Sinclair, and Piyush Srivastava. Correlation decay and partition function zeros: Algorithms and phase transitions. SIAM Journal on Computing, 54(4):FOCS19–200–FOCS19–252, 2025.
[LY52] T. D. Lee and C. N. Yang. Statistical theory of equations of state and phase transitions. II. lattice gas and Ising model. Physical Review, 87(3):410–419, 1952.
[PR17] Viresh Patel and Guus Regts. Deterministic polynomial-time approximation algorithms for partition functions and graph polynomials. SIAM Journal on Computing, 46(6):1893–1919, 2017.
[SST12] Alistair Sinclair, Piyush Srivastava, and Marc Thurley. Approximation algorithms for two-state anti-ferromagnetic spin systems on bounded degree graphs. In SODA, pages 941–953. SIAM, 2012.
[SV03] Amit Sahai and Salil Vadhan. A complete problem for statistical zero knowledge. J. ACM, 50(2):196–249, 2003.
[Wei06] Dror Weitz. Counting independent sets up to the tree threshold. In STOC, pages 140–149. ACM, 2006.
A Proof of the constructive Jackson lemma
Proof of Lemma 4.2. We first place F on a circle without increasing its Lipschitz constant. Let
and then extend F 4n-periodically. Both added linear pieces have slope
2nF(−n)−F(n),
whose absolute value is at most one. The pieces join continuously, and F(−2n)=F(2n)=u; hence the periodic extension is 1-Lipschitz. It also takes values in [0,2n] and agrees with F on [−n,n].
We now make the Jackson construction explicit. Let q=⌊2K⌋+1 and d=2q−2≤K. Following Jackson's construction [Jac12], define the normalized fourth-power Jackson kernel
Jq(y)=c01(sin(πy)sin(πqy))4,−21≤y≤21,(65)
where c0=3q(2q2+1) and removable singularities are filled in by continuity. Indeed, the Fejér identity gives
(sin(πy)sin(πqy))2=r∈Z∑are2πiry,ar=(q−∣r∣)+.
Consequently, the fourth power in (65) has Fourier coefficients
ck=r∈Z∑arak−r,∣k∣≤d,
and no other nonzero coefficients. Its constant coefficient is
c0=r∑ar2=q2+2s=1∑q−1s2=3q(2q2+1),
consistent with the definition of c0 above. Since
∫−1/21/2e2πikydy={1,0,k=0,k=0,
integrating a finite Fourier series over one period extracts its constant coefficient. Hence
Thus Jq is an even, nonnegative, normalized trigonometric polynomial of degree d. Moreover, ck≥0, while Cauchy–Schwarz gives
ck=r∑arak−r≤(r∑ar2)1/2(r∑ak−r2)1/2=c0.
Consequently,
Jq(y)=∣k∣≤d∑c0cke2πiky.
Extend these Fourier multipliers by zero up to degree K, and set
mk={ck/c0,0,∣k∣≤d,d<∣k∣≤K.
Then 0≤mk≤1 for every ∣k∣≤K. The convolution formula for ck also allows all these rational multipliers to be computed exactly in O(K2) arithmetic operations.
For ∣k∣≤K, let
Fk(F)=4n1∫−2n2nF(z)e−itkzdz,αk=mkFk(F).
We next verify explicitly that these coefficients give the Jackson convolution. The factor 4n below identifies the period-one y-circle with the period-4n circle of F. Since the Fourier series of Jq is finite, we may integrate it term by term. For every ∣k∣≤d, the substitution z=x−4ny, together with tk=πk/(2n), gives
Substituting this estimate into (67) and using q≥K/2 gives
P(x)−F(x)≤q3n≤K6n≤4ε.
This proves the approximation bound on [−n,n]. Also, Fk(F)≤2n and mk≤1, so
∣k∣≤K∑∣αk∣≤2n(2K+1)≤6nK,
which proves (11).
We finally give the deterministic coefficient computation. Cache F(−n) and F(n), and let N be the smallest power of two satisfying
N≥max{2K+1,⌈ε8n(1+πK)(2K+1)⌉}.(68)
Set
xj=−2n+(j+21)N4n,0≤j<N.
Define
Fk=N1j=0∑N−1F(xj)e−itkxj,αk=mkFk.
The integrand gk(x)=F(x)e−itkx is Lipschitz with constant at most
1+2n∣tk∣≤1+πK.
For completeness, on each subinterval of length h=4n/N, the midpoint error for an L-Lipschitz function is at most Lh2/4. After summing the N errors and dividing by 4n, the normalized midpoint error is at most nL/N. Therefore
Fk−Fk(F)≤Nn(1+πK)≤8(2K+1)ε.
Since mk≤1, summing this bound over ∣k∣≤K proves (12).
After caching F(−n) and F(n), evaluating the N sample values F(xj) costs O(NTF(n)) time. Directly computing Fk requires O(N) operations for each of the 2K+1 frequencies, so all midpoint sums cost O(KN) operations. Computing all Jackson multipliers mk from the convolution formula for ck costs O(K2) operations: there are O(K) coefficients, each with O(K) summands. Forming αk=mkFk then costs another O(K) operations. Alternatively,
e−itkxj=(−1)ke−πik/Ne−2πikj/N,
so all sums are fixed phase multiples of entries of one length-N DFT. Since N is a power of two, one length-N FFT computes this DFT in O(NlogN) operations. The condition N≥2K+1 ensures that the required frequencies −K,…,K are distinct modulo N. Extracting the corresponding DFT entries, dividing by N, applying the fixed phase factors, and multiplying by mk costs O(K) additional operations. These O(K) postprocessing costs are absorbed by the other terms. Thus direct summation takes
O(NTF(n)+KN+K2)=O(ε3n3TF(n)+ε4n4)(69)
operations, where the three terms account for sampling, evaluating all midpoint sums, and computing the multipliers, respectively. Using an FFT replaces the midpoint-sum cost O(KN) by the DFT cost O(NlogN), giving
The multiplier cost O(K2) is absorbed by O(KN) in the direct bound and by O(NlogN) in the FFT bound. This completes the proof.
B Proof of the multivariate Lee–Yang approximation lemma
Proof of Lemma 5.1. Let n=∣V(H)∣. If n=0, return 1 in constant time. If β=1, then
ZH(1,z)=v∈V(H)∏(1+zv),
so the partition function can be computed exactly in O(n) operations. Hence assume that 0<β<1, and define the univariate polynomial
Q(t)=ZH(β,(tzv)v∈V(H)).
Thus Q(0)=1 and Q(1)=ZH(β,z). If ∣t∣<1/r, then ∣tzv∣<1 for every v. The multivariate Lee–Yang theorem, applied separately to each connected component and combined with spin reversal, gives
Q(t)=0for∣t∣<1/r
[LSS17, Theorem 4.2 and Eq. (13)].
The coefficient algorithm in the proof of [LSS17, Theorem 3.1] applies to Q by adding one singleton hyperedge {v} at each vertex, with unary factor
φ{v}(−)=1,φ{v}(+)=zv.
Keeping the original Ising edge factors and taking the common vertex activity to be t gives precisely Q(t). All factors satisfy the normalization φe(−,…,−)=1 required by the coefficient algorithm. Adding these singleton hyperedges increases the maximum degree to at most Δ+1, while the maximum hyperedge size remains at most 2. The labelled-insect enumeration handles the distinct fixed weights without changing the enumeration bound. Consequently, the first m coefficients of Q can be computed using nO(1)exp(OΔ(m)) arithmetic operations. The Newton identities compute the first m inverse power sums of its zeros from these coefficients in another O(m2) operations. In particular, there are constants cΔ,CΔ≥1, depending only on Δ, for which the combined cost is
OΔ,β(ncΔexp(CΔm)).
Here CΔ is enlarged if necessary to absorb the Newton-identity cost.
Let α1,…,αn be the zeros of Q. Since ∣αj∣≥1/r, write pk=∑j=1nαj−k. The Taylor approximation
Tm=−k=1∑mkpk
satisfies
∣logQ(1)−Tm∣≤nk>m∑krk≤1−rnrm+1,
where the logarithm is the branch normalized by logQ(0)=0. Taking
m=⌈log(1/r)log(2n/(1−r)ε)⌉=Or(log(n/ε))
makes the last quantity at most ε/2. Therefore, for ZH(β,z)=exp(Tm),
∣ZH(β,z)∣ZH(β,z)−ZH(β,z)≤exp(ε/2)−1≤ε.
Forming Tm costs O(m) further operations, and its exponential costs one elementary-function evaluation. Substituting the chosen value of m gives the total bound
OΔ,β,r(ncΔ+CΔ/log(1/r)ε−CΔ/log(1/r)).
Thus one may take
aLY=cΔ+log(1/r)CΔ,bLY=max{1,log(1/r)CΔ}.
These constants are at least one and depend only on Δ and r. Together with the cases n=0 and β=1, this proves the stated bound TZ(n,ε)=OΔ,β,r((n+1)aLYε−bLY).