vibespin.scripts.ising package
Submodules
scripts.ising.coarsening_analysis module
Supplementary coarsening analysis for the 2D Ising model.
Precomputes three data sets used by the Correlation_and_Coarsening notebook:
Quench-depth sensitivity: Multiple quench temperatures, multi-seed median R_xi(t) at each, confirming that the growth exponent n = 1/2 is independent of quench depth while the prefactor depends on temperature.
Equilibrium comparison: A long coarsening R_xi(t) trajectory next to the equilibrium correlation length xi_eq at the same temperature. Below T_c xi_eq is the short connected correlation length of the ordered phase, so the domain size grows far beyond it and stops only at the lattice size.
Stochastic ensemble: Multiple independent seeds at one quench temperature, storing per-seed traces to visualize run-to-run variability and the ensemble median + IQR.
scripts.ising.correlation_comparison module
Comparison of spin-spin correlation functions for the 2D Ising model. Analyzes correlation behavior in ferromagnetic, critical, and paramagnetic phases.
scripts.ising.correlation_divergence module
Analysis of correlation length divergence in the 2D Ising model. Extracts the critical exponent nu by fitting correlation lengths near Tc.
- scripts.ising.correlation_divergence.get_correlation_length(params: tuple[float, int, int, int, int, int]) tuple[float, dict[str, float]][source]
Simulate and extract the correlation length xi for a given temperature.
The point estimate fits the correlation function averaged over the whole measurement. Its uncertainty comes from blocking: the samples are split into contiguous blocks, each block’s averaged G(r) is fitted on its own, and the spread of the block estimates gives the standard error and a Student-t interval, centred on the full-run fit.
- Parameters:
params (tuple[float, int, int, int, int, int]) – Tuple of (T, L, steps, eq_steps, sample_interval, seed).
- Returns:
The temperature and the summary
value,err,ci_low,ci_high,tau_int(NaN, not defined for a fitted length),n_eff(NaN), andsamples(number of correlation samples).- Return type:
tuple[float, dict[str, float]]
scripts.ising.diag_eq_traces module
Diagnostic tool for visualizing two-start equilibration traces.
This script runs simultaneous random-start and ordered-start simulations of the 2D Ising model at multiple representative temperatures (deep ordered, critical, and paramagnetic). It identifies seeds that lead to metastable stuck states at low temperatures and generates a multi-panel visualization of the magnetization trajectories.
Results are saved to results/ising/diagnostic_eq_traces_L<size>.png.
- scripts.ising.diag_eq_traces.PALETTE: dict[str, str] = {'convergence': '#888888', 'ordered': '#D65F5F', 'random': '#4878CF'}
Color palette for traces.
- scripts.ising.diag_eq_traces.TC_ISING: float = np.float64(2.269185314213022)
Exact Onsager critical temperature for the 2D nearest-neighbour Ising model.
- scripts.ising.diag_eq_traces.collect_trace(*, size: int, temp: float, seed: int, init_state: str, n_chunks: int, chunk_size: int) ndarray[source]
Run a simulation and collect the magnetization trace.
- Parameters:
size (int) – Linear lattice size L.
temp (float) – Temperature T.
seed (int) – RNG seed.
init_state (str) – Initial state (‘random’ or ‘ordered’).
n_chunks (int) – Number of measurement chunks.
chunk_size (int) – Sweeps per chunk.
- Returns:
Array of magnetization values at each sweep.
- Return type:
np.ndarray
scripts.ising.measure_z module
Measure the dynamical critical exponent z for Metropolis and Wolff algorithms.
This script runs simulations of the 2D Ising model at the critical temperature Tc for various lattice sizes L. It calculates the integrated autocorrelation time tau_int and fits tau_int ~ L^z to extract the dynamic exponent z.
Results are saved to results/ising/dynamic_exponent_z.npz.
- scripts.ising.measure_z.TC_ISING: float = np.float64(2.269185314213022)
Exact Onsager critical temperature for the 2D nearest-neighbour Ising model.
scripts.ising.ordering_evolution module
Domain ordering evolution visualisation for the 2D Ising model.
Quenches from a disordered state to T < T_c and records the spin configuration at multiple time steps, plotting spin configurations, structure factors, and radially averaged correlation functions G(r).
scripts.ising.ordering_kinetics module
Ordering kinetics analysis for the 2D Ising model.
Starting from a disordered state, quenches to T < T_c and tracks the growth of domain size R(t) and the evolution of domain boundaries.
scripts.ising.temperature_sweep module
Standardized temperature sweep for the 2D Ising model. Calculates magnetization, energy, susceptibility, and specific heat, and produces a thermodynamics figure plus a companion diagnostics figure.
scripts.ising.wolff_efficiency module
Wolff cluster algorithm efficiency demonstration for the 2D Ising model.
Compares integrated autocorrelation time, independent samples per second, mean cluster size fraction, and susceptibility between the Metropolis checkerboard and Wolff cluster algorithms across a temperature range centred on the critical point.
Results are saved to results/ising/wolff_efficiency.npz for notebook
re-use and results/ising/wolff_efficiency.png as a four-panel figure.
- scripts.ising.wolff_efficiency.TC_ISING: float = np.float64(2.269185314213022)
Exact Onsager critical temperature for the 2D nearest-neighbour Ising model.