Transcription of Lecture notes on Monte Carlo simulations
1 Lecture notes onMonte Carlo simulationsPeter OlssonApril 4, 2022iiContents1 Buffon s needle .. Models in Physics .. Different kinds of Monte Carlo simulations .. 32 Random variables and Distributions .. Estimation .. Error estimates of averages variance of the mean .. Generating random variables .. Sampling a distribution with Markovchains .. 173 The Lennard-Jones Summary of different ensembles .. Gibbs entropy formula .. Monte Carlo versus Molecular Dynamics .. Classical statistical mechanics .. Recipe for a Monte Carlo simulation .. Ensemble with a fluctuating volume .. The grand canonical ensemble .. 324 The Ising Lattices .. Definition of the model .. Monte Carlo simulations for the Isingmodel.
2 Exact solutions .. Behavior at a critical point .. Mean field theory .. Energy-entropy argument .. Universality, RG theory, and scaling .. More on analytical techniques .. The lattice gas .. A few words about all the other models .. Superconductivity and theXYmodel .. 705 Simple stochastic Scale free behavior .. Site percolation .. Random walk .. Self-organized criticality .. Complex networks .. 956 Quantum Monte Carlo with the SSE Basic relations for quantum spins .. Monte Carlo update steps .. 1077 Technical 2D arrays .. Periodic boundary conditions .. The implementation of queues .. Correlation function through FFT .. Determination of the correlation length .. 1158 To organize large scale The two-step approach.
3 Organizing the source code .. 1219 Particle transport a brief Basic methods .. Variance reduction .. 127I Two Monte Carlo methods for the Ising Monte Carlo programs for the 2D Ising model .. For extra points .. 136 CONTENTSvII Scaling analyses of critical Data handling .. Finite size scaling analysis .. For extra points .. 139A Lagged Fibonacci random number generator .. 143viCONTENTSC hapter 1 IntroductionThese notes are intended as an introduction to Monte Carlo methods inphysics with an emphasis on Markov chain Monte Carlo and critical phe-nomena. Some simple stochastic models are also introduced; many ofthemhave been selected because of there interesting collective behavior. The termMonte Carlois used in the broad sense to contain all kinds of calculationsthat can be performed with the help of random Buffon s needleThe common first example of a stochastic calculation isBuffon s needle the calculation of the value of by throwing a needle on a plane surfacewith parallel straight lines separated by a fixed distance.
4 If the length ofthe needle is equal to the distance between the lines, the probabilitythatthe needle will cross a line is equal to1 R 0d sin = 2/ . By throwing theneedle a large number of times it is then possible to estimate through thefraction of throws that hit the the above example nicely illustrates the stochastic elementofMonte Carlo simulations it doesn t properly convey the strength, beauty,and usefulness of MC simulations . This example differs in at least the twofollowing ways from usual MC simulations : The calculation of may be done in numerous other more efficientways. In contrast MC methods are normally used for problems thatwould otherwise be considered very difficult or even 1. introduction The calculation of would be much more precise if the experimentcould be done in a systematic instead of a random way.
5 One couldthen be lead to believe that a carefully chosen set of numbers woulddo better than the random numbers in the MC simulations , but that isindeed not the case. In some applications it is even the case that oneneeds a very high quality of the random numbers (very low degree ofcorrelations) to obtain the correct Models in PhysicsVirtually all real world phenomena are complex and complicated. In spiteof this we will here focus on a number of simple models. There are actuallyseveral good reasons for doing so: When one is trying to arrive at anunderstandingof some phenomenonit is necessary to turn to simplified versions of the system. Considerthe opposite case that one actually managed to include everything inthe calculation and obtained perfect agreement with be a great triumph for the people involved in the work, but wouldnot provide any new understanding of what is going on.
6 In contrast,the construction and analysis of a simple model that could be foundto capture certain key features of the original system could add somenew understanding about the mechanisms that are responsible fortheobtained behavior. Many simple models are general enough to describe a large number ofdifferent systems. This means that even though the original motivationfor a study usually comes from a single specific problem, the result canoften be taken over to an entirely different context. The simple modelsmay therefore function as tools in a conceptual toolbox. The development of physics since the beginning of the 70 s has stressedthe importance ofuniversality the insight that certain properties maybe altogether insensitive to many of the details of the system.
7 Thismeans that the most efficient approach is to try to find and analyze thesimplest possible model that belongs to the sameuniversality classasthe problem under DIFFERENT KINDS OF Monte Carlo SIMULATIONS3 After stressing the use of the simple models it should be emphasized thatmost MC methods are general and flexible enough to work with modelsofarbitrary Different kinds of Monte Carlo simula-tionsThere are at least three different kinds of Monte Carlo simulations : Transport basic problem here is an energetic par-ticle ( a neutron) that reaches a shield. It will then collide with theatoms in the shield and cause different kinds of reactions. The ques-tion is how much that will get through. Instead of keeping track ofthe position of the atoms in the shield and try to calculate the eventsaccording to the precise position and momentum of the incident par-ticle, (which would be terribly complicated and according to quantummechanics would still not be deterministic) the idea is here to choosethe outcome of the collision by random.
8 This collision could in turngive rise to a complex chain reaction where all the different events aresimilarly chosen by random. Markov Chain Monte is a method that is very usefulin statistical physics where we want the configurations to appear witha probability proportional to the Boltzmann factor. This is achievedbyconstructing a Markov chain with the desired property. Monte Carloin statistical physics is a big field that has exploded into a number ofdifferent methods of which several are very beautiful. Beside the meth-ods for classical statistical mechanics that are covered in this coursethere are also many different ways to do Quantum Monte Carlo . Simple stochastic should maybe not be called MonteCarlo, but the term is frequently used for all kinds of simulations thatmake use of random 1.
9 INTRODUCTIONC hapter 2 Random variables anddistributionsRandom variables arise when repeated attempts under apparentlyidenticalconditions fail to give the same results. We will denote the random variablebyx. The random variables are usually distributed in a way which can beapproximated by a simple mathematical function the probability densityfunction (pdf),p(x). The meaning of this function is that the probability fora sample to be within the intervalxtox+dxisp(x) probability density function should of course be normalized,Zdx p(x) = 1,and for the case of discrete variables that can only take certain valuesx(i),the corresponding expression isXip(x(i)) = of this chapterWe will below first define two properties mean and variance that are usedto characterize various distributions.
10 We then turn to the art ofestimatingthe same properties from a finite number of random variables. To estimate56 CHAPTER 2. RANDOM VARIABLES AND DISTRIBUTIONSthe mean is usually trivial; the focus is therefore on estimating the variancewhich is needed to get an estimate of the uncertainity in the will then be concerned with various methods to generate randomsamplesfrom various simple distributions. In the last subsection we introduce Markovchains that are very important to generate multidimensional samplesfrom complicated DistributionsTwo quantities are used for characterizing distributions: themean and thevariance 2. The mean is obtained as =Zdx x p(x).The variance is a characteristic measure of the spread of the variables aroundthe mean. It is given by 2=Zdx(x )2p(x).