Third year CMP compulsory experiment

From ChemWiki
Revision as of 13:51, 19 January 2015 by Npj12 (Talk | contribs) (Assessment)

Jump to: navigation, search

This is the compulsory experiment for students taking the chemistry with molecular physics option. If you are looking for the optional simulation experiment for other third year chemistry students, you will find it here.

Introduction

Last year, you were introduced to Python, a scripting language which is rapidly becoming the de facto language for everyday scientific programming. Python is an interpreted, rather than compiled language, and is rather more forgiving than older languages such as C or FORTRAN. This reduces the amount of time that we need to spend programming and debugging. The downside to all this is that the execution of a Python program is much slower than a compiled equivalent. As a compromise, we usually let large codes written in a compiled language (usually C/C++) do the hefty numerical work for us, and then use scripting languages like Python to analyse the results.

These large codes for numerical work (you may have already used GAUSSIAN for electronic structure calculations) typically take arcane text files as input, and produce equally arcane text files as output. If, for the sake of example, you run twenty different molecular dynamics simulations, and each of them produces an output file which contains information about the density of the system, then extracting this information by hand would be very tedious (and if you run hundreds or thousands of simulations, virtually impossible), but this sort of task is the thing at which languages like Python really excel.

In this exercise, you are going to use the Python that you learned last year to write a code 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.

Assessment

At the end of this experiment you must submit a "report" in wiki form. You can find instructions on how to create the wiki page and edit it in the "Report Preparation" section of this page. 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. At the end of the experiment, you should send the link to your wiki report, as well as a fully annotated copy of any Python scripts that you produce to n.jackson12@imperial.ac.uk.

Getting Help

For help with the chemistry department laptops, visit Mod:laptop.

The demonstrator and assessor for this exercise is Niall Jackson (n.jackson12@imperial.ac.uk). He will be available in the second floor chemistry computer room between 1pm and 3pm on the first Monday of the experiment, and between 2pm and 3pm every other day. If you have questions outside of these times, you are of course welcome to send them by e-mail. The computational teaching fellow, Joao Bettencourt Cepeda Malhado (malhado@imperial.ac.uk), will be available in the same location between 1pm and 2pm daily.

The member of academic staff responsible for this exercise if Professor Fernando Bresme (f.bresme@imperial.ac.uk).

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