Algorithmic Cluster Expansions for Quantum Problems

We establish a general framework for developing approximation algorithms for a class of counting problems. Our framework is based on the cluster expansion of abstract polymer models formalism of Koteck\'y and Preiss. We apply our framework to obtain efficient algorithms for (1) approximating probability amplitudes of a class of quantum circuits close to the identity, (2) approximating expectation values of a class of quantum circuits with operators close to the identity, (3) approximating partition functions of a class of quantum spin systems at high temperature, and (4) approximating thermal expectation values of a class of quantum spin systems at high temperature with positive-semidefinite operators. Further, we obtain hardness of approximation results for approximating probability amplitudes of quantum circuits and partition functions of quantum spin systems. This establishes a computational complexity transition for these problems and shows that our algorithmic conditions are optimal under complexity-theoretic assumptions. Finally, we show that our algorithmic condition is almost optimal for expectation values and optimal for thermal expectation values in the sense of zero freeness.


I. INTRODUCTION
The classification of the computational complexity of quantum problems is important for understanding the capabilities and limitations of quantum computing.These problems include the computation of probability amplitudes, expectation values, partition functions, and thermal expectation values.In this paper we consider the classification of such problems in the sense of approximate counting.We establish a general framework for developing approximation algorithms and hardness of approximation results for a class of counting problems.By applying this framework, we are able to obtain efficient approximation algorithms and hardness of approximation results for several quantum problems under certain algorithmic conditions.
Our results concerning the approximation of quantum problems may be summarised as follows.We obtain efficient algorithms for (1) approximating probability amplitudes of a class of quantum circuits close to the identity, (2) approximating expectation values of a class of quantum circuits with operators close to the identity, (3) approximating partition functions of a class of quantum spin systems at high temperature, and (4) approximating thermal expectation values of a class of quantum spin systems at high temperature with positive-semidefinite operators.Our approach offers a simpler and sharper analysis compared to existing algorithms.Our algorithmic results are summarised in Table I. |β| ≤ 1 2e 2 (∆−1)r(∆r−r+1) [3] TABLE I. Summary of algorithmic results for quantum problems.In the context of probability amplitudes, partition functions, and thermal expectation values, ∆ denotes the maximum degree and r denotes the rank of the interaction multihypergraph.In the context of expectation values, d denotes the depth of the quantum circuit, and k denotes the maximum number of qudits each gate can act on.
Our algorithmic framework is based on the cluster expansion of abstract polymer models formalism of Kotecký and Preiss [4].We consider polymers that are connected subgraphs of bounded-degree bounded-rank multihypergraphs with compatibility relations defined by vertex disjointness.The key insight underlying our framework is that when the polymer weights decay sufficiently fast, computing the truncated cluster expansion to sufficiently high order allows us to obtain a multiplicative approximation to the abstract polymer model partition function.Our framework can be viewed as a straightforward generalisation of the framework of Helmuth, Perkins, and Regts [5], and Borgs et al. [6] from the case of bounded-degree graphs to bounded-degree bounded-rank multihypergraphs.This approach is closely related to that of Patel and Regts [7] using Barvinok's method [8]; see Ref. [9] for a survey of this method.
A multigraph is a graph in which multiple edges between vertices are permitted.A hypergraph is a graph in which edges between any number of vertices are permitted.A multihypergraph is a graph in which multiple edges between vertices and edges between any number of vertices are permitted.We shall assume that the edges in a multihypergraph are uniquely labelled, that is, all edges are considered distinct.Let G = (V, E) be a multihypergraph.We denote the order of G by |G| = |V (G)| and the size of G by ∥G∥ = |E(G)|.The maximum degree ∆(G) of G is the maximum degree over all vertices of G and the rank r(G) of G is the maximum cardinality of an edge of G.The distance d(u, v) between two vertices u and v in G is defined as the size of the shortest path connecting them.A multihypergraph is called ∆-regular if all the vertices have degree ∆ and called r-uniform if all the edges have cardinality r.

