Defining a Model¶
To define your own model, you need a class for spin states, a class for spin transformations, a bond and site coupling, and a generator of transformations. Many examples of models can be found in the headers contained in lib/wolff_models/
.
Spin States¶
-
class
X_t
¶ The spin type, which we have been denoting with
X_t
, only needs to have a default constructor. If your spins can take only finitely many values, consider following the instructions in Finite States to significantly speed the algorithm.
Transformations¶
-
class
R_t
¶ The transformation type must have a default constructor, and the following member functions:
-
X_t
act
(const X_t&)¶ The action of the transformation on a spin, returning the transformed spin.
- Parameters
const X_t& – The spin state to transform.
- Returns
The transformed spin state.
-
R_t
act
(const R_t&)¶ The action of the transformation on another transformation, returning the transformed transformation.
- Parameters
const R_t& – The transformation state to transform.
- Returns
The transformed spin state.
-
X_t
Couplings¶
When a system
object is initialized it needs to be given a bond and field coupling, to resemble the Hamiltonian
Note that building with certain compile flags will change the form that these coupling functions must take, as outlined in Compile Options.