27.01.2014 Views

An Introduction to Monte Carlo Methods in Statistical Physics.

An Introduction to Monte Carlo Methods in Statistical Physics.

An Introduction to Monte Carlo Methods in Statistical Physics.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Workshop on Markov Cha<strong>in</strong> <strong>Monte</strong> <strong>Carlo</strong><br />

S<strong>in</strong>gapore March 8-12, 8<br />

2004<br />

<strong>An</strong> <strong>Introduction</strong> <strong>to</strong> <strong>Monte</strong> <strong>Carlo</strong> <strong>Methods</strong><br />

<strong>in</strong> <strong>Statistical</strong> <strong>Physics</strong><br />

D. P. Landau<br />

Center for Simulational <strong>Physics</strong><br />

The University of Georgia<br />

• <strong>Introduction</strong> and perspective<br />

• <strong>Monte</strong> <strong>Carlo</strong> Simulations:<br />

“Simple” methods<br />

Accelerated algorithms<br />

Wang-Landau sampl<strong>in</strong>g<br />

• Summary and overview


<strong>Introduction</strong><br />

<strong>Physics</strong> was first known as “natural philosophy”<br />

⇒ research was purely theoretical<br />

Later, experiment became accepted but was limited by<br />

problems with sample preparation and apparatus<br />

• Modern computers allow simulations of models that are<br />

<strong>in</strong>tractable us<strong>in</strong>g “classical” theory ⇒ can now <strong>in</strong>vent<br />

new models and solve them without great simplification<br />

• Computer simulations have become another way of do<strong>in</strong>g<br />

physics research<br />

• Sometimes simulations provide a theoretical basis for<br />

understand<strong>in</strong>g experimental results, and sometimes<br />

they provide "experimental" data <strong>to</strong> compare with theory


Goal of these lectures ⇒<br />

<strong>to</strong> provide a basic understand<strong>in</strong>g of the methods and<br />

philosophy of computer simulations<br />

• Emphasis on problems <strong>in</strong> statistical thermodynamics<br />

(condensed matter physics/ materials science)<br />

• Choose the simulation algorithm and conditions with the<br />

problem <strong>to</strong> be solved <strong>in</strong> m<strong>in</strong>d. The <strong>in</strong>terpretation of the<br />

result is critical <strong>to</strong> the success of any simulational project!


What is a <strong>Monte</strong> <strong>Carlo</strong> Simulation?<br />

. . . follow the "time dependence" of a model for which<br />

change is not determ<strong>in</strong>istic (e.g. given by New<strong>to</strong>n's laws) but<br />

s<strong>to</strong>chastic. Do this with a sequence of random numbers.<br />

<strong>An</strong>other sequence of random numbers will give results that<br />

agree <strong>to</strong> with<strong>in</strong> some “statistical error”.<br />

Approach is valid for many problems, e.g:<br />

• magnets<br />

• percolation<br />

• diffusion limited aggregation (DLA)<br />

⇑<br />

discovered on the computer!


What problems can we solve with <strong>Monte</strong> <strong>Carlo</strong>?<br />

• B<strong>in</strong>ary (AB) metallic alloys ⇔ order<strong>in</strong>g, <strong>in</strong>terdiffusion or<br />

unmix<strong>in</strong>g k<strong>in</strong>etics. Jump rates depend on the local<br />

environment. (Phonon “heat bath” → excitation energy for<br />

jumps ... good approximation because the characteristic times<br />

between jumps >> than a<strong>to</strong>mic vibration periods.)<br />

• DLA growth of colloidal particles . . . their masses >> a<strong>to</strong>mic<br />

masses ⇒ motion of colloidal particles <strong>in</strong> fluids is described by<br />

Brownian motion.<br />

• “Micelle formation” <strong>in</strong> lattice models of microemulsions (wateroil-surfactant<br />

fluid mixtures). Part of the “art” of simulation is<br />

the appropriate choice (or <strong>in</strong>vention!) of a suitable (coarsegra<strong>in</strong>ed)<br />

model.<br />

• Interact<strong>in</strong>g quantized particles... transform <strong>in</strong><strong>to</strong> a pseudoclassical<br />

model or consider permutation properties.<br />

• Polymer models, e.g. flexible polymer as a random walk.


What difficulties will we encounter?<br />

Limited computer time and memory<br />

Important... consider requirements of memory and cpu<br />

time BEFORE start<strong>in</strong>g. Are the resources needed<br />

available now? The tractability of a problem may require a<br />

new algorithm... Develop<strong>in</strong>g new strategies is itself excit<strong>in</strong>g!<br />

<strong>Statistical</strong> and other errors<br />

• Computers have f<strong>in</strong>ite word length → limited precision.<br />

Truncation & round-off may produce problems.<br />

• <strong>Statistical</strong> errors come from f<strong>in</strong>ite sampl<strong>in</strong>g. Estimate them,<br />

then make a "policy" decision, i.e. simulate longer <strong>to</strong><br />

reduce statistical errors or use the cpu time <strong>to</strong> study the<br />

properties of the system under other conditions?<br />

• Systematic errors. <strong>An</strong> algorithm may not describe the<br />

physics properly, e.g. due <strong>to</strong> f<strong>in</strong>ite particle number, etc.


What strategy should we follow?<br />

• New simulations face hidden pitfalls. Beg<strong>in</strong> with a<br />

simple program, small systems, and short runs. Test the<br />

program for special values of parameters for which the<br />

answers are known. Uncover parameter ranges of<br />

<strong>in</strong>terest and f<strong>in</strong>d unexpected difficulties. Then, ref<strong>in</strong>e the<br />

program and <strong>in</strong>crease runn<strong>in</strong>g times.<br />

• Use BOTH cpu time and human time effectively. Don’t<br />

spend a month <strong>to</strong> rewrite a computer program that saves<br />

only a few m<strong>in</strong>utes of cpu time.


How do Simulations Relate <strong>to</strong> Theory and<br />

Experiment?<br />

•Theory might be available for a model with no good physical<br />

realization ⇔ compare with "data" from a simulation.<br />

Dramatic example: reac<strong>to</strong>r meltdown . . . we want<br />

understand<strong>in</strong>g but do not want <strong>to</strong> carry out experiments!<br />

• Physical systems exist that are <strong>to</strong>o complex for theory, e.g.<br />

<strong>in</strong> polymer blends there is a subtle <strong>in</strong>terplay between<br />

compet<strong>in</strong>g <strong>in</strong>teractions configurational entropy of flexible<br />

macromolecules, etc). If the simulation (play<strong>in</strong>g the role of<br />

theory) disagrees with experiment, a new model is needed.<br />

<strong>An</strong> important advantage of simulations ⇒ different<br />

physical effects which are simultaneously present <strong>in</strong><br />

real systems may be isolated and through separate<br />

consideration may provide better understand<strong>in</strong>g.


Simulation<br />

NATURE<br />

Experiment Theory


Ergodicity and Broken Symmetry<br />

Ergodicity ⇒ all configurations are atta<strong>in</strong>able. Below T c<br />

multiple ordered states may be well separated <strong>in</strong> phase<br />

space.<br />

Symmetry break<strong>in</strong>g usually means ergodicity break<strong>in</strong>g, i.e.,<br />

the system stays <strong>in</strong> one separate region <strong>in</strong> phase space.<br />

In an Is<strong>in</strong>g model simulation, we may wish <strong>to</strong> keep the system<br />

from explor<strong>in</strong>g all of phase space. If the simulation<br />

algorithm is fully ergodic, both M > 0 and M < 0 states will<br />

appear and = 0. A danger for simulations is that<br />

specialized algorithms may be un<strong>in</strong>tentionally non-ergodic,<br />

thus yieldig <strong>in</strong>correct results.


Probability Distributions and the<br />

Central Limit Theorem<br />

( x x )<br />

1 ⎡ −<br />

P G ( x )<br />

⎥ ⎥ ⎤<br />

= exp ⎢ −<br />

2 2<br />

2 πσ ⎢ ⎣ 2 σ ⎦<br />

2<br />

Gaussian distribution<br />

… approximation <strong>to</strong> the b<strong>in</strong>omial distribution with a large<br />

number of possible outcomes and a large number of samples.<br />

If random variables x i are <strong>in</strong>dependent and drawn from the<br />

same distribution, X ∑ 1<br />

x / N as → ∞ is always<br />

=<br />

N<br />

N i = i N<br />

distributed as a Gaussian ⇐ Central Limit Theorem


<strong>Statistical</strong> Errors<br />

<strong>Statistical</strong> Errors<br />

Consider a quantity A distributed accord<strong>in</strong>g <strong>to</strong> a gaussian<br />

with mean value and width σ. For n <strong>in</strong>dependent<br />

observations<br />

n i i<br />

A =<br />

1<br />

