Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ca_ising_magnetisation_example.cc File Reference

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>
Include dependency graph for ca_ising_magnetisation_example.cc:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

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:

  • T < T_c: ordered phase, |m| close to 1.
  • T ~ T_c: critical fluctuations.
  • T > T_c: disordered phase, |m| close to 0.

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.

Function Documentation

◆ main()

int main ( void  )