Finite States

One of the slower steps in running the algorithm is taking the exponent involved in computing the bond activation probabilities for each prospective bond. When the spins in your system have a finite number of possible states, the algorithm can be sped up considerably by precomputing the bond activation probabilities for every possible pair of spins. Once the appropriate things have been defined for your model, the compile definition WOLFF_USE_FINITE_STATES can be set to automate this process. The provided model headers wolff_models/ising.hpp and wolff_models/potts.hpp demonstrate the expected usage.

Required Definitions

WOLFF_USE_FINITE_STATES

This macro must defined before wolff.hpp or any of the other header files are invoked.

WOLFF_FINITE_STATES_N

This macro must be defined and given a value equal to the number of states your model can take. It must be defined before wolff.hpp or any of the other header files are invoked.

X_t::X_t(q_t)

Your spin class X_t must have a constructor defined that takes a q_t and returns a unique state for all arguments less than WOLFF_FINITE_STATES_N.

q_t X_t::enumerate()

Your spin class X_t must have a function defined that returns the index associated with a given state. This must be the inverse function of the constructor above.