∑ = 1 A = unbiased estima<strong>to</strong>r of the mean < A ><br />

n<br />

and the standard error of this estimate = σ / n<br />

Estimate the variance σ from the observations,<br />

δ A<br />

2<br />

1<br />

n<br />

i<br />

n<br />

1<br />

2 2<br />

( A ) A − ( A ) 2<br />

= ∑ δ =<br />

=<br />

i


Relate this <strong>to</strong> σ 2 = - < A> 2<br />

2<br />

2<br />

( 1 − 1 n )<br />

δ A = σ /<br />

⇒ compute errors of averages from uncorrelated estimates:<br />

error =<br />

δ A<br />

2<br />

n<br />

2<br />

( n − 1 ) = ( A ) / [ n ( 1 )]<br />

/ ∑ δ<br />

i<br />

n −<br />

=<br />

i<br />

1


Markov Cha<strong>in</strong>s and Master Equations<br />

Markov Cha<strong>in</strong>s and Master Equations<br />

…central <strong>to</strong> <strong>Monte</strong> <strong>Carlo</strong> simulations. Def<strong>in</strong>e a s<strong>to</strong>chastic process<br />

at times t 1 , t 2 ,… for a system with possible states S 1 , S 2 ...<br />

P<br />

state of the system at time t<br />

↓<br />

( X = S X = S , X = S , K , X = S )<br />

t n i n t n − 1 i n − 1 t n − 2 i n<br />

↑<br />

conditional probability<br />

−<br />

2<br />

t<br />

1<br />

i<br />

1<br />

,<br />

This is a Markov Process if the conditional probability<br />

depends only upon the immediate predecessor.


The sequence of states {X t } is a Markov cha<strong>in</strong><br />

transition probability <strong>to</strong> move from state i <strong>to</strong> state j ,<br />

( X = S )<br />

P<br />

n j<br />

14243<br />

P ( S , t )<br />

P<br />

( ) X = S X = S = W P ( X = S )<br />

t t n j<br />

i ij t n<br />

j<br />

=<br />

tn<br />

−<br />

1<br />

↓<br />

−<br />

1<br />

i<br />

.<br />

dP<br />

( S , t )<br />

dt<br />

j<br />

= −∑ W ( )<br />

ji<br />

P S<br />

j<br />

, t +∑ W<br />

ji<br />

P ( S<br />

i<br />

, t ) Master Equation<br />

i<br />

i<br />

Importance sampl<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong> ⇔ a Markov process.<br />

The pr<strong>in</strong>ciple of detailed balance must be satisfied:<br />

W<br />

ji<br />

equilibrium probabilit y<br />

↓<br />

P<br />

eq<br />

( S ) = W P ( S ), i . e ., dP ( S , t )/<br />

dt ≡ 0<br />

j<br />

ij<br />

eq<br />

i<br />

eq<br />

j


The “Art” of Random Number Generation<br />

The “Art” of Random Number Generation<br />

<strong>Monte</strong> <strong>Carlo</strong> methods need fast, efficient production of<br />

random numbers. Physical processes, e.g. electrical circuit<br />

white noise, pre-calculated tables, etc. are <strong>to</strong>o slow!<br />

Software algorithms are actually determ<strong>in</strong>istic, produc<strong>in</strong>g<br />

"pseudo-random" numbers...this may be helpful, e.g. <strong>to</strong> test a<br />

program, want <strong>to</strong> compare the results with a previous run<br />

made us<strong>in</strong>g identical random numbers.<br />

Poor quality random numbers → systematic errors!!<br />

In general, the random number sequences should be<br />

uniform, uncorrelated, and have a long period.


Congruential Method<br />

A fixed multiplier c and seed X o are chosen. Then,<br />

( c × X<br />

n 1<br />

a ) MOD N<br />

max<br />

X<br />

n<br />

=<br />

−<br />

+<br />

o<br />

where X n is an <strong>in</strong>teger between 1 and N max . c must have<br />

“good” properties. Performance is best for X 0 odd. A “good”<br />

genera<strong>to</strong>r is the 32-bit l<strong>in</strong>ear congruential algorithm (CONG)<br />

X<br />

( ) (<br />

31<br />

16807 × X MOD 2 1 )<br />

n<br />

=<br />

n −1<br />

−<br />

(<strong>An</strong>other, popular congruential genera<strong>to</strong>r had noticeable<br />

correlation between consecutive triplets of random numbers.)


Shift Register (Tausworthe<br />

( Tausworthe) ) Algorithm<br />

A new random number is produced by comb<strong>in</strong><strong>in</strong>g two<br />

different exist<strong>in</strong>g numbers from a pre-exist<strong>in</strong>g table:<br />

X n = X n − p . XOR . X n − q<br />

where p and q must be properly chosen. The .XOR.<br />

opera<strong>to</strong>r is the bitwise exclusive-OR opera<strong>to</strong>r. The best<br />

choices of the pairs (p,q) are given by primitive Mersenne<br />

tr<strong>in</strong>omials:<br />

+ q x p x<br />

+1


Examples of pairs which satisfy this condition are:<br />

p = 250 q = 103 ← popular, known as R250<br />

p = 1279 q = 216, 418<br />

p = 9689 q = 84, 471, 1836, 2444, 4187<br />

Large p and q yield better sequences. The “table” must be<br />

properly <strong>in</strong>itialized. Use a good congruential genera<strong>to</strong>r <strong>to</strong><br />

generate a different random number for each bit <strong>in</strong> turn.<br />

Lagged Fibonacci Genera<strong>to</strong>rs<br />

Replace the exclusive-or by another opera<strong>to</strong>r, e.g.,<br />

X n = X n − p * X n − q


Tests for Quality (some examples)<br />

Tests for Quality (some examples)<br />

Uniformity test: Break up the <strong>in</strong>ternal 0


Example:<br />

Plot po<strong>in</strong>ts us<strong>in</strong>g consecutive pairs of random numbers for x and y.<br />

“bad” genera<strong>to</strong>r “good” genera<strong>to</strong>r


Non-uniform Distributions of Random Numbers<br />

Look at the <strong>in</strong>tegrated distribution function F(x) of the desired<br />

distribution f(x), generate a uniform distribution of random<br />

numbers y i and take the <strong>in</strong>verse function with the uniformly<br />

chosen random number as the variable, i.e.<br />

y<br />

=<br />

F<br />

(<br />

y<br />

)<br />

=<br />

0<br />

y<br />

∫ f ( x ) dx ⇒ x =<br />

F<br />

−<br />

1<br />

(<br />

y<br />

)<br />

Examples<br />

Generate random numbers distributed accord<strong>in</strong>g <strong>to</strong> f(x)=x.<br />

y = F ( x ) =<br />

0<br />

x<br />

∫ x ′ dx ′ =<br />

0.5 x<br />

2 .<br />

If a random number y is chosen from a uniform distribution,<br />

then x = 2.0y 1/2 .


Non-uniform Distributions of Random Numbers<br />

Gaussian distribution (Box-Muller method):<br />

Draw x 1 and x 2 from a uniform distribution, and the desired<br />

random numbers are<br />

y<br />

y<br />

1<br />

2<br />

=<br />

=<br />

1/ 2<br />

( − 2ln x<br />

1<br />

) cos ( 2 π x<br />

2<br />

)<br />

1/ 2<br />

( − 2ln x ) s<strong>in</strong> ( 2 π x )<br />

1<br />

2


Us<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong> for Numerical Integration<br />

•Our goal is <strong>to</strong> estimate:<br />

b<br />

y = ∫ f ( x )<br />

a<br />

dx


Us<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong> for Numerical Integration<br />

•Our goal is <strong>to</strong> estimate:<br />

b<br />

y = ∫ f ( x )<br />

a<br />

dx<br />

Acceptance - rejection ("hit and miss") method<br />

Draw a box from a <strong>to</strong> b and from 0 <strong>to</strong> y o where y o > f(x)


Us<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong> for Numerical Integration<br />

•Our goal is <strong>to</strong> estimate:<br />

b<br />

y = ∫ f ( x )<br />

a<br />

dx<br />

Acceptance - rejection ("hit and miss") method<br />

Draw a box from a <strong>to</strong> b and from 0 <strong>to</strong> y o where y o > f(x)<br />

Drop N po<strong>in</strong>ts randomly <strong>in</strong><strong>to</strong> the box; N o fall below f(x).


Us<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong> for Numerical Integration<br />

•Our goal is <strong>to</strong> estimate:<br />

b<br />

y = ∫ f ( x )<br />

a<br />

dx<br />

Acceptance - rejection ("hit and miss") method<br />

Draw a box from a <strong>to</strong> b and from 0 <strong>to</strong> y o where y o > f(x)<br />

Drop N po<strong>in</strong>ts randomly <strong>in</strong><strong>to</strong> the box; N o fall below f(x).<br />

