\documentstyle{article}
\bibliographystyle{plain}
\pagestyle{empty}
\pagenumbering{arabic}
\hoffset -2.5 cm
\textwidth 17 cm
\textheight 22 cm
\footskip 1 cm
\topmargin -1cm
% \baselineskip 24pt
\baselineskip 14pt
\begin{document}
                         \vspace*{0 cm}
 \begin{center}
 \Large\bf The Visualization of Triangular Lattice Spin Models \\
                         \bigskip
 \large\sc Daniel Baumann\\
                         \medskip
\sf Computational Physics Research Undergraduate, Syracuse University \\
                         \bigskip
\large \sc Paul Coddington \\
                         \medskip
\sf Physics Department, Syracuse University \\
\end{center}

\large
\section*{\bf Overview}

To understand spin models of magnets, and the algorithms used to simulate them,
it is very helpful to use computer graphics to visualize these systems.
For the particular case of a triangular lattice, we developed
a fast and friendly program in C using XWindows 
to help us study and create new Monte Carlo algorithms 
for simulating spin models.

The program allows the simulation of ferromagnets and 
antiferromagnets with many different update algorithms. 
With the help of this program we hope to develop new and improved updating
procedures, and to better understanding the present algorithms.   

\section*{\bf Spin Models of Magnets}

Some materials can become magnetized due to complex interactions between
the spins of electrons in the atoms of the material. 
There is generally a transition between a magnetized phase, where the spins
are aligned, and an unmagnetized phase where the spins are random. 
Surprisingly, the behavior at this {\it phase transition} 
is well described by very simple models of interacting spins on a lattice.

One such model is the Potts model, for which the spins can be 
in Q discrete states. For a ferromagnet, two neighboring spins in the same 
state have a smaller energy than if they are in different states. Hence the 
spins tend to align, except when the temperature becomes high enough so that
the thermal energy causes the system to become disordered, just as in real
magnetic systems.

% \subsection*{\bf Frustration}

For an antiferromagnet, the energy values are swapped and the spins on
neighboring sites will try to oppose each other. 
However the 2-state triangular lattice has a geometry such
that not all neighboring spins can be opposite (i.e. have the lowest energy) 
simultaneously. This is the simplest example of a {\it frustrated} system,
which are of great interest in the study of spin models and cluster
algorithms. A ground state of this model, generated using the graphics
program, is displayed in Fig. 1.

\section*{\bf Monte Carlo Simulations}

One method for doing numerical calculations on spin models is known as 
{\it Monte Carlo} simulation, since it is a stochastic, non-deterministic 
procedure, like spinning a roulette wheel. It is used to generate sample
configurations of spins, upon which measurements can be made.

The standard way of generating these configurations is the Metropolis
algorithm. One step of this algorithm consists of changing a single spin
with a probability dependent on the consequent change in energy.
The Metropolis algorithm has very wide applicability, and is used not just
for spin models, but in the simulation of a huge variety of systems.

\subsection*{\bf A Problem --- Critical Slowing Down}

The configurations generated by the Metropolis algorithm are generally
correlated over many iterations, especially near a phase transition. 
This is known as {\it critical slowing down}, and is a major problem for 
Monte Carlo simulations.
It occurs because the algorithm is {\it local} (i.e. the method depends only 
on the neighbors of the spin to be updated), whereas at the phase 
transition the spins are correlated over large distances. 

\subsection*{\bf A Solution --- Cluster Algorithms}

A non-local updating scheme which can dramatically reduce critical slowing
down was recently introduced by Swendsen and Wang.
Their algorithm is very simple -- if two neighboring spins are the same, 
a bond is placed between them with a probability dependent on the temperature. 
This creates clusters of bonded spins, and all the spins in a cluster can be
changed to a new value. 
A variation of this algorithm, due to Wolff, is to pick a site at random 
and generate a single cluster around it.

For the same computational cost, the Metropolis algorithm 
changes the configuration only slightly, leaving the large scale structure 
intact, whereas the cluster algorithms both produce a completely different
configuration. 

\section*{\bf Visualizing Spin Models using Computer Graphics}

By visualizing spin models we can better understand cluster algorithms, 
and gain insight into new algorithms. Since fast workstations can be used
to perform simulations of spin models, it is only natural to utilize their
graphics capabilities.  
XWindows was chosen for the graphics due to its portability, speed and high 
resolution.
For 2-dimensional lattice spin models, the sites can be mapped simply onto
groups of pixels, and scaling parameters added to change the lattice size.
In this particular project we focused on the 2-dimensional triangular lattice.

\subsection*{\bf The Triangular Lattice}

The sites of a triangular lattice are located at the
intersections of a triangular grid (Fig. 2a), however the representation
of the sites themselves is not triangular, but hexagonal, as in Fig. 2b.
The result is that a triangular lattice appears to be a grid of hexagons,
while the bonds between sites form a triangular pattern (Fig. 2c).
Each hexagon is filled solid with a color representing the state of the 
spin at that site in the lattice.  

It is convenient to display the triangular lattice such that the
overall shape is a rectangle. 
Mapping the values of the sites in the array to the displayed
rectangular honeycomb of hexagons, while enforcing the periodic boundary 
conditions, was one of the more complicated parts of the program.

\subsection*{\bf Displaying the Various Updates}

Important to following the performance of a cluster update
algorithm, is the understanding of where and when bonds are placed
between sites, and in knowing the characteristics of the clusters
created during the updating procedures, such as the
sizes, shapes, and numbers. Thus as well as showing the spin states,
bonds are displayed as line segments joining the centers of the sites,
and cluster boundaries are displayed by showing their borders, which involves
drawing lines separating sites in different clusters.  
All this can be accomplished using only two drawing procedures --
XFillPolygon and XDrawLine. 
This is illustrated for the Swendsen-Wang algorithm in Fig. 3.

\subsection*{\bf The Control Panel}

An important feature of this program is the ease with which the user can
change the necessary parameters and control the updating of the
lattice. For this, a mouse oriented control panel is used (Fig. 4), 
created using XView. The panel has numerous slides, buttons, and input
locations to make controlling the program as simple as possible. 
The user can select the temperature (Beta); 
the initial configuration -- cold (ordered), hot (random), or read in 
from a file;
a seed for the random number generator;
the number of iterations; the number of spin states (Spin Type);
and the lattice size (X and Y).

The display window is always the same size, so when the dimensions of the 
lattice are changed the size of the hexagons and bonds are scaled 
proportionately.
Once the parameters have been set, the user can now experiment. 
The different updates each have their own button, and when selected by the 
mouse, the workings of the chosen update and the change in the 
configuration of the spin model will be shown on the display. 
    
\bigskip
\section*{\bf Future Work}
\medskip

The advantages gained by this display program are easily recognizable.
The control panel makes the user environment powerful, yet friendly.
The user can easily understand the workings of the algorithm, and the
behavior of the spin model, by merely watching a window of the display. 
This is certainly much better than looking at a stream of numbers and 
trying to follow what is taking place.

This tool will hopefully help us in finding new update algorithms for 
triangular lattice spin models, and in particular the antiferromagnetic 
2-state Potts model, which is a simple example of the important class of
frustrated systems, for which current cluster algorithms work very poorly.

In the future, our plans include the visualization of 3-dimensional 
lattices, as well as graphics for algorithms running on parallel computers.

\end{document}

