Monte Carlo in statistical physics refers to the application of the Monte Carlo method to problems in statistical physics, or statistical mechanics.
The general motivation to use the Monte Carlo method in statistical physics is to evaluate a multivariable integral. The typical problem begins with a system for which the Hamiltonian is known, it is at a given temperature and it follows the Boltzmann statistics. To obtain the mean value of some macroscopic variable, say A, the general approach is to compute, over all the phase space, PS for simplicity, the mean value of A using the Boltzmann distribution:
\langleA\rangle=\intPSA\vec{r
where
E(\vec{r})=E\vec{r
\vec{r}
\vec{r}=\left(\vec{q},\vec{p}\right)
\beta\equiv1/kbT
Z=\intPS
-\betaE\vec{r | |
e |
is the partition function.
One possible approach to solve this multivariable integral is to exactly enumerate all possible configurations of the system, and calculate averages at will. This is done in exactly solvable systems, and in simulations of simple systems with few particles. In realistic systems, on the other hand, an exact enumeration can be difficult or impossible to implement.
For those systems, the Monte Carlo integration (and not to be confused with Monte Carlo method, which is used to simulate molecular chains) is generally employed. The main motivation for its use is the fact that, with the Monte Carlo integration, the error goes as
1/\sqrt{N}
In the following sections, the general implementation of the Monte Carlo integration for solving this kind of problems is discussed.
An estimation, under Monte Carlo integration, of an integral defined as
\langleA\rangle=\intPSA\vec{r
is
\langleA\rangle\simeq
1 | |
N |
N | |
\sum | |
i=1 |
A\vec{ri}
-\betaE\vec{ri | |
e |
where
\vec{r}i
From all the phase space, some zones of it are generally more important to the mean of the variable
A
-\betaE\vec{ri | |
e |
Lets assume
p(\vec{r})
The mean value of
A
\langleA\rangle=\intPSp-1(\vec{r})
A\vec{r | |
}{p |
-1
-\betaE\vec{r | |
(\vec{r})}e |
where
* | |
A | |
\vec{r |
p(\vec{r})
\langleA\rangle\simeq
1 | |
N |
N | |
\sum | |
i=1 |
p-1(\vec{r}i)
* | |
A | |
\vec{r |
i}
-\betaE\vec{ri | |
e |
}/Z
where
\vec{r}i
p(\vec{r})
Because it is known that the most likely states are those that maximize the Boltzmann distribution, a good distribution,
p(\vec{r})
p(\vec{r})=
| |||||||
be the distribution to use. Substituting on the previous sum,
\langleA\rangle\simeq
1 | |
N |
N | |
\sum | |
i=1 |
* | |
A | |
\vec{r |
i}
So, the procedure to obtain a mean value of a given variable, using metropolis algorithm, with the canonical distribution, is to use the Metropolis algorithm to generate states given by the distribution
p(\vec{r})
* | |
A | |
\vec{r |
One important issue must be considered when using the metropolis algorithm with the canonical distribution: when performing a given measure, i.e. realization of
\vec{r}i
See main article: multicanonic ensemble.
As stated before, micro-canonical approach has a major drawback, which becomes relevant in most of the systems that use Monte Carlo Integration. For those systems with "rough energy landscapes", the multicanonic approach can be used.
The multicanonic approach uses a different choice for importance sampling:
p(\vec{r})=
1 | |
\Omega(E\vec{r |
)}
where
\Omega(E)
The major drawback of this choice is the fact that, on most systems,
\Omega(E)
\beta
On this section, the implementation will focus on the Ising model. Lets consider a two-dimensional spin network, with L spins (lattice sites) on each side. There are naturally
N=L2
\vec{r}=(\sigma1,\sigma2,...,\sigmaN)
\sigmai\in\{-1,1\}
E(\vec{r})=
N\sum | |
\sum | |
j\invizi |
(1-Jij\sigmai\sigmaj)
vizi
On this example, the objective is to obtain
\langleM\rangle
\langleM2\rangle
M(\vec{r})=
N | |
\sum | |
i=1 |
\sigmai
First, the system must be initialized: let
\beta=1/kbT
With micro-canonic choice, the metropolis method must be employed. Because there is no right way of choosing which state is to be picked, one can particularize and choose to try to flip one spin at the time. This choice is usually called single spin flip. The following steps are to be made to perform a single measurement.
step 1: generate a state that follows the
p(\vec{r})
step 1.1: Perform TT times the following iteration:
step 1.1.1: pick a lattice site at random (with probability 1/N), which will be called i, with spin
\sigmai
step 1.1.2: pick a random number
\alpha\in[0,1]
step 1.1.3: calculate the energy change of trying to flip the spin i:
\DeltaE=2\sigmai
\sum | |
j\invizi |
\sigmaj
and its magnetization change:
\DeltaM=-2\sigmai
step 1.1.4: if
\alpha<min(1,e-\beta)
\sigmai=-\sigmai
step 1.1.5: update the several macroscopic variables in case the spin flipped:
E=E+\DeltaE
M=M+\DeltaM
after TT times, the system is considered to be not correlated from its previous state, which means that, at this moment, the probability of the system to be on a given state follows the Boltzmann distribution, which is the objective proposed by this method.
step 2: perform the measurement:
step 2.1: save, on a histogram, the values of M and M2.
As a final note, one should note that TT is not easy to estimate because it is not easy to say when the system is de-correlated from the previous state. To surpass this point, one generally do not use a fixed TT, but TT as a tunneling time. One tunneling time is defined as the number of steps 1. the system needs to make to go from the minimum of its energy to the maximum of its energy and return.
A major drawback of this method with the single spin flip choice in systems like Ising model is that the tunneling time scales as a power law as
N2+z
The method thus neglects dynamics, which can be a major drawback, or a great advantage. Indeed, the method can only be applied to static quantities, but the freedom to choose moves makes the method very flexible. An additional advantage is that some systems, such as the Ising model, lack a dynamical description and are only defined by an energy prescription; for these the Monte Carlo approach is the only one feasible.
The great success of this method in statistical mechanics has led to various generalizations such as the method of simulated annealing for optimization, in which a fictitious temperature is introduced and then gradually lowered.