Hanoi 7/11/2018 Ngo Van Thanh, Institute of Physics, Hanoi, Vietnam.
Finite size effects and Reweighting methods 1. Finite size effects 2. Single histogram method 3. Multiple histogram method 4. Wang-Landau method 5. The applications
A Guide to Monte Carlo Simulations in Statistical Physics D. Landau and K. Binder, (Cambridge University Press, 2009). Monte Carlo Simulation in Statistical Physics: An Introduction K. Binder and D. W. Heermann (Springer-Verlag Berlin Heidelberg, 2010). Understanding Molecular Simulation : From Algorithms to Applications D. Frenkel, (Academic Press, 2002). Frustrated Spin Systems H. T. Diep, 2 nd Ed. (World Scientific, 2013). Lecture notes Example code : http://iop.vast.ac.vn/~nvthanh/cours/vsop/code/
Phase transitions finite size effects Second order Critical exponents First order Double peak histogram Single histogram Multiple histogram Flat histogram
1. Finite size effects Using for determining the properties of the corresponding infinite system distinguish the order of the transition (first or second order transition) test the results of simulation of finite size systems Finite size scaling and critical exponents Consider a spin model on the lattice of finite size L Scaling forms of thermodynamic quantities (3.1) : are scaling functions Scaling relations (3.2)
The thermodynamic properties at the transition reduce to proportionality constants Scaling relations (3.3) If, then The cumulants fourth order cumulant of the order parameter (3.4) As the system size For For
fourth order cumulant of the energy (3.5) The logarithmic derivative of the n th power of the magnetization (3.6) For a continuous transition (second order transition) (3.7) where
Calculate the critical exponents exponent : (3.8) exponent : (3.9) exponent : exponent : (3.10) (3.11) For a discontinuous transition (first order transition) finite-size scaling laws (3.12) with
Ferromagnetic Ising spin model on simple cubic lattice
Ferromagnetic Ising spin model on simple cubic lattice
The behavior of V L for the q = 10 Potts model in two dimensions A Guide to Monte Carlo Simulations in Statistical Physics D. Landau and K. Binder
2. Single histogram method Introduced by Ferrenberg and Swendsen (1988), Ferrenberg (1991) using histograms to extract information from Monte Carlo simulations Applying to the calculation of critical exponents The theory Consider a Monte Carlo simulation performed at T = T 0 generates system configurations with a frequency proportional to the Boltzmann weight, exp(-e/k B T). Histogram of energy and magnetization H(E, M) The probability of simultaneously observing the system : is the number of configurations (density of states) with energy E and magnetization M (3.13) Partition function: (3.14)
: provides an estimate for over the range of E and M values generated during the simulation N is the number of measurements made We have (3.15) : is an estimate for the true density of states From the histogram H(E, M) we can invert Eq. (3.15) to determine (3.16) Replace in Eq. (3.13) with the expression for, and normalize the distribution. the relationship between the histogram measured at K = K 0 and the estimated probability distribution for arbitrary K (3.17)
The average value of any function of E and M : (3.18) Energy histogram vs energy for ferromagnetic Ising spin model on square lattice of size L = 64, at temperature K = 0.1540
Case study - one dimension single histogram From the histogram of energy H(E) The estimated probability distribution for arbitrary K (3.19) The average value of any function of E (3.20) For example
The simulations Find the temperature T 0 which is close to transition temperature Simulate the model by using the standard Monte Carlo simulation (Metropolis algorithm). Plot specific heat or susceptibility versus temperature, peaking the value of temperature at maxima of or. Choose the range of energy T 0 = 2.26 E min = -1.8, E max = -1.0
Do the simulation by using the single histogram method at T = T 0 Program structure - Gererating an array of N_BIN for energy range of interest - initialize the lattice SUBROUTINE equilibrating! Equilibrating process DO ieq = 1 to N_eq CALL monte_carlo_step() ENDDO END SUBROUTINE SUBROUTINE averaging! Averaging process DO iav = 1 to N_av CALL monte_carlo_step() do-analysis ENDDO END SUBROUTINE SUBROUTINE monte_carlo_step generate-one-sweep END SUBROUTINE
Source : single_histogram_ising.f90 PROGRAM SINGLE_HISTOGRAM_ISING IMPLICIT NONE INTEGER, PARAMETER :: n = 40,nms = n*n REAL,DIMENSION(n,n) :: s REAL,ALLOCATABLE,DIMENSION(:) :: e1,e2,m1,m2,he INTEGER :: i,j,ip,im,jp,jm,ie,ia,ms,neq,nav,ib,nbin REAL :: r,emin,emax,t,dt,temp,et1,et2! CALL RANDOM_SEED() neq = 200000 nav = 400000 t = 2.3; dt = 4.0 emax = -1.0*float(n*n); emin = -2.0*float(n*n) nbin = INT((emax-emin)/dt) + 1 ALLOCATE(he(nbin),e1(nbin),e2(nbin),m1(nbin),m2(nbin))
CALL spin_conf()! initial configuration CALL equilibrating() he =0.0; e1 = 0.0; e2 = 0.0; m1 = 0.0; m2 = 0.0 CALL averaging() OPEN(UNIT=12,FILE='sh_ising.dat') i = 0 DO ib = 1,nbin IF (he(ib) > 0) THEN write(12,1) he(ib),e1(ib)/he(ib),e2(ib)/he(ib)&,m1(ib)/he(ib),m2(ib)/he(ib) i = i + 1 ENDIF ENDDO 1 format(5(f16.6,1x)) CLOSE(12) OPEN(UNIT=12,FILE='sh_ising.info') write(12,*) t,i,n CLOSE(12) DEALLOCATE(he,e1,e2,m1,m2)! CONTAINS! list of subroutine/function
SUBROUTINE spin_conf! CALL RANDOM_NUMBER(s) DO j = 1,n DO i = 1,n IF (s(i,j) > 0.5) THEN s(i,j) = 1.0 ELSE s(i,j) = -1.0 ENDIF ENDDO ENDDO END SUBROUTINE spin_conf! SUBROUTINE equilibrating DO ie = 1, neq CALL monte_carlo_step() ENDDO END SUBROUTINE equilibrating
SUBROUTINE averaging DO ia = 1, nav CALL monte_carlo_step() temp = 0.0 DO i = 1,n ip = i + 1; im = i - 1 IF (i == n) ip = 1 IF (i == 1) im = n DO j = 1,n jp = j + 1; jm = j - 1 IF (j == n) jp = 1 IF (j == 1) jm = n temp = temp & - s(i,j)*(s(ip,j)+s(im,j)+s(i,jp)+s(i,jm)) ENDDO ENDDO temp = 0.5*temp ib = NINT((temp-emin)/dt) + 1
IF ((ib > 0).AND. (ib <= nbin)) THEN he(ib) = he(ib) + 1.0 temp = temp/float(n*n) e1(ib) = e1(ib) + temp e2(ib) = e2(ib) + temp*temp! temp = 0.0 DO j = 1,n DO i = 1,n temp = temp + S(i,j) ENDDO ENDDO temp = temp/float(n*n) m1(ib) = m1(ib)+ abs(temp) m2(ib) = m2(ib)+ temp*temp ENDIF ENDDO END SUBROUTINE averaging
SUBROUTINE monte_carlo_step DO ms = 1,nms CALL RANDOM_NUMBER(r) i = INT(r*float(n))+1 CALL RANDOM_NUMBER(r) j = INT(r*float(n))+1 ip = i + 1; im = i - 1 IF (i == n) ip = 1 IF (i == 1) im = n jp = j + 1; jm = j - 1 IF (j == n) jp = 1 IF (j == 1) jm = n et1 = -s(i,j)*(s(ip,j)+s(im,j)+s(i,jp)+s(i,jm)) et2 = -et1 CALL RANDOM_NUMBER(r) IF (r < exp(-(et2-et1)/t)) s(i,j) = -s(i,j) ENDDO END SUBROUTINE monte_carlo_step! END PROGRAM SINGLE_HISTOGRAM_ISING
Do analysis Read the data from histogram MC simulation Calculate the partition function Calculate the average value of physical quantities
Source : single_histogram_analysis.f90 PROGRAM SINGLE_HISTOGRAM_ANALYSIS IMPLICIT NONE REAL,ALLOCATABLE,DIMENSION(:) :: e,e1,e2,m1,m2,he INTEGER :: n,ib,nbin,it,nt REAL :: r,tmin,tmax,t,t0,dt,z REAL :: et1,et2,mt1,mt2,cv,chi! nt = 80 tmin = 2.1 tmax = 2.4 dt = (tmax-tmin)/float(nt-1)!
OPEN(UNIT=12,FILE='sh_ising.info') read(12,*) t0,nbin,n CLOSE(12) ALLOCATE(he(nbin),e(nbin),e1(nbin)&,e2(nbin),m1(nbin),m2(nbin))! OPEN(UNIT=12,FILE='sh_ising.dat') DO ib = 1,nbin read(12,1) he(ib),e1(ib),e2(ib),m1(ib),m2(ib) ENDDO 1 format(5(f16.6,1x)) CLOSE(12) e = e1*float(n*n)! OPEN(UNIT=12,FILE='ising_analysis.dat') t = tmin
DO it = 1,nt z = 0.0 DO ib = 1,nbin z = z + he(ib)*exp(e(ib)*(1/t0-1/t)) ENDDO et1 = 0.0; et2 = 0.0; mt1 = 0.0; mt2 = 0.0 DO ib = 1, nbin et1 = et1 + he(ib)*e1(ib)*exp(e(ib)*(1/t0-1/t)) et2 = et2 + he(ib)*e2(ib)*exp(e(ib)*(1/t0-1/t)) mt1 = mt1 + he(ib)*m1(ib)*exp(e(ib)*(1/t0-1/t)) mt2 = mt2 + he(ib)*m2(ib)*exp(e(ib)*(1/t0-1/t)) ENDDO et1 = et1/z; et2 = et2/z; mt1 = mt1/z; mt2 = mt2/z cv = float(n*n)*(et2-et1*et1)/t/t chi = float(n*n)*(mt2-mt1*mt1)/t write(12,1) t,et1,mt1,cv,chi t = t + dt ENDDO CLOSE(12) DEALLOCATE(he,e,e1,e2,m1,m2) END PROGRAM SINGLE_HISTOGRAM_ANALYSIS
Ferromagnetic Ising spin model on the square lattice Specific heat and susceptibility vs temperature with N = 40 red points : Standard MC result green points : Single histogram result
Ferromagnetic Ising spin model on the square lattice Specific heat and susceptibility vs temperature with N = 40, 50, 60
3. Multiple histogram method Introduced by Ferrenberg and Swendsen (Phys. Rev. Lett. 63,1195, 1989) Developed from single histogram method The technique is known to reproduce with very high accuracy the critical exponents of second order phase transitions The theory Consider n independent MC simulation Each simulation at temperature T j, the system has N j configurations The overall probability distribution at temperature T (3.21) where (3.22) f i is chosen self-consistently using Eq. 3.21
The thermal average of a physical quantity A is then calculated by (3.23) Monte Carlo simulations Choose the range of temperature [T min, T max ] Divide the teperature into n points: T i (i = 1,, n) Choose the range of energy [E min, E max ] Divide the energy into nbin Perform n independent MC simulation Calculate the energy histogram, average energy, magnetization Perform the analysis Read the simulation data Calculate self-consistently f i by iterating Eqs. (3.21) and (3.22) Do the calculations for the physical quantities by using (3.23)
4. Wang-Landau method Introduced by Wang and Landau, Phys. Rev. Lett. 86, 2050 (2001) It permits one to detect with efficiency weak first-order transitions Use to study classical statistical models with difficultly accessed microscopic states. The theory Wang Landau sampling The algorithm uses a random walk in energy space to obtain an accurate estimate for the density of states g(e) g(e) is defined as the number of spin configurations for any given E The classical partition function can either be written as a sum over all states or over all energies (3.24) g(e) independent of temperature, it can be used to find all properties of the system at all temperatures.
We begin with some simple guess for the density of states: g(e) = 1 For improve g(e), spins are overturned according to the probability (3.25) Following each spin-flip trial the density of states is updateds f i is a modification factor that is initially greater than 1 (3.26) At the beginning of the random walk, the modification factor f can be as large as A histogram H(E) records the number of times a state of energy E is visited Each time the energy histogram satisfies a certain flatness criterion, f is reduced according to and reset histogram H(E) = 0 for all E
The reduction process of the modification factor f is repeated several times until the final value f final is close enough to 1.0 The histogram is considered as flat if x% is flatness criterion, it can be chosen between 70% and 95% is the average (mean value) histogram. The thermodynamic quantities can be evaluated by (3.27) (3.28) (3.29) where Z is the partition function defined by (3.29) The canonical distribution at a temperature T (3.30)
Wang-Landau Monte Carlo scheme (1) Set g(e) = 1; choose a modification factor (e.g. f 0 = e 1 ) (2) Choose an initial state (3) Choose a site i (4) Calculate the ratio of the density of states (5) Generate a random number r such that 0 < r < 1 (6) If r < : then flip the spin (7) Set (8) If the histogram is not flat, go to the next site and go to (4) (9) If the histogram is flat, decrease f, e.g. (10) Repeat steps (3) (9) until (11) Calculate properties using final density of states g(e)
Critical behavior of magnetic thin films Study the critical behavior of magnetic thin films as a function of the film thickness Lattice: simple cubic Spin: Ising Methods: Standard Monte Carlo method Multiple histogram method Model We consider a thin film made made from a ferromagnetic simple cubic lattice The size of the film is L L N z Hamiltonian The periodic boundary conditions (PBC) is applied in the xy planes X.T. Pham Phu, V. T. Ngo and H. T. Diep, Surface Science 603, 109 116 (2009).
Monte Carlo results Magnetization and susceptibility with
Susceptibility and V 1 with
Critical exponents Two-dimensional Ising model = 1
Critical exponents Two-dimensional Ising model = 1.75
Critical exponent 3D = 0.613 Three-dimensional Ising model = 0.63
Critical exponent 3D = 1.25 Three-dimension Ising model = 1.24
Critical exponent vs film thickness
Critical exponent vs film thickness
From, we calculate the effective dimension of thin film
Stacked triangular antiferromagnets Study the phase transition in the frustrated XY and Heisenberg spin model Lattice: Stacked triangular lattice (3D) Spin: XY and Heisenberg Methods: Standard Monte Carlo method Wang-Landau method Model We consider the stacking of triangular lattices in the z direction The system size is N N N Lattice size : N = 12, 18, 24,, 120, 150 Hamiltonian V. T. Ngo and H. T. Diep, J. Appl. Phys. 103, 07C712 (2008). V. T. Ngo and H. T. Diep, Phys. Rev. E 78, 031119 (2008).
XY antiferromagnets Energy vs temperature for N = 84
XY antiferromagnets magnetization vs temperature for N = 84
XY antiferromagnets Energy histogram
Heisenberg antiferromagnets Energy and magnetization vs temperature for N = 120
Heisenberg antiferromagnets Energy histogram for N = 96 and 120
Heisenberg antiferromagnets Energy histogram for N = 150 Susceptibility vs temperature
Heisenberg antiferromagnets Susceptibility vs temperature Maximum of susceptibility versus N = 96, 108, 120, and 150 on a ln-ln scale
Crossover from first- to second-order transition in frustrated Ising antiferromagnetic films Study the nature of this phase transition in the case of a thin film as a function of the film thickness Lattice: Face center cubic thin films Spin: Ising antiferromagnetic Methods: Standard Monte Carlo method Wang-Landau method Green s function technique Model Consider a film of FCC lattice structure Hamiltonian X. T. Pham Phu, V. T. Ngo and H. T. Diep, Phys. Rev. E 79, 061106 (2009).
Ground state: The spin configuration depends on the interface interaction J s (a) ordering of type I for (b) ordering of type II for The energy of a surface spin for two configurations
Monte Carlo results for J s = J = -1 For the bulk case, L = N z = 12 Energy vs temperature Energy histogram with PBC (a) and without PBC (b) in z direction
For the N z = 4 Energy histogram for L = 20, 30 and 40
For the case N z = 2 and L = 120 Energy vs temperature Energy histogram
For the case N z = 2 and L =120 Specific heat vs temperature Susceptibilities of sublattices (a) 1 and (b) 3
The latent heat E as a function of film thickness
Critical exponents for N z = 2 Maximum sublattice susceptibility The maximum value of V 1
Fully frustrated simple cubic lattice Study the nature of the phase transition in the fully frustrated Lattice: simple cubic lattice Spin: Ising, XY and Heisenberg Methods: Standard Monte Carlo method Wang-Landau method Model Hamiltonian : for antiferromagnetic bond : for antiferromagnetic bond V. T. Ngo, D. Tien Hoang and H. T. Diep, Phys. Rev. E 82, 041123 (2010) V. T. Ngo, D. Tien Hoang and H. T. Diep, Mod. Phys. Lett. 25, 929 (2011) V. T. Ngo, D. Tien Hoang and H. T. Diep, J. Phys.: Condens. Matter 23, 226002 (2011)
Monte Carlo results for the case XY spin Energy and specific heat with N =24 Magnetization and susceptibility
Monte Carlo results for the case XY spin Energy histogram for N =24 Energy histogram The transition is clearly of first order at L = 36
Monte Carlo results for the case Heisenberg spin Energy and specific heat Magnetization and susceptibility
Monte Carlo results for the case Heisenberg spin Energy histogram The transition is clearly of first order at L = 70
Monte Carlo results for the case Ising spin Energy and specific heat
Monte Carlo results for the case Ising spin Energy histogram Maximum of the specific heat The transition is clearly of first order at L = 120 We conclude that a fully frustrated simple cubic lattice undergoes a first-order transition for Ising, XY and Heisenberg spin models