1 Introduction

The Ising model was proposed by Lenz in 1920 and solved in one dimension, therefore without the phase transition, by Ising in 1925 in his doctoral dissertation [1]. The main result is due to Onsager [2] in 1944 where the exact partition function for the model in 2D in the absence of the magnetic field B was calculated. In 1952 Yang [3] has proven an exact formula (earlier announced by Onsager and Kaufman in 1949) for the first derivative of the partition function of the Ising Model in 2D with respect to B at \(B=0\) (magnetization). There are thousands of papers on the subject trying to include the non-vanishing magnetic field and huge body of results, both numerical and analytical, exists for the Ising on finite lattices (for a review see for example [4]). The most surprising were the papers [5, 6] that gave the description of the Ising model with the magnetic field in the conformal field theory language but only in the scaling limit (see for example [7] for a review of the results). There are also far-reaching results and efficient polynomial algorithms for magnetic susceptibility in the vicinity of the scaling limit [8]. The present paper presents the largest (as far as we know) full low temperature expansion in the presence of the magnetic field in powers of \(x=\exp (-J/(kT))\) and \(z=\exp (B/(kT))\) describing both the analytic expansions of the partition function and the efficient combinatorial methods to get the coefficients of the expansion in \(x^4\) (as polynomials in \(z^{-2}\)) and in \(z^{-2}\) (as polynomials in \(x^4\)) in the former case up to \(x^{88}\) and in the latter up to \(z^{-60}\). In the combinatorial part new algorithms were invented to speed up the computations and the supercomputing power of the Grid.pl was used with parallel computing using 64 GPU cards (in the GPU oriented version of the algorithm) or 15,000 CPU (in the CPU oriented version).

2 Basic Considerations

On a 2D square lattice with N ‘spins’ \(\sigma = \pm 1\) we introduce a Hamiltonian

$$\begin{aligned} H = -\frac{J}{2} \sum _{i,j,i\ne j}\sigma _i\sigma _j -B\sum _i\sigma _i. \end{aligned}$$
(1)

where the first sum runs over closest neighbours only. We will assume that \(J>0\) (the ferromagnetic Ising model) and the system is on a square \(\sim \sqrt{N}\times \sqrt{N}\) with periodic boundary conditions. We will introduce the notation

$$\begin{aligned} x:=\textrm{e}^{-\beta J},\ \ \ \ z:=\textrm{e}^{\beta B} \end{aligned}$$
(2)

where \(\beta =1/T\) and we assume that \(z\geqslant 1\) what corresponds to the choice of the direction of B.

We define the normalized free energy

$$\begin{aligned} \textrm{e}^{-\beta NF_N(x,z)} = Z_N(x,z) =\sum \textrm{e}^{-\beta (E-E_0)} \end{aligned}$$
(3)

where the sum runs over all configurations and \(E_0\) is the lowest energy corresponding to the configuration with all spins pointing in the direction of B for which \(\textrm{e}^{-\beta E_0}=x^{-N^2}z^N\). The goal is to calculate the free energy per spin \(F_N\) in the thermodynamic limit \(N\rightarrow \infty \). The advantage of calculating \(F_N(x,z)\) over \(Z_N(x,z)\) is that one has to include only ‘connected diagrams’.

A simple case of \(J = 0\) gives immediately the result

$$\begin{aligned} -\beta F_N(1,z)= \ln \left( 1 +\frac{1}{z^2}\right) \end{aligned}$$
(4)

The low temperature expansion (which starts from a special configuration with all spins directed in the direction of B) consists of specially ordered contributions from configurations with more and more inverted spins. For N sufficiently large so that the periodic boundary conditions do no not play a role up to a given order we have