B. Abstract Polymer Models
An abstract polymer model is a triple (C, w, ∼), where C is a countable set of objects called polymers, w : C → C is a function that assigns to each polymer γ ∈ C a complex number w γ called the weight of the polymer, and ∼ is a symmetric compatibility relation such that each polymer is incompatible with itself.A set of polymers is called admissible if the polymers in the set are all pairwise compatible.Note that the empty set is admissible.Let G denote the collection of all admissible sets of polymers from C. The abstract polymer partition function is defined by The archetypal example of an abstract polymer model is the independence polynomial.Let G = (V, E) be a graph and let I denote the collection of all independent sets of G. Recall that an independent set of G is a subset of vertices with no edges between them.The independence polynomial I(G; x) of G is a polynomial in x, defined by This corresponds to an abstract polymer model (C, w, ∼) as follows.The polymers C are the vertices V of G, the weight function w is given by w γ = x for all γ ∈ C, and two polymers are compatible if and only if there is no edge between them in G.An admissible set of polymers is then an independent set of G, and it follows that the partition function of this model Z(C, w) is precisely the independence polynomial I(G; x) of G.In the context of statistical physics, the independence polynomial I(G; x) is the partition function of the hard-core model with activity x.In this model, each independent set corresponds to a possible configuration of particles that are subject to hard-core repulsion.The abstract polymer model can be viewed as a generalisation of the independence polynomial.In particular, it attempts to capture the independence properties of a problem.
A useful tool for representing a problem as an abstract model is the principle of inclusionexclusion.The principle is formalised by the following well-known lemma (see for example [10,Theorem 12.1]); we provide a proof for completeness.
Lemma 1 (Principle of inclusion-exclusion). Let f be a function defined on the subsets of finite set E, then Proof.By interchanging the summations, we have Now, by applying the binomial theorem, we obtain completing the proof.■ As we shall see in Section IV, several quantum problems admit an abstract polymer model representation.

C. Abstract Cluster Expansion
We now define the abstract cluster expansion [4,11].Let Γ be a non-empty ordered tuple of polymers.The incompatibility graph H Γ of Γ is the graph with vertex set Γ and edges between any two polymers if and only if they are incompatible.Γ is called a cluster if its incompatibility graph H Γ is connected.A polymer and cluster are compatible if the polymer is compatible with every polymer in the cluster.Let G C denote the set of all clusters of polymers from C. The abstract cluster expansion is a formal power series for log Z(C, w) in the variables w γ , defined by where φ(H) denotes the Ursell function of a graph H: The sum is over all spanning connected edge sets of H.For a derivation of the cluster expansion, we refer the reader to Ref. [11].
An important theorem due to Kotecký and Preiss [4] provides a sufficient criterion for the absolute convergence of the cluster expansion.An improved convergence criterion is given in Ref. [12].
Theorem 2 (Kotecký and Preiss [4]).Let (C, w, ∼) be an abstract polymer model and let a : C → R + and d : C → R + be functions such that for all polymers γ ∈ C. Then the cluster expansion for log(Z(C, w)) converges absolutely, Z(C, w) ̸ = 0, and for all polymers γ ∈ C.
We shall use Theorem 2 to establish the absolute convergence of the cluster expansion.In the case of the independence polynomial, the radius of convergence is given by Shearer's bound for the Lovász Local Lemma [13]; this was elucidated by Scott and Sokal [14].For results on the hypergraph independence polynomial see Refs.[15,16].Note that the Kotecký-Preiss convergence criterion can be viewed as a type of local lemma.
Let ∥ • ∥ : C → Z + be a function that assigns to each polymer γ ∈ C a positive integer ∥γ∥ called the size of the polymer.A useful quantity for algorithmic purposes is the truncated cluster expansion T m (Z(C, w)) for log(Z(C, w)): where ∥Γ∥ = γ∈Γ ∥γ∥.
It is often convenient to consider clusters as multisets of polymers.Define a multiset cluster to be a multiset (Γ, m Γ ) of polymers Γ with multiplicity function m Γ : Γ → Z + whose incompatibility graph is connected.Here the definition of the incompatibility graph is extended to multisets in the natural way.Let ĜC denote the collection of all multiset clusters of polymers from C. Note that, for a given multiset (Γ, m Γ ), there are precisely ( γ∈Γ m Γ (γ))! γ∈Γ m Γ (γ)! tuples that correspond to it.The abstract cluster expansion may then be written as

D. Approximation Schemes
Let ϵ > 0 be a real number.An additive ϵ-approximation to z is a complex number ẑ such that |z − ẑ| ≤ ϵ.A multiplicative ϵ-approximation to z is a complex number ẑ such that |z − ẑ| ≤ ϵ|z|.Note that an additive-error approximation to the logarithm of a number is equivalent to a multiplicative approximation to that number.A fully polynomial-time approximation scheme for a sequence of complex numbers (z n ) n∈N is a deterministic algorithm that, for any n and ϵ > 0, produces a multiplicative ϵ-approximation to z n in time polynomial in n and 1/ϵ.

E. Computational Complexity
We shall refer to the following complexity classes: P (polynomial time), RP (randomised polynomial time), NP (non-deterministic polynomial time), and #P.For a formal definition of these complexity classes, we refer the reader to Ref. [17].

