
% BB Nov 21 2006.
% BB Mar 11 2004.

\documentclass[20pt,landscape,footrule]{foils}
\usepackage[dvips]{graphicx}
\usepackage[pdftex]{geometry}
\geometry{headsep=3ex,hscale=0.9}
\usepackage[pdftex]{color} % for the colored block
\date{\color{blue} Singapore MCMC Meeting, March 2004}
\usepackage[ignore]{pause}
%\usepackage{pause}
\usepackage{background}
%\usepackage{pp4slide}
%\MyLogo{AV HEP,CSIT}
\LogoOff
\begin{document}
\def\r{\color{red}}
\def\b{\color{blue}}
\def\s{\color{black}}

\foilhead{\r Lecturenotes MCMC III -- Contents}\b \vskip 0.0pt
\begin{enumerate}
\item The $O(3)\ \sigma$ Model and the Heat Bath Algorithm
\end{enumerate}

\foilhead{\r The $O(3)\ \sigma$ Model and the Heat Bath Algorithm}
\vskip -30pt

We give an example of a model with a continuous energy function. The 
$\s 2d$ version of the model is of interest to field theorists because 
of its analogies with the four-dimensional Yang-Mills theory. In 
statistical physics the $d$-dimensional model is known as the 
{Heisenberg ferromagnet}. Expectation values are calculated with 
respect to the partition function
\begin{equation}\s \label{O3_Z} 
 Z\ =\ \int \prod_i ds_i\ e^{-\beta E(\lbrace s_i \rbrace )}\ .
\end{equation}
\begin{equation}\s \label{O3_spin} 
{\rm The\ spins}~~ \vec{s}_i = 
  \left( \matrix{ s_{i,1} \cr s_{i,2} \cr s_{i,3} \cr}
  \right) ~~{\rm are\ normalized\ to}~~ (\vec{s}_i)^2=1
\end{equation}
\begin{equation}\s \label{O3_measure}
{\rm and\ the\ measure}\ ds_i\ {\rm is\ defined\ by}\
 \int ds_i\ =\ {1\over 4\pi} \int_{-1}^{+1} d \cos (\theta_i) 
                              \int_0^{2\pi}  d \phi_i\ , 
\end{equation} \s
where the polar ($\theta_i$) and azimuth ($\phi_i$) 
angles define the spin $s_i$ on the unit sphere. 
\newpage

\b The energy is
\begin{equation}\s \label{O3_energy}
 E\ =\ \sum_{\langle ij\rangle} ( 1 - \vec{s}_i \vec{s}_j )\ ,  
