\documentstyle[a4wide,12pt]{article} \begin{document} \section*{Introduction to numerical projects} Here follows a brief recipe and recommendation on how to write a report for each project. \begin{itemize} \item Give a short description of the nature of the problem and the eventual numerical methods you have used. \item Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself. \item Include the source code of your program. Comment your program properly. \item If possible, try to find analytic solutions, or known limits in order to test your program when developing the code. \item Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes. \item Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc. \item Try to give an interpretation of you results in your answers to the problems. \item Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts you've made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it. \item Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you don't properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning. \end{itemize} \section*{Format for electronic delivery of report and programs} % The preferred format for the report is a PDF file. You can also use DOC or postscript formats. As programming language we prefer that you choose between C/C++ and Fortran90/95. You could also use Java or Python as programming languages. Matlab/Maple/Mathematica/IDL are not accepted, but you can use them to check your results where possible. Finally, we do prefer that you work together. Optimal working groups consist of 2-3 students, but more people can collaborate. You can then hand in a common report. \section*{Project 1, Phase transitions in spin systems, deadline 24 april 12pm (midnight)} For this project you can build upon program programs/ising\_2dim.cpp. The first part deals with the Ising model in two dimensions, without an external magnetic field. In its simplest form the energy is expressed as \begin{equation} E=-J\sum_{}^{N}s_ks_l \end{equation} with $s_k=\pm 1$, $N$ is the total number of spins, $J$ is a coupling constant expressing the strength of the interaction between neighboring spins and $B$ is an external magnetic field interacting with the magnetic moment set up by the spins. The symbol $$ indicates that we sum over nearest neighbors only. We will assume that we have a ferromagnetic ordering, viz $J> 0$. We will also use periodic boundary conditions and the Metropolis algorithm first. \begin{enumerate} \item[a)] Here we study the autocorrelation function, defined by Eq.~(3.21) from the text of Newman and Barkema. We choose a square lattice with $L=40$ spins in the $x$ and $y$ directions. Choose first a temperature of $T=1.5$ (in units of $kT/J$) and study the mean energy and magnetisation (absolute value) as functions of the number of Monte Carlo cycles. Use both an ordered (all spins pointing in one direction) and a random spin orientation as starting configuration. How many Monte Carlo cycles do you need before you reach an equilibrium situation? Repeat this analysis for $T=2.5$. Try also different seeds for the random number generators. \item[b)] The previous analysis is rather rough and obviously user dependent, in the sense that it is very much up to the user to define when an equilibrium situation has been reached. To improve upon this, compute the autocorrelation function defined in Eq.~(3.21) for the mean magnetisation (absolute value) and plot it for the two temperatures in [a) as function of the number of Monte Carlo steps per site. Discuss your results. Can you extract an equilibration measure? \newline\newline Near $T_C$ we can characterize the behavior of many physical quantities by a power law behavior. As an example the mean magnetization is given by \begin{equation} \langle {\cal M}(T) \rangle \sim \left(T-T_C\right)^{\beta}, \end{equation} where $\beta=1/8$ is a so-called critical exponent. A similar relation applies to the heat capacity \begin{equation} C_V(T) \sim \left|T_C-T\right|^{\alpha}, \end{equation} and the susceptibility \begin{equation} \chi(T) \sim \left|T_C-T\right|^{\gamma}, \end{equation} with $\alpha = 0$ and $\gamma = 7/4$. Another important quantity is the correlation length, which is expected to be of the order of the lattice spacing for $T>> T_C$. Because the spins become more and more correlated as $T$ approaches $T_C$, the correlation length increases as we get closer to the critical temperature. The divergent behavior of $\xi$ near $T_C$ is \begin{equation} \xi(T) \sim \left|T_C-T\right|^{-\nu}. \label{eq:xi} \end{equation} A second-order phase transition is characterized by a correlation length which spans the whole system. Since we are always limited to a finite lattice, $\xi$ will be proportional with the size of the lattice. Through finite size scaling relations, see chapter 8.3 of Newman and Barkema, it is possible to relate the behavior at finite lattices with the results for an infinitely large lattice. The critical temperature scales then as \begin{equation} T_C(L)-T_C(L=\infty) \sim aL^{-1/\nu}, \label{eq:tc} \end{equation} with $a$ a constant and $\nu$ defined in Eq.~(\ref{eq:xi}). The correlation length is given by \begin{equation} \xi(T) \sim L\sim \left|T_C-T\right|^{-\nu}. \label{eq:xi2} \end{equation} and if we set $T=T_C$ one obtains \begin{equation} \langle {\cal M}(T) \rangle \sim \left(T-T_C\right)^{\beta} \rightarrow L^{-\beta/\nu}, \label{eq:scale1} \end{equation} a heat capacity \begin{equation} C_V(T) \sim \left|T_C-T\right|^{-\gamma} \rightarrow L^{\alpha/\nu}, \label{eq:scale2} \end{equation} and susceptibility \begin{equation} \chi(T) \sim \left|T_C-T\right|^{-\alpha} \rightarrow L^{\gamma/\nu}. \label{eq:scale3} \end{equation} \item[c)] Compute the mean energy, absolute value of the magnetisation, heat capacity, susceptibility and correlation function (given by Eq.~(3.50)) as functions of temperature for the $40\times 40$ lattice and temperatures in the range $T\in [1.5,3.0]$. Make plots of these quantities as functions of temperature and study the results for $10^4$, $10^5$ and $10^6$ Monte Carlo cycles. Extract also the correlation length from the correlation function and plot it as function of temperature. Comment your results, and for the correlation length emphasize the fact that you are using periodic boundary conditions. You should parallelize the code at this stage. When doing this, be sure that you obtain the same results as with the serial code. \item [d)] We will now study the behavior of the Ising model in two dimensions close to the critical temperature as a function of the lattice size $L\times L$. Calculate the expectation values for $\langle E\rangle$ and $|\langle {\cal M}\rangle|$, the specific heat $C_V$, the susceptibility $\chi$ and the correlation function $G(r)$ as functions of $T$ for $L=20$, $L=40$, $L=60$, $L=80$ and $L=100$ for $T\in [2.0,2.4]$ with a step in temperature $\Delta T=0.05$. Plot $\langle E\rangle$, $\langle {\cal M}\rangle$, $C_V$, $\chi$ and $G(r)$ as functions of $T$. Can you see an indication of a phase transition? \item[e)] Use Eq.~(\ref{eq:tc}) and the exact result $\nu=1$ in order to estimate $T_C$ in the thermodynamic limit $L\rightarrow \infty$ using your simulations with $L=20$, $L=40$, $L=60$, $L=80$ and $L=100$. \item[f)] In the remaining part we will use the exact result $kT_C/J=2/ln(1+\sqrt{2})\approx 2.269$ and $\nu=1$. Determine the numerical values of $C_V$, $\chi$ and ${\cal M}$ at the exact value $T=T_C$ for $L=20$, $L=40$, $L=60$, $L=80$ and $L=100$. Plot $log_{10}$ ${\cal M}$ and $\chi$ som funksjon av $log_{10}$ $L$ and use the scaling relations of Eqs.~(\ref{eq:scale1}) and (\ref{eq:scale3}) in order to determine the constants $\beta$ and $\gamma$. Are your log-log plots close to straight lines? The exact values are $\beta=1/8$ and $\gamma=7/4$. \item[g)] Make a log-log plot using results for $C_V$ as function of $L$. In this case you should not get a straight line since the specific heat exhibits a logarithmic divergence with $\alpha=0$. The specific heats behaves as \[ C_V \approx -\frac{2}{k_B\pi}\left(\frac{J}{T_C}\right)^2ln\left|1-\frac{T}{T_C}\right|+\mathrm{const}. \] Do your results agree with this behavior? \item[h)] Use the exact value of $T_C$ and compute the correlation time $\tau \sim L^z$ (Eq.~(4.7)) for the above lattices and make a log-log plot as in Figure 4.2 of Newman and Barkema. Comment your results for the Metropolis algorithm. \item[i)] The last result shows that the Metropolis algorithm is inefficient close to the critical temperature. Repeat the analysis of [f-h)] using the Wolff algorithm discussed in chapters 4.2 and 4.3. Discuss your results. \end{enumerate} \end{document}