$$\begin{aligned} \textrm{e}^{-\beta NF_N(x,z)}= & {} \left( 1 + \frac{N}{z^2}x^8 + \frac{N}{2z^4}\left( (N-5)x^{16}+4x^{12}\right) \nonumber \right. \\{} & {} \left. + \frac{N}{6z^6}\left( (N^2-15N+62)x^{24}+12(N-6)x^{20}+36x^{16}\right) +\ldots \right) \nonumber \\= & {} \left( 1 + \frac{x^8}{z^2} + \frac{x^{12}(1-x^4)2}{z^4}+\frac{x^{16}(1-x^4)(-8x^{4}+6)}{z^6}+\ldots \right) ^N \end{aligned}$$
(5)

where we ordered terms by increasing powers of \(z^{-2}\) and the polynomial in parentheses is finite with the last term equal to \(z^{-2N}\).

The task is to calculate the thermodynamic limit of the expression in parentheses

$$\begin{aligned} \exp (f^\infty (x, z)) =\lim _{N\rightarrow \infty }\exp (-\beta F_N(x, z)) =\exp \left( \sum _{m,k}C_{m,k}\,x^{4m}z^{-2k}\right) \end{aligned}$$
(6)

For example

$$\begin{aligned} \exp (f^\infty (1,z)) = 1 +\frac{1}{z^2} \end{aligned}$$
(7)

The famous result of Onsager [2] gives the full result for the case \(z=1\) (\(B = 0\)):

$$\begin{aligned} \exp (f^\infty _{Ons}(x)) = \lim _{z\rightarrow 1}\exp (f^\infty (x, z)) = (1 + x^4)\exp \left( - \sum _{n=1}^{\infty }\left( \frac{(2n)!}{(n!)^2}\right) ^2 \frac{1}{4n}\left( \frac{y}{4(1 + y)^2}\right) ^n\right) \end{aligned}$$
(8)

where

$$\begin{aligned} y =\frac{4}{\left( \frac{1}{x^2}-x^2\right) ^2} \end{aligned}$$
(9)

In the original article the result was expressed in terms of elliptic functions. This result serves as a check for our results. The beginning of the expansion:

$$\begin{aligned} \exp (f^\infty _{Ons}(x)) = 1 + x^8+2x^{12}+5x^{16} +14x^{20}+44x^{24}+152x^{28}+566x^{32}+\ldots \end{aligned}$$
(10)

The result of Yang [3] for the magnetization at \(B = 0\)

$$\begin{aligned} \left. z\frac{\partial f^\infty (x,z)}{\partial z}\right| _{z=1}=\big (1-y^2\big )^{\frac{1}{8}}-1 \end{aligned}$$
(11)

although extremely simple was obtained by a very complicated method and it serves as yet another check on the results. The result for susceptibility \(\left. z\partial _z(z\partial _z (f^\infty (x,z)))\right| _{z=1}\) is not known analytically but only as a beginning of an expansion in \(x^4\). There is a large literature on the calculation of susceptibility, for example in [9] one can find explicitly 38 first coefficients of the expansion and in [8] one can find asymptotic formulae for susceptibility close to the scaling limit based on several hundred coefficients—it would be interesting to compare the numerically known asymptotic behavior of susceptibility close to the scaling limit with the results of the present paper.

The phase transition for \(B=0\) occurs for a temperature when the expression in parentheses in (8) diverges:

$$\begin{aligned} y = 1 \Rightarrow x_c^4+x_c^{-4}=6\Rightarrow x_c^4=3 - 2\sqrt{2} \end{aligned}$$
(12)

The formula for the partition function when \(B\ne 0\) is not analytically known.

3 Combinatorial and Symbolic Algorithms

We consider a square lattice \(L\times L\) on the torus and define configuration \(\sigma \) as any assignment of values \(\sigma _{i, j}\), spanning the set \(\{ 0, 1 \}\), to the lattice nodes ij \(\in \) [0, L − 1]. Let \(C(\sigma )\) be a circumference function on \(\sigma \), defined as follows:

$$\begin{aligned} C(\sigma ) = \sum _{i=0}^{L-1} \sum _{j=0}^{L-1} (\sigma _{i,j} \oplus \sigma _{i,j+1\!\!\!\!\! \mod L} + \sigma _{i,j} \oplus \sigma _{ i + 1 \!\!\!\!\! \mod L, j} ) \end{aligned}$$
(13)