III. GENERAL FRAMEWORK A. Approximation Algorithms
In this section we establish a general framework for developing approximation algorithms for abstract polymer model partition functions.We consider abstract polymer models in which the polymers are connected subgraphs of bounded-degree bounded-rank multihypergraphs and compatibility is defined by vertex disjointness.When the polymer weights of these models decay sufficiently fast, then the logarithm of the partition function can be controlled by a convergent cluster expansion.Our algorithm approximates the logarithm of the partition function by computing the truncated cluster expansion to sufficiently high order.
Our general framework is based on that of Helmuth, Perkins, and Regts [5] and Borgs et al. [6] where approximation algorithms were developed in the setting of bounded-degree graphs.Our algorithm can be viewed as a straightforward generalisation of theirs to the setting of bounded-degree bounded-rank multihypergraphs.Our main theorem is as follows.
Theorem 3. Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r.Further let (C, w, ∼) be an abstract polymer model such that the polymers are connected subgraphs of G and that two polymers γ and γ ′ are compatible if and only if V (γ) ∩ V (γ ′ ) = ∅.Suppose that, for all polymers γ ∈ C, the weight w γ can be computed in time exp(O(∥γ∥)) and satisfies Then the cluster expansion for log(Z(C, w)) converges absolutely, Z(C, w) ̸ = 0, and there is a fully polynomial-time approximation scheme for Z(C, w).
In Section IV we shall apply Theorem 3 to establish efficient approximation algorithms for several quantum problems.
Our proof of Theorem 3 requires several lemmas.We first prove the following lemma which bounds the number of polymers of a certain size containing a particular vertex.
Lemma 4. Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r, and let v ∈ V be a vertex.The number of connected subgraphs with m edges that contain vertex v is at most (e∆(r−1)) m 2 .
Proof.Let C m,v (G) denote the set of connected subgraphs of G with m edges that contain the vertex v ∈ V .Further let T ∆,r,v denote the infinite ∆-regular r-uniform linear hypertree with root v. Recall that a hypergraph is linear if the intersection of any pair of edges contains at most one vertex.Let T ⋆ ∆,r,v be the graph with vertex set {v} ∪ E(T ∆,r,v ) and edges between vertices v and ε ∈ E(T ∆,r,v ) if and only if v ∈ ε and edges between vertices ε, ε completing the proof.■ Remark.The proof of Lemma 4 gives a slightly sharper bound of (e((∆−1)(r−1)+1)) m

2
. Improved bounds may be obtained for certain classes of multihypergraphs.
We now show that provided the polymer weights decay sufficiently fast, then the cluster expansion converges absolutely and the truncated cluster expansion provides a good approximation to log(Z(C, w)).This is formalised by the following lemma which utilises the Kotecký-Preiss convergence criterion.
Lemma 5. Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r.Further let (C, w, ∼) be an abstract polymer model such that the polymers are connected subgraphs of G and that two polymers γ and γ ′ are compatible if and only if V (γ) ∩ V (γ ′ ) = ∅.Suppose that, for all polymers γ ∈ C, the weight w γ satisfies Then the cluster expansion for log(Z(C, w)) converges absolutely, Z(C, w) ̸ = 0, and for m ∈ Z + , Proof.We introduce a polymer γ v to every vertex v in G consisting of only that vertex.We define γ v to be incompatible with every polymer that contains v.Then, we have where we have used the fact that |γ| ≤ (r − 1)∥γ∥ + 1.By Lemma 4, the number of polymers γ with ∥γ∥ = m that are incompatible with γ v is at most (e∆(r−1)) m
Fix a polymer γ.By summing over all vertices in γ, we obtain |γ|.
Now by applying Theorem 2 with a(γ) = 1 2(r−1) |γ| and d(γ) = 1 2 ∥γ∥, we have that the cluster expansion converges absolutely, Z(C, w) ̸ = 0, and By summing over all vertices in G, we obtain completing the proof.■ Lemma 5 implies that to obtain a multiplicative ϵ-approximation Z(C, w), it is sufficient to compute the truncated cluster expansion T m (Z(C, w)) to order m = O(log(|G|/ϵ)).We shall now establish an algorithm for computing 1) .This requires the following two lemmas.Lemma 6. Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r.Further let (C, w, ∼) be an abstract polymer model such that the polymers are connected subgraphs of G and that two polymers γ and γ ′ are compatible if and only if V (γ)∩V (γ ′ ) = ∅.The clusters of size at most m can be listed in time exp(O(m)) • |G| O (1) .Proof.Our proof follows a similar approach to that of Ref. [5,Theorem 6].We list all connected subgraphs of G with at most m edges in time exp(O(m)) • |G| O(1) by depth-first search.For each of these subgraphs, we consider all ways to label the edges with positive integers such that their sum is at most m in time exp(O(m)).For each of these labelled subgraphs, we consider all clusters that correspond to it, i.e., clusters whose multiset sum over polymers induces the subgraph with multiplicities given by the edge labels.
We now prove by induction that the number of such clusters for a subgraph with label sum m is at most (e∆(r − 1)) 2m .This is clearly true when m = 0. Now suppose that the number of such clusters for a subgraph with label sum m is at most (e∆(r − 1)) 2m .For a subgraph with label sum m + 1, we choose an arbitrary vertex in the subgraph and consider all polymers that contain that vertex.By Lemma 4, there are at most (e∆(r − 1)) n such polymers of size n.By removing each polymer from the subgraph and applying the induction hypothesis, we have that the number of clusters in the subgraph is at most Proof.Our proof follows that of Ref. [5,Lemma 5].For a connected graph H, we have where T H (x, y) denotes the Tutte polynomial of H defined by Here  1) .■ Combining Lemma 5 with Lemma 8 proves Theorem 3.

