Docsity

Physics 642 HW #3: Monte Carlo Simulations for Ising & Heisenberg Magnets, Assignments of Physics

Toggle sidebar
bg1
Physics 642, Spring 2007 – Homework Assignment #3
(deadline: Monday, May 14)
More about the deadline: the practical Monte Carlo exercise I want you to do in this homework
assignment would be of no value if done in rush. It’s not a particularly time-consuming task, but it
may be time-consuming for the computer you employ for the job. And – imagine such a situation:
you feed the computer with input data and leave it to do the job overnight. But something goes
wrong, say, you have made a small error in the input data file. You get a lot of worthless data.
So, you have to figure out what was wrong, re-run the program, and so on. Therefore, it seems
reasonable to give you an extra ā€œsafety marginā€ in this particular assignment, and set a two-week
deadline (Monday, May 8) instead of the customary one-week deadline. But please please please!,
start working on the simulation problem ASAP! Not on Sunday, May 13!!!
Problem 1 – 1 pt. Prove that the ā€œMetropolis Algorithm recipeā€ given at the beginning of
Chapter 4 in the book by D. Landau and K. Binder (ā€œBook Fourā€ in the Webpage material) is
consistent with the Detalied Balance Principle.
Problem2–10pts. I hope you have already got familiar with the Monte Carlo programs
I have prepared for you. Now there is time to do some simple exercises.
The 2D Ising magnet is the only known magnetic system that has an exact solution.The
critical temperature Tcfor such a system can be obtained from the expression:
sinh 2J
kTc
=1 (1)
or kTc/J =2.269185 ... .
The spontaneous magnetization m(m=M/N,whereMis the total magnetization, and Nis
the number os spins) vs. Tis given by:
m(T)=1āˆ’(1āˆ’tanh2K)4
16 tanh4Kī˜‚1/8for T<T
c
= 0 for T>T
c
(2)
where K≔J/kT.
I would like you to run the program ising2d.c to check how well the Monte Carlo simulation
reproduces the analythical solution. Keep in mind that the temperature the program uses is in
units of J/k, so that the (program temperature)āˆ’1isthesameasKin the Eq. (2).
Prepare an input data file. Before you do that, I recommend to spen some time playing with
the ising2ds.c program. You will notice that well below Tcthe magnetization is ā€œwell behavedā€,
but it starts strongly fluctuaing when you get close to the transition point. You have to use your
own judgement to decide how many cycles are needed at each temperature to obtain a trustworthy
average of m. If you think that the data from ising2ds.c are not enough conclusive, you may
do someting else: when you run the ising2d.c program, instead of performing a single run for
each temperature, make several runs at the same temperature. If the mvalues produced by each
cycle do not differ very much, it means that the cycle is ā€œlong enoughā€; but if the values differ
considerably, you may want to increase the number of steps. Actually, very close to Tcas many
as ∼105or even more steps may be ā€œlong enoughā€; but, of course, I don’t want you to run into
such extremes; use your common sense to decide when ā€œenough is enoughā€.
pf2

Partial preview of the text

Download Physics 642 HW #3: Monte Carlo Simulations for Ising & Heisenberg Magnets and more Assignments Physics in PDF only on Docsity!

Physics 642, Spring 2007 – Homework Assignment

(deadline: Monday, May 14)

More about the deadline: the practical Monte Carlo exercise I want you to do in this homework assignment would be of no value if done in rush. It’s not a particularly time-consuming task, but it may be time-consuming for the computer you employ for the job. And – imagine such a situation: you feed the computer with input data and leave it to do the job overnight. But something goes wrong, say, you have made a small error in the input data file. You get a lot of worthless data. So, you have to figure out what was wrong, re-run the program, and so on. Therefore, it seems reasonable to give you an extra ā€œsafety marginā€ in this particular assignment, and set a two-week deadline (Monday, May 8) instead of the customary one-week deadline. But please please please!, start working on the simulation problem ASAP! Not on Sunday, May 13!!!

Problem 1 – 1 pt. Prove that the ā€œMetropolis Algorithm recipeā€ given at the beginning of Chapter 4 in the book by D. Landau and K. Binder (ā€œBook Fourā€ in the Webpage material) is consistent with the Detalied Balance Principle.

