computer language, means up (down) spin. There are also some very useful methods in
the class such as Mone and Mtwo, which yield the distance from the current spin to its
nearest up spin in the left and right directions respectively. There is also a method called
magnetization which as the name implies gives the total number of up spins on the
lattice. One could easily add new methods to the SPINS class but this should only be done
with operations which belong with this general implementation of spins. This breaks the
program down into understandable and useable blocks. Model specific operations belong
the the model obi. -t which we will now explain.
In the same way as fields on a lattice are subtypes of LATTCONF, models are built
in a similar hierarchial structure. Although the hierarchy has yet to stretch out, it serves
as a template for future construction and model-building. Each model inherits properties,
method-names and actual methods from an abstract base class named BASEMODEL.
So far there are two subclasses to BASEMODEL namely SIMPLECHAIN and TwoD1.
The latter is an implementation of the model which is the second main subject of this
thesis, whereas the former is a bit of test code implementing the Monte Carlo simulation
of a simple one-dimensional Ising spin system (spin-chain) as described in section 4.1.3.
The abstract class BASEMODEL declares certain universal methods which all models
within this framework must have. The functions startsweep(), prob(), accept ()
and nextsite () are examples of such methods. This means that an argument of type
BASEMODEL is expected as input to the Monte Carlo simulation program. The program
does not care what kind of model it is, as long as it is a subclass of BASEMODEL. The
simulation will simply ask the model to perform certain actions whose names are common
with all BASEMODEL-s. Repeating the three core steps in performing a sweep from section
A.1.1:
1. Calculate the acceptance probability. Method used: prob
2. Accept or decline the change using a random number generator. One method used in
this step: accept: