Rep:JJ1516Ising
Introduction to the Ising Model
The Model
Minimum Energy State
Minimum Interaction Energy
The interaction energy of an Ising lattice is given by:
In an Ising lattice with D dimensions and periodic boundary conditions, a given spin has 2D neighbours.
The minimum interaction energy is achieved when all spins in the lattice are aligned (all ↑ or all ↓). As such, any spin must be aligned with all 2D of its neighbours. That is, for all .
Therefore, for any , the sum of its interactions is
As this is true for all N spins in the lattice, it follows that .
Thus the minimum interaction energy is given by:
Entropy of the Minimum Energy State
The entropy of a state is given by:
Where is the multiplicity of the state, the number of degenerate configurations of said state. The minimum energy state is achievable with all spins ↑ or with all spins ↓. In the absence of an external magnetic field, these configurations are degenerate and indistinguishable giving for this state. Therefore,
Phase Transitions
Changes to Minimum Energy Configuration
Energy Change
The energy change associated with a single spin 'flip' from the lowest energy onfiguration may be calculated by considering the change in the interaction energy with the spin's neighbours.
Let
Interaction energy after one spin has been 'flipped'
Lowest energy configuration
This energy change is independent of and depends only on the dimension size and the coupling constant .
In this calculation, the following assumption has been made.
- The lattice dimensions are infinite relative to the size of each cell
This allows any cell to be treated as the centre of the lattice. As every cell interacts with 2D neighbours, flipping any cell in the minimum energy configuration results in the same energy change. Alternatively, the periodic boundary conditions of the Ising model remove the necessity for such an assumption. As a consequence, the absence of from the resulting energy change is justified.
Entropy Change
Where denotes the factorial of the number of spins in spin state .
Magnetisation Values of 1D and 2D Lattices
1D Lattice Magnetisation
2D Lattice Magnetisation
Magnetisation at 0K
At 0K, no thermal energy is available to overcome the energetic barriers to spin flipping. Considering the Hemholtz free energy:
A temperature of 0K nullifies the entropic contribution to the free energy. Thus the energetic driving force (which maximises parallel spin interactions) dominates the entropic driving force (which maximises multiplicity of lattice states). For an Ising Lattice with D = 3, N = 1000 at 0K, the alignment of all spins results in the minimum energy configuration and an overall magnetisation of .
Calculating the Energy and Magnetisation
Modifying the Files
Energy and Magnetisation Functions
=Energy
The above energy method segments a given lattice into lattice cells on the edges, corners or in the bulk of the lattice and calculates the energy interactions with its neighbours as appropriate.
Magnetisation
The magnetisation method loops over all elements in the array representing the Ising lattice and adds the value of the spin to the magnetisation variable.
Testing the Files
ILCheck.py
Above, the results of the ILcheck.py script are presented.
Introduction to the Monte Carlo Simulation
Average Energy and Magnetisation
Configurations of a 100 Spin System
For a system of two spins, 4 configurations are possible (↑↑, ↓↓, ↑↓, ↓↑) i.e. . For a system of 100 spins, there are configurations. In the first example, the ↑↑ and ↓↓ are degenerate, as are the ↑↓ and ↓↑ configurations. Therefore, dividing the number of possible configurations by the multiplicity of each configuration () gives the number of non-degenerate configurations. As previously stated, degenerate configurations are indistinguishable in the absence of an external magnetic field.
For 100 spins, this gives distinguishable configurations.
If processing speed permits calculations each second, the evaluation of a single value of would last seconds or times the age of the Universe!
Modifying IsingLattice.py
Monte Carlo and Statistics Methods
The Metropolis Monte Carlo (MMC) algorithm provides a computationally inexpensive path from random initial states to the minimum free energy states of the Ising lattices generated. First, a random 2D Ising lattice is generated. A single random spin within this lattice is "flipped" and the resulting (internal) energy change between these states is measured. Recalling the relationship between the Hemholtz free energy, internal energy and entropy, it follows that a decrease in internal energy also lowers the free energy of the system: thus the configuration change is accepted.
In the case that the spin "flip" does not lower the internal energy, the MMC algorithm tests this configuration change against the Boltzman factor. In the canonical (NVT) ensemble, the free energy of the system is given by:
where Z is the canonical partition function which depends upon , the Boltzman factor. By choosing a random value in the interval [0,1)from a continuous uniformm probability distribution and rejecting any value of the Boltzman factor less than this value, the MMC algorithm allows for configuration changes with small, positive internal energy changes if they conform to the Boltzman probability distribution. Alternatively, the MMC allows small perturbations to the internal energy which prevents the system from settling in a metastable internal energy minimum and instead, ensures that the system equilibrates around the true free energy minimum.
Spontaneous Magnetisation
Below the Curie Temperature, , the energetic driving force dominates the entropic driving force, resulting in a highly ordered system and an overall magnetisation. The spins of the system align in order to maximise favourable coupling interactions rather than adopting a less ordered configuration of higher multiplicity. Therefore, when , the most probable configurations have an overall magnetisation resulting in .
The plots of magnetisation per spin and energy per spin obtained from ILanim.py support this prediction. Below, the plots show that upon equilibration, the system adopts the minimum energy per spin: and exhibits the maximum magnitude of magnetisation per spin:
An unknown system error prevented the statistics() function from printing the average values.
Accelerating the Code
Initial Method Speeds
Taking 10 repeat measurements for the time taken to perform 2000 Monte Carlo steps resulted in
- An average time of
- A standard error of
Updating Measurement
NOTE: ILtimetrial.py has been modified to:
- Perform a requested number of '2000 Monte Carlo Step' measurements
- Record these measurements in a CSV file
- Return the mean measuremd time and the Standard Error i.e.
Updating Energy and Magnetisation Methods
Updated Method Speeds
Taking 30 measurements of the time taken to perform 2000 Monte Carlo Steps resulted in:
- An average time of
- A standard error of
This represents a 93% decrease in the average computation time from the initial methods.
The Effect of Temperature
Correcting the Averaging Code
Finding a Delay Value
To quickly find a value for , the minimum number of cycles typically needed for the equilibration of a system of within the lattice and temperature ranges of interest, it was assumed that:
- Larger lattices would require more Monte Carlo steps to reach equilibrium from their initial, random configurations
- Lattices at lower temperatures would require more Monte Carlo steps to reach equilibrium from their initial, random configurations.
Therefore, an initial value for was found for a lattice at a temperature of reduced temperature units.
By this number of steps, all smaller lattices at all higher temperatures were found to have equilibrated also. Thus, this value of was accepted as an appropriate delay.
For the 128x128 lattices at T=0.5, equilibration was ensured from 185000 steps onwards.
Smaller lattices at the same temperature did indeed equilibrate more slowly, but all equilibrated within MC steps.
The figure below shows the modifications made to IsingLattice.py to incorporate the step delay.
Running over a Range of Temperatures
To examine the effect of temperature on the average energy and average magnetisation of Ising lattices at equilibrium, the following parameters were used:
- Temperature Range: reduced units
- Temperature Interval: reduced units ( temperature values)
- Number of MMC Steps per Temperature value: with the aforementioned value of Monte Carlo steps
- Lattice Sizes: , , , , ,
Plots of and per spin as versus temperature are presented below for each lattice size. Errorbars have been implemented to demonstrate how well-behaved lattice systems of each size are at each temperature, that is, how temperature and lattice size affect the size of the variations in the expected values. For the error calculations, the standard errors, , in and per spin have been used:
8x8
A Python script has been written to generate a plot of or against temperature based upon user input. A screenshot of this code has been inserted below.
The Effect of System Size
Scaling the System Size
More Lattice Sizes
2x2
4x4
16x16
32x32
64x64
Scrutiny of the plots of average energy per spin for each lattice size reveals an increase in the errorbar width with increasing lattice size. This is most notable in the low temperature region of the plots. Between the and lattices, the long range fluctuations become suddenly prominent. The lattice is the first (in the range of sizes tested)to clearly capture these fluctuations.
Determining the Heat Capacity
Calculating the Heat Capacity
Heat Capacity Derivation
Working in the canonical ensemble (constant volume), the heat capacity is given by:
where is the average total energy or expected value of the internal energy of the system.
where is the partition function for the system of N interacting spins.
By evaluating the second form of the partial derivative with respect to :
Applying the product rule enables the differentiation of this expression for with respect to temperature, giving:
Thus,
Heat Capacity versus Temperature
Below, a screenshot of the Python script written to produce plots of against , together with the output images of this script.
2x2
4x4
8x8
16x16
32x32
Locating the Curie Temperature
C++ Data Comparison
Below a comparison of the against plot generated for the to the corresponding C++ data is offered.
The data generated by the ILtemperaturerange.py script is a faithful match to the C++ data. However, this is an exceptional case; the plots for all other lattice sizes were found to be very dissimilar, necessitating polynomial fitting.
Polyfitting of C++ Data
Fitting a Polynomial to the Entire Range
The following Python script was written to perform a polynomial fit to the entire range of the graph of against .
Below, the result of the polyfit to the lattice data is offered (for comparison to the previous, non-fitted example).
Polynomials with 5 terms and above were found to match the data in the vicinity of the critical region considerably well. Below 7 terms, the tails of the plot were matched poorly. In the above example, a polynomial of 15 terms was fit to the data.
Fitting a Polynomial to the Critical Region
The following Python script was written to perform a polynomial fit to the region of interest (the critical region) of the plots of against to facilitate the discovery of .
An example of the result returned by the script is offered below for the C++ data for the lattice.
Finding the Peak C Values for Each Lattice Size
Below, a screenshot of the code used to obtain the temperatures at which the maximum values of C occured is presented for each lattice size. The temperatures themselves are also featured on the image.
The range of lattice sizes and their associated values were exported to a text file, enabling a plot to be created.
Subsequently, the scipy.optimize.curve_fit function was used to fit function to the data obtained. This enabled the estimation the constant and the value of at , otherwise .
A value of was obtained. A comparison to the literature[1] value of reveals a percentage error value of only . Surprisingly, the investigation of lattices in the given size range was enough to capture the theoretical behaviour of an infinite lattice. As explained by Frenkel and Smit, the implementation of periodic boundary conditions enables the simulation of an infinite bulk (or infinite adjacent lattices) surrounding the single lattice under scrutiny. The agreement of the experimental and theoretical values for prove the effectiveness of this idea.
A likely source of error arises from the polynomial fitting of the data. The peaks in against were far more sharp than the broad peaks of the polynomial functions used to fit them. In several cases, the polynomial peak was a slight, yet discernible overestimate of the true peak. This has resulted in an overestimation of the final value. Fitting a function with a sharper peak (e.g. a Kronecker delta function) to the critical region could overcome this overestimation and provide a more faithful final value.
References
- Frenkel, Daan, et al. Understanding Molecular Simulation : From Algorithms to Applications, Elsevier Science & Technology, 2001
- Krieger, M. Constitutions of matter : Mathematically modeling the most everyday of physical phenomena. Chicago ; London: University of Chicago Press, 1996
- https://en.wikipedia.org/wiki/Square-lattice_Ising_model Accessed 13-11-18























