The input file specifies the details of the system to be simulated. By default this file is read from standard input, but its filename can also be given on the command line. As a convention this file has the extension '.in'. The complete specification of the system can be spread over a number of files which should all be referred to from this file. With the option “–lattice” for example you can link to a file containing the lattice defenition and hamiltonian of the system.
When a new simulation is started you typically want to begin with a randomised (or thermalised) state. Therefore the program will run at a high temperature (T=100) until the energy has stabilised. This is called thermalisation. If you want to start off from a structure saved from a previous run with the option '-E', then you have to use the '–no-thermalise' option in combination with the '-I' option.
The '.state' file obtained using '-E' contains the lattice structure as well as the magnetic structure. You can edit this file to create structures which cannot be obtained using the normal input method. For example when you want to introduce random vacancies or missing bonds.
Once the system is thermalised and brought to the right temperature,
spinner
will run without taking data until the energy has
stabilised. This 'equilibration' phase can take up to 10000 sweeps,
but this depends on the previous temperature set. spinner
can try
to estimate when the energy has stabilised for the new temperature
(see section Equilibration) but the default as specified in the '.spinner'
config file is 4000 sweeps.
Use the option '–no-averaging' if you want all data to be saved (number of sweeps data points per temperature). This is usefull when you want to do hystogram analysis afterwards. Otherwise the data will be averaged as described in the following chapter.
The data file has the same name as the '.in' input file, but with the extension '.dat'. After equilibration at each temperature T, the total energy (E) and the total magnetisation vector (M) will be calculated (measured) and stored. When the set number of sweeps is reached at each temperature this data will be averaged and the data is written to the data file in the following order: <E>/N, C_v=(<E^2>-<E>^2)/(NT^2), M_abs=<|M|>/N,Chi_abs=<<|M|^2>-<|M|>^2>/NT, B.C. = [1-<|M|^4>/(3<|M|^2>^2)], <Mi>/N, Chi_i=<<|M_i|^2>-<|M_i|>^2>/NT for i=1..D where D is the spin-dimension and N is the number of spins.
In order to add your own observables (YOO) to this list you need to edit two files and recompile the program. In the file 'metropolis.hpp' add a line like this in the methods metropolis_1to3dim::operator() and metropolis_heisenberg::operator() at the points indicated there:
dm[``YOO''].push_back(YOO);
In 'data_handler.hpp' you should add
YOOave = inner_product(dm["YOO"].begin(),dm["YOO"].end(),dm["YOO"].begin(),0.0) / dm["YOO"].size(); fstr<<data_entry%(YOOave/Nspins);
in data_handler::run() at the place indicated in the file.
Equilibration is a difficult matter. For the final data it should be
done very carefully, and can take up to 100000 sweeps if you start
from a random configuration. However, when you gradually choose lower
temperatures at each step in the simulation, then you generally don't
need that many sweeps before data can be taken. During the
equilibration Spinner
can measure whether the energy is
stabilised or still changing. In deciding whether the system is
equilibrated three parameters are used; 'si' is the interval between
which the energy should be measured, 'sc' is the number of
measurements over which the change in energy should be sufficiently
low, and 'sf' is the factor by which the net change in energy from the
first to the last energy in the 'sc' measurements taken is larger than
the random fluctuations in energy.
This method is not scientific, and should only be used for convenience and efficiency as long as no proper data is taken. The safest is to simply set 'si=50000' and 'sc=1' in the '.spinner' file. However, if you take small steps down in temperature this value can be set smaller.
The random number generators of the Boost library are used in the metropolis algorithm. For randomly picking a spin the Mersenne twister algorithm is used, and the lagged fibonacci algorithm is used for generating a random spin orientation and for accepting/rejecting a new spin orientation.
These algorithm produce semi random numbers. i.e. if the starting
state of the algorithm is the same, the same sequence of numbers will
be produced. This can be a problem if you add data acquired in
different runs. To avoid the same sequence of numbers being used again
in a subsequent run of the same simulation spinner
saves the
state of the random number generator in a file called
'.<NameOfInputFile>.random_state'.
So if you want to increase the statistics of your data by repeating a run, so that afterwards you can average the data over several runs, you should use the same name for the input file every time you run it. The new data will be added at the bottom of the old data file automatically, and the old random state will be read in, so that a new sequence of numbers is produced.
In the config file '.spinner' which will be searched for in the current directory and then in the user's /home directory, you can also specify a default name, say '.default.random_state' so that each new run starts from the point where the previous run left off regardless of the name of the input file.
Spinner
uses a update method for the spins which optmises the
acceptance rate to 50% of updates by varying the maximum angle over
which a spin can be rotated from its current value. The maximum of the
maximum angle can be specified in the '.spinner' file, and is by
default 2PI.
There is an additional 'config' file. By default spinner
looks
for the file '.spinner' first in the working directory and then in the
user's /home directory. With this file the general behavior of the
program can be changed. See the sections on equilibration and the
random number generator.