Sei sulla pagina 1di 11

The Ising Model December 2014

Investigation into the two-dimensional


Ising model by use of Monte-Carlo
methods.
Ty Tankard
University of Nottingham
eeytlt@nottingham.ac.uk
Abstract
This investigation is concerned with studying the interactions of a 2D lattice using the Monte Carlo methods and
using the theory of the Ising model. The main parameter set out to be determined was the critical temperature. The
value found for this was: Tc = 2.330.05[ J/K B ], which agrees strongly with the literature referenced throughout the
report. Other values set out to be measured to help confirm the Tc were the magnetic susceptibility and specific
heat Cv . The peak values for these were found to be = 0.031[/K B ] and Cv = 3.75[ J/K2B ].

Contents
1

Introduction

Theory of the Ising model


2.1 The Critical Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Specific heat of an ideal lattice. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Magnetic Susceptibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2
2
2
2

Methodology of code
3.1 Generating the lattice and spin values
3.2 Calculating average spin of a site . . .
3.3 The Specific Heat of the lattice . . . .
3.4 Calculating magnetic susceptibility . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

3
3
3
4
4

Key Results Determined


4.1 Average spin per lattice site . . . . . . . . . . . . . . . . . . . . . .
4.2 Further development of code . . . . . . . . . . . . . . . . . . . . .
4.2.1 The Specific heat of a lattice using Monte Carlo methods .
4.2.2 Investigating the Magentic Susceptibility. . . . . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

4
4
5
5
8

Comparing the ferromagnetic and anti-ferromagnetic cases


5.1 Absence of a magnetic field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8
8

Studying the effects of applied magnetic fields

10

Summary

10

Ty

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

Tankard eeytlt 4163702

The Ising Model December 2014

1.

Introduction

rapidly die off and tend to zero. At values above this,


the probability of a lattice site flipping becomes sigThe Ising model is arguably the most thoroughly nificant, and the lattice tends into a disordered state
investigated models in statistical mechanics[1] . Since of higher entropy and net magnetisation of zero.
its invention in 1925 by the German mathematician Ernst Ising, it has been applied to numerous
2.2. Specific heat of an ideal lattice.
applications regarding spin interactions and phase
transitions. The key equation governing the Ising The specific heat at a constant volume of an ideal
gas is given by the thermodynamic equation,
model is given by the energy Hamiltonian,
dE
(2)
dT
i,j
i
where dE, and dT represent the change in energy
where Si is the spin of the current lattice point, and
and temperature respectivley[4] . This can be rewritS j is the spins of the neighbours being summed
ten in terms of the expectation value of the Energy
over and J is the degree of spin interactions (J
of the lattice,
= 1 is the case for ferromagnetism, J=-1 for antiferromagnetism)[2, 3] . Using Monte Carlo methods, a
< E >
computer simulation can generate a large number of
Cv =

lattice sites, and flip each site a large number of times




requiring an energy given by Eq. 1. As it does this, if

1 Z
=
it calculates key values such as magnetisation of the
T Z
(3)
 2 !
lattice and the energy at each site, it is possible to
1 2 Z
1
Z
calculate thermodynamic values such as; critical tem=
2
T Z 2
B
Z
perature Tc , and specific heat Cv , both as a function
hD
E
i

of temperature. In this project, the previous quan=


E2 h E i2
tities amongst others were set out to be measured,
T
along with the effects of applying a net magnetic where is a constant, that has been set to a value
field to the site, and investigating the critical temper- of 1, in the case where K = h = 1 and T is the
B
ature and behaviour of an anti-ferromagnetic lattice. temperature being sampled at[5] . If a large number
Esite = J Si S j B Si

(1)

Cv =

of temperatures are sampled across, and the values


of E and E2 are calculated, it is then possible to cal2. Theory of the Ising model
culate the specific heat of the lattice at a range of
As mentioned in the introduction, the main equa- temperatures.
tion in understanding the Ising model is given by
the Hamiltonian, defined in Eq. 1. From this, using
2.3. Magnetic Susceptibility
relatively simple code, it is then possible to begin to
investigate the key thermodynamic properties of a The magnetic susceptibility is defined as the ratio
of magnetism induced in a sample to the magnetistwo-dimensional spin lattice.
ing force or intensity of field to which it is subject [1] .
Which can be written in the thermodynamic limit as,
2.1. The Critical Temperature
M ( H )
According to literature, the critical temperature of a
( H ) =
(4)
H
lattice is defined as "the highest temperature T for
which there can be non-zero spin"[2] , in a computer
where M is the magnetisation of the sample, and
simulation, it would be expected that the average H the magnetic field at that localisation of the samspin values above the critical temperature Tc , would ple. The zero field susceptibility, that is the magnetic
2

