Glauber dynamics
In statistical physics, Glauber dynamics{{cite journal|url=https://aip.scitation.org/doi/abs/10.1063/1.1703954|title=Time-Dependent Statistics of the Ising Model |journal= Journal of Mathematical Physics|date= February 1963|volume= 4|issue= 2|pages= 294–307|doi= 10.1063/1.1703954|language=en-US|access-date=2021-03-21|last1= Glauber|first1= Roy J.|url-access= subscription}} is a way to simulate the Ising model (a model of magnetism) on a computer.{{cite journal|url= http://journals.aps.org/pre/abstract/10.1103/PhysRevE.90.032141|title=Effective ergodicity in single-spin-flip dynamics |journal= Physical Review E|date= 29 September 2014|volume= 90|issue= 3|page= 032141|doi= 10.1103/PhysRevE.90.032141|language=en-US|access-date=2022-08-09|last1= Süzen|first1= Mehmet|pmid= 25314429|arxiv= 1405.4497|s2cid= 118355454}}
The algorithm is named after Roy J. Glauber.
The algorithm
The Ising model is an abstract model for the magnetic interaction of neighboring atoms. It is conventionally considered on a two-dimensional square lattice, with magnetic interactions occurring only between nearest neighbors. In this model, each lattice site is given a spin that is either up (+1) or down (-1); the x and y are the grid coordinates. Glauber's algorithm becomes:{{cite journal|title= An introduction to Monte Carlo methods |year= 2015 |doi= 10.1016/j.physa.2014.06.014 |arxiv= 1404.0209 |language=en-US|last1= Walter |first1= J.-C. |last2= Barkema |first2= G.T. |journal= Physica A: Statistical Mechanics and Its Applications |volume= 418 |pages= 78–87 |s2cid= 118589022 }}
- Choose a location at random.
- Sum the spins of the nearest-neighbors. For a two-D square lattice, there are four: .
- Compute the change in energy if the spin at x, y were to flip. This is given by the Hamiltonian for the Ising model; it is
- Flip the spin with probability given by the Fermi function where T is the temperature.
- Go To Step 1.
In Glauber algorithm, if the energy change in flipping a spin is zero, , then the spin would flip with probability . Similarly, if the temperature is very high, then and again, the probability of a flip is one-half. If the temperature is very low, then a flip to a higher-energy state almost never happens, while a flip to a lower energy state almost always happens.
Comparison to Metropolis
File:Glauber Acceptance Probability.png
The Glauber algorithm can be compared to the Metropolis–Hastings algorithm. These two differ in how a spin site is selected (step 1), and in the probability of a spin-flip (step 4). In the Glauber dynamic, every spin has an equal chance of being chosen at each time step, and the decision to flip that spin, or not, is given by the Fermi function, as given above.
By contrast, the Metropolis algorithm considers a spin site with a probability given by the Boltzmann weight , but if it is accepted, then it always flips a spin in favor of lowering the energy. Thus, the total spin-flip probability is:
:
1, \ \ \ \ \ \ \ \ \ \Delta E \leqslant 0\\
e^{-\Delta E/T}, \ \Delta E > 0\\
\end{matrix}\right.
File:Metropolis-Hastings Acceptance Probability.pngAlthough both of the acceptance probabilities approximate a step curve and they are almost indistinguishable at very low temperatures, they differ when temperature gets high. For an Ising model on a 2d lattice, the critical temperature is .
At thermal equilibrium, the Glauber and Metropolis algorithms should give identical results. In general, at equilibrium, any MCMC algorithm should produce the same distribution, as long as the algorithm satisfies ergodicity and detailed balance. In both algorithms, for any change in energy, , meaning that transition between the states of the system is always possible despite being very unlikely at some temperatures. So, the condition for ergodicity is satisfied for both of the algorithms. Detailed balance, which is a requirement of reversibility, states that if you observe the system for a long enough time, the system goes from state to with the same frequency as going from to . In equilibrium, the probability of observing the system at state A is given by the Boltzmann weight, . So, the amount of time the system spends in low energy states is larger than in high energy states and there is more chance that the system is observed in states where it spends more time. Meaning that when the transition from to is energetically unfavorable, the system happens to be at more frequently, counterbalancing the lower intrinsic probability of transition. Therefore, both, Glauber and Metropolis–Hastings algorithms exhibit detailed balance.
Software
- Simulation package IsingLenzMC provides simulation of Glauber Dynamics on 1D lattices with external field. [https://cran.r-project.org/web/packages/isingLenzMC/index.html CRAN].