B. Hardness of Approximation
In this section we establish the hardness of approximating abstract polymer model partition functions.In particular, we establish the hardness of approximating the Ising model partition function at imaginary temperature on bounded-degree graphs, which will be useful for our purposes via reductions.This setting was studied in Ref. [20], which established hardness of approximation results for this problem.We utilise the results of Ref. [20] to obtain significantly sharper bounds when the maximum degree is sufficiently large.
We model an Ising system by a multigraph G = (V, E).At each vertex v of G there is a two-dimensional classical spin space {−1, +1}.The classical spin space on the multihypergraph is given by {−1, +1} V .An interaction ϕ assigns a real number ϕ(ε) to each edge ε of G.We are interested in the partition function Z Ising (G; β) at inverse temperature β, defined by We shall normalise the partition function by a multiplicative factor of 1  2 |G| .Further, we shall assume that |ϕ(ε)| ≤ 1 for all ε ∈ E, which is always possible by a rescaling of β.We shall consider the case where the inverse temperature β is imaginary, i.e., β = iθ for θ ∈ R. The Ising model partition function at imaginary temperature arises naturally in the probability amplitudes of quantum circuits [21].Our hardness result concerning the approximation of Z Ising (G; iθ) is as follows.
Proof.By Ref. [20,Theorem 3], it is #P-hard to approximate the Ising model partition function Z Ising (G; iθ) up to a multiplicative ϵ-approximation on multigraphs of maximum degree 3 for For a graph G of maximum degree 3 and a positive integer k ∈ Z + , let G k denote the k-thickening of G, that is, the multigraph formed by replacing each edge of G with k parallel edges.Note that the maximum degree of G k is precisely 3k.Now observe that, for any k ∈ Z + , we have Z Ising (G; iθ) = Z Ising G k ; iθ k .Hence, it is #P-hard to approximate Z Ising (G; iθ) up to a multiplicative ϵ-approximation on multigraphs of maximum degree at most 3k for θ ≥ π 5k .It follows that it is #P-hard to approximate Z Ising (G; iθ) up to a multiplicative ϵ-approximation on multigraphs of maximum degree at most ∆ for θ ≥ 3π 5(∆−2) , completing the proof.■ Remark.The proof of Theorem 9 gives a slightly sharper bound.Further, the proof technique may be applied to the case of complex β.This offers a significant improvement over Ref. [20] when ∆ ≥ 7, which applies when |θ| > arctan In Section IV we shall apply Theorem 3 to establish the hardness of approximation of several quantum problems.We shall now show that the Ising model partition function Z Ising (G; β) admits an abstract polymer model representation.This is formalised by the following lemma.e −βϕ({u,v})σuσv − 1 .
Proof.By applying Lemma 1 with {u,v}∈E e −βϕ({u,v})σuσv , we have For a subset S ⊆ E, let Γ S denote the maximally connected components of S. Recall that polymers are connected subgraphs of G with compatibility relations defined by vertex disjointness.For a polymer γ, |γ| denotes the order and ∥γ∥ denotes the size of the corresponding subgraph.By factorising over these components, we have This completes the proof.■ We note that Lemma 10 can be combined with Theorem 3 to establish an efficient approximation algorithm for Z Ising (G; β) on graphs of maximum degree at most ∆ when |β| ≤ 1 e 4 ∆ .Efficient approximation algorithms with significantly sharper bounds have previously been established [20,21].In particular, Ref. [20] established an efficient approximation algorithm that applies when |β| < π 4(∆−1) .In the case when β is real, the exact point of a computational complexity transition is known under the complexity-theoretic assumption that RP is not equal to NP due to the approximation algorithm of Ref. [22] and the hardness of approximation results of Refs.[23,24].