<strong>An</strong> estimate for the <strong>in</strong>tegral is given by the fraction of po<strong>in</strong>ts<br />

which fall below the curve<br />

times the area of the box, i.e y<br />

est<br />

= ( N<br />

o<br />

/ N ) × [ y<br />

o<br />

( b − a )]


Example: Estimate “π” us<strong>in</strong>g simple sampl<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong><br />

• Choose N po<strong>in</strong>ts randomly <strong>in</strong> the xy-plane so that 0


Numerical Integration by <strong>Monte</strong> <strong>Carlo</strong> (cont’d)<br />

Simple "crude method“<br />

• Choose N values of x randomly, and then<br />

1<br />

y = ∑ f<br />

N<br />

(<br />

est xi<br />

i<br />

)<br />

•As N → ∞, the estimate converges <strong>to</strong> the correct result.<br />

• Simple variation of this method... divide the <strong>in</strong>terval <strong>in</strong><strong>to</strong><br />

unequal sub-<strong>in</strong>tervals and perform a separate <strong>Monte</strong><br />

<strong>Carlo</strong> <strong>in</strong>tegration for each sub-<strong>in</strong>terval.<br />

• Less effort can be expended on those sub-<strong>in</strong>tervals over<br />

which the function is small.


Intelligent methods for <strong>Monte</strong> <strong>Carlo</strong> Integration<br />

Control variate method<br />

Select a known, <strong>in</strong>tegrable function and only <strong>in</strong>tegrate the<br />

