Introduction to Mathematical Physics/Statistical physics/Some numerical computation in statistical physics

In statistical physics, mean quantities evaluation can be done using by Monte--Carlo methods. in this section, a simple example is presented.

The following Metropolis algorithm , is used \index{Metropolis} to simulate probabilities $$exp(-E/k_BT)$$:

 select spin $$S_k$$ to consider. evaluate variation of energy $$\Delta E=E_{new}-E_{old}$$ associated to a possible split of spin $$S_k$$.  compare a random number $$z$$ between zero and one with probability $$p=exp(-\Delta E/k_BT)$$.  split spin number $$k$$ (that is do $$S_k=-S_k$$) i=f and only if $$z use the obtained configuration to compute mean quantities.  