The Ising Model December 2014

susceptibility in the abesence of a magnetic field can


then be defined as,

conditional statement was if the spin was at a coordinate (X,L), the lattice would then wrap the top to
the bottom, to ensure all the spins at the top, had a
(0) = lim H 00 ( H )
neighbour above them which was the spin with the
h
i
= h0,0 j, ki M2 .
(5) same x co-ordinate, and y co-ordinate of 1 and vice
versa. The result of wrapping the lattice to ensure
j,k
all spins had 4 nearest neighbours to interact with
If the limit lim H 0 exists, then the above expression was that the lattice stops becoming a flat lattice, and
for the case of an Ising model lattice becomes equal is in essence the surface of a torus as seen in Fig 1.
to,
hD E
i
=

M 2 h M i2 ,

(6)

therefore, it is the variance in magnetisation of the


sample at a given temperature[2, 5] .

3.

Methodology of code

3.1. Generating the lattice and spin values


The first step in the project for all studied parameters
was to generate a lattice of a size determined by the
user. To begin this, the MATLAB program asked the
user to input a value L, which would be the length
of the square lattice in each direction. The program
then generated an empty lattice filled with zeros of
size LL. The next step in the algorithm was to generate random numbers to fill the square lattice, to
do this, the MATLAB program generated a random
number between 0 and 1. A conditional statement
was then used to fill the lattices, so if the random
number was greater than 0.5 the lattice site being
filled would be filled with a one, and if the random
number was less than or equal to 0.5 it would be
filled with a zero accordingly.
The next major step in code development was to
generate a piece of code that would calculate the 4
nearest neighbour interactions. This was done using by using a series of conditional statements that
would ensure all points on the lattice regardless of
position would still interact with a total of four nearest neighbours. If the x co-ordinate of a spin lattice
was at a position x=L, the code would wrap the lattice around, so the neighbour to the right would
be the spin with the same x coordinate at x=1, or
(1,Y). It would also perform the same step if the x
co-ordinate of the lattice was 1. The next nested

Figure 1: A 3d image of a torus demonstrating how the lattice


has been wrapped to ensure all spin sites have a total of 4 nearest neighbours to interact with.(image
courtesy of tex.stackexchange.com)

3.2.

Calculating average spin of a site

Once an array of size LL had been generated, the


program could then move on to determined key parameters the project had set out to achieve. The first
step in doing this was to apply Monte Carlo methods
to attempt to flip the spins at random a large number of times. A variable named flips was generated
within the MATLAB code which had size 10*LL.
The software then iterates through temperature with
a step size given by the user, between limits which
have been inputted by the user. At each temperature,
the code runs for 100s and at each of the time iterations, the software attempts to flip 10*LL spins
at random. So on average, for the case where L=10,
each site is flipped 1000 times (10 for each time iteration) at every value of temperature. When the
3

The Ising Model December 2014

program attempted to flip a site, it initially flipped it


and calculated the energy by using the Hamiltonian
given in Eq. 1. It then determined E which is the
change in energy required to perform this flip, which
is simply given by 2E. If the change in energy E
was < 0 the spin is flipped automatically, however, if
E>0 the spin is flipped with a probability calculated
in the code by,


2 E
,
(7)
P = exp
T
where T is the temperature the lattice site is being
flipped at.
After all the sites had been flipped at a given temperature and time, the program would then iterate
through the lattice via a "for" loop embedded inside
another "for" and sum up the spins of each lattice
iteratively, this generated an array of size 10*LL,
where every time a site has been flipped, the total
spin has been determined. To get an average total
spin value, the spin lattice was summed up, and then
divided through by 10LL to give the average total
spin of the lattice. It is then possible to calculate the
average spin per site as function of temperature by
simply requiring MATLAB to divide the previous
average by a factor of LL, the number of lattice sites.

3.3.

