The Ising model in 2D models
We are interested in computing the magnetization
The critical value for the temperature should be
In the MC method, we randomly flip spins and accept/reject the flip depending on a sampling scheme (Metropolis, Swendsen-Wang, Wolff). In short, the method will go as follows:
-
Model
$N$ spins in volume$V$ (square lattice,$N = n^2$ ) with periodic boundary conditions. -
Repeat the following loop for
$M$ steps:- Pick a random site
$(i,j)$ - Flip the spin and compute the associated
$\Delta H$ - If
$\Delta H <0$ , accept the flip - Otherwise, accept with propability
$p = e^{- \beta \Delta H}$
- If
- Pick a random site
In the GA method, we create a random population of states (
- Create
$Y$ children from random pairs of parents (their probability of choice is proportional to the fitness):- To create children, we divide each parent in two blocks using a random divider
$s$ (so we have two sets of two blocks,of size$s \times n$ and$(n - s) \times m$ ). We cross-combine these blocks to create two new matrices. - We mutate each child by randomly flipping some of their spins per the mutation rate.
- To create children, we divide each parent in two blocks using a random divider
- Add children to the population, compute their fitness score. The population is now of size
$M + Y$ . - Sort the population w.r.t. the fitness score and cutoff the
$Y$ poorest members. The population is back to size$M$ .
In order to include thermal fluctuations, we need to compute the Gibbs free energy