How does Metropolis algorithm work in the Ising model? I was reading the proof of Metropolis algorithm.
The transition probability of going from a state $i$ to a state $j$ is $\pi_{ij}$. If I understand correctly, this is the product $\pi_{i
j}=\alpha_{ij}p_{ij}$ where $\alpha_{ij}$ is the probability of selecting the spin that is flipped when going from $i$ to $j$ and $p_{ij}$ is the acceptance probability ($1$ if the new state lowers total energy and $e^{-\beta \Delta E}$ if it doesn't).
What I don't understand is detailed balance. It is said that $p_i \pi_{ij}=p_j \pi_{ji}$. I don't know what $p_{i}$ is. What is the difference with $\pi_{ij}$?
And when I calculate average observables numerically , such as energy, should I take the value of one should I take the mean?
 A: You can think of the whole thing as a "fluid of systems" and each one of them can be in any of the states $i$ available.


*

*$\pi_{ij}$ tells you what is the speed at which a system in state $i$ will go to state $j$ 

*$p_i$ tells you how likely it is for a system (in this fluid or ensemble of systems) to be in state $i$ and is proportional to the number of systems in this state. If your system is in contact with a thermostat $p_i \propto \exp(-\beta E_i)$
Now, the total flux that goes from $i$ to $j$ is the velocity to go from $i$ to $j$ for a single system times the number of systems in state $i$; hence $p_i \pi_{ij}$. Conversely, the total flux to go from $j$ to $i$ is $p_j \pi_{ji}$.


*

*The detailed balance criterion (which is a sufficient criterion for equilibrium) tells you that the flux from $i$ to $j$ has to be balanced by the flux from $j$ to $i$ so that state $i$ (stationary) population cannot suffer any loss/gain by moving to to state $j$ as it is exactly balanced by systems from $j$ moving to $i$ and vice versa.