The Specific Heat of the lattice

The next most important thermodynamic property to


calculate is the specific heat Cv , which is a desirable
quantity to calculate as it should hopefully confirm
the critical temperature value Tc . The way this was
done is by modifying the program which calculated
and plotted average spin per site as a function of
temperature.
At the start of the loop that iterated through time,
a variable ecurrent was assigned a value of 0, then as
the program attempts to flip each site, it updates the
energy of the lattice. If the energy of the Hamiltonian
> 0, the statement, ecurrent = ecurrent-2E was used
to update the energy, and if the energy of the hamiltonian < 0, ecurrent = ecurrent+2E was used instead
to update the energy of the lattice. Again, this would
be performed each time a lattice site was attempted
to be flipped, but instead because of the iterative
4

nature of this calculation, just a single value was


determined for each "time" step. To determine the
specific heat from this, the value for Energy was first
squared for each time step, then before the next temperature iteration began. The code took both a mean
value over time for Energylattice andEnergylattice 2 , it
then inserted these into Eq. 3 to determine the specific heat of the lattice. After this had been done, it
then divided through by the number of lattice sites
to determine the specific heat per site of the lattice
as a function of temperature.

3.4.

Calculating magnetic susceptibility

In each iteration of time, a few extra lines of code was


added later into the project to allow for the magnetic
susceptibility to be studied. In order for this to be
done the code first summed up all the spins on the
lattice, every time a random flip was performed, and
then divided through by the number of Monte Carlo,
to find the average spin of the lattice. It would then
divide through by the length of the lattice squared to
determine average magnetisation
per site h M i, and


square this result to get M2 , at a particular time.
After the code had iterated through all the time values, it worked out the variance in magnetisation at
a given temperature given by Eq. 6. This value is
then what the code went on to plot as a function of
temperature to determine T .

4. Key Results Determined


4.1.

Average spin per lattice site

The average spin per lattice was found for a variety of Lattice sizes. Initially, a 10-by-10 lattice was
used to allow rapid data acquisition, as Monte Carlo
methods can be slow due to the large number of
calculations being produced. After this had been
done, the simulation was repeated for L values of
10, 20, 40, 50 and 60. This allowed a large array
of Tc values to be determined to ensure maximum
accuracy for minimum computational time. A plot
of mean spin per lattice site for a 20-by-20 lattice has
been produced in Fig. 2, where the critical temperature as defined previously can be seen to take a

The Ising Model December 2014

value of 2.30.1. The error quoted here is the size


gap between temperatures, thus creating an inherent
uncertainty in exactly where the critical temperature
lies.

Figure 3: A graph of spin per lattice as a function of temperature for Lattice length of 60, the critical temperature
is seen to again have a value of approximately 2.3.

Figure 2: A graph of Average spin per lattice site as a function of temperature for a 20by20 lattice. 20by20 was 4.2.
chosen as at smaller lattices, a large amount of noise
was produced around the critical temperature as the
lattice turned into a disordered state. Larger lattices
4.2.1
were also generated, but took longer to produce, so
the key physics being studied was done on 20-by-20
lattices.

In Fig. 2 there is a clear phase transition from


a state of average spin -1 for low temperature to
that of high temperature at a critical temperature
value Tc . This has been left as a simple numeric
value as both the Boltzmann constant and the Planck
constant have been defined to be equal to 1. This
value for Tc is a constant for all values of L (except
when L becomes very small), as can be seen in Fig. 3.

Further development of code


The Specific heat of a lattice using Monte
Carlo methods

Another key thermodynamic property of a lattice


is the specific heat Cv at various temperatures. To
calculate the specific heat of a lattice at a given
temperature, the code iterated through time in steps
of 1s, and at each time value calculated the energy
of the lattice, and the energy2 of the lattice. After
the code had iterated through the time steps, it then
calculated the variance in the energy and divided by
the temperature at which Cv was being determined,
as seen in Eq. 3. For a 20-by-20 lattice, the highest
specific heat was found to have a value of 3.75 J/K2B
at a corresponding temperature of T=2.35J/K B . A
plot of specific heat as a function of temperature can
be seen in Fig. 4,

The Ising Model December 2014

Figure 4: A graph of specific heat as function of temperature


for lattice length L = 20, a peak in specific heat can
be seen at a value of T = 2.35.

