Most problems in stat mech have similiar procedures. This page is for the programs of solving problems.

The steps of Monte Carlo of Metropolis.

- Initialize
- Change
- Transition probability
- Random number
- Compare
- Update states

Detail balance is the key to the update rule,

\[P(S_i)P(S_i \to S_j) = P(S_j) P(S_j\to S_i),\]

which can be rewritten as

\[\frac{P(S_i\to S_j)}{P(S_j\to S_i)} = \frac{ P(S_j) }{ P(S_i) }.\]

For Boltzmann distribution, we have

\[\frac{ P(S_j) }{ P(S_i) } = e^{ - (E_j - E_i)/k_B T}.\]

© Copyright 2017, Lei Ma. | On GitHub | Index of Statistical Mechanics | Created with Sphinx1.2b2.