IV. APPLICATIONS
In this section we apply our algorithmic framework to establish efficient approximation algorithms for classes of quantum problems.This includes probability amplitudes, expectation values, partition functions, and thermal expectation values.We apply our hardness of approximation framework to show the optimality of our algorithmic conditions for probability amplitudes and partition functions under complexity-theoretic assumptions.Further, we show that our algorithmic condition is almost optimal for expectation values and optimal for thermal expectation values in the sense of zero freeness.

A. Probability Amplitudes
In this section we study the problem of approximating probability amplitudes of quantum circuits.This problem is known to be #P-hard in general [25]; however, we show that, for a class of quantum circuits close to the identity, this problem admits an efficient approximation algorithm.Further, we show that this algorithmic condition is optimal under complexity-theoretic assumptions.
We model a quantum circuit by a multihypergraph G = (V, E).At each vertex v of G there is a d-dimensional Hilbert space H v with d < ∞.The Hilbert space on the multihypergraph is given by H G := v∈V H v .An interaction U assigns a unitary operator U ε on H ε := v∈ε H v to each edge ε of G.We shall assume there is an implicit ordering of the unitary operators given by the edge labels which determines the order in which products of these operators are taken.The quantum circuit on G is defined by U G := ε∈E U ε .We are interested in the probability amplitude A U G , defined by A U G := 0 |G| U G 0 |G| .Note that any probability amplitude may be expressed in this form by a simple modification of the circuit.Our algorithmic result concerning the approximation of A U G is as follows.
Theorem 11.Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r.Suppose that, for all ε ∈ E, Then the cluster expansion for log(A U G ) converges absolutely, A U G ̸ = 0, and there is a fully polynomial-time approximation scheme for A U G .
Remark.Theorem 11 also applies to probability amplitudes of the form ⟨ψ|U G |ψ⟩, where |ψ⟩ is a product state over qudits, i.e., |ψ⟩ := v∈V |ψ v ⟩.Further, Theorem 11 applies to unitary operators of the form U ε = e −iθΦ(ε) , where θ is a real number such that |θ| ≤ 1 We prove Theorem 11 by showing that the conditions required to apply Theorem 3 are satisfied.That is, we show that (1) the probability amplitude A U G admits a suitable abstract polymer model representation, (2) the polymer weights satisfy the desired bound, and (3) the polymer weights can be computed in the desired time.This is achieved in the following three lemmas.
Lemma 12.The probability amplitude A U G admits the following abstract polymer model representation. where For a subset S ⊆ E, let Γ S denote the maximally connected components of S. By factorising over these components, we have This completes the proof.■ Lemma 13.Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r.Suppose that, for all ε ∈ E, Then, for all polymers γ ∈ C, the weight w γ satisfies Proof.Fix a polymer γ.We have Proof.The result follows by sparse matrix-vector multiplication.■ Combining Theorem 3 with Lemma 12, Lemma 13, and Lemma 14 proves Theorem 11.We now show that the algorithmic condition of Theorem 11 is optimal in the case of multigraphs under complexity-theoretic assumptions.This is achieved by establishing a hardness of approximation result for the probability amplitude A U G .For convenience, we shall consider unitary operators of the form U ε = e −iθΦ (ε) , where θ is a real number and Φ(ε) is a self-adjoint operator on H ε with ∥Φ(ε)∥ ≤ 1.Our hardness result concerning the approximation of A U G (θ) is as follows.
Proof.Our proof is based on a reduction from the Ising model partition function.We consider quantum circuits on multigraphs with a two-dimensional Hilbert space at each vertex and unitary operators of the form U ε = e −iθϕ(ε) v∈ε Xv , where ϕ(ε) is a real number satisfying |ϕ(ε)| ≤ 1.We have The proof then follows from Theorem 9. ■ Our results establish a computational complexity transition from P to #P-hard for the problem of approximating probability amplitudes.

