The Metropolis Algorithm#
The Metropolis algorithm provides an elegant solution to this sampling problems. Rather than trying to calculate absolute probabilities, it works with probability ratios:
Starting from a configuration \(i\):
Propose a random move to configuration \(j\).
Calculate the energy change \(\Delta E_{ij} = E_j - E_i\).
Accept the move with probability:
\[A(i \rightarrow j) = \min(1, \exp(-\Delta E_{ij}/kT))\]
This acceptance criterion ensures:
Moves that lower energy (\(\Delta E < 0\)) are always accepted.
Moves that raise energy are accepted with probability \(\exp(-\Delta E/kT)\)
The partition function \(Z\) cancels out in the ratio