where \(\oplus \) denotes exclusive OR. Finding the formula proposed in this work requires determining the number of configurations \(\sigma \) with a given value of \(C(\sigma )\) for a fixed number m of ones in the \(\sigma _{i,j}\) set and a given torus size L. The problem is computationally extensive, especially in the parameter range of interest. The total number of such configurations for a given m and L is \(\left( {\begin{array}{c}L^2\\ m\end{array}}\right) \). Below we present two variants of an algorithm for finding the required number of configurations and describe their respective differences.

Algorithm variant I

We denote by a the number of configurations \(\sigma \) sharing the same value of \(q=C(\sigma )\), for a given m and L. The total number of configurations for \(m=10\) and \(L=21\) is 69180774489220679208. Sample values of q and a are shown in the table below.

q

a

14

13230

16

397782

18

17229870

\(\cdots \)

\(\cdots \)

36

3728300274453675564

38

19491600033692972892

40

45521466242717189340

The main idea of the proposed algorithm is to represent each configuration \(\sigma \) as an L-element sequence \(p = [ p_1, p_2, \ldots p_L ]\) of sums over the rows (or columns) of the torus lattice, i.e. \(\sum _{i=1}^{L} p_i = m, p_i \in \{0, 1, \ldots L\}\). Thus, each element of the sequence is equal to the number of ones in the corresponding row (or column). Considering that the studied values of m and L are of the same order, there are many sequences p with multiple zero values. We introduce a polynomial g:

$$\begin{aligned} g(x) = \sum _{i} a_i x^{q_i} \end{aligned}$$
(14)

where:

\(q_{i}\) the value of \(C(\sigma )\)

\(a_{i}\) the number of configurations \(\sigma \) with a given value of \(q_{i}\)

We observe, that the number of configurations having the same value of the \(C(\sigma )\) function can be calculated by determining the polynomial g. Further, we find that the polynomial g(x) can be formulated as an expression of polynomials \(g_{k}(x)\) representing all subsequences \(G_k\) of the sequence p separated by one or more consecutive zeros or ones. For the separator 0, this expression is the product of polynomials representing individual subsequences \(G_k\), while for the separator 1 an analogous algebraic formula can be given.

For sequences with a size equal to the size of the torus L, the algorithm should be run for all the sequences of length \(p_0\) and the computation of the final output should take into account the correspondence of the values for \(p_0\) and \(p_{L-1}\). Example: for \( L = 21 \) and sequence \( p = [2, 3, 7, 5, 3] \), the polynomial representation is of the form:

$$\begin{aligned} g(x)= & {} 1890 x^{24}+35469 x^{26}+513429 x^{28}+6059214 x^{30}\nonumber \\{} & {} +60282390 x^{32}+532295715 x^{34}\nonumber \\{} & {} +4216243920 x^{36}+30319386972 x^{38}\nonumber \\{} & {} +198904938603 x^{40}+1191973363014 x^{42}\nonumber \\{} & {} +6515264362656 x^{44}+32349141844341 x^{46}\nonumber \\{} & {} +145002536779275 x^{48} + 581984976967422 x^{50}\nonumber \\{} & {} +2071038766883856 x^{52}+6459065687883018 x^{54}\nonumber \\{} & {} +17419061247080493 x^{56} +40019991455704323 x^{58}\nonumber \\{} & {} +77114090303006253 x^{60} +122702527182508161 x^{62}\nonumber \\{} & {} +158880959047544181 x^{64} +165175913830079061 x^{66}\nonumber \\{} & {} +136114567514444358 x^{68} +87688385553126582 x^{70}\nonumber \\{} & {} +43396295154271416 x^{72}+16078044280858812 x^{74}\nonumber \\{} & {} +4267980947851488 x^{76}+742151135328120 x^{78}+65807307035568 x^{80} \end{aligned}$$
(15)

