You are on page 1of 2

Notes:

Slide 4:
-Higher temp.. Because the system now
has enough energy and by Metropolis
algorithm, lattice with anti-parallel spins
areaccepted.
Slide 6:
- so that detailed balance is satisfied
- the Metropolis algorithm, a special case of
the MetropolisHastings algorithm where the
proposal function is symmetric,
Slide 7
-This process is repeated until some stopping
criteria is met which for the Ising model is
often when the lattice becomes
ferromagnetic meaning all of the sites point
in the same direction
-Boltzmann probability-with a probability
proportional to exp(-dE/T)
- the Metropolis algorithm, a special case of
the MetropolisHastings algorithm where the
proposal function is symmetric,
Slide 8
-stdio is for c functions
-math is for exp
Slide 12
-Asking for values and construction of lattice,
computation of Boltzmann factor and initial
energy
Slide 13
-assigning of spin
-The whole lattice is travelled and average
magnetization is obtained
Slide 14
-sum is total energy of upper and right
neighbors (iteration is from lower left corner
going right, one row higher then left to right
again)
-Thats why left and down are not included
since accounted for from previous ions
Slide 15
-Boltzmann factor is the ratio of a Boltzmann
distribution computed for two states. It is the
probability of the system being found in a
particular microstate.
-exp(-dE/T) is probability ratio

-ratio factors are 2si (sum sj) but sum sj can


take the values +-4, +-2, 0. So pwedeng +8,+-4,0
Slide 16
-In thermal equilibrium a system's energy
only fluctuates within a small range.
-Metro algo will be repeated until
pass<=stepeq
-accept initial value. Only acceptance
probability (final output) is affected.
Slide 17
-It then goes sa deltaE function
Slide 18
-impose periodic boundary conditions so
same number of neighbors and continuous
-X=column, y=row
-left=up,right=down
Slide 19
-up=right,down=left
Slide 20
-left+up+right+down is sum of neighbor
spins
-energy difference between the considered
spin and its four nearest neighbors (factor 2
to avoid counting spins twice)
-de is returned to Metro function
Slide 21
-Spin is flipped if rnd<=boltzmann factor. If
not, retain with probability exp(-dE/T)
-M & E are computed and returned to main
Slide 22
-State/spin of each ion is changed depending
on step na input of user.
-How many times Metro algo for each ion in
the lattice
Slide 23
-mean energy
-mean energy squared
-mean magnetization
-mean magnetization squared
-mean absolute magnetization
Slide 24
-prints results
Slide 25
-accept is acceptance ratio

-values are multiplied by norm (step times #


of ions) to get average per spin

Slide 28
-utility function for random seed

You might also like