Jump to content

Programming a 2D Ising Model

From ChemWiki

This is the Ising Model experiment (aka programming for simple simulations). This is a core experiment for year 3 students on the Chemistry with Molecular Physics degree.

Introduction

In this exercise, you are going to use the Python that you learned in the first year to write a code to perform Monte-Carlo simulations of the 2D Ising model, a set of spins on a lattice which is used to model ferromagnetic behaviour, and also to analyse the results of the simulation to find the heat capacity of the system and the Curie temperature — the temperature below which the system is able to maintain a spontaneous magnetisation.

A more extensive introduction to the Ising Model will be given in the next page. This page gives some practical information about how the experiment.

Assessment

At the end of this experiment you must submit a report, writing up your findings. Each section of the experiment has a number of tasks that you should complete, labelled TASK. If this is a mathematical exercise, your report should contain a short summary of the solution. If it is a graphical exercise, you should include the relevant image. Your report should explain briefly what you did in each stage of the experiment, and what your findings were.

The report should be submitted as a PDF file to Turnitin, created with your favourite word processor or LaTeX, and should contain the annotated source code of the Python scripts that your write during the experiment. For clarity, code included in the report should be written in a monospaced font (e.g. Courier), which in LaTeX can be easily achieved by placing your code inside a \texttt{} command. The code, except where relevant to discussion, can be placed in an appendix.

As well as including relevant source code in your report, you should also submit a bundle with all your scripts and analysis code as a separate Blackboard submission.

The mark breakdown for the tasks is given below. You will also be assessed on the quality of the code and the report.

Task 1a-c: 6 marks

Task 2a-b: 10 marks

Task 3a-c: 12 marks

Task 4a-c: 10 marks

Task 5a-b: 12 marks

Task 6: 10 marks

Task 7a-b: 10 marks

Task 8a-d: 20 marks

Report + Code: 10 marks

Total: 100 marks

This mark will be divided by 5 and rounded to the nearest integer to obtain a final mark out of 20.

On the use of AI tools

The code you write for this experiment is assessed, and as per the department's guidelines on the use of AI, it is not acceptable to use generative AI tools to write computer code for this assignment.

Writing computer programs yourself enhances your logical thinking and problem solving skills. Using generative AI tools to write your code makes you dumb. Don't choose to be dumb, don't use AI to write code for you.

Getting Help

The Graduate Teaching Assistants demonstrating this experiment are Fionn Carman, Ayse Halkseven and Aidan Chapman. Demonstrators will be available in room 232A at the following times:

Demonstrator timetable
Monday Tuesday Wednesday Thusrsday Friday
Morning 10:00 - Experiment intro
10:00-13:00 - Fionn and Aidan
10:00-13:00 - Ayse and Aidan 10:00-13:00 - Fionn 10:00-13:00 - Ayse and Aidan
Afternoon 14:00-17:00 - Fionn 14:00-17:00 - Ayse and Aidan 14:00-16:00 - Fionn and Aidan 14:00-17:00 - Ayse

If you have questions outside these times, please use the Discussion Board on Blackboard.

João and Giuseppe are the members of academic staff responsible for this experiment. You are welcome to address your questions and comments to them.

Structure of this Experiment

This experimental manual has been broken up into a number of subsections. Direct links to each of them may be found below. You should attempt them in order, and you should complete all of them to finish the experiment.

  1. Introduction to the Ising model
  2. Calculating the energy and magnetisation
  3. Introduction to the Monte Carlo simulation
  4. Accelerating the code
  5. The effect of temperature
  6. The effect of system size
  7. Determining the heat capacity
  8. Locating the Curie temperature