Loading [MathJax]/extensions/Safe.js
The two-dimensional Ising model The Hamiltonian of the Ising model is \begin{equation*} \mathcal{H} = -J \sum_{\langle i, j \rangle} \sigma_i \, \sigma_j \end{equation*} where $\sigma_i = \pm 1$ is a spin living on the site $i$ of a periodic square lattice with $N = L \times L$ sites. We will consider a ferromagnetic coupling and set our unit of energy $J=1$. We will be interested in computing the energy and the magnetization at a given temperature $T = 1/\beta$ \begin{equation*} \langle \mathcal{O} \rangle = \frac{1}{Z} \sum_{\sigma} e^{-\beta E(\sigma)} \, \mathcal{O}(\sigma) \qquad \text{where} \quad \mathcal{O} = E, m \end{equation*} The sum is over all spin configurations $\sigma = \{\sigma_1, \ldots, \sigma_N\}$. This is a total of $2^N$ terms which quickly becomes intractable. % matplotlib inline % config InlineBackend.figure_format = 'retina' import matplotlib.pyplot as plt import numpy as np np . random . seed ( 29387 ) plt . style . use ( 'style.mpl' )