Class model::Potts
Potts Model.
This model implements a hamiltonian of the form \(\mathcal{H} = \sum_j c_j \delta_{s_{j,1}, s{j,2}, \ldots}\), where \(\delta\) is the kronecker delta, which is 1 iff all its subscripts are identical (and 0 otherwise). That is: Each term in this cost function will contribute only if all Potts spins participating in it are of the same value.
Inherited Members
Constructors
Potts()
Declaration
model::Potts::Potts()
Methods
get_identifier()
Returns the identifier string of the model type (e.g., "ising").
Declaration
std::string model::Potts::get_identifier() const override
get_version()
Returns the version of the input format this implementation expects.
Declaration
std::string model::Potts::get_version() const override
calculate_cost()
Calculate the Potts Hamiltonian.
Declaration
double model::Potts::calculate_cost(const PottsState&state) const override
calculate_cost_difference()
Recompute the parts affected by transition
.
Declaration
double model::Potts::calculate_cost_difference(const PottsState&state, const PottsTransition&transition) const override
get_random_state()
Return a random Potts state.
This function decides on the number of potts spins and the possible values of each to return (according to the model configuration).
Declaration
PottsState model::Potts::get_random_state(utils::RandomGenerator&rng) const override
get_random_transition()
Create a random transition for state
.
Declaration
PottsTransition model::Potts::get_random_transition(const PottsState&state, utils::RandomGenerator&rng) const override
apply_transition()
Change state
according to transition
.
Declaration
void model::Potts::apply_transition(const PottsTransition&transition, PottsState&state) const override
configure()
Serialize q
and the underlying graph.
Declaration
void model::Potts::configure(const utils::Json&json) override
state_memory_estimate()
Declaration
size_t model::Potts::state_memory_estimate() const override
state_only_memory_estimate()
Declaration
size_t model::Potts::state_only_memory_estimate() const override
calculate_term()
Declaration
double model::Potts::calculate_term(const PottsState&state, size_t edge_id) const
calculate_term()
Declaration
double model::Potts::calculate_term(const PottsState&state, size_t edge_id, const PottsTransition&transition) const