| title | geometry | output | numbersections | header-includes | abstract | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NST-II Computational Physics Project
| **Ising Model of Ferromagnets**
|
margin=2cm |
pdf_document |
true |
|
This project is an investigation into the useage of Monte-Carlo methods to solve the Ising model of ferromagnetism. For simplicity, the 2-dimensional case is chosen and we consider only spin interactions between 4 closest neighbours. This model lets us evaluate the total energy of each microstate from which we can derive the probability of any particular spin flipping. The system can thus be evolved in time for some temperature, |
Ferromagnets are materials in which spin orientations are able to exhibit long range order below some critical temperature, the occurrence of such behaviour is a well known case of spontaneous symmetry breaking [@sadler]. The Ising model attempts to describe the behaviour of spins within a ferromagnet by considering the spin interactions between closest neighbours only. While this may be a substantial simplification, it proves to be a powerful tool for explaining ferromagnetic characteristics and provides reasonably physical results.
A Monte-Carlo method is best understood as a random sampling of a function's parameter space, which if done sufficiently converges onto the solution [@monte]. The rate at which the result converges will depend on the size of the parameter space and how well behaved the function is; in particular, if points of divergence are not treated properly, the accuracy of results may vary dramatically. Over the course of this investigation, the effects of said divergences will be analysed and discussed in the context of the Ising Model near the transition tempearture
Our aim is to find reasonable solutions to the Ising model in 2 dimensions via the Metropolis algorithm [@metropolis] (a specialised Monte Carlo method), allowing us to model the time evolution of spins within the magnet. Properties of the ferromagnet, including the mean magnetisation,
Finally, the behaviour of the magnet is also identified for nonzero external fields. In particular, we vary
We begin by making the assumption that spins are only able to align along one axis; greatly simplifying calculations while still maintaining relatively physical. The system is described by a set of spins 1/2 particles,
Where
\begin{equation} \Delta E_i = \sum_\delta s_i s_{i+\delta} - 2H\mu s_i \label{eq:delE} \end{equation}
Where
We can determine the probability of the system taking on a spin configuration by considering the Boltzmann distribution: \begin{equation} P(\mathbf{x}) = e^{-\beta E(\mathbf{x})} \quad \text{where} \quad \beta = \frac{1}{k_\mathrm{B}T} \label{eq:boltz} \end{equation}
Where
However, this integral is unwieldy even with the simplified Ising model. Instead, we use a Monte Carlo method with importance sampling based on the Boltzmann distribution known as the Metropolis algorithm [@metropolis], described in more detail in section \ref{sec:met}.
Finally, a note on the boundary conditions. To maximise the number of interacting spins, we have imposed periodic boundary conditions on the system such the 2D matrix is mapped onto a toroidal surface.
It is important to note that in the limit of an infinite lattice, a true transition occurs at the critical temperature. However, for finite
From theory of finite-scaling relations, we know that the size-dependent ordering of temperature is given by [@landau]: \begin{equation} T_\mathrm{c}(N) - T_\mathrm{c}(\infty) = a N^{-1/\nu} \quad N\to \infty \label{eq:TcInf} \end{equation}
The critical exponent
The Metropolis algorithm [@metropolis] can be summarised by the following flow chart:
\begin{figure}[H] \captionsetup{width=0.8\textwidth} \centering {\includegraphics[width=3.8in]{flow.pdf}} \caption{Flow chart describing the Metropolis algorithm.} \label{fig:flow} \vspace{-10pt} \end{figure}
- We choose some arbitrary starting configuration, and start with
$t=0$ . - Choose a point within the lattice based on a uniform probability distribution.
- Calculate the change in energy if the spin is flipped,
$\Delta E$ as per equation \ref{eq:delE}.- If
$\Delta E<0$ , the spin is flipped and the new configuration is recorded. - If
$\Delta E>0$ , we generate a random number,$\alpha$ , in the uniform distribution$[0,1]$ , if$\alpha < \exp{(-\beta\Delta E)}$ , the spin is flipped and the new configuration is recorded.
- If
- Repeat from step 2
$N^2$ times for 1 Monte Carlo step . - Record observables, e.g.\ total magnetisation,
$M_t$ , and total energy$E_t$ . - Increment
$t$ and repeat from step 2 until$I$ Monte Carlo steps are completed. - Average
$M$ and$E$ , over$t$ and find their variance. Calculate$C$ and$\chi$ from averages and variances, as per equation \ref{eq:calc_obsv} - Output data.
Using equation \ref{eq:F}, and the dissipation-fluctuation theory [@waldram] we can write down:
\begin{equation} \begin{aligned} C & = \pdv{E}{T} = \frac{\avg{E^2}-\avg{E}^2}{\kB T^2} \ \chi & = \pdv{M}{T} = \frac{\avg{M^2}-\avg{M}^2}{\kB T} \end{aligned} \label{eq:calc_obsv} \end{equation}
Where
After the system reaches an equilibrium state, there is still no guarantee that samples from individual MC steps are uncorrelated. We therefore have to treat these results with care as they will introduce skew in the errors of observables. Introducing the autocorrelation function,
\begin{equation} A(\tau) = \avg{M'(t)M'(t+\tau}/\avg{M'^2}\quad \text{where} \quad M'(t) = M(t) - \avg{M} \end{equation}
For samples to be uncorrelated, we require that they must be separated by an interval
We know that successive samples from the Metropolis algorithm will inevitably be correlated as multiple steps may be require to `randomise' the spins. If calculations are made based on these correlated values, the errors in observed quantities will display some bias. One way to circumvent this is to resample the data starting from a set of uncorrelated states. For some observable
Given
\begin{equation} \sigma_A ^ 2 = \avg{A^2} - \avg{A}^2 \end{equation}
To show how the total magnetisation varied with some nonzero external field,
Due to the large .csv files, we could easily run the code for multiple values of multiprocessing package was used to parallelise the programme, however, it rendered the PC unusable and was therefore ultimately abandoned.
In an attempt the lower the computation cost of each MC step, the probabilities python interpreter either knows to stash these calculations automatically, or the retrieval of values from an array is slower than the calculation of an exponent (the former of which sounds more plausible).
Finally, the code was `vectorised' such that the MC steps for multiple values of python.
We first consider how the total magnetisation of the system evolves in time if the initial spins are chosen randomly.
\begin{figure}[H]
\vspace{-10pt}
\captionsetup{width=0.8\textwidth}
\centering
{\includegraphics[width=3.5in]{./Mag/Mag.pdf}}
\caption{How total magnetisation (total spin) of a system of
It is clear that for low temperatures, the system tends to an extreme as all spins become aligned, displaying spontaneous magnetisation. At temperatures above the critical point, the system appears to behave randomly and fluctuates rapidly about
\begin{figure}[H]
\vspace{-10pt}
\centering
\captionsetup{width=0.95\textwidth}
\subfloat[$T = 1.0$]{
{\includegraphics[width=2in]{./spin/T10-arr3.pdf}}}\quad
\subfloat[$T = 2.7$]{
\includegraphics[width=2in]{./spin/T27-arr3.pdf} \label{singleError}}
\subfloat[$T = 4.0$]{
\includegraphics[width=2in]{./spin/T40-arr3.pdf} \label{singleError}}
\caption{Plot of the spin orientations within a
\begin{figure}[H]
\vspace{-10pt}
\centering
\captionsetup{width=0.95\textwidth}
\subfloat[$T = 1.0$]{
{\includegraphics[width=2in]{./spin/T10-arr21.pdf}}}\quad
\subfloat[$T = 2.7$]{
\includegraphics[width=2in]{./spin/T27-arr21.pdf} \label{singleError}}
\subfloat[$T = 4.0$]{
\includegraphics[width=2in]{./spin/T40-arr21.pdf} \label{singleError}}
\caption{Plot of the spin orientations within a
Starting from a random collection of spins, we can see that for low temperatures, regions of different spins form, which limits the system's interaction energy to the zone boundaries. This explains why a large number of steps are required to reach an equilibrium (figure \ref{fig:totMag}), as the formation of zones drastically hinders the thermalising process. In the long run, the smaller regions will shrink until eventually the whole system is dominated by one spin at equilibrium. This problem is exacerbated for larger
Close to the critical temperature, small amounts of ordering can be seen at equilibrium but the boundaries between such zones are more ambiguous than the low temperature case. For higher temperatures, the spins remain in an almost random configuration and exhibits no long range order as expected.
If instead we initialise the system with a homogeneous configuration, the problem with zone boundaries vanishes as the system starts off in its ground state. Furthermore, for supercritical temperatures, the rate at which the system thermalises is not hindered, demonstrated using a
\begin{figure} [H]
\vspace{-10pt}
\centering
\captionsetup{width=0.95\textwidth}
\subfloat[1 step]{
{\includegraphics[width=2in]{./spin/T40-arr2ones.pdf}}}\quad
\subfloat[2 steps]{
\includegraphics[width=2in]{./spin/T40-arr3ones.pdf} \label{singleError}}
\subfloat[20 steps]{
\includegraphics[width=2in]{./spin/T40-arr19ones.pdf} \label{singleError}}
\caption{Plot of the spin orientations within a
It is abundantly clear that the system reaches equilibrium within 20 steps at
To reinforce this point, animations of the first set of spin evolutions were created, (see Appendix C). These demonstrate how the effectiveness of the Metropolis algorithm is sensitive to initial conditions, suggesting they should be carefully chosen to best facilitate the investigation.
We move on to the mean magnetisation and energy of a system in equilibrium and how they depend upon the temperature. 50000 iterations were performed for each of these results, where the first 5000 were treated as thermalising steps and therefore not considered in equilibrium.
Firstly, we must acknowledge that taking a mean over the total magnetisation will always be 0 given a long enough time for finite lattices and nonzero
\begin{figure}[H]
\vspace{-10pt}
\captionsetup{width=0.8\textwidth}
\centering
{\includegraphics[width=3.5in]{3.pdf}}
\caption{How the mean of the absolute magnetisation of a system of
We expect the total magnetisation to drop around the critical point (highlighted region in figure \ref{fig:meanMag}). For the larger
Next, we have the energy per spin as a function of temperature. The total energy was normalised by the size of the matrix to aid comparison between different
\begin{figure}[h]
\vspace{-10pt}
\captionsetup{width=0.8\textwidth}
\centering
{\includegraphics[width=3.5in]{2.pdf}}
\caption{How total energy of a system of
Unlike the mean magnetisation, the energy of the system does not exhibit a sharp transition around the critical temperature. The difference between the two sizes of lattice also does not appear to greatly affect the average energy per site. Note that for low temperatures, the energy per site tends towards
\begin{figure}[H]
\captionsetup{width=0.8\textwidth}
\centering
{\includegraphics[width=3.5in]{4.pdf}}
\caption{How the specific heat,
The heat capacity was plotted as a function of temperature and normalised with respect to the lattice size to aid comparison. We see a clear spike in
\begin{figure}[H]
\vspace{-10pt}
\captionsetup{width=0.8\textwidth}
\centering
{\includegraphics[width=3.5in]{6.pdf}}
\caption{How the magnetic susceptibility,
Comparing figures \ref{fig:heatCap} and \ref{fig:magSus} clearly shows that the magnetic susceptibility of the ferromagnet has a much more pronounced discontinuity around the critical temperature producing a more prominent spike. For the
Despite the distinctive peak, the results are clearly subpar for smaller
\begin{figure}[H]
\vspace{-10pt}
\captionsetup{width=0.8\textwidth}
\centering
{\includegraphics[width=3.5in]{8.pdf}}
\caption{How the magnetic susceptibility,
Again, looking at the peak of
Using the peaks of the specific heat for a range of different lattice sizes, we can determine how the critical temperature depends on
\begin{figure}[H]
\vspace{-10pt}
\centering
\captionsetup{width=0.95\textwidth}
\subfloat[Plot of
We first fitted the data to equation \ref{eq:TcInf}, shown in figure \ref{fig:Tc1} (orange), which showed that the critical exponent,
We then turn to the peaks of the modified magnetic susceptibility,
\begin{figure}[H]
\vspace{-10pt}
\centering
\captionsetup{width=0.95\textwidth}
\subfloat[Plot of
The fitting procedure adopted remains unchanged. The intersection was found to be
If we now turn on an external magnetic field and then vary it slowly between
The hysteresis loop for 3 different temperatures were plotted, showing that the ferromagnetic properties are only present for
We also found the energy of the system under the same conditions and plotted it against the external field below.
\begin{figure}[H]
\vspace{-10pt}
\centering
\captionsetup{width=0.95\textwidth}
\subfloat[Magnetisation per spin,
From figure \ref{fig:spinArr21} we know that spins in a ferromagnet tend to form zones of opposing spins if the spins are initialised without a bias. This makes the process of reaching equilibrium (when all spins are aligned) much more time consuming than it ought to be for large matrices. To overcome this problem, we initialise the spins homogeneously meaning the whole matrix starts of as up spins (
Fortunately, at high temperatures, the thermalisation of the system is much less dependent on initial conditions and will readily reach equilibrium within 5000 steps. Therefore, choosing a homogeneous starting configuration is in fact rather sensible as it yields useful results most consistently.
As previously mentioned, if we applied equation \ref{eq:calc_obsv} directly,
- the peaks have moved back to the right, towards the analytical solution.
-
$\chi$ is relatively larger for higher temperatures. - The peak temperature now decreases with increasing
$N$ , a trend resembling$C$ suggesting the scaling relation is now correct.
Ultimately, the use of this modified susceptibility is justified by the fact that it produces a better estimate for
Plotting the critical temperature against
The results for the hysteresis loops were as expected and again strongly suggested that ferromagnetic behaviour only exists at subcritical temperatures. It also confirmed that the `hardness' of a magnet increases the further below
The energy of the system also behaves as we expect, varying linearly with
Looking at figures \ref{fig:Tc} shows clearly that the errors when determining
It is also evident from our results that the Metropolis algorithm partially breaks down
Our investigation has shown that the Ising model is adept at describing the properties of a ferromagnet despite its massive simplifications. In particular, we are able to obtain a clear transition temperature from the model by looking at the heat capacity and magnetic susceptibility for varying values of
Overall the results obtained were reasonable and matched expected theoretical results. The best estimate for the asymptotic value of the critical temperature is