Finding polynomial representations \(g_{k}(x)\) for all \(G_k\) groups is computationally extensive. The naive approach requires reviewing all configurations that make up a \(G_k \) group. Work is underway to develop a more efficient algebraic method reducing the search space of sequences and number of matrix operations.

We can observe that the generating function g(x) is invariant to certain transformations of the subsequences \(G_k\). These transformations include:

  • Rotation In torus topology, a sequence can be started at any given index; all such sequences are equivalent, e.g. (\(p_0\), \(p_1\),..., \(p_j\),... \(p_m\)) is equivalent to (\(p_j\),... \(p_m\), \(p_0\),..., \(p_{j-1}\))

  • Inversion Of any subsequence \(G_k\)—Any subsequence (\(m_0\)... \(m_{j-1}\), \(m_j\)) is equivalent to subsequence (\(m_j\), \(m_{j-1}\)... \(m_0\))

  • Translation Elements of the zero subsequences (separators) can be shifted between those subsequences, as long as each separator subsequence contains at least one element.

  • Swap All sequences constructed by swapping entire subsequences \(G_k\) are equivalent to the original sequence p.

Given a sequence, we can formulate an algorithm for finding the number of such transformations. Moreover, we can designate a sequence representing the group of sequences sharing the same value of \(C(\sigma )\), resulting from invariant transformations, and use it in downstream computations. Intermediate results for subsequences \(G_k\) shared across groups p are reused to reduce computational complexity. The final result for a sequence p is calculated based on the values found for all its subsequences \(G_k\).

Variant II

In this algorithm variant we fix the values of L and q = C\((\sigma )\) and look for the number of configurations a with m ones, for all values of m. We note that for a given value of C, we can reduce computational complexity by performing the calculations on a lattice of size \(\tfrac{C}{2}\) + 1.

Below is an example for \(C=36\) and \(L=19\)

m

a

81

361

80

2166

79

7942

\(\cdots \)

\(\cdots \)

11

586185684966484668

10

682914380225164860

9

172190699515632837

Next, for a perimeter C, we define \(C_v\) and \(C_h\), denoting, respectively, the number of vertical and horizontal lattice edges on C:

\(C_h = [C_{h1}, C_{h2}, \ldots , C_{hn}] \)

where \(C_{hi}\) is the number of horizontal edges in column  i.

Similarly to variant I, we can use symmetries in sequences \(C_v\) and \(C_h\) to reduce the complexity of the algorithm (in this method for separator 0 only). We observe that these symmetries allow to perform computations for \(C_h\) in the range of \(1, \ldots ,\lfloor {\frac{C}{4}}\rfloor \) and reuse the results for higher values (\(\lfloor ...\rfloor \) is the floor function).

The above algorithm can be implemented as separate tasks performed on a computing cluster. These tasks, i.e., finding symmetries, calculating the value of the polynomial generating function and construction of the final solution are easily parallelizable and can be run on GPUs.

The algorithms described were devised and implemented for the square Ising model with the magnetic field but their possible scope of applications (with eventual modifications) is much wider—different spin configurations, different boundary conditions, extension to higher spins etc.

4 Results

We assume that \(x \leqslant 1\) and \(z\geqslant 1\) so all the expansions are in positive powers of x and negative powers of z. We will present the results in two different expansions: all powers of x up to a given inverse power of z (in our case up to \(z^{-60}\)) and all inverse powers of z up to a given power of x (in our case up to \(x^{88}\)).

4.1 Expansion in Inverse Powers of z

As it turns out it is much better to expand the partition function (5) in inverse powers of \(z^2 +x^8\) and not \(z^2\). It is a new result that the polynomials being coefficients of the expansion are divisible by the growing powers of \((1-x^4)\):

$$\begin{aligned} z^2 \exp (f^\infty ) = z^2 + x^8 +\sum _{k=1}^\infty \frac{(1 - x^4)^{\lfloor k/2\rfloor +1}x^{4l}M_k(x^4)}{(z^2 + x^8)^k} \end{aligned}$$
(16)

