1D Ising model Simple model of interacting spins in a lattice ● Nearest-neighbor only ● No external magnetic field Here, we look at a 1D chain of spins ● Future: higher dimensions, higher coordination numbers
Numerical Challenge ● Implement Metropolis algorithm for Ising model – Pick random spin, flip according to algo. – Repeat for N random spins → 1 mcs (Monte Carlo step) ● Compute system parameters, in particular fluctuations after MC has settled into distr.: – Mean energy, mean-squred energy – Mean magnetization; mean-squared magnetization – Heat capacity – Magnetic susceptibility
Generic but efficient implementation ● Metropolis algorithm taken as granted ● Nearest-neighbors implemented as an array-of-arrays which point into the lattice array – Neighbors computed once, in beginning (good); interesting process for > 1D lattices – Memory scales with coordination number (bad) ● How large a system can be simulated? – mem = (1 bit/site)•(N sites) + N•ceil[log 2 (N)]•(c.n.) – If c.n.= 12 , N= 1e8 yields mem = 3.8 GiB – If c.n.= 2, N= 1e9 yields mem = 7.1 GiB
System energy vs. temperature: Simulation vs. analytic solution No ferromagnetic phase transition: Magnetic Susceptibility Heat capacity doesn't diverge!
Recommend
More recommend