B. Expectation Values
In this section we study the problem of approximating expectation values of quantum circuits.This problem is known to be #P-hard in general [25]; in particular, it is a special case of computing output probabilities of quantum circuits.We show that, for a class of quantum circuits with operators close to the identity, this problem admits an efficient approximation algorithm.This setting was studied in Ref. [1], which established an efficient approximation algorithm for this problem.Our approach offers a simpler and sharper analysis in a more slightly general setting.Further, we show that this algorithmic condition is almost optimal in the sense of zero freeness.
We model a quantum circuit by a multihypergraph G = (V, E) as in Section IV A and assume that the size of G is at most a polynomial in the order of G.An operator O assigns a self-adjoint operator We are interested in the expectation value ⟨O⟩ U G , defined by . We now introduce some further definitions that will be useful for our analysis.Let S E := (ε) ε∈E denote the sequence of edges from G sorted in increasing order with respect to the edge labels.For a vertex v of G, let S v denote the longest increasing subsequence of S E such that every prefix induces a connected subgraph of G containing v. We define the causal subgraph C v of v to be the subgraph of G induced by the sequence S v .For a subset U of vertices of G, we define the causal subgraph C U of U to be the subgraph of G induced by the set v∈U E(C v ).We define the causal intersection hypergraph C(G) of G to be the hypergraph with vertex set V and edge set {V (C v )} v∈V .We identify the edges of C(G) with the vertices of G.Note that the connected components of a subgraph S of C(G) are in one-to-one correspondence with the connected components of C E(S) .We shall consider polymers that are connected subgraphs of C(G).Our algorithmic result concerning the approximation of ⟨O⟩ U G is as follows.
Theorem 16.Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph such that the causal intersection hypergraph C(G) of G has maximum degree at most ∆ and rank at most r.Suppose that, for all v ∈ V , Then the cluster expansion for log ⟨O⟩ U G converges absolutely, ⟨O⟩ U G ̸ = 0, and there is a fully polynomial-time approximation scheme for ⟨O⟩ U G .
Remark.Theorem 16 may be extended to a slightly more general class of product operators.
In the case when G corresponds to a quantum circuit U G of depth at most d with each gate acting on at most k qudits, the causal intersection hypergraph C(G) has maximum degree at most k d and rank at most k d .Further, when G is restricted to edges on the lattice graph Z ν , the causal intersection hypergraph C(G) has maximum degree at most (2d) ν and rank at most (2d) ν .This implies that our algorithm may be applied to these classes of quantum circuits when ) 3ν for all v ∈ V , respectively.A more refined analysis in the latter case shows that our algorithm may be applied when ∥O v − I∥ ≤ 2 e 3 2 3ν d 2ν for all v ∈ V .This offers a significant improvement over Ref. [1], which applies to these classes when ∥O v − I∥ < 1 60k 5d and ∥O v − I∥ < 1 60(16d) 2ν for all v ∈ V , respectively.We prove Theorem 16 by showing that the conditions required to apply Theorem 3 are satisfied.That is, we show that (1) the expectation value ⟨O⟩ U G admits a suitable abstract polymer model representation, (2) the polymer weights satisfy the desired bound, and (3) the polymer weights can be computed in the desired time.This is achieved in the following three lemmas.
Lemma 17.The expectation value ⟨O⟩ U G admits the following abstract polymer model representation. where For a subset S ⊆ E(C(G)), let Γ S denote the maximally connected components of S. By factorising over these components, we have This completes the proof.■ Lemma 18. Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph such that the causal intersection hypergraph C(G) of G has maximum degree at most ∆ and rank at most r.Suppose that, for all v ∈ V , Then, for all polymers γ ∈ C, the weight w γ satisfies Proof.Fix a polymer γ.We have Proof.The proof follows similarly to that of Lemma 14. ■ Combining Theorem 3 with Lemma 17, Lemma 18 and Lemma 19 proves Theorem 16.We now show that the algorithmic condition of Theorem 16 is almost optimal in the sense of the zero freeness of the expectation value.This is achieved by a constructive argument based on an observation of Ref. [1] and is formalised by the following theorem.
Theorem 20.Fix d ∈ Z + and k ∈ Z ≥2 .There exists a hypergraph G = (V, E), a quantum circuit U G of depth d with each gate acting on at most k qubits, and an operator Note that there is a hypergraph G and a quantum circuit U G of depth d with each gate acting on at most k qubits such that Further, for all v ∈ V , we have This completes the proof.■ Remark.The operator in the proof of Theorem 20 is not self-adjoint.

C. Partition Functions
In this section we study the problem of approximating partition functions of quantum spin systems.This problem is known to be #P-hard in general [25]; however, we show that, for a class of quantum spin systems at high temperature, this problem admits an efficient approximation algorithm.Efficient approximation algorithms have previously been established for approximating partition functions of quantum spin systems at high temperature [2,26,27] and for restricted classes at low temperature [28].Our analysis closely follows that of Ref. [27] and can be viewed as a straightforward generalisation from the setting of bounded-degree graphs to bounded-degree bounded-rank multihypergraphs.This offers a simpler and slightly sharper analysis than Refs.[2,26].Further, we show that this algorithmic condition is optimal under complexity-theoretic assumptions.
We model a quantum spin system by a multihypergraph G = (V, E).At each vertex v of G there is a d-dimensional Hilbert space H v with d < ∞.The Hilbert space on the multihypergraph is given by H G := v∈V H v .An interaction Φ assigns a self-adjoint operator Φ(ε) on H ε := v∈ε H v to each edge ε of G.The Hamiltonian on G is defined by H G := ε∈E Φ(ε).We are interested in the partition function Z G (β) at inverse temperature β, defined by Z G (β) := Tr e −βH G .We shall assume that the trace is normalised so that Tr(I) = 1, which is equivalent to a rescaling the partition function by a multiplicative factor.Further, we shall assume that ∥Φ(ε)∥ ≤ 1 for all ε ∈ E, which is always possible by a rescaling of β.Our algorithmic result concerning the approximation of Z G (β) is as follows.
Theorem 21.Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r, and let β be a complex number such that |β| ≤ 1 e 4 ∆ r 2 .
Then the cluster expansion for log(Z G (β)) converges absolutely, Z G (β) ̸ = 0, and there is a fully polynomial-time approximation scheme for Z G (β).
Remark.Theorem 21 applies when β is complex, which includes the case of time evolution.This offers a modest improvement over Ref. [26], which established a quasi-polynomial time algorithm when |β| ≤ and over Ref. [2], which established a polynomial-time algorithm when |β| ≤ . In the case when G is a bounded-degree graph, we recover the results of Ref. [27].
We prove Theorem 21 by showing that the conditions required to apply Theorem 3 are satisfied.That is, we show that (1) the partition function Z G (β) admits a suitable abstract polymer model representation, (2) the polymer weights satisfy the desired bound, and (3) the polymer weights can be computed in the desired time.This is achieved in the following three lemmas.For a subset S ⊆ E, let Γ S denote the maximally connected components of S. By factorising over these components, we have This completes the proof.■ Lemma 23.Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r, and let β be a complex number such that Then, for all polymers γ ∈ C, the weight w γ satisfies Proof.Fix a polymer γ.Let P denote the set of all sequences of edges in γ.By the Taylor series, There are precisely n ∥γ∥ ∥γ∥! sequences ρ of length n whose support is γ, where n ∥γ∥ denotes the Stirling number of the second kind.Hence, we may write where we have used the identity ∞ Proof.The sum is over all subsets T of E(γ), of which there are 2 ∥γ∥ .For each of these subsets T , the trace may be evaluated in time exp(O(∥γ∥)) by diagonalising the sum of interactions.■ Combining Theorem 3 with Lemma 22, Lemma 23, and Lemma 24 proves Theorem 21.We now show that the algorithmic condition of Theorem 21 is optimal in the case of multigraphs under complexity-theoretic assumptions.This is achieved by establishing a hardness of approximation result for the partition function Z G (β) at imaginary temperature, i.e., β = iθ for θ ∈ R. Our hardness result concerning the approximation of Z G (iθ) is as follows.
Proof.Our proof is based on a reduction from the Ising model partition function.We consider quantum spin systems on multigraphs with a two-dimensional Hilbert space at each vertex and self-adjoint operators of the form Φ(ε) = ϕ(ε) v∈ε Z v , where ϕ(ε) is a real number satisfying |ϕ(ε)| ≤ 1.We have The proof then follows from Theorem 9. ■ We note that a hardness of approximation result with similar bounds may be obtained for real temperature under the assumption that RP is not equal to NP via the results of Refs.[23,24].Our results establish a computational complexity transition from P to #P-hard for the problem of approximating partition functions.