where \(M_k(x^4)\) are ‘magnetic’ polynomials of degree \((2k + 1 - \lfloor k/2\rfloor - l)\) with integer coefficients and

$$\begin{aligned} l = \lfloor \sqrt{4k + 3}\rfloor + 1 \end{aligned}$$
(17)

In the Appendix all \(M_k\) polynomials are given up to \(k=29\) what corresponds to \(\exp (f^\infty )\) up to \(z^{-60}\). Thanks to the powers of x and \((1-x^4)\) in front of \(M_k\) in (16) the number of polynomial coefficients to be calculated at each order of \(z^{-2k}\) is greatly reduced in comparison to the usual expansion in inverse powers of \(z^2\).

The fact that the coefficients have to be divisible by a growing power of \((1-x^4)\) is a very powerful check on calculations.

4.2 Expansion in Powers of x

The expansion reads

$$\begin{aligned} \exp (f^\infty ) = 1 +\sum _{k=1}^{\infty }\frac{x^{8k}}{z^{2k^2}} P_k^s\big (z^2\big ) + 2\sum _{k=1}^{\infty }\frac{x^{8k+4}}{z^{2k(k+1)}} P_k^r\big (z^2\big ) \end{aligned}$$
(18)

The superscripts s and r stand for ‘square’ and ‘rectangle’ since the first class starts from a square \(k \times k\) and the subsequent powers of \(z^2\) correspond to reversing spins keeping the same perimeter and the second class starts from two rectangles \(k\times (k+1)\) and \((k+1)\times k\) and again the subsequent powers of \(z^2\) correspond to reversing spins keeping the same perimeter. Since the expansion is for \(\exp (f^\infty )\) we include the ‘disconnected diagrams’.

We quote first few polynomials (they were calculated up to \(P^s_{11}\) and \(P^r_{10}\) but they are too long to be presented here)

$$\begin{aligned} P^s_1= & {} 1\nonumber \\ P^s_2= & {} 1 + 6z^2 - 2z^4\nonumber \\ P^s_3= & {} 1 + 6z^2 + 22z^4 + 40z^6 + 44z^8 - 77z^{10} + 8z^{12}\nonumber \\ P^s_4= & {} 1 + 6z^2 + 22z^4 + 68z^6 + 151z^8 + 310z^{10} + 462z^{12}\nonumber \\{} & {} +546z^{14} + 221z^{16} - 424z^{18}- 1556z^{20} + 799z^{22} - 40z^{24}\nonumber \\ P^s_5= & {} 1 + 6z^2 + 22z^4 + 68z^6 + 187z^8 + 426z^{10} +914z^{12}+1728z^{14}+2979z^{16}\nonumber \\{} & {} +4572z^{18} +6426z^{20} +7444z^{22}+7557z^{24}+3699z^{26}-2696z^{28}-14444z^{30}\nonumber \\{} & {} -18964z^{32}-13598z^{34}+30348z^{36}-7672z^{38}+225z^{40} \end{aligned}$$
(19)

The polynomials \(P^s_k\) are of degree \(k(k - 1)\) in \(z^2\). These polynomials are the result of calculations but the lowest coefficients in these polynomials can be understood analytically. For example the first nontrivial term, \(6z^2\), in \(P^s_k\) with the prefactor \(x^{8k}\) (i.e. perimeter 4k): we start from a very large lattice of spins (much bigger than \(k\times k\)) pointing in the direction of B and a square \(k\times k\) with \(k^2\) spins pointing in the direction opposite to B—hence the prefactor \(z^{-2k^2}\). The next term corresponds to reversing the spins of four corners of the square and adding two rectangles \((k - 1) \times (k + 1)\) and \((k + 1) \times (k - 1)\) with all six contributions having the same perimeter but one spin less pointing in the direction opposite of B—hence the term \(6z^2\). The next term, \(22z^4\), can be explained as coming from six pairs of reversed spins in the disjoint corners of the square, eight pairs of reversed adjacent spins in the corners of the square and eight reversed in the corners of the two rectangles all of which have again the same perimeter 4k. For higher and higher terms the analysis gets more and more involved.