Where the highest value for the specific heat lies


at a value of 2.350.05, which agrees with the critical
value found in Fig. 3. If the lattice dimension L is
increased, it is expected that the maximum value for
the specific heat falls closer to the truer value for the
critical temperature. This can be seen in the case
where L has been increased to 30, with temperature
iterations of 0.025, as seen in Fig. 5

Figure 5: A graph of specific heat as function of temperature


for a 30-by-30 lattice, with temperature iterations of
0.025. A peak in specific heat can clearly be seen at a
temperature value of 2.30.025

Again, the strong bell curve function for specific


heat as a function of temperature has been strongly
generated for a 30-by-30 lattice. To begin to understand this relation, Eq. 3 must first be studied. If
6

a lattice plot at various temperatures is plotted in


real time, at the critical temperature a large number
of lattices will begin to flip. If the total energy is
then averaged over the total time, a large variance
in energies will be found. In Fig. 6 to Fig. 10, a spin
lattice plot has been generated for lattice length L
= 20, in the absence of a magnetic field for varying
times (10,20,30,40,50).
At the theoretical critical temperature value of
2.3[6] , the spins at each lattice have a significant
probability of being flipped. This in turn tends to
generate large clusters of spin on the spin lattice, and
if the spin lattice is generated at each time step for
a given temperature as seen in Figures 6 to 10, a
large variation in the spin patterns is observed.
According to Eq. 1 each of these spin lattice plots
will have a large difference in their energy values as
the spin interactions between lattice sites is changing
by a large amount with each iteration. Because of
this, it is clear that a large variance in energy occurs
at the Tc value and hence the largest specific heat
value will occur at this temperature.
By plotting the specific heat as a function of temperature as in Fig. 5, it is possible to confirm the
value for the critical temperature found in Fig. 3 and
Fig. 2.

The Ising Model December 2014

Figure 6: Spin lattice plot for T = 2.3, and Time = 10s

Figure 9: Spin lattice plot for T =2.3, at Time = 40s

Figure 7: Spin lattice plot for T = 2.3, and Time = 20s

Figure 10: Spin lattice plot for T = 2.3, for Time = 50s

Figure 8: Spin lattice plot for T = 2.3, at Time = 30s

The Ising Model December 2014

4.2.2

Investigating the Magentic Susceptibility.

other parts of the investigation within experimental


error.

In an effort to further investigate the Ising model, one


can begin to investigate the effects of temperature on
a thermodynamic property referred to as the Magnetic Susceptibility, that is the degree of magnetisation
of a sample in response to a magnetic field[7] . This is
a key property to investigate in the Ising model, as it
allows for an understanding of how strongly neighbouring spins interact with one another. Following
on from the studying of the specific heat, it would
be expected that the highest magnetic susceptibility
has a value corresponding to a temperature in the
range of 2.2 to 2.6. For the project, various lattice
sizes were produced to begin studying the magnetic
susceptibility and the magnetic susceptibility was
plotted as a function of temperature. In Fig. 11 a 40 Figure 12: Magnetic Susceptibility Vs. Temperature for a latby 40 lattice has been generated, and the magnetic
tice of length L = 30
susceptibility calculated as a function of temperature
in steps of T = 0.05.

5.

Comparing the ferromagnetic and


anti-ferromagnetic cases

The simplest and most effective way to compare how


the lattice behaves for the ferromagnetic and antiferromagnetic cases is to compare the spin lattice
plots at a range of temperatures.

Figure 11: The magnetic susceptibility as a function of temperature for a 40 by 40 lattice.

The strong peak at a temperature value of


T=2.40.1 with corresponding magnetic susceptibility =0.032[/K B ], which agrees with theory and
published results[6] , that the magnetic susceptibility
is largest at a temperature equal to that of the critical temperature. A second graph for the magnetic
susceptibility was plotted using a smaller lattice to
allow for smaller temperature iterations to be used.
This can be seen in Fig. 12, where a definite peak is
occurring at a value of T=2.40.05 which agrees with
8

5.1.

Absence of a magnetic field

In the absence of a magnetic field, the behaviour of


the J=1 case, and the J=-1 case are extremely similar,
in the fact that they both exist in a highly ordered
state below the critical temperature, and as the system approaches Tc , the system descends into a state
of lower order. This can easily be seen in Fig. 13 to
Fig. 20 where blue represents a spin of -1, and red a
spin of +1

The Ising Model December 2014

Figure 13: Spin lattice for T = 2, for B=0, and J=1 after 100s

Figure 17: Spin lattice for T=1,B=0,J=1 after 100s

Figure 14: spin lattice for T=2.1,B=0,J=1 after 100s

Figure 18: Spin lattice for T=2.1,B=0,J=-1 after 100s

Figure 15: Spin lattice for T = 2.3,B=0,J=1 after 100s

Figure 19: Spin lattice for T = 2.3,B=0,J=-1 after 100s

Figure 16: Spin lattice or T = 2.5, B=0,J=1, after 100s

Figure 20: Spin lattice for T =2.5, B=0, J=-1 after 100s

The Ising Model December 2014

In the spin lattice plots above, a clear relation


between temperature and order of the system can
be observed. At low temperatures of T<2 [ KJB ], the
order of the spin lattice is high, and the spins tend
to stay in either one state or the other. In the case
of J=1, the lattice exists in a pure state of one spin
value or the other, as the magnetism will vastly dominate over the temperature contributions if left for a
period of time[1, 3] . If the value for J is now switched
to -1, in the anti-ferromagnetism case, similar behaviour exists. However, instead of existing in a
pure state of one spin value, the lattice exhibits a
more checkerboard type pattern, as the spins want
to be anti-parallel to their nearest neighbours.
Figure 21: The spin plot of a lattice in the presence of a magnetic field B=1, for the ferromagnetic case J=1, at T
=3

6.

Studying the effects of applied


magnetic fields

The simplest way to study the effect of placing a net


magnetic field across the sample is to again study
the lattice site images at various temperatures. If
Eq. 1 is used to calculate the energy of a lattice at a
site (x,y), it can be seen that, the second term will
alter the energy of the lattice site in the presence of
a magnetic field. This will result in higher temperatures being required to start flipping the lattice in
the case of J=1. For both the case of J=1, and J=-1, the
effect of placing the lattice in a net magnetic field has
the effect of raising the critical temperature Tc . In
Fig. 21 and Fig. 22 the effect of a magnetic field can
be clearly be seen. For the case of ferromagnetism,
the sample tends to have a net magnetisation up to
a larger temperature, as the spins tend to align with
one another up to a new critical temperature Tcnew .
However, for the case of anti ferromagnetism, the
spins tend to oppose one another as in the case of B=1, and at the value of T=3, the critical temperature
has been exceed as the spin lattice has descended
into a state of lower order, which agrees directly
with the findings published by L. Witthauer and M.
Dieterle in [2].
10

Figure 22: The spin plot for a lattice with values, B=1, J=-1,
And at T=3

7.

Summary

Through out the investigation, numerous parameters


have been set out to be determined each with its
own unique coding requirements. All of the sections
had a large part of them in common with one another, that is that they are all able to determine an
estimate for the critical temperature Tc of the lattice.
A mean value of the critical temperature was found
to be T = 2.33[ J/K B ], where this value has been determined by taking the average of the values from

The Ising Model December 2014

Figures 2, 3, 4, 5, 11 and 12. The error on this value


was found to be 0.05 which was determined by
means of summing the associated errors from Figure. 2 to Figure. 12 (not inclusive of the spin plots) in
quadrature. Overall the investigation was a large success as everything set out to be done was achieved,
along with substantial farther investigation which
helped confirm the Tc value, the original quantity
set out to be determined.

References

[2] L. Witthauer and M. Dietrele, The phase transition of the 2d-ising model.
[3] J. M. Yeomans, Statistical Mechanics of Phase Transitions. Oxford Science Publications, 1992.
[4] R. Bowley and M. Sanchez, Introductory Statistical
Mechanics. Oxford Science Publications, 1999.
[5] L. Larrimore, Monte carlo simulation of the 2d
ising model.
[6] Kosherlitz, The critical properties of the twodimensional xy ising model, Journal of Physics C
- Insitute of physics, 2012.

[1] B. M. McCoy and T. T. Wu, The Two Dimension


[7] R. Clarke, Magnetic properties of materials.
Ising Model. Harvard University Press, 1975.

11

Potrebbero piacerti anche