difference [f '(x)-f(x)], i.e.<br />

b<br />

+∫ [ f '( x ) −<br />

y<br />

est<br />

= F ' f ( x )] dx<br />

a<br />

where F ' f '( x ) dx .<br />

= ∫<br />

b a<br />

( Note: can be improved without additional numerical effort by an<br />

<strong>in</strong>telligent choice of f '(x) ! )


Intelligent methods for <strong>Monte</strong> <strong>Carlo</strong> Integration<br />

Importance sampl<strong>in</strong>g<br />

Choose po<strong>in</strong>ts by the expected importance p(x) of the value<br />

of the function at that po<strong>in</strong>t <strong>to</strong> the <strong>in</strong>tegral. Weight the<br />

contribution by the <strong>in</strong>verse of the probability of choice:<br />

y<br />

− 1<br />

est<br />

= ∑ p ( x i ) f ( x<br />

i<br />

Values of x are no longer chosen with equal probability ⇒ need<br />

random numbers that are not drawn from a uniform sequence.<br />

Some expertise is often needed <strong>in</strong> choos<strong>in</strong>g p(x) → Iterate...<br />

carry out a rough study, get an improved p(x), and repeat.<br />

i<br />

)<br />

Intelligent importance sampl<strong>in</strong>g is far more effective <strong>in</strong><br />

improv<strong>in</strong>g convergence than the brute force method of<br />

simply generat<strong>in</strong>g many more po<strong>in</strong>ts!<br />

Homework: Suppose f(x) = x 10 -1. Use a "hit or miss" <strong>Monte</strong> <strong>Carlo</strong><br />

simulation <strong>to</strong> estimate the <strong>in</strong>tegral between x=1 and x=2.


<strong>Monte</strong> <strong>Carlo</strong> Solution of Boundary<br />

Value Problems<br />

Often have a differential equation with a boundary condition<br />

∇<br />

2<br />

2<br />

2<br />

u = ∂ x / ∂ x + ∂ x / ∂ y = 0<br />

2<br />

2<br />

Laplace' s equation<br />

where u(r) = f on the boundary. Re-express as a f<strong>in</strong>ite<br />

difference equation us<strong>in</strong>g a small <strong>in</strong>crement ∆,<br />

∇<br />

2<br />

u =<br />

=<br />

⇒ u<br />

[ u ( x + ∆ , y ) + u ( x − ∆ , y ) + u ( x , y + ∆ ) + u ( x , y − ∆ ) − 4 u ( x , y ) ]<br />

0<br />

( x , y ) =<br />

[ u ( x + ∆ , y ) + u ( x − ∆ , y ) + u ( x , y + ∆ ) + u ( x , y − ∆ ) ]/<br />

4<br />

/ ∆<br />

2


Probabilistic <strong>in</strong>terpretation: Consider a grid of po<strong>in</strong>ts <strong>in</strong> the<br />

x-y plane with a lattice spac<strong>in</strong>g ∆. The probability of a random<br />

walk return<strong>in</strong>g <strong>to</strong> po<strong>in</strong>t (x,y) from a nearest neighbor site is 1/4.<br />

Place the boundary on the grid, a random walk will end at a<br />

boundary po<strong>in</strong>t<br />

(x',y') where<br />

u(x',y') = f(x',y') .<br />

Execute many walks beg<strong>in</strong>n<strong>in</strong>g at po<strong>in</strong>t (x,y), then<br />

1<br />

u ( x , y ) ≈ ∑ f ( x i ′ , y i ′ ) , let N →∞.<br />

N<br />

i


example<br />

Consider two concentric, circular conduc<strong>to</strong>rs <strong>in</strong> a plane<br />

which are placed <strong>in</strong><strong>to</strong> the center of a square box which is 20cm<br />

on a side. The <strong>in</strong>ner conduc<strong>to</strong>r has a radius of 4cm and carries<br />

a potential of 2V.; the outer conduc<strong>to</strong>r has a radius of 16cm<br />

and has a potential of 4V. What is the potential halfway between<br />

the two conduc<strong>to</strong>rs? Consider a square box with an L × L grid.<br />

N L=10 L=20 L=40 L=80 L=160 L=320<br />

500 3.6560 3.3000 3.2880 3.3240 3.3400 3.3760V.<br />

5000 3.5916 3.2664 3.3272 3.3372 3.3120 3.3172<br />

10000 3.6318 3.2886 3.3210 3.3200 3.3128 3.3222<br />

50000 3.6177 3.2824 3.3149 3.3273 3.3211 3.3237<br />

100000 3.6127 3.2845 3.3211 3.3240 3.3243 3.3218<br />

exact value = 3.3219 V.


<strong>Monte</strong> <strong>Carlo</strong> and Stat. Mech.- <strong>An</strong> <strong>Introduction</strong><br />

Phase transitions and critical phenomena are of<br />

great <strong>in</strong>terest! How can we learn about them?<br />

The Partition function conta<strong>in</strong>s all thermodynamic<br />

<strong>in</strong>formation:<br />

Lattice models are simple and amenable <strong>to</strong> high<br />

resolution study via computer simulation<br />

(magnets, lattice gauge models, polymers, etc.)<br />

How do we get <strong>to</strong> long times, i.e. sample much of<br />

phase space?


<strong>Monte</strong> <strong>Carlo</strong> and Stat. Mech.- <strong>An</strong> <strong>Introduction</strong><br />

Phase transitions and critical phenomena are of<br />

great <strong>in</strong>terest! How can we learn about them?<br />

The Partition function conta<strong>in</strong>s all thermodynamic<br />

<strong>in</strong>formation:<br />

Z<br />

H<br />

/k T<br />

= ∑ e<br />

−<br />

B<br />

all states<br />

Lattice models are simple and amenable <strong>to</strong> high<br />

resolution study via computer simulation<br />

(magnets, lattice gauge models, polymers, etc.)<br />

How do we get <strong>to</strong> long times, i.e. sample much of<br />

phase space?


The Percolation problem<br />

The Percolation problem<br />

. . . a geometric problem <strong>in</strong> which random addition of objects can<br />

create a contiguous path which spans the entire system.<br />

Site Percolation<br />

• Lattice sites are randomly occupied with probability p.<br />

• Connect occupied nearest neighbor sites <strong>to</strong> form clusters<br />

• Generate many (<strong>in</strong>dependent) realizations P span<br />

= probability<br />

of hav<strong>in</strong>g a spann<strong>in</strong>g (<strong>in</strong>f<strong>in</strong>ite) cluster.<br />

•The order parameter M is the fraction of occupied sites <strong>in</strong> the<br />

lattice which belong <strong>to</strong> the <strong>in</strong>f<strong>in</strong>ite cluster.<br />

• p = p c (percolation threshold); (p-p c ) ⇔ (T c -T) for a thermal<br />

transition.<br />

Simplest “<strong>in</strong>f<strong>in</strong>ite” cluster random <strong>in</strong>f<strong>in</strong>ite cluster


Some Brief Background<br />

Some Brief Background<br />

The Partition function conta<strong>in</strong>s all <strong>in</strong>formation about a system<br />

Z<br />

H<br />

= ∑ − /k T<br />

e B<br />

all states<br />

Example<br />

N non-<strong>in</strong>teract<strong>in</strong>g Is<strong>in</strong>g sp<strong>in</strong> <strong>in</strong> an external magnetic field H<br />

H<br />

= − H ∑<br />

i<br />

σ<br />

i<br />

, σ = ± 1<br />

i<br />

⎛ − H / k T +<br />

then Z = ⎜ e B + e<br />

⎝<br />

H / k T<br />

B<br />

N<br />

⎞<br />

⎟<br />

⎠<br />

Usually Z cannot be evaluated exactly. For an N=10,000 Is<strong>in</strong>g<br />

model Z has 2 10,000 terms!


Probability that the system is <strong>in</strong> state µ :<br />

P<br />

µ<br />

=<br />

e<br />

−H<br />

( µ )<br />

/<br />

k B T<br />

/<br />

Z<br />

Partition function ⇔ thermodynamic quantities<br />

F = − k B<br />

U = − T<br />

2<br />

T ln Z Free energy<br />

∂<br />

( F / T )/<br />

∂ T<br />

Can also estimate Free Energy differences by <strong>in</strong>tegration,<br />

e.g.,<br />

∆ ( F / T ) = ∫ d ( 1/ T ) d ( U / T ).


Fluctuations<br />

Mean values, eg.:<br />

( ) ∑ ( ) ∑ ( )<br />

− β H ( µ )<br />

∑<br />

− β H ( µ )<br />

β = P<br />

µ<br />

H µ = H µ e e<br />

µ<br />

µ<br />

µ<br />

U /<br />

Fluctuation relation:<br />

k<br />

2<br />

( ∆ U ) ∆ ≡ H H<br />

2<br />

B<br />

T C<br />

v<br />

= H − H =<br />

, U −<br />

2 2<br />

NVT<br />

In experiment N≈ 10 22 and fluctuations are <strong>to</strong>o small <strong>to</strong> be<br />

detectable. In simulations they are readily observable!<br />

Other fluctuation relations exist, e.g. isothermal susceptibility<br />

= χ<br />

( ) [ ]<br />

2<br />

2<br />

∂ / ∂ H = N M − M k T<br />

M<br />

T<br />

/<br />

B


S<strong>in</strong>gle Sp<strong>in</strong>-Flip<br />

<strong>Monte</strong> <strong>Carlo</strong> <strong>Methods</strong><br />

Typical sp<strong>in</strong> configurations for the Is<strong>in</strong>g square lattice<br />

T >T c


Simple Sampl<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong><br />

Simple Sampl<strong>in</strong>g <strong>Monte</strong> <strong>Carlo</strong><br />

The Partition function conta<strong>in</strong>s all <strong>in</strong>formation about a system<br />

Z =<br />

all<br />

∑<br />

e<br />

states<br />

−<br />

H /k<br />

T<br />

B ≈ e<br />

∑<br />

M states<br />

−<br />

H /k<br />

B<br />

T<br />

Example: N Is<strong>in</strong>g sp<strong>in</strong>s on a square lattice<br />

H<br />

= − J<br />

i<br />

∑<br />

,<br />

j<br />

σ<br />

i<br />

σ<br />

j<br />

, σ<br />

i<br />

= ± 1<br />

At low temperature, only two states contribute very much<br />

(i.e. all sp<strong>in</strong>s up or all sp<strong>in</strong>s down). Simple sampl<strong>in</strong>g is very<br />

<strong>in</strong>efficient s<strong>in</strong>ce it is very unlikely <strong>to</strong> generate these two<br />

states! Use importance sampl<strong>in</strong>g <strong>in</strong>stead.<br />

Remember, for an N=10,000 Is<strong>in</strong>g model Z has 2 10,000 terms!


S<strong>in</strong>gle sp<strong>in</strong>-flip sampl<strong>in</strong>g for the Is<strong>in</strong>g model<br />

Produce the n th state from the m th state … relative<br />

probability is P n /P m → need only the energy difference, i.e.<br />

∆ E =(E n -E m ) between the states<br />

<strong>An</strong>y transition rate that satisfies detailed balance is<br />

acceptable, usually the Metropolis form (Metropolis et al,<br />

1953).<br />

W(m→ n) = τ<br />

-1<br />

o exp (-∆E/kB T), ∆E > 0<br />

= τ<br />

-1<br />

o , ∆E < 0<br />

where τ o is the time required <strong>to</strong> attempt a sp<strong>in</strong>-flip.


Metropolis Recipe:<br />

(1.) Choose an <strong>in</strong>itial state<br />

(2.) Choose a site i<br />

(3.) Calculate the energy change ∆E which results if the sp<strong>in</strong><br />

at site i is overturned<br />

(4.) Generate a random number r such that 0 < r < 1<br />

(5.) If r < exp(-∆E/k B T), flip the sp<strong>in</strong><br />

(6.) Go <strong>to</strong> the next site and go <strong>to</strong> (2)<br />

Critical Slow<strong>in</strong>g Down!


Some Practical Advice<br />

1. In the very beg<strong>in</strong>n<strong>in</strong>g, th<strong>in</strong>k!<br />

What problem do you really want <strong>to</strong> solve? What<br />

method and strategy are best suited <strong>to</strong> the study?<br />

(A little thought may reduce the number of false starts.)<br />

2. In the beg<strong>in</strong>n<strong>in</strong>g th<strong>in</strong>k small!<br />

Use small lattices and short runs... gives fast “turnaround” and<br />

aids debugg<strong>in</strong>g. Can rapidly search through parameter<br />

space <strong>to</strong> f<strong>in</strong>d ranges with physically <strong>in</strong>terest<strong>in</strong>g behavior.<br />

3. Test the random number genera<strong>to</strong>r!<br />

F<strong>in</strong>d limit<strong>in</strong>g cases where accurate, or exact values of some<br />

properties can be compared with your results with different<br />

random number sequences and/or genera<strong>to</strong>rs.


Some Practical Advice (cont<strong>in</strong>ued)<br />

4. Look at systematic variations with system size and run<br />

length!<br />

Use a wide range of sizes and runs lengths and then use<br />

scal<strong>in</strong>g forms <strong>to</strong> analyze data<br />

5. Calculate error bars!<br />

Search for and estimate both statistical and systematic<br />

errors. (This enables the evaluation of the correctness of<br />

the conclusions which are drawn from the data.)<br />

6. Make a few very long runs!<br />

Check for hidden very long time scales


His<strong>to</strong>rical Background (from The Mathematical Intelligencer)<br />

Montmorency Royce Sebastian <strong>Carlo</strong>w (1878-1927). The son of a<br />

Buck<strong>in</strong>ghamshire peat-digger, he was born <strong>in</strong> the sedate village of Gossoon two<br />

years after Alexander Graham Bell's <strong>in</strong>vention of the telephone, and died the year<br />

L<strong>in</strong>dberg flew the Atlantic.<br />

Montmorency <strong>Carlo</strong>w's contribution <strong>to</strong> science is no less strik<strong>in</strong>g. He<br />

displayed no noticeable mathematical talent - <strong>in</strong>deed no talent at all worth<br />

speak<strong>in</strong>g of - until the age of forty-eight, when he succeeded <strong>in</strong> destroy<strong>in</strong>g the<br />

entire village of Gossoon, and much of the surround<strong>in</strong>g countryside, <strong>in</strong> a<br />

s<strong>in</strong>glehanded air-raid mounted from a Handley Page 0/0400 Night Bomber. At his<br />

subsequent trial he offered the defence that he was attempt<strong>in</strong>g <strong>to</strong> estimate the<br />

area of Gossoon's village pond by calculat<strong>in</strong>g the proportion of hits from a random<br />

bomb<strong>in</strong>g pattern; add<strong>in</strong>g that s<strong>in</strong>ce the <strong>to</strong>tal area of Gossoon was 946.32 acres<br />

and he had hit the pond exactly once us<strong>in</strong>g 143 bombs, the area of the pond was<br />

approximately 6.6176224 and a bit acres.<br />

Lord Justice Milnesshawe-Ffeebes, fail<strong>in</strong>g <strong>to</strong> appreciate the revolutionary<br />

nature of the method, commented that s<strong>in</strong>ce the bomb crater had obliterated all<br />

trace of the pond, the calculation left someth<strong>in</strong>g <strong>to</strong> be desired. Before the<br />

conclusion of the trial, <strong>Carlo</strong>w attempted <strong>to</strong> estimate the probability of surviv<strong>in</strong>g a<br />

fall by repeatedly jump<strong>in</strong>g from a high w<strong>in</strong>dow, fell on his head at the first attempt,<br />

and broke his neck. His name l<strong>in</strong>gers on, however: the techniques of estimation<br />

that he pioneered are known throughout the world as Monty <strong>Carlo</strong>w <strong>Methods</strong>.


Types of Computer Simulations<br />

Types of Computer Simulations<br />

Determ<strong>in</strong>istic methods . . . (Molecular dynamics)<br />

S<strong>to</strong>chastic methods . . . (<strong>Monte</strong> <strong>Carlo</strong>)


Boundary Conditions<br />

Boundary Conditions<br />

Different boundary conditions ⇒ different physics


Boundary Conditions<br />

Boundary Conditions<br />

Different boundary conditions ⇒ different physics<br />

Extrapolate size <strong>to</strong> ∞<br />

→ bulk behavior


Boundary Conditions<br />

Boundary Conditions<br />

Different boundary conditions ⇒ different physics<br />

Introduce an <strong>in</strong>terface parallel<br />

<strong>to</strong> the <strong>to</strong>p “surface”<br />

→ study <strong>in</strong>terfacial phenomena


Boundary Conditions<br />

Boundary Conditions<br />

Different boundary conditions ⇒ different physics<br />

Study nanoparticles


Boundary Conditions<br />

Boundary Conditions<br />

Different boundary conditions ⇒ different physics<br />

AND, free edges on <strong>to</strong>p, pbc on the sides<br />

→ Study surface critical behavior


S<strong>in</strong>gle Sp<strong>in</strong>-Flip<br />

<strong>Monte</strong> <strong>Carlo</strong> Method<br />

Typical sp<strong>in</strong> configurations for the<br />

Is<strong>in</strong>g square lattice with pbc<br />

T >T c


Correlation times<br />

Correlation times<br />

Def<strong>in</strong>e an equilibrium relaxation function φ(t)<br />

ϕ<br />

MM<br />

( t )<br />

< ( M ( 0 )M ( t ) > - < M ><br />

< M<br />

2<br />

> - < M ><br />

2<br />

2<br />

⎯<br />

=<br />

⎯ →<br />

t<br />

→ ⎯ ∞<br />

e<br />

−<br />

t<br />

/<br />

τ<br />

and<br />

τ<br />

∝ T − T |<br />

|<br />

c<br />

−<br />

z ν<br />

i.e. τ diverges at T c !<br />

“Critical slow<strong>in</strong>g down”


F<strong>in</strong>ite Sampl<strong>in</strong>g Time Effects<br />

F<strong>in</strong>ite Sampl<strong>in</strong>g Time Effects<br />

Consider the expectation of the square of the statistical error<br />

2<br />

( δ A ) = ∑ ( A − )<br />

µ<br />

A<br />

⎢<br />

⎣<br />

⎡<br />

1<br />

N<br />

N<br />

µ =1<br />

⎥<br />

⎦<br />

⎤<br />

2<br />

=<br />

1<br />

N<br />

2<br />

N<br />

∑<br />

µ =1<br />

∞<br />

Def<strong>in</strong>e τ A ≡ ∫ φ A()<br />

tdt<br />

0<br />

N N<br />

( ) ( )<br />

2 2<br />

− + ∑ ∑<br />

2<br />

A<br />

µ<br />

A<br />

A −<br />

2<br />

µ<br />

A<br />

µ<br />

A<br />

N<br />

µ<br />

1<br />

=1<br />

µ<br />

2<br />

=<br />

µ<br />

Correlation time<br />

1<br />

+<br />

1<br />

1<br />

2<br />

No. of measurements, made<br />

time δ t apart<br />

1 2 2<br />

⎛ +<br />

( ) [ ]<br />

2<br />

= −<br />

A<br />

δ A A A<br />

⎜ 1 2<br />

N<br />

⎟ ⎝ t ⎠<br />

δ<br />

τ<br />

⎞<br />

True “error”


F<strong>in</strong>ite Sampl<strong>in</strong>g Time Effects<br />

F<strong>in</strong>ite Sampl<strong>in</strong>g Time Effects<br />

Biased sampl<strong>in</strong>g: a systematic error<br />

2 2<br />

E ( s ) = σ (1 −<br />

1/ n )<br />

No. of <strong>in</strong>dependent<br />

measurements<br />

Consider the<br />

magnetic<br />

susceptibility<br />

χ∝ (- 2 )


F<strong>in</strong>ite Size Effects<br />

F<strong>in</strong>ite Size Effects<br />

A scal<strong>in</strong>g ansatz for the s<strong>in</strong>gular part of the free energy:<br />

where ε = (T-T c )/T c .<br />

F(L,T) = L (2-α/ν) F(εL 1/ν )<br />

Choose the scal<strong>in</strong>g variable x = εL 1/ν because ξ~ε -ν ~ L<br />

as T→T c . (L “scales” with ξ; but can use L/ξ ∝ε ν L or<br />

εL 1/ν as the argument of F.) Differentiate ⇒<br />

M = L -β /ν M o (εL 1/ν ) magnetization<br />

χ = L -γ/ν χ o (εL 1/ν ) susceptibility<br />

C = L -α/ν C o (εL 1/ν ) specific heat<br />

M o (x), χ o (x), and C o (x) are scal<strong>in</strong>g functions. Corrections<br />

<strong>to</strong> scal<strong>in</strong>g and f<strong>in</strong>ite size scal<strong>in</strong>g appear for small L<br />

and large ε.


A case study: L×L L Is<strong>in</strong>g square lattice<br />

with p.b.c. (from 1976)<br />

The large scatter <strong>in</strong> the data is characteristic of early <strong>Monte</strong><br />

<strong>Carlo</strong> work--the effort is with<strong>in</strong> the reach of a PC <strong>to</strong>day!


Dynamic F<strong>in</strong>ite Size Scal<strong>in</strong>g<br />

Dynamic F<strong>in</strong>ite Size Scal<strong>in</strong>g<br />

τ = L z F ( ε L<br />

1 / ν<br />

)<br />

so at T c ,<br />

τ∝L z Critical Slow<strong>in</strong>g Down<br />

This is valid only as long as L is sufficiently large that<br />

corrections <strong>to</strong> f<strong>in</strong>ite size scal<strong>in</strong>g do not become<br />

important.<br />

For the Metropolis method, z~2.1


F<strong>in</strong>ite Sampl<strong>in</strong>g/F<strong>in</strong>ite Lattice Size Effects<br />

F<strong>in</strong>ite Sampl<strong>in</strong>g/F<strong>in</strong>ite Lattice Size Effects<br />

Biased sampl<strong>in</strong>g dom<strong>in</strong>ates<br />

F<strong>in</strong>ite size dom<strong>in</strong>ates<br />

Consider the<br />

magnetic<br />

susceptibility<br />

χ∝ (- 2 )


Cluster Flipp<strong>in</strong>g <strong>Methods</strong><br />

Cluster Flipp<strong>in</strong>g <strong>Methods</strong><br />

Fortu<strong>in</strong>-Kasteleyn theorem. . . map a ferromagnetic Potts model<br />

on<strong>to</strong> a correspond<strong>in</strong>g percolation model for which successive<br />

states are uncorrelated ⇒ no critical slow<strong>in</strong>g down!<br />

For the q-state Potts model<br />

Z<br />

=<br />

(<br />

e<br />

− K δ σ<br />

−<br />

i σ j<br />

i , j<br />

{ all states }<br />

∑ ∑<br />

1)<br />

where K = J / k<br />

B<br />

T .<br />

• Replace each pair of <strong>in</strong>teract<strong>in</strong>g sp<strong>in</strong>s by a bond with probability<br />

− Kδ σ i σ<br />

= 1−<br />

p j<br />

e<br />

• Repeat for all pairs → lattice with bonds that connect some sites<br />

<strong>to</strong> form clusters with diverse sizes and shapes. Note: all sp<strong>in</strong>s <strong>in</strong><br />

each cluster have the same value.


• The sp<strong>in</strong>s may then be <strong>in</strong>tegrated out (leav<strong>in</strong>g a fac<strong>to</strong>r of q<br />

beh<strong>in</strong>d for each cluster), and for the N c rema<strong>in</strong><strong>in</strong>g clusters<br />

bonds<br />

b<br />

N<br />

b − b )<br />

Z = ∑ p (1 − p ) q<br />

c<br />

(<br />

N<br />

where b = # of bonds, N b = <strong>to</strong>tal # of possible bonds, (1-p)<br />

is the probability that no bond exists between a pair of<br />

sites.


Swendsen-Wang method<br />

• Choose an <strong>in</strong>itial sp<strong>in</strong> state.<br />

• Place bonds between each pair of sp<strong>in</strong>s with probability p.<br />

• F<strong>in</strong>d all clusters i.e. connected networks of bonds.<br />

• Randomly assign a sp<strong>in</strong> value <strong>to</strong> all sites <strong>in</strong> each cluster.<br />

• Erase bonds → new sp<strong>in</strong> state.<br />

orig<strong>in</strong>al sp<strong>in</strong>s clusters formed “decorated” clusters


At high T, clusters are small. At low T, almost all sites with<br />

nearest neighbors <strong>in</strong> the same state are <strong>in</strong> the same cluster<br />

and the system oscillates back and forth between similar<br />

structures. Near T c , a rich array of clusters is produced and<br />

each configuration differs substantially from its predecessor<br />

⇒ critical slow<strong>in</strong>g down is reduced!<br />

z ~2.1 for Metropolis<br />

~ 0 <strong>in</strong> 2-dim and ~0.5 <strong>in</strong> 3-dim for SW (Wang, 1990)<br />

Code is more complex than for s<strong>in</strong>gle sp<strong>in</strong>-flip methods.<br />

⇒ For small lattices the SW technique may be slower, but for<br />

sufficiently large lattices it will be more efficient.


Wolff method<br />

The Swendsen-Wang approach spends great effort on small<br />

clusters that do not contribute <strong>to</strong> the critical slow<strong>in</strong>g down.<br />

Instead, grow s<strong>in</strong>gle clusters and flip them sequentially:<br />

• Randomly choose a site.<br />

• Draw bonds <strong>to</strong> all nearest neighbors that are <strong>in</strong> the same<br />

state with probability p = 1 – e -K . Repeat, iteratively,<br />

<strong>to</strong> form a cluster of connected sites.<br />

• Flip the entire cluster of connected sites.<br />

• Choose another <strong>in</strong>itial site and repeat the process.<br />

Wolff k<strong>in</strong>etics has a smaller prefac<strong>to</strong>r and smaller dynamic<br />

exponent than does the Swendsen-Wang method.


“Improved estima<strong>to</strong>rs”<br />

It may be possible <strong>to</strong> calculate a thermodynamic property us<strong>in</strong>g<br />

clusters . . . for some quantities “noise reduction” occurs, e.g.<br />

the susceptibility for O(N) models is given by the mean cluster<br />

size, i.e.,<br />

χ = β <br />

where |C| is the size of a cluster. The statistical error <strong>in</strong> this<br />

def<strong>in</strong>ition is less than that obta<strong>in</strong>ed from fluctuations <strong>in</strong> the order<br />

parameter (fluctuations due <strong>to</strong> small clusters cancel).


N-fold way and extensions<br />

The above methods are time-step driven → low T problems!<br />

In event driven algorithms (e.g., “N-fold Way” Bortz et al, 1975)<br />

a flip occurs at each step :<br />

For discrete sp<strong>in</strong> models ⇒ only a few flipp<strong>in</strong>g probabilities<br />

• Collect sp<strong>in</strong>s <strong>in</strong><strong>to</strong> lists; sp<strong>in</strong>s <strong>in</strong> each have equivalent<br />

local environments (Is<strong>in</strong>g square lattice has N=10<br />

classes).<br />

• Total probability of some class l sp<strong>in</strong> flipp<strong>in</strong>g <strong>in</strong> a step is<br />

p<br />

l<br />

=<br />

n<br />

l<br />

e<br />

−<br />

∆<br />

k<br />

E<br />

/<br />

l B<br />

↑<br />

number of sp<strong>in</strong>s <strong>in</strong> class l<br />

T<br />

Q p<br />

M = <strong>to</strong>tal for all classes with l ≤ M<br />

= ∑<br />

l l ≤ M


• Generate a random number 0 < rn < Q N ⇒ class for the next<br />

flip, i.e., class M is chosen if Q M-1 < rn


Classical sp<strong>in</strong> models<br />

e.g., the classical Heisenberg model with sp<strong>in</strong> vec<strong>to</strong>rs S r<br />

i<br />

r r r<br />

H = − J ∑ S<br />

i<br />

⋅ S<br />

j<br />

, S<br />

i<br />

=1<br />

nn<br />

The Metropolis method <strong>in</strong>volves “sp<strong>in</strong>-tilts” <strong>in</strong>stead of “sp<strong>in</strong>-flips”<br />

Over-relaxation method (Brown and Woch, 1987; Creutz, 1987)<br />

Precess the sp<strong>in</strong> about the effective <strong>in</strong>teraction field (due<br />

<strong>to</strong> neighbors) by an angle θ us<strong>in</strong>g the equation of motion<br />

S<br />

&r r r<br />

= − S ×<br />

H eff<br />

This is microcanonical (and also determ<strong>in</strong>istic) but it<br />

decorrelates successive states. Comb<strong>in</strong>e with Metropolis ⇒<br />

becomes canonical.<br />

What about cluster-flipp<strong>in</strong>g?


Wolff embedd<strong>in</strong>g trick and cluster-flipp<strong>in</strong>g<br />

The “embedd<strong>in</strong>g trick” turns the classical sp<strong>in</strong> model <strong>in</strong><strong>to</strong><br />

an <strong>in</strong>homogeneous Is<strong>in</strong>g model (Wolff, 1989):<br />

nˆ<br />

• Choose a direction randomly <strong>in</strong> space.<br />

• Project sp<strong>in</strong>s on<strong>to</strong> that direction <strong>to</strong> form an Is<strong>in</strong>g model<br />

with <strong>in</strong>teractions that depend on the sp<strong>in</strong> projections<br />

• Then, use cluster flipp<strong>in</strong>g, e.g. for Wolff flipp<strong>in</strong>g, bonds<br />

are added between nearest neighbors with probability<br />

p = 1-exp{m<strong>in</strong>[0,2βJ(nˆ ⋅Si)( nˆ ⋅Sj)]}<br />

• Reverse the components parallel <strong>to</strong> for all sp<strong>in</strong>s <strong>in</strong> a cluster<br />

<strong>to</strong> yield a new sp<strong>in</strong> configuration.<br />

• Choose a new (random) direction and repeat.<br />

nˆ<br />

nˆnˆ


Hybrid methods<br />

Comb<strong>in</strong>e updat<strong>in</strong>g types ⇒ a s<strong>in</strong>gle scheme,<br />

e.g., a study of the 2-dim classical, XY-model used a<br />

mixture of Metropolis, over-relaxation and embedd<strong>in</strong>g<br />

trick Wolff flips, <strong>to</strong>gether with f<strong>in</strong>ite size scal<strong>in</strong>g, <strong>to</strong><br />

determ<strong>in</strong>e the Kosterlitz-Thouless temperature <strong>to</strong> higher<br />

precision than previously possible (Evertz and Landau, 1996),<br />

J/k B T KT = 0.700(5).


Improvements <strong>in</strong> Performance (Is<strong>in</strong>g model):<br />

• Computer speed<br />

• Algorithmic advances - cluster flipp<strong>in</strong>g, reweight<strong>in</strong>g . . .<br />

•1E10<br />

•1E9<br />

•1E8<br />

•1E7<br />

•relative performance<br />

•100000 0<br />

•100000<br />

•10000<br />

•1000<br />

•100<br />

•10<br />

•computer speed<br />

•1<br />

•1970 •1975 •1980 •1985 •1990 •1995 •2000


Variation on a Theme...<br />

Probability-Chang<strong>in</strong>g Cluster Algorithm (Tomita and Okabe, 2001)<br />

Goal: Tune the critical po<strong>in</strong>t au<strong>to</strong>matically<br />

Extend the SW algorithm by <strong>in</strong>creas<strong>in</strong>g or<br />

decreas<strong>in</strong>g the probability of form<strong>in</strong>g bonds<br />

(<br />

K<br />

)<br />

−<br />

p =1− δ σ<br />

i j<br />

e<br />

σ<br />

depend<strong>in</strong>g on whether or not the clusters are percolat<strong>in</strong>g.<br />

Recipe:<br />

1. Choose an <strong>in</strong>itial configuration and a value of p<br />

2. Construct the Kasteleyn-Fortu<strong>in</strong> clusters us<strong>in</strong>g probability p.<br />

Check <strong>to</strong> see if the system is percolat<strong>in</strong>g.<br />

3. Update the sp<strong>in</strong>s us<strong>in</strong>g the SW rule.<br />

4. If the system was percolat<strong>in</strong>g, decrease p by ∆p. If the<br />

system was not percolat<strong>in</strong>g, <strong>in</strong>crease p by ∆p<br />

5. Go <strong>to</strong> 2.<br />

Note: Start with some value of ∆p and decrease it as the<br />

simulation proceeds.


Test for the 2-dim Is<strong>in</strong>g model


Multicanonical Sampl<strong>in</strong>g<br />

Multicanonical Sampl<strong>in</strong>g<br />

What is Multicanonical sampl<strong>in</strong>g?<br />

P(E) may conta<strong>in</strong> multiple maxima that are widely spaced<br />

<strong>in</strong> configuration space (1st order phase transitions, sp<strong>in</strong><br />

glasses, etc.) ⇒ Standard methods become “trapped”<br />

near one maximum; <strong>in</strong>frequent transitions between maxima<br />

leads <strong>to</strong> ill determ<strong>in</strong>ed relative weights of the maxima and<br />

the m<strong>in</strong>ima of P(E).<br />

∴ modify the s<strong>in</strong>gle sp<strong>in</strong> flip probability <strong>to</strong> enhance the<br />

probability of the “unlikely” states between the maxima ⇒<br />

accelerates effective sampl<strong>in</strong>g!


Reformulate the problem ⇒ an effective Hamil<strong>to</strong>nian<br />

H<br />

eff<br />

=<br />

eff<br />

σ H H<br />

( ) ( β ( σ ))<br />

The probability distribution for the energy is then:<br />

P ( E ) =<br />

( S ( E ) − H ) eff<br />

( S ( E ) H )<br />

∑ exp −<br />

E<br />

exp<br />

eff<br />

Determ<strong>in</strong>e self-consistently (Berg and Neuhaus 1991, 1992) . . .<br />

P(E) from one simulation is an estimate for a 2nd simulation, etc.<br />

This can be very time consum<strong>in</strong>g!


Compare ensembles:<br />

( H ) eff − H<br />

( H − H )<br />

A exp<br />

Then, A =<br />

β<br />

exp<br />

Thermodynamic variable<br />

eff


H eff<br />

How <strong>to</strong> get :<br />

F<strong>in</strong>d where it is easy <strong>to</strong> measure (via standard <strong>Monte</strong> <strong>Carlo</strong>)<br />

and use it as an estimate for a 2 nd run made closer <strong>to</strong> the<br />

<strong>in</strong>terest<strong>in</strong>g region. Cont<strong>in</strong>ue <strong>to</strong> the “unknown” region where<br />

standard sampl<strong>in</strong>g fails.<br />

Example: A q=7 Potts model (After Janke, 1992).


Phase Switch <strong>Monte</strong> <strong>Carlo</strong><br />

Phase Switch <strong>Monte</strong> <strong>Carlo</strong><br />

In some cases, e.g. the freez<strong>in</strong>g transition, a crystal state<br />

forms that is defect ridden…these do not anneal out <strong>in</strong><br />

reasonable time scales → the system is trapped<br />

Strategy: Make a global coord<strong>in</strong>ate transformation that maps<br />

one pure phase<br />

on<strong>to</strong> another<br />

Wild<strong>in</strong>g and Bruce (2000)


Phase Switch <strong>Monte</strong> <strong>Carlo</strong><br />

Phase Switch <strong>Monte</strong> <strong>Carlo</strong><br />

{R} γ is the representative configuration for phase γ<br />

Def<strong>in</strong>e particle positions: r i<br />

γ<br />

= R i<br />

γ + ui<br />

Displacement vec<strong>to</strong>rs<br />

Phase switch:<br />

Replace {R} γ by {R} γ′<br />

Results for the<br />

order parameter<br />

of a 256 particle<br />

system


A New Approach <strong>to</strong> <strong>Monte</strong> <strong>Carlo</strong> Simulations <strong>in</strong><br />

<strong>Statistical</strong> <strong>Physics</strong><br />

Fugao Wang and D P L<br />

• <strong>Introduction</strong><br />

• Method<br />

• Applications (how well does it work?)<br />

1 st Order transition – 2d Potts Models<br />

2 nd order transitions – 2d Is<strong>in</strong>g model<br />

Sp<strong>in</strong> glass transition – 3d EA model<br />

Critical endpo<strong>in</strong>t - triangular Is<strong>in</strong>g model<br />

• Conclusions


A New Approach <strong>to</strong> <strong>Monte</strong> <strong>Carlo</strong><br />

Simulations <strong>in</strong> <strong>Statistical</strong> <strong>Physics</strong>: The<br />

“Random Walk <strong>in</strong> Energy Space with a Flat<br />

His<strong>to</strong>gram” method<br />

or<br />

“Wang-Landau sampl<strong>in</strong>g”


Problems and Challenges<br />

Problems and Challenges<br />

Statics: <strong>Monte</strong> <strong>Carlo</strong> methods are valuable, but near T c<br />

⇒ critical slow<strong>in</strong>g down for 2 nd order transitions<br />

⇒ metastability for 1 st order transitions<br />

∴ Try <strong>to</strong> reduce characteristic time scales or circumvent<br />

them<br />

“Dynamics”: s<strong>to</strong>chastic vs determ<strong>in</strong>istic


Metropolis Recipe:<br />

Metropolis Recipe:<br />

1. Choose an <strong>in</strong>itial state<br />

2. Choose a site i<br />

3. Calculate the energy change ∆E that results if the sp<strong>in</strong> at<br />

site i is overturned<br />

4. Generate a random number r such that 0 < r < 1<br />

5. If r < exp(-∆E/k B T), flip the sp<strong>in</strong><br />

6. Go <strong>to</strong> 2.<br />

This is not a unique solution. <strong>An</strong> alternative (Glauber, 1963):<br />

W n→m =τ o<br />

-1 [1+σi tanh (E i /k B T)],<br />

where σ i E i is the energy of the i th sp<strong>in</strong> <strong>in</strong> state n. Both<br />

Glauber and Metropolis algorithms are special cases of a<br />

general transition rate (Müller-Krumbhaar and B<strong>in</strong>der, 1973)


Correlation times (rem<strong>in</strong>der)<br />

Correlation times (rem<strong>in</strong>der)<br />

Def<strong>in</strong>e an equilibrium relaxation function φ(t)<br />

ϕ<br />

MM<br />

( t )<br />

< ( M ( 0 )M ( t ) > - < M ><br />

< M<br />

2<br />

> - < M ><br />

2<br />

2<br />

⎯<br />

=<br />

⎯ →<br />

t<br />

→ ⎯ ∞<br />

e<br />

−<br />

t<br />

/<br />

τ<br />

and<br />

τ<br />

∝ T − T |<br />

| c<br />

− ν z<br />

i.e. τ diverges at T c !


A Quite Different Approach<br />

A Quite Different Approach<br />

Random Walk <strong>in</strong> Energy Space with a Flat His<strong>to</strong>gram<br />

Rem<strong>in</strong>der:<br />

Z<br />

=<br />

∑<br />

all<br />

states<br />

H<br />

∑<br />

all<br />

energies<br />

H<br />

− k T<br />

− k<br />

e<br />

B<br />

/<br />

≡ g ( E ) e<br />

B<br />

T<br />

Estimate the density of states g(E) directly –– how?<br />

Solution: Perform a random walk <strong>in</strong> energy space:<br />

1. Set g(E)=1; choose a modification fac<strong>to</strong>r (e.g. f 0 =e 1 )<br />

2. Randomly flip a sp<strong>in</strong> with probability:<br />

3. Set g(E i ) → g(E i )* f<br />

⎛ g ( E<br />

1<br />

)<br />

→ E =<br />

⎜<br />

2<br />

) m<strong>in</strong> , 1<br />

⎝ g ( E<br />

2<br />

)<br />

4. Cont<strong>in</strong>ue until the his<strong>to</strong>gram is “flat”; decrease f, e.g. f !+1 = f 1/2<br />

p (<br />

E<br />

1<br />

⎞<br />

⎟<br />

⎠<br />

5. Repeat steps 2 - 4 until f = f m<strong>in</strong> ~ exp(10 -8 )<br />

6. Calculate properties us<strong>in</strong>g f<strong>in</strong>al density of states g(E)


How can we test the method?<br />

How can we test the method?<br />

For a 2 nd order transition, study the 2-dim Is<strong>in</strong>g model:<br />

H ,<br />

= − J ∑ σ σ , = ± 1<br />

i<br />

j<br />

i<br />

j<br />

σ i<br />

• T c is known for an <strong>in</strong>f<strong>in</strong>ite system (Onsager)<br />

• Bulk properties are known<br />

• g(E) is known exactly for small systems<br />

For a 1 st order transition, study the 2-dim Potts model:<br />

H = − J ∑ δ σ σ , σ i = 1 , K , q for q=10<br />

,<br />

i<br />

j<br />

i<br />

j<br />

• T c is known for an <strong>in</strong>f<strong>in</strong>ite system (duality)<br />

• Good numerical values exist for many quantities


Density of States for the 2-dim 2<br />

Is<strong>in</strong>g model<br />

Compare exact results with data from random walks <strong>in</strong> energy<br />

space: L× L lattices with periodic boundaries


Density of States for the 2-dim 2<br />

Is<strong>in</strong>g model<br />

Compare exact results with data from random walks <strong>in</strong> energy<br />

space: L× L lattices with periodic boundaries<br />

ε = relative error ( exact solution is known for L≤ 64 )


Density of States: Large 2-dim 2<br />

Is<strong>in</strong>g Model<br />

‣ use a parallel, multi-range random walk<br />

NO exact solution is available for comparison!<br />

Question:<br />

• Need <strong>to</strong> perform a random walk over ALL energies?


How Does f i<br />

Affect the Accuracy?<br />

Data for<br />

L=32:<br />

ε<br />

1<br />

N<br />

exact<br />

[ ln ( g )] = ∑ | ln [ g ( E ) ] − ln[ g ( )] |<br />

i i<br />

E<br />

E E<br />

error


Specific Heat of the 2-dim 2<br />

Is<strong>in</strong>g Model<br />

ε = relative error


Free Energy of the 2-dim 2<br />

Is<strong>in</strong>g Model<br />

ε = relative error


Wang-Landau<br />

Landau vs Metropolis Sampl<strong>in</strong>g<br />

<strong>in</strong> the 2-dim 2<br />

dim Is<strong>in</strong>g model<br />

Compare states generated us<strong>in</strong>g Wang-Landau sampl<strong>in</strong>g an<br />

us<strong>in</strong>g the Metropolis method at T c <strong>in</strong> L× L Is<strong>in</strong>g square lattices<br />

with periodic boundaries


What About a 1st Order Transition?<br />

What About a 1st Order Transition?<br />

Look at the q=10 Potts model <strong>in</strong> 2-dim<br />

At T c coexist<strong>in</strong>g states are separated by an energy barrier


q=10 Potts Model: Determ<strong>in</strong>e T c


q=10 Potts Model: Internal Energy


What About a System with Complex “Order”?<br />

What About a System with Complex “Order”?<br />

The EA (Edwards-<strong>An</strong>derson) sp<strong>in</strong> glass model <strong>in</strong> 3 dim:<br />

H = − ∑ J σ σ , = ± 1<br />

< i , j ><br />

ij i j i<br />

σ and J<br />

J ij = ± .<br />

At T c (if it exists) a sp<strong>in</strong> glass state forms ⇒<br />

get a “rough” energy landscape where multiple m<strong>in</strong>ima<br />

are separated by high energy barriers<br />

Def<strong>in</strong>e an Order Parameter<br />

α<br />

First choose a f<strong>in</strong>ite lattice groundstate { σ } , then<br />

q<br />

= 1<br />

n < 1 σ<br />

α<br />

N<br />

i σ<br />

α<br />

∑ ∑ i<br />

><br />

i<br />

"EA order parameter"<br />

↑<br />

number of bond configurations<br />

Extend random walk ⇒ multi-dimensional parameter space


3-dim EA Sp<strong>in</strong> Glass model: Two-dimensional<br />

random walk<br />

Energy-order parameter his<strong>to</strong>gram (L=6)<br />

Perform a different random walk sequence for each<br />

bond distribution


Distribution of States: 3d EA Sp<strong>in</strong> Glass<br />

Distribution of States: 3d EA Sp<strong>in</strong> Glass<br />

. . . For larger L, P(q,T) becomes even more complex!


Energy landscape – 3d EA Sp<strong>in</strong> Glass Model


3d EA Sp<strong>in</strong> Glass Model<br />

3d EA Sp<strong>in</strong> Glass Model<br />

Look for a phase transition (Prelim<strong>in</strong>ary results)


A “new” old problem: A Critical Endpo<strong>in</strong>t<br />

A “new” old problem: A Critical Endpo<strong>in</strong>t<br />

A schematic view: T is temperature; g is a non-order<strong>in</strong>g field<br />

Theory predicts new s<strong>in</strong>gularities at (g e ,T e )<br />

(Fisher and Up<strong>to</strong>n, 1990)


Triangular Is<strong>in</strong>g Model with Two-Body and<br />

Three-Body Interactions<br />

H<br />

= − J ∑ σ iσ<br />

j − J 3 ∑ σ iσ<br />

jσ<br />

k − H ∑σ<br />

i , σ i<br />

i<br />

,<br />

j<br />

i,<br />

j , k<br />

i<br />

= ± 1<br />

J=1, J 3 =2<br />

Must search for the<br />

critical endpo<strong>in</strong>t <strong>in</strong><br />

(H,T) space


Critical Endpo<strong>in</strong>t: S<strong>in</strong>gularity <strong>in</strong> the<br />

Critical Endpo<strong>in</strong>t: S<strong>in</strong>gularity <strong>in</strong> the<br />

Curvature of the Specta<strong>to</strong>r Phase Boundary<br />

Curvature of the Specta<strong>to</strong>r Phase Boundary


Critical Endpo<strong>in</strong>t: S<strong>in</strong>gularity <strong>in</strong> the<br />

Order Parameter


Postscript: (<strong>in</strong>complete)<br />

F. Wang and DPL, PRL 86, 2050 (2001); PRE 64, 056101 (2001) (<br />

⇒<br />

Improved sampl<strong>in</strong>g:<br />

B. J. Schulz et al., Int. J. Mod. Phys. C 13, 477 (2002)<br />

C. Yamaguchi and N. Kawashima, PRE 65, 0556710 (2002)<br />

B. J. Schulz et al., Phys. Rev. E 67, 067102 (2003)<br />

Prote<strong>in</strong>s: N. Rathore et al., J. Chem. Phys. 116, 7225 (2002)<br />

N. Rathore et al., J. Chem. Phys. 118, 4285 (2003).<br />

Polymer Films: T. S. Ja<strong>in</strong> et al., J. Chem. Phys. 116, 7238 (2002)<br />

Cont<strong>in</strong>uum (fluid) simulations:<br />

Q. Yan et al., J. Chem Phys. 116, 8745 (2002)<br />

Q. Yan and J. J. de Pablo, Phys. Rev. Lett. 90, 035701 (2003)<br />

T. S. Ja<strong>in</strong> and J. J. de Pablo, J. Chem. Phys. 118, 4226 (2003)<br />

M. S. Shell et al., Phys. Rev. E 66, 056703 (2002)<br />

AF Potts model groundstate: C. Yamaguchi and Y. Okabe, J. Phys. A 34, 8781 (2001)<br />

Reaction coord<strong>in</strong>ates: F. Calvo, Mol. Phys. 100, 3421 (2002)<br />

Quantum <strong>Monte</strong> <strong>Carlo</strong>: M. Troyer et al., Phys. Rev. Lett. 90, 120201 (2003)<br />

Kondo problem: W. Koller et al., Phys. Rev. B 67, 104432 (2003)<br />

Biological circuits: H.-B. Schüttler, et al.<br />

Comb<strong>in</strong>a<strong>to</strong>rial number theory: V. Mus<strong>to</strong>nen and R. Rajesh<br />

Performance studies:<br />

Dayal et al. cond-mat/0306108<br />

C. Zhou and R. H. Bhatt, cond-matt/0306711


Overview: Wang-Landau sampl<strong>in</strong>g<br />

The random walk <strong>in</strong> energy space method<br />

is powerful and flexible<br />

It provides direct access <strong>to</strong> the density of states<br />

It is easily parallelizable<br />

It is effective for the study of critical phenomena<br />

It elim<strong>in</strong>ates the problem with energy barriers at 1 st<br />

order phase transitions<br />

It can be used <strong>to</strong> study systems with complex<br />

energy landscapes and multi-dimensional<br />

parameter spaces


Critical “Dynamics”, a few comments<br />

Critical “Dynamics”, a few comments<br />

Time dependent behavior is important because:<br />

• correlations reduce precision of static properties<br />

• “dynamic” critical behavior <strong>in</strong>herently <strong>in</strong>terest<strong>in</strong>g<br />

S<strong>to</strong>chastic models ⇒ critical relaxation<br />

e.g. <strong>Monte</strong> <strong>Carlo</strong> sampl<strong>in</strong>g<br />

note: “acceleration” methods alter the critical relaxation!<br />

Determ<strong>in</strong>istic models ⇒ true critical dynamics


Summary and Overview<br />

Summary and Overview<br />

Static behavior of many models <strong>in</strong> statistical physics<br />

can be studied by <strong>Monte</strong> <strong>Carlo</strong> sampl<strong>in</strong>g methods<br />

‣ The “standard” is the Metropolis method which is flexible<br />

and easy <strong>to</strong> implement<br />

‣ Long time-scales may be reduced with <strong>in</strong>ventive algorithms<br />

(cluster flipp<strong>in</strong>g, N-fold way, multicanonical, etc.)<br />

‣ Wang-Landau sampl<strong>in</strong>g provides all <strong>in</strong>formation from a<br />

s<strong>in</strong>gle simulation<br />

Time dependent behavior is more difficult . . . Sp<strong>in</strong><br />

dynamics simulations allow the study of true<br />

dynamic properties . . . more on this <strong>to</strong> come


Learn more about <strong>Monte</strong> <strong>Carlo</strong> methods<br />

Learn more about <strong>Monte</strong> <strong>Carlo</strong> methods<br />

Published by Cambridge University Press<br />

ISBN 0 521 65314 2<br />

(hardbound)<br />

ISBN 0 521 65366 5<br />

(paperback)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!