The second set:

$$\begin{aligned} P^r_1= & {} 1\nonumber \\ P^r_2= & {} 1 + 4z^2 + 9z^4 - 7z^6\nonumber \\ P^r_3= & {} 1 + 4z^2 + 15z^4 + 36z^6 + 67z^8 + 69z^{10} + 20z^{12} - 185z^{14} + 49z^{16}\nonumber \\ P^r_4= & {} 1 + 4z^2 + 15z^4 + 44z^6 + 109z^8 + 228z^{10} + 432z^{12} + 671z^{14} + 951z^{16}\nonumber \\{} & {} +948z^{18} + 615z^{20} - 611z^{22} - 1854z^{24} - 2735z^{26} + 2652z^{28} - 353z^{30}\nonumber \\ P^r_5= & {} 1 + 4z^2 + 15z^4 + 44z^6 + 119z^8 + 280z^{10} +604z^{12}+1204z^{14}+2236z^{16}+3787z^{18}\nonumber \\{} & {} +6088z^{20} +8873z^{22}+12000z^{24}+14487z^{26}+15697z^{28}+12729z^{30}+6636z^{32}\nonumber \\{} & {} -8736z^{34}-24893z^{36}-43974z^{38}-32931z^{40}-347z^{42}\nonumber \\{} & {} +75787z^{44}-32552z^{46}+2602z^{48} \end{aligned}$$
(20)

The polynomials \(P^r_k\) are of degree \((k^2 - 1)\) in \(z^2\). Analysis analogous to \(P^s_k\) gives the prefactor \(x^{8k+4}\) from the perimeter \((4k+2)\), \(z^{-2k(k+1)}\) from the number \(k(k+1)\) of reversed spins and 2 from the two rectangles \(k\times (k+1)\) and \((k+1)\times k\) that we start with. Then the first nontrivial term \(8z^2\) corresponds to removing eight corners of any of these two rectangles.

These polynomials for \(z = 1\) should match the expansion (10) and the derivatives \(\partial _z\) at \(z=1\) the expansion (11) what are very useful checks on the calculation.

We can note that some patterns emerge (what seems to be related to [10]). For \(P^s\) we have

$$\begin{aligned} A^s =\prod _{m=1}^{\infty }\big (1 - z^{2m}\big )^{-3}\big (1 + z^{2m}\big )\big (1 + z^{4m-2}\big )^2 = 1 + 6z^2 + 22z^4 + 68z^6 + 187z^8 + 470z^{10} + \ldots \end{aligned}$$
(21)

while for \(P^r\) we have

$$\begin{aligned} A^r = \prod _{m=1}^{\infty }\big (1 - z^{2m}\big )^{-3}\big (1 + z^{2m}\big )\big (1 + z^{4m}\big )^2 = 1 + 4z^2 + 15z^4 + 44z^6 + 119z^8 + 292z^{10} + \ldots \end{aligned}$$
(22)

k first terms of these expansions are exact in \(P_k\) (checked up to \(k=10\)). The existence of these ‘\(\theta \)-function like’ patterns reproducing (19) and (20) is extremely intriguing but we were unable to justify this heuristic observation.

5 Conclusions

It is pointed out that, unexpectedly, polynomials in the expansion of the free energy in the thermodynamical limit in inverse powers of \((z^2+x^8)\) have to be divisible by growing powers of \((1-x^4)\). Not only does it provide a new and powerful check on the calculations but also gives a hint about the intriguing ‘off-diagonal’ correlations in the Ising model mixing the \(B\ne 0\) contributions with the usual low temperature \(B=0\) expansion what may be useful on the road to find the full analytic expression for the partition function of the Ising model with non-vanishing magnetic field. The patterns that are suggested by the results are not easy to justify. Several combinatorial algorithms are proposed in the paper that make the calculations of the expansion in \(x^4\) and \(z^{-2}\) feasible also for large powers, in the present case up to \(x^{88}\) and \(z^{-60}\).