Problem 2 – 10 pts. I hope you have already got familiar with the Monte Carlo programs I have prepared for you. Now there is time to do some simple exercises. The 2D Ising magnet is the only known magnetic system that has an exact solution. The critical temperature Tc for such a system can be obtained from the expression:

sinh

2 J

kTc

or kTc/J = 2. 269185.... The spontaneous magnetization m (m = M/N , where M is the total magnetization, and N is the number os spins) vs. T is given by:

m(T ) =

[ 1 āˆ’ (1āˆ’tanh

(^2) K) 4 16 tanh^4 K

] 1 / 8 for T < Tc

= 0 for T > Tc

where K ≔ J/kT. I would like you to run the program ising2d.c to check how well the Monte Carlo simulation reproduces the analythical solution. Keep in mind that the temperature the program uses is in units of J/k, so that the (program temperature)āˆ’^1 is the same as K in the Eq. (2). Prepare an input data file. Before you do that, I recommend to spen some time playing with the ising2ds.c program. You will notice that well below Tc the magnetization is ā€œwell behavedā€, but it starts strongly fluctuaing when you get close to the transition point. You have to use your own judgement to decide how many cycles are needed at each temperature to obtain a trustworthy average of m. If you think that the data from ising2ds.c are not enough conclusive, you may do someting else: when you run the ising2d.c program, instead of performing a single run for each temperature, make several runs at the same temperature. If the m values produced by each cycle do not differ very much, it means that the cycle is ā€œlong enoughā€; but if the values differ considerably, you may want to increase the number of steps. Actually, very close to Tc as many as ∼ 105 or even more steps may be ā€œlong enoughā€; but, of course, I don’t want you to run into such extremes; use your common sense to decide when ā€œenough is enoughā€.

I’d like to remind you that you don’t need to sit all the time at the computer. All you need to do is to prepare the input data file, start the program, and then ask the computer to ā€œrun it in the backgroundā€. Then you may simply log out; the computer will keep working. When you log in next morning, the output data file will be there waiting for you (if you don’t know how to switch into the ā€œbackground modeā€, ask me).

Problem 3 – 4 pts. The Ising magnet is one important model in the theory of magnetism; another one is the Heisenberg magnet. Ising spins have only two states, ā€œupā€ and ā€œdownā€; in contrast, Hiesenberg spins may assume any orientation in the 4Ļ€ solid angle. In Monte Carlo simulations of Heisenberg systems we usually approximate the spins by unit classical vectors. One of the steps in the Metropolis algorithm is to generate a ā€œnew random orientationā€ of the spin we are working on. In the Ising model this is an easy task because there is only one choice — to flip the spin. But in the case of Heisenberg spins the situation is more complicated. There is an infinite number of possible ā€œnew orientationsā€, and one of them has to be selected using a procedure that is completely random. Inexperient Monte Carlo novices often use the following method that seems quite ā€œnaturalā€: using a standard generator they create three random numbers from the (0,1) range: rx, ry, and rz ; then, using a simple operation, convert all three of them to random numbers from the (-1,1) range: Rx = 2Ɨrx āˆ’1, etc.; and then, normalize them to obtain three coordinates of a unit vector:

xˆ =

Rx √ R^2 x + R^2 y + R^2 z

, etc.

However, it is easy to see that such a procedure is biased. Each triad Rx, Ry, Rz can be thought of as a point inside a cube whose corners are at the (1,1,1), (-1,1,1),... positions. If the random num- ber generator generates truly random numbers, these points should be uniformly distributed inside the cube. So, it’s clear that the probability of obtaining a point located on the cube’s main diagonal is

3 times larger than of a point located on the cube’s edge; consequently, (1/

unit vectors will be generated

3 times more often than (1,0,0) vectors. There is probably more than one method of obtaining an ā€œunbiasedā€ distribution. One idea is to use the angular coordinates. Let’s take Ļ• = 2Ļ€ Ɨr. But what with Īø? If we take Īø = (2rāˆ’1)Ć—Ļ€/2, we again would have a non-uniform distribution, even ā€œmuch more badly biasedā€ that the previous one! So, what would you propose instead for the other coordinate? (Hint: how about cylindrical coordinates? Why don’t you try?).