|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Phase 8 example: Ising spins with Glauber dynamics + temperature sweep. More...
#include <algorithm>#include <array>#include <cmath>#include <cstddef>#include <cstdint>#include <iomanip>#include <iostream>#include <random>#include <string>#include <ca-rng.H>#include <ca-traits.H>#include <tpl_ca_engine.H>#include <tpl_ca_lattice.H>#include <tpl_ca_neighborhood.H>#include <tpl_ca_storage.H>#include <tpl_ca_stochastic_rules.H>Go to the source code of this file.
Functions | |
| int | main () |
Phase 8 example: Ising spins with Glauber dynamics + temperature sweep.
Builds a 32x32 toroidal Ising lattice with Von-Neumann neighbours (degree 4) and runs the Glauber single-spin-flip dynamics from a disordered initial state. The example sweeps a small grid of temperatures (T = 1.0, 2.0, 2.27, 2.5, 4.0) and reports, for each temperature, the average absolute magnetisation per site after a burn-in.
The exact 2-D Ising critical temperature on the square lattice is T_c = 2 * J / ln(1 + sqrt(2)) ~ 2.269 J so we expect:
After the sweep we render the final spin configuration of the cold, critical, and hot regimes so the visual contrast is obvious.
Glyphs: '+' spin up '-' spin down
Definition in file ca_ising_magnetisation_example.cc.
| int main | ( | void | ) |
Definition at line 139 of file ca_ising_magnetisation_example.cc.
References bar(), Aleph::blossom_maximum_cardinality_matching(), cols, k, r, rows, and seed.