Beruflich Dokumente
Kultur Dokumente
1. Introduction
Ferromagnetism is an intrinsically many-body quantum phenomenon. As in
typical many-body quantum situations, analytic solutions are rare. However,
many aspects of ferromagnetism can be investigated numerically. The Ising
model provides a simplified model for the spin-spin interactions that captures
the essence of the behaviour.
The purposes of this project are to simulate a 2D ferromagnetic system using the
Ising model and study the behaviour, in the absence of the magnetic field, of
magnetisation and energy as a function of temperature from which the critical
temperature can be deduced. Also, we will estimate the heat capacity of the
system by two various approaches: the derivative of energy with respect to
temperature and the fluctuation-dissipation theorem. These give a better
estimate of the critical temperature. Furthermore, we will focus on the
behaviour near the critical temperature and finally investigate the behaviour of
the system when the magnetic field is turned on.
The analysis of the computational aspects of the problem is presented in the next
section. The implementation of the algorithm, along with the overall approach to
obtain the solutions of the problem, is then given in section 3. The results and
discussions are summarised in section 4. The conclusions are then presented in
section 5, following by the references in section 6.
1
2. Analysis
2.1 Ising Model
In the Ising model, only the nearest neighbour spin-spin interactions are
considered. In a two-dimensional
lattice, the energy E of the system can
then be written as
(1)
(2)
where
(3)
The magnetisation M is given in units where it is defined by
(4)
(
where
If we measure
in units of J and
in units of
], and
. In other words,
(6)
(5)
)
(7)
Next, this is repeated for all the spins and these steps together are regarded as
a single time step. After these step are performed, the spin system is evolved
in time by one time step.
We need to run the simulation for many time steps to ensure that it approaches a
near-equilibrium point.
Note that there is a choice of initial spin orientations with which to start the
simulation. Both uniform and random sets of spin orientations should work.
The effects of initial conditions will be investigated when the time evolution of
magnetisation towards equilibrium is studied.
)
(8)
)
(9)
where
(10)
where is a constant.
From equation (10),
Therefore, a plot of
.
), the magnetisation M
(11)
will be a straight line with gradient
against
We will denote as and as in all the following sections because all the
calculations and measurements will be done in these reduced units.
3. Implementation
3.1 Overall approach
The ferromagnetic system is represented by a set of spins on an
lattice. This will be denoted by a C++ vector of size . The indexing of the
vector is done such that the spin in the
row and
column of the lattice is
stored in the
argument of the vector. Keeping in mind that the first
row and first column are denoted by
and
respectively.
The random number p, needed in equation (4), is generated from the GSL
random number generator code. Therefore, h GSL h d r fi gsl/gsl_rng.h i
needed for this purpose.
The spin configurations are initialised by the function initial_uniform, which
assigns
to all the spins, or the function initial_random, which assigns
randomly to all the spins by means of the random number generator function
random_uniform.
The magnetisation is calculated by the function magnetisation, which simply
takes the sum of all the spin values. The system energy is calculated from
equation (2) by the function energy and the energy required to flip a particular
spin is computed by the function energydiff.
The spin system is evolved in time according to the Metropolis algorithm as
described in section 2.2 by the function metropolis, which decides whether or
not to flip the spin at a particular lattice site. This is done for all the
lattice
sites by going through a regular sequence. All these
operations are regarded
as a single time step. We need to run the simulation for many time steps to
ensure it reaches equilibrium.
for
for
for
10
for
11
for
12
for an
for an
for an
13
for an
for an
The
This is consistent within the random errors with both the estimated values
obtained from the magnetisation and energy.
16
The heat capacity was derived from the two methods detailed in section 2.3.
These gave a better estimate of the critical temperature than the estimates made
from the previous plots because the critical temperature can be deduced from
the peak of the heat capacity plot, which can be measured more accurately.
A plot of the heat capacity from
Figure 13.
17
18
against
A plot of
against
is should be a straight line for close enough to
from below. Here,
. Ignoring the divergent standard
deviation of the data as the system approaches the critical temperature, the plot
is a straight line. The critical exponent is given by the gradient of the plot.
In principle,
19
20
21
A hysteresis loop is present below the critical temperature with the size of the
loop decreasing as the temperature increases towards . At the critical point,
the loop disappears and it becomes a curve with an infinite gradient at the origin.
As the temperature increases further, the gradient becomes finite and decreases
steadily.
22
5. Conclusions
1. In the absence of the field, there are two equilibrium states. Depending on the
initial conditions, the system will evolve into one of these states
2. The magnetisation of the system is non-zero below and zero above a particular
temperature called the critical temperature .
3.The fluctuations of the system are largest at
4. The heat capacity has a peak at the critical temperature and this provides an
efficient way to measure the critical temperature.
5. Near , some parameter can be expressed in terms of
the corresponding critical exponent.
, where
is
6. The presence of two equilibrium states is the origin of the hysteresis loop
when the magnetic field is varied from one direction to the opposite direction.
7. The hysteresis loop becomes smaller as the temperature is increased towards
the critical temperature. At and above the critical temperature, the system
becomes non-hysteretic.
6. References
1. R.J. Needs & E.M. Terentjev. Experimental and Theoretical Physics NST Part 2.
Thermal and Statistical Physics Supplementary Course Material, Michaelmas
Term 2013, pp95-116
2. C. Castelnovo. Experimental and Theoretical Physics NST Part 2. Theoretical
Physics, Michaelmas Term 2013, pp52-60
23
// Function to generate a random number using the GSL random number generator
code
double random_uniform( unsigned long int seed = 0 )
{
static gsl_rng* rng = 0;
if ( rng == 0 )
rng = gsl_rng_alloc( gsl_rng_default );
if ( seed != 0 )
gsl_rng_set( rng, seed );
return gsl_rng_uniform( rng );
}
// Function to calculate the total energy E for a given set of spin orientations
// E/J = - sum_s_i_s_j - (A*sum_s_i) where A = uH/J
// H is the magnetic field, u is the magnetic moment, J is the exchange energy
double energy( std::vector<int>& spin, int N, double A )
{
int sum_spin = 0;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
sum_spin += spin[(i*N) + j];
}
int product_spin = 0;
int down, right;
for (int i = 0; i < N; i++)
{
for(int j = 0; j < N; j++)
{
if(i == N-1)
down = spin[j];
else
down = spin[N*(i+1) + j];
if(j == N-1)
right = spin[i*N];
else
right = spin[(i*N) + (j+1)];
product_spin += spin[(i*N) + j] * (right + down);
}
}
return - product_spin - (A*sum_spin);
}
24
25
26
27
{
if(t > (max-n))
{
sum_M += magnetisation(spin, N);
sum_E += energy(spin, N, A);
}
for (int i = 0; i < N; i++)
{
for(int j = 0; j < N; j++)
{
deltaE = energydiff(spin, N, i, j, A);
p = random_uniform();
metropolis(spin, N, i, j, T, deltaE, p);
}
}
}
std::cout << T << " " << sum_M/1000 << " " << sum_E/1000 << "\n";
}
return 0;
}
28
29
sum_M = 0.0;
//10000 time steps at each temperature T
for (int t = 0; t <= max; t++)
{
if(t > (max-n))
sum_M += magnetisation(spin, N);
for (int i = 0; i < N; i++)
{
for(int j = 0; j < N; j++)
{
deltaE = energydiff(spin, N, i, j, A);
p = random_uniform();
metropolis(spin, N, i, j, T, deltaE, p);
}
}
}
std::cout << A << " " << sum_M/1000 << "\n";
}
return 0;
}
30