\end{equation}
where the sum goes over the nearest neighbor sites of the lattice. 
We would like to update a single spin $\s \vec{s}$. The sum of its 
$\s 2d$ neighbors is
$$\s \vec{S}=\vec{s}_1+\vec{s}_2+\dots+\vec{s}_{2d-1}+\vec{s}_{2d}\ .$$
Hence, the contribution of spin $\s \vec{s}$ to the action is $\s
2d-\vec{s}\vec{S}$. We propose a new spin $\s \vec{s}^{\,'}$ with the
measure~(\ref{O3_measure}) by drawing two uniformly distributed random 
numbers
\begin{eqnarray}\s \nonumber
  \phi^r \in [0,\pi) ~~{\rm for\ the\ azimuth\ angle\ and} \\ \s
  \cos (\theta^r) = x^r \in [-1,+1) ~~{\rm for\ the\ cosine\ of\
   the\ polar\ angle}. \nonumber
\end{eqnarray}
This defines the probability function $\s f(\vec{s}^{\,'},\vec{s})$ of 
the Metropolis process, which accepts the proposed spin
$\s \vec{s}^{\,'}$ with probability 
$$\s w(\vec{s}\to \vec{s}^{\,'})\ =\ \left\{ \matrix{ 1 & {\rm for}
 & \vec{S} \vec{s}^{\,'} > \vec{S} \vec{s} , \cr
 e^{ -\beta (\vec{S} \vec{s} - \vec{S}\vec{s}^{\,'}) } & {\rm for} &
 \vec{S}\vec{s}^{\,'} < \vec{S}\vec{s} . \cr } \right.    $$
If sites are chosen with the uniform probability distribution $\s 1/N$ 
per site, where $\s N$ is the total number of spins, it is obvious 
that the procedure fulfills detailed balance. It is noteworthy that 
the procedure remains valid when the spins are chosen in the systematic 
order $\s 1,\dots ,N$, then $\s 1,\dots ,N$ again, and so on. Balance 
still holds, whereas detailed balance is violated (exercise). 
\bigskip

{\r The heath bath algorithm}

Repeating the Metropolis algorithm again and again for the same
spin $\s \vec{s}$ leads to the equilibrium distribution of this spin, 
which reads
$$\s P(\vec{s}^{\,'};\vec{S}) = {\rm const}\,
  e^{\beta \vec{S}\vec{s}{\,'}} ~~{\rm with}~~
   \int P(\vec{s}^{\,'};\vec{S})\, ds' = 1\ .  $$
One would prefer to choose $\s \vec{s}^{\,'}$ directly with the
probability
$$\s W(\vec{s}\to \vec{s}^{\,'})\ =\ P(\vec{s}^{\,'};\vec{S})\ =\
  {\rm const}\, e^{\beta\, \vec{s}^{\,'} \vec{S}}\ , $$
as $\s \vec{s}^{\,'}$ is then immediately  Boltzmann distributed
with respect to its neighbor spins. The algorithm, which creates 
this distribution, is called the {\bf heat bath algorithm.}

Implementation of this algorithm becomes feasible when the energy 
function is sufficiently simple to allow for an explicit calculation 
of the probability $\s P(\vec{s}^{\,'};\vec{S})$. 

This is an easy task for the $\s O(3)$ $\s \sigma$-model. Let
$$\s \alpha = {\rm angle} (\vec{s}^{\,'},\vec{S}),\ \
x=\cos (\alpha )\ \ {\rm and}\ \  S=\beta |\vec{S}|\ . $$
For $\s S=0$ a new spin $\s \vec{s}^{\,'}$ is simply obtained by 
random sampling. We assume in the following $\s S>0$. The Boltzmann 
weight becomes $\exp (x S)$ and the normalization constant follows 
from
$$\s \int_{-1}^{+1} dx\, e^{x S}\ =\ {2\over S}\, \sinh (S)\ .$$
\smallskip

\noindent
Therefore, the desired probability is
$$\s \index{heat bath algorithm!O(3) $\sigma$-model|textbf}
   \index{O(3) $\sigma$-model!heat bath algorithm}
   \index{heat bath algorithm!Heisenberg ferromagnet|textbf}
   \index{Heisenberg ferromagnet!heat bath algorithm|textbf}
  P(\vec{s}^{\,'};\vec{S})\ =\  
  {S \over 2\sinh (S)}\, e^{x S}\ =: f(x) $$
and the method of the first lecture can be used to generate events 
with the probability density $\s f(x)$. With
$$\s y = F(x) = \int_{-1}^x dx'\, f(x') = \int_{-1}^x dx'\,
   {S \over 2\sinh (S)}\, e^{x' S} =
   {\exp(+xS)-\exp(-S)\over 2\,\sinh (S)}\ $$
a uniformly distributed random number $\s y^r\in [0,1)$ translates
into
\begin{equation}\s \label{O3_heat_bath-xr}
  x^r = \cos{\alpha^r} = {1\over S} \ln\, [\, \exp (+S) -
  y^r\, \exp (+S) + y^r\, \exp (-S) ]\ . 
\end{equation}
Finally, one has to give $\s \vec{s}^{\,'}$ a direction in the plane
orthogonal to $\s S$. This is done by choosing a random angle $\s 
\beta^r$ uniformly distributed in the range $\s 0\le\beta^r < 2\pi$. 
Then, $\s x^r=\cos{\alpha^r}$ and $\s \beta^r$ completely determine
$\s \vec{s}^{\,'}$ with respect to $\s \vec{S}$. Before storing
$\s \vec{s}^{\,'}$ in the computer memory, we have to calculate
coordinates of $\s \vec{s}^{\,'}$ with respect to a Cartesian
coordinate system, which is globally used for all spins of the
lattice. This is achieved by a \index{linear transformation}
\index{transformations, linear}{linear transformation}. We define
$$\s \cos \theta = {S_3\over S},\
   \sin \theta = \sqrt{1-\cos^2\theta},\
   \cos\phi = {S_1\over S\,\sin\theta} ~~{\rm and}~~
   \sin\phi = {S_2\over S\,\sin\theta}\ . $$

\newpage 
Unit vectors of a coordinate frame $\s K'$, with $\s \hat{z}$ in the 
direction of $\s \hat{S}$
and $\s \hat{y}$ in the $\s x-y$ plane, are then defined by
$$\s \hat{z}'= \left( \matrix{ \sin\theta\,\cos\phi \cr
             \sin\theta\,\sin\phi \cr \cos\theta } \right),~~
   \hat{x}'= \left( \matrix{ \cos\theta\,\cos\phi \cr
            \cos\theta\,\sin\phi \cr -\sin\theta } \right)
~~{\rm and}~~ \hat{y}'= \left( \matrix{ - \sin\phi \cr
                          \cos\phi \cr 0 } \right)\ . $$
Expanding $\s \vec{s}^{\,'}$ in these units vectors, we have
$$\s \vec{s}^{\, '} = \sin\alpha^r\,\cos\beta^r\,\hat{x}^{\,'} +
   \sin\alpha^r\sin\beta^r\,\hat{y}{\,} +
   \cos\alpha^r\,\hat{z}^{\,'} $$
\begin{equation}\s \label{stored_vector}
   = \left( \matrix{
   \sin\alpha^r\cos\beta^r\,\cos\theta\,\cos\phi
 - \sin\alpha^r\sin\beta^r\,\sin\phi
 + \cos\alpha^r\,\sin\theta\,\cos\phi \cr
   \sin\alpha^r\cos\beta^r\,\cos\theta\,\sin\phi
 + \sin\alpha^r\cos\beta^r\,\cos\phi
 + \cos\alpha^r\,\sin\theta\,\sin\phi \cr
 - \sin\alpha^r\cos\beta^r\,\sin\theta
 + \cos\alpha^r\,cos\theta } \right)
\end{equation}
and the three numbers of the column vector (\ref{stored_vector}) are 
stored in the computer.
\newpage

{\r Self-Averaging Illustration for the $\s 2d$ $O(3)$ model}

We compare the peaked distribution function of the mean action per 
link for different lattice sizes. The property of {\bf self-averaging} 
is observed: The larger the lattice, the smaller the confidence range.
The other way round, the peaked distribution function is very well 
suited to exhibit observables for which self-averaging does not work, 
as for instance encountered in spin glass simulations.
%
\begin{figure} \begin{center}
\includegraphics[height=0.45\textheight]{figures/qdf_o3.pdf}
\caption{$O(3)$ $\sigma$-model at $\beta=1.1$ (assignments 
{\tt a0304\_06} and {\tt a0304\_08}).}
\end{center} \end{figure}

\end{document}
