\documentclass[12pt]{article}
%\documentstyle[preprint,aps]{revtex}
\textwidth 16.5cm
\textheight 23cm
\topmargin -1.5cm
\evensidemargin 0cm
\oddsidemargin 0cm
\parindent 2.5em
\begin{document}

\raggedbottom

\begin{center}
\Large \bf
Computational Physics \\
\large 
\vspace{0.2cm}
28 March 2001
\end{center}

\noindent 
{\bf Ex.10 : Monte Carlo for the 2D Ising model on a square lattice.} 

We will consider the Ising model for a 2D square lattice of $N=L\times L$ 
sites. Each spin
$s_i$ may point up ($s_i=1$) or down ($s_i=-1$). The energy is given by the sum over nearest neighbour interactions (indicated by the symbol $\Sigma_{<ij>}$)
\begin{equation}
E=-J\Sigma_{<ij>}s_is_j
\end{equation}
where $J$ is the coupling constant which we take $J=1$. The total magnetization is simply $M=\Sigma_i s_i$.
It is convenient to define a magnetization per  spin $m=M/N$ and an energy per 
spin $\epsilon=E/N$.

At low temperatures and zero applied magnetic field, the ground state 
magnetization per spin is $m=1$ (or equivalently $m=-1$) since all spins are 
aligned. The ground state energy per spin is $\epsilon=-2J$ (because each spin 
has four neighbours but interactions should not be counted twice).
At high temperatures, both the average energy and magnetization tend to zero.
The critical temperature from the phase transition from the ordered low 
temperature phase to the disordered high temperature phase is $T_c=2,269J$.
\medskip

\noindent 
\begin{description}
\item[{\bf Study of behaviour of magnetization by use of Metropolis algorithm}]~\\

The basic program to run a Monte Carlo simulation with the Metropolis algorithm
for a 20$\times$20 lattice of spins in contact with a heath bath at constant 
temperature (canonical ensemble)
is given in the program $mc.f$  (written in fortran 77).   
You need also to copy the file $mc.inc$ which is needed by
$mc.f$. Besides, a second program $mcini.f$ can be used to generate an initial 
configuration of assigned magnetization. These programs have been written for 
didactical purposes by Dr. M. P. Allen, University of Bristol.
They are easy to read and well documented and  you will appreciate the
implementation of the algorithm. Notice that
periodic boundary conditions are used. A sweep (or a MC step) consists of $N$
attempts to flip a spin chosen at random. The averages are done on all the 
moves. I suggest to start by using the program as it is and change it afterwards if you wish.
\begin{itemize}

\item[1)] Read the program and try to understand how it works. 
Give particular attention to the implementation of the Metropolis algorithm and to the evaluation of averages. Check that also if a spin flip is not accepted, 
the configuration is added to the number of configuration on which averages 
are performed.

\item[2)] Compile the programs with f77. Generate with $mcini.f$ an initial 
configuration with average magnetization $m=0$. Run $mc.f$ for 
 $T=2.0$ (below  $T_c$). Change  the program to write 
the quantities which appear on the screen into files to plot them 
afterwards. In doing this try not to change drastically the lay-out of the 
program. Keep the lines of comment in the output, with a \# in front to use 
gnuplot.

\item[3)] Study the behaviour of magnetization as function of MC steps 
for $T=1.$ and $T=3.5$ starting in each case both with initial 
magnetization $m=1$
and $m=0$, using the same initial seed and same number of steps.
A reasonable 
run could be of a total of 5000 MC steps for each temperature divided in 
$nblock$ blocks of $nstep$ MC steps. Estimate of the errors are done 
as described for random walks.

In this way, one gets a feeling of the relaxation time needed to reach 
the equilibrium value of the magnetization at each temperature, 
depending on the initial conditions. 

\item[4)] Make a plot of the magnetization as a function of temperature from  
 $T=1.$ to $T=3.5$. In doing this 
one should, in principle, discard all MC steps before equilibration 
before starting to compute the average value of the magnetization. 
\end{itemize}
\item[{\bf Domain formation, Kawasaki dynamics with constant magnetization}]~\\
When considering single spin flips, as done in the previous point,
the magnetization is not conserved and one can study the relaxation of the 
system. It is interesting to consider another approach which conserves the 
magnetization, the so-called Kawasaki dynamics. Instead of attempting single 
spin flips, a move consists in exchanging the spin of two neighboring sites 
with opposite spins.  Our aim is to show that if we start with a configuration 
with zero magnetization (typical of high temperature) and the temperature is 
lowered well below $T_c$ domain formation (clustering of up and down spins)
occurs in the system. 
 
\end{description}
\end{document}
