# From dynamics to equilibrium

## Metropolis sampling

Given the parameters of the Ising model ($\displaystyle{ \textstyle\beta, \{J_{ij}\} }$), one can use the Metropolis sampling (also called Glauber dynamics) to sample the Boltzmann distribution.

To collect 'm' configurations that independently sampled from the Boltzmann distribution, the procedure is detailed below:

• starting from an initial configuration $\displaystyle{ \textstyle\underline\sigma }$ (for example a random configuration);
• for t = 1:m
• for t'=1:T
• randomly select a spin, say 'i', set its value according to probability $\displaystyle{ \textstyle P(\sigma_i | \underline \sigma)=\frac{ e^{\beta\sigma_i\sum_jJ_{ij}\sigma_j}}{2\cosh\beta\sum_jJ_{ij}\sigma_j} }$
• end
• record the current configuration.
• end

We can see that to collect 'm' configurations, totally 'mT' configurations are generated, where a large-enough constant 'T' is the relaxation time to make sure that configurations are sampled independently.

## Detailed balance and equilibrium

The configurations generated in the way described above form a Markov chain. So above procedure is usually called Markov Chain Monte Carlo (MCMC) simulation or Gibbs sampling. We know that the system has an equilibrium if the Markov Chain is reversible, in physics it is called Detailed Balance. That is for two consecutive configurations

$\displaystyle{ \underline\sigma=\{\sigma_1,\sigma_2,...,\sigma_i,...,\sigma_n\} }$

and

$\displaystyle{ \underline\sigma=\{\sigma_1,\sigma_2,...,-\sigma_i,...,\sigma_n\}, }$

$\displaystyle{ P(\underline\sigma\to\underline s)P(\underline\sigma)=P(\underline s\to \underline\sigma)P(\underline s). }$

Next we are going to show the condition for the detailed balance and the result distribution associated with the equilibrium.

First of all we see that the transition probabilities between two configurations are given by

$\displaystyle{ P(\underline\sigma\to\underline s)=\frac{ e^{-\beta\sigma_i\sum_jJ_{ij}\sigma_j}}{2\cosh\beta\sum_jJ_{ij}\sigma_j}, }$
$\displaystyle{ P(\underline s\to\underline \sigma)=\frac{ e^{\beta\sigma_i\sum_jJ_{ij}\sigma_j}}{2\cosh\beta\sum_jJ_{ij}\sigma_j}. }$

Then the condition for detailed balance is written as

$\displaystyle{ e^{-\beta\sigma_i\sum_jJ_{ij}\sigma_j}P(\underline\sigma)=e^{\beta\sigma_i\sum_jJ_{ij}\sigma_j}P(\underline s), }$

which implies that

$\displaystyle{ P(\underline\sigma)\propto e^{\frac{1}{2}\beta\sum_i\sum_jJ_{ij}\sigma_i\sigma_j}. }$

Inserting the last equation into the detailed-balance-condition gives

$\displaystyle{ e^{-\beta\sum_j\sigma_i\sigma_jJ_{ij}+\frac{1}{2}\beta\sum_j\sigma_i\sigma_jJ_{ij}+\frac{1}{2}\beta\sigma_i\sigma_jJ_{ji}}=e^{\beta\sum_j\sigma_i\sigma_jJ_{ij}-\frac{1}{2}\beta\sum_j\sigma_i\sigma_jJ_{ij}-\frac{1}{2}\beta\sigma_i\sigma_jJ_{ji}}, }$

which evaluates to

$\displaystyle{ e^{\beta\sum_j\sigma_i\sigma_jJ_{ij}}=e^{\beta\sum_j\sigma_i\sigma_jJ_{ji}}. }$

So above condition can be satisfied iff

$\displaystyle{ J_{ij}=J_{ji} }$
$\displaystyle{ J_{ii}=0 }$

and the associated equilibrium distribution is Boltzmann distribution.