The partition function is a cornerstone of statistical mechanics [1, 2], in particular since thermodynamics quantities can be obtained as derivatives of . Nevertheless, computing for larger systems is a challenging task if a closed-form solution cannot be found. In this work we are concerned with an efficient numerical method for evaluating and the associated free energy density for (semi-)classical chains, in the thermodynamic limit of infinite system size. In more detail, we consider a Hamiltonian on a (quasi) one-dimensional lattice of size , containing solely nearest neighbor terms:
with for all and some fixed . We assume periodic boundary conditions and thus set . A canonical example is a classical particle chain, with the momentum and position of the -th particle (), and
consisting of kinetic energy terms and the potential energy described by .
The partition function of the physical system is defined as
with the “inverse temperature”. Our goal is to take the thermodynamic limit and compute the canonical free energy density
To evaluate the partition function numerically, we combine the well-known transfer-matrix method [3, 4] with a numerical discretization of integral kernels based on numerical quadrature methods. The latter idea traces back to Nyström  and was recently applied by the second author to the computation of Fredholm determinants .
To keep technical preliminaries as simple as possible, we make the following assumptions, which cover the applications in the next section: Let be a (not necessarily finite) interval of and be a finite positive measure on with a strictly positive, continuous density (weight function). Now we rewrite the partition function in the form
with as before. Here the integral kernel
is assumed to be continuous and bounded; it is strictly positive by construction. We further assume that , i.e., is a symmetric kernel. These assumptions imply, in particular,
so that the symmetric kernel induces an integral operator [7, §16.1]
on the Hilbert space that is self-adjoint and Hilbert–Schmidt (and hence, compact). Since the product of two Hilbert-Schmidt operators is of trace class and the trace class operators form an ideal within the bounded ones, Eq. (5) for may be represented as333This holds for only if would be trace class itself, cf. the discussion in [6, pp. 878–879].
2.2 Dominant eigenvalue and free energy
Following the mathematical theory of compact operators on Hilbert spaces [7, §21.2], the non-zero elements of the spectrum of
(which is real since the operator is selfadjoint) are at most countably many eigenvalues of finite multiplicity that accumulate only at(which belongs to the spectrum).
Generalizing the Perron–Frobenius theory in matrix analysis [8, §8.2], Jentzsch’s Theorem [9, §8.7, Satz 3] states that the Hilbert-Schmidt operator with strictly positive kernel has a simple, dominant, strictly positive eigenvalue. That is, all the non-zero eigenvalues can be ordered as (with each eigenvalue listed as often as given by its multiplicity)
Thus the calculation of the free energy amounts to computing the dominant eigenvalue of .
2.3 Nyström method for computing the dominant eigenvalue
For simplicity, we restrict the discussion of the numerical method to , that is, . For the multi-dimensional case , see the discussion of the example in Sect. 3.3.
We make use of a numerical quadrature rule of the form
with positive weights and nodes . The approximation is of order if the quadrature rule is exact for polynomials of degree at most . It is possible to construct such a unique quadrature rule of maximum order , called Gauss quadrature rule; see  for the classical construction of Gaussian weights and nodes from the tridiagonal Jacobi matrix of the orthogonal polynomials associated with the measure
. Error estimates depend on the regularity of the integrand, e.g., [11, §4.8]: the error for is of the form if and of the form with some if extends analytically to an ellipse or (semi)-strip in the complex plane containing . The former estimate is called algebraic convergence, the latter exponential convergence.
Inserting the quadrature rule into Eq. (8) results in
for all . Setting , we have thus discretized the integral operator by the symmetric matrix (Nyström method)
By the Perron–Frobenius theory [8, Cor. 8.2.6], this (element-wise) strictly positive matrix has a simple, dominant, strictly positive eigenvalue . The following theorem shows that , and thus for the free energy density in Eq. (4)
with a speed of convergence, algebraic or exponential, depending on the smoothness of .
Under the assumptions in Sect. 2.1 the error of the Nyström method for computing the dominant eigenvalue behaves as follows as :
if then there is algebraic convergence ;
if extends analytically to , where is an ellipse or (semi-)strip, there is exponential convergence with some constant .
The classical, though long and quite involved proof goes by the theory of collectively compact operators and can be found in many books on the numerical treatment of integral equations, e.g., [12, Thm. 4.8.20]. Note, that though only the case of algebraic convergence is covered in this reference, the proof extends literally to the case of exponential convergence by adjusting the consistence assumptions accordingly.
An alternative, conceptually much simpler novel proof based on the theory of the Fredholm determinant can be found in the Appendix of this paper.
While the Nyström method for the dominant eigenvalue essentially inherits the convergence properties of an underlying cubature formula also in the multidimensional case (see the proof in the Appendix for guidance), we refrained from formulating a general theorem since the characterization of convergence properties of general cubature formulae is much more involved in the first place. If, however, a Gaussian quadrature is applied coordinate-wise, Theorem 1 extends in a straightforward fashion (in the case of exponential convergence has then to be chosen as an poly-ellipse or poly-(semi-)strip), cf. the example in Sect. 3.3.
We demonstrate the range of applicability of the method via a diverse selection of model systems.
3.1 Classical particle chain
Consider a classical particle chain governed by a Hamiltonian of the form (2) above. For evaluating the partition function, the integration over the momentum variables can be performed in closed form, such that
As specific example for the following, we choose
with anharmonic on-site potential
and coefficients , , . The term ensures that grows asymptotically to infinity as , and the above is equivalent to its symmetrized version .
We now assign the term from the on-site potential to the weight function:
This leads to a (rescaled) Gauss-Hermite quadrature rule [13, §3.5(v)], and we denote the weights by and nodes by , , as above.444A modern, fast numerical method of optimal complexity for calculating these weights and nodes can be found in . The particular choice of the weight function is somewhat arbitrary — we could have also included the cubic and quartic terms from the on-site potential into the weight function; at the expense, though, of a less straightforward computation of the weights and nodes of the quadrature rule. The general reasoning is to capture most of the local weight while retaining a well-behaved kernel for the genuine inter-particle potential (see Eq. (21) below).
with the symmetrized kernel
We then assemble the symmetric matrix in Eq. (13). Finally, after taking all prefactors in to account, the numerical approximation of the free energy density reads
The special case serves as reference, since the partition function factorizes in this case, i.e., with
For the following numerical examples, we set and . Fig. 1 visualizes the kernel in Eq. (21). The factor localizes the kernel around the line , which poses a challenge for accurately “sampling” it using a limited number of points in Eq. (13).
Fig. (a)a shows the free energy as function of , for several values of , and Fig. (b)b the relative error depending on the number of quadrature points . One observes exponential convergence. The less favorable shape of the kernel with increasing , as mentioned above (see also Fig. 1), translates to a slower convergence rate.
Based on the free energy one can obtain averages and higher-order cumulants following the well-known procedure based on derivatives of . For example, the average squared particle distance and energy per site are
independent of by translation invariance. In practice, a higher-order finite difference scheme on a fine grid is well suited to calculate the derivatives. Fig. 3 shows these averages, for the same parameters as before. One notices that the average energy hardly depends on .
As a remark, for the case of vanishing on-site potential, , the model conserves momentum, and the statistical mechanics description changes accordingly . Numerically computing the free energy is less challenging in this case since the partition function factorizes after introducing the “stretch” .
3.2 Discrete nonlinear Schrödinger equation
To be self-contained, we first restate the physical setup: the central object is a complex-valued wave field () governed by the semiclassical Hamiltonian
with parameter (so-called defocusing case). The corresponding partition function reads
where we have introduced the chemical potential as additional parameter, which is dual to the total particle number .
A symplectic change of variables to polar coordinates leads to the representation
with , and (unit circle). The Hamiltonian in these variables reads
It depends only on phase differences, which implies the invariance under the global shift . For evaluating the partition function, the integrals can be calculated in closed form . This leads to
with the kernel
is the modified Bessel function of the first kind. For this example, we use the second factor of the integrand in Eq. (29) as weight function:
with , and the normalization constant
After constructing a Gauss quadrature rule on as described in Sect. 2.3, we form the symmetric matrix in Eq. (13), here denoted since it implicitly also depends on via the quadrature points and weights. Then, taking the prefactor in Eq. (29) and the normalization constant (32) into account, one arrives at
Fig. 4 shows the free energy as function of , for various values of .
Numerically, we again observe exponential convergence with respect to the number of quadrature points, see Fig. 5. At and for example, points suffice for double precision accuracy. The reference data stems from a calculation with .
As mentioned before, one can obtain thermodynamic averages based on derivatives of . For example, the average density and energy per lattice site are
See  for a detailed study of the model.
3.3 Classical oscillators on a cylindrical lattice
The numerical method is in principle also applicable to two-dimensional lattices, by using periodic boundary conditions in one direction and reducing the setting to a quasi-one dimensional problem. Specifically, we consider the lattice for , i.e., starting with periodic boundary conditions both in - and -direction, but eventually sending while keeping finite. Thus we arrive at a cylindrical lattice, as visualized in Fig. 6.
We identify a lattice site by the index , and consider for simplicity scalar spatial variables ; these could be displacements from the reference positions in one fixed direction, for example. denotes the momentum of the -th particle.
As demonstration, let the system be governed by the Hamiltonian
consisting of site-local kinetic and potential energy terms (first sum) as well as nearest neighbor interactions (second sum). Specifically, we consider a local quadratic potential , , and an interaction potential with two coefficients and .
), we subsume the particles contained in one lattice “ring” into the vectors
Similar to the particle chain in subsection 3.1, the momentum integration for evaluating the partition function can be performed explicitly. This results in
Note that is symmetric in its arguments, i.e., for any .
It suggests itself to use the factor in Eq. (39
extends straightforwardly to this choice. An alternative, which is less affected by the inherent curse of dimensionality, is a cubature rule dedicated to multidimensional integration[18, 19, 20, 21], or sparse grid methods. The convergence properties of such cubature rules are more involved, but they would essentially be inherited by the Nyström method for the dominated eigenvalue. We leave an exploration of these ideas for future work.
Using as measure, Eq. (39) becomes
with the kernel
Following the factorized quadrature rule, the symmetric matrix in Eq. (13) takes the form
with multi-indices and the definitions , and , , the weights and points of the one-dimensional rescaled Gauss-Hermite quadrature rule. Thus the overall number of weights and points is .
The numerical approximation of the free energy per lattice site is then
with kept fixed. For the following examples, we set , such that the overall number of quadrature points remains manageable up to . Fig. (a)a visualizes the free energy as function of , for several combinations of . One notices that the curve for is visually indistinguishable from the case with interchanged parameters , pointing to the conclusion that the influence of a finite compared to the “infinite” on the free energy is quite small.
Fig. (b)b shows the corresponding relative error depending on the number of quadrature points along one dimension. In the special case (without coupling in -direction), the partition function factorizes, such that, analogous to Sect. 3.1, with
We evaluate this integral numerically and use it as reference for computing the relative error in Fig. (b)b for . The relative error is still rather large for and ; as before, this observation can be explained by the difficulty of accurately sampling the kernel (44) via (45) using a small number of quadrature points along each coordinate. To mitigate this issue for the present example, one could associate the terms in the Hamiltonian to the integration measure instead of the kernel, at the expense of a more complicated quadrature rule.
In summary, this application example demonstrates that our method can in principle handle two-dimensional lattice topologies as well, although the large number of required quadrature points (when interpreting the problem as quasi one-dimensional) limits the size of the periodic dimension in practice.
4 Conclusion and outlook
The convergence plots of the example applications illustrate the validity of Theorem 1, which states that approximating the dominant eigenvalue of the discretized kernel inherits the favorable exponential convergence properties of the underlying quadrature rule in the case of kernels extending analytically into the complex domain.
To optimize the numerical performance of the method for the cylindrical topologies, one could further exploit the factorized structure of in (44) along coordinate directions, or use sparse grid methods for the quadrature as mentioned above.
C.M. likes to thank Herbert Spohn and Abhishek Dhar for helpful discussions, and the Munich Center for Quantum Science and Technology for support.
We give here an alternative, conceptually much simpler proof555To the best of our knowledge, this proof has not yet been given in the literature. of Theorem 1 based on the theory of the Fredholm determinant of the kernel , namely
shows that the multiplicities of the roots of and the multiplicities of the non-zero eigenvalues of agree. In particular, is a simple root and therefore . Also, [6, Thm. 6.2] (whose proof can literally be extended to the current assumptions) gives
where, uniformly for bounded , the error is given by or according to whether or extends analytically into the complex plane. By Perron–Frobenius is the simple, dominant, strictly positive eigenvalue of the entry-wise positive matrix , which by the argument principle of complex analysis must satisfy
Hence, by inserting into (# ‣ Appendix), followed by a Taylor expansion, we get
which completes the proof.
-  L. D. Landau and E. M. Lifshitz. Statistical Physics: Part 1. Pergamon, 1980.
-  K. Huang. Introduction to Statistical Physics. Taylor and Francis, 2010.
-  H. A. Kramers and G. H. Wannier. Statistics of the two-dimensional ferromagnet. Part I. Phys. Rev., 60:252–262, 1941.
-  G. Mussardo. Statistical Field Theory: An Introduction to Exactly Solved Models in Statistical Physics. Oxford University Press, 2009.
-  E. J. Nyström. Über die praktische Auflösung von Integralgleichungen mit Anwendungen auf Randwertaufgaben. Acta Math., 54:185–204, 1930.
-  F. Bornemann. On the numerical evaluation of Fredholm determinants. Math. Comp., 79:871–915, 2010.
-  P. D. Lax. Functional Analysis. Wiley-Interscience, 2002.
-  R. A. Horn and C. R. Johnson. Matrix analysis. Cambridge University Press, Cambridge, 1985.
-  S. Fenyö and H.-W. Stolle. Theorie und Praxis der linearen Integralgleichungen 2. VEB Deutscher Verlag der Wissenschaften, Berlin, 1983.
-  G. H. Golub and J. H. Welsch. Calculation of Gauss quadrature rules. Math. Comp., 23:221–230, 1969.
-  P. J. Davis and P. Rabinowitz. Methods of numerical integration. Dover Publications, Inc., Mineola, NY, 2007. Corrected reprint of the second (1984) edition.
-  W. Hackbusch. Integral Equations, Theory and Numerical Treatment. Birkhäuser Verlag, Basel, 1995.
-  F. W. J. Olver, D. W. Lozier, R. F. Boisvert, and C. W. Clark, editors. NIST Handbook of Mathematical Functions. Cambridge University Press, 2010.
-  A. Townsend, T. Trogdon, and S. Olver. Fast computation of Gauss quadrature nodes and weights on the whole real line. IMA J. Numer. Anal., 36:337–358, 2016.
-  H. Spohn. Nonlinear fluctuating hydrodynamics for anharmonic chains. J. Stat. Phys., 154:1191–1227, 2014.
-  C. B. Mendl and H. Spohn. Low temperature dynamics of the one-dimensional discrete nonlinear Schrödinger equation. J. Stat. Mech., 2015:P08028, 2015.
-  K. O. Rasmussen, T. Cretegny, P. G. Kevrekidis, and N. Grønbech-Jensen. Statistical mechanics of a discrete nonlinear system. Phys. Rev. Lett., 84:3740–3743, 2000.
-  A. H. Stroud. Approximate Calculation of Multiple Integrals. Prentice-Hall, 1971.
-  R. Cools and P. Rabinowitz. Monomial cubature rules since “Stroud”: a compilation. J. Comput. Appl. Math., 48:309–326, 1993.
-  R. Cools. Constructing cubature formulae: the science behind the art. Acta Numerica, 6:1–54, 1997.
-  V. Keshavarzzadeh, R. M. Kirby, and A. Narayan. Numerical integration in multiple dimensions with designed quadrature. SIAM J. Sci. Comput., 40:A2033–A2061, 2018.
-  J. Haegeman and F. Verstraete. Diagonalizing transfer matrices and matrix product operators: A medley of exact and computational methods. Annu. Rev. Condens. Matter Phys., 8:355–406, 2017.
-  M. Dellnitz and O. Junge. On the approximation of complicated dynamical behavior. SIAM J. Numer. Anal., 36:491–515, 1999.