D. Thermal Expectation Values
In this section we study the problem of approximating thermal expectation values of quantum spin systems.This problem is known to be #P-hard in general [29]; however, we show that, for a class of quantum spin systems at high temperature with positive-semidefinite operators, this problem admits an efficient approximation algorithm.This setting was studied in Ref. [3], which established an efficient approximation algorithm for this problem.Our approach offers a similar but slightly sharper analysis.Further, we show that this algorithmic condition is optimal in the sense of zero freeness.
We model a quantum spin system by a multihypergraph G = (V, E) as in Section IV C.An operator Ψ assigns a positive-semidefinite operator Ψ(v) on H v to each vertex v of G.The operator Ψ G on G is defined by Ψ G := v∈V Ψ(v).We are interested in the thermal expectation value β) , where Z Ψ G (β) := Tr Ψ G e −βH G .We shall assume that the positive-semidefinite operators are normalised so that Tr(Ψ v ) = 1 for all v ∈ V , which is equivalent to a rescaling of the thermal expectation value by a multiplicative factor.Our algorithmic result concerning the approximation of ⟨Ψ⟩ G (β) is as follows.
Theorem 26.Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r, and let β be a complex number such that Then the cluster expansion for log(⟨Ψ⟩ G (β)) converges absolutely, ⟨Ψ⟩ G (β) ̸ = 0, and there is a fully polynomial-time approximation scheme for ⟨Ψ⟩ G (β).
Remark.Theorem 26 applies when β is complex, which includes the case of time evolution.This offers a modest improvement over Ref. [3] when ∆ ≥ 4, which established a polynomialtime algorithm when |β| ≤ 1 2e 2 (∆−1)r(∆r−r+1) .By using the slightly sharper bound given in the remark subsequent to Lemma 4, we obtain an improvement when ∆ ≥ 3. We note that efficient approximations algorithms may be established when the observable appears in the Hamiltonian under different assumptions.
We prove Theorem 26 by showing that the conditions required to apply Theorem 3 are satisfied and then combining this with Theorem 21.That is, we show that (1) Z Ψ G (β) admits a suitable abstract polymer model representation, (2) the polymer weights satisfy the desired bound, and (3) the polymer weights can be computed in the desired time.This is achieved in the following three lemmas.Proof.The sum is over all subsets T of E(γ), of which there are 2 ∥γ∥ .For each of these subsets T , the trace may be evaluated in time exp(O(∥γ∥)) by diagonalising the sum of interactions and matrix multiplication.■ Combining Theorem 3 with Lemma 27, Lemma 28, Lemma 29, and Theorem 21 proves Theorem 26.We now show that the algorithmic condition of Theorem 26 is optimal in the case of multigraphs in the sense of the zero freeness of the thermal expectation value.This is achieved by a straightforward constructive argument and is formalised by the following theorem.
Theorem 30.Fix ∆ ∈ Z + .There exists a multigraph G = (V, E) of maximum degree ∆, an operator O, and a self-adjoint operator Φ, such that ⟨Ψ⟩ G (β) = 0 with β = iπ ∆ .Proof.We consider a quantum spin system on a multigraph comprising a single multiedge with a twodimensional Hilbert space at each vertex.Further, we consider the operator Ψ with Ψ(v) = |0⟩⟨0| v for all v ∈ V and the self-adjoint operator Φ with Φ(ε) =  This completes the proof.■

V. CONCLUSION & OUTLOOK
We have established a general framework for developing approximation algorithms and hardness of approximation results for a class of counting problems.We applied this framework to obtain efficient approximation algorithms and hardness of approximation results for several quantum problems under certain algorithmic conditions.
In particular, we obtained efficient approximation algorithms for (1) approximating probability amplitudes of a class of quantum circuits close to the identity, (2) approximating expectation values of a class of quantum circuits with operators close to the identity, (3) approximating partition functions of a class of quantum spin systems at high temperature, and (4) approximating thermal expectation values of a class of quantum spin systems at high temperature with positive-semidefinite operators.Further, we obtained hardness of approximation results for approximating probability amplitudes of quantum circuits and partition functions of quantum spin systems.
Our results established a computational complexity transition for the problems of approximating probability amplitudes of quantum circuits and partition functions of quantum spin systems and showed that our algorithmic conditions for these problems are optimal under complexity-theoretic assumptions.Finally, we showed that our algorithmic condition is almost optimal for expectation values and optimal for thermal expectation values in the sense of zero freeness.
It would be interesting to identify other quantum problems to which our framework applies and to explore whether our results can be extended using ideas from duality [30].Further, it is an intriguing open problem to not only identify the exact points of a computational complexity transition for these problems, as is known for the Ising model at real temperature [22][23][24], but also to develop methods to experimentally probe these transitions.Finally, it would be interesting to obtain algorithms with an improved runtime, for example, via the Markov chain polymer approach of Ref. [31].
k(S) denotes the number of connected components of the subgraph with edge set S. The Ursell function can then be computed in time exp(O(|H|)) by evaluating the Tutte polynomial in time exp(O(|H|)) via an algorithm of Börklund et al. [19].This completes the proof.■ Lemma 8. Fix ∆, r ∈ Z ≥2 .Let G = (V, E) be a multihypergraph of maximum degree at most ∆ and rank at most r.Further let (C, w, ∼) be an abstract polymer model such that the polymers are connected subgraphs of G and that two polymers γ and γ ′ are compatible if and only if V (γ)∩V (γ ′ ) = ∅.Suppose that, for all polymers γ ∈ C, the weight w γ can be computed in time exp(O(∥γ∥)).Then the truncated cluster expansion T m (Z(C, w)) can be computed in time exp(O(m)) • |G| O(1) .Proof.We can list all clusters of size at most m in time exp(O(m)) • |G| O(1) by Lemma 6.For each of these clusters, we can compute the Ursell function in time exp(O(m)) by Lemma 7, and the polymer weights in time exp(O(m)) by assumption.Hence, the truncated cluster expansion T m (Z(C, w)) can be computed in time exp(O(m)) • |G| O(

Lemma 14 .
The weight w γ of a polymer γ can be computed in time exp(O(∥γ∥)).

Lemma 19 .
The weight w γ of a polymer γ can be computed in time exp(O(∥γ∥)).