Changelog
All notable changes to VibeSpin are documented here. The format follows Keep a Changelog. Version types align with Conventional Commits: feat → Added, fix → Fixed, perf → Performance, refactor → Changed, docs → Documentation, phys → Physics, test → Tests, chore → Chores.
Policy: Update the [Unreleased] section for every commit that changes user-facing behavior (physics, CLI, NPZ schema, public API, or documentation). When cutting a release, move [Unreleased] entries to a dated version block.
Unreleased
Added
New script
scripts/clock/correlation_comparison.py: computes equilibrium \(G(r)\) for the \(q = 6\) clock model in ordered, quasi-ordered, and disordered phases using convergence equilibration. Savesresults/clock/correlation_comparison.npz.New script
scripts/ising/coarsening_analysis.py: precomputes quench-depth sensitivity, equilibrium-to-coarsening crossover (\(\xi_{\mathrm{eq}}\) measurement), and stochastic ensemble data for the Ising model. Savesresults/ising/coarsening_analysis.npz.Multi-seed ensemble support in
utils/kinetics_helpers.run_ordering_kinetics: newn_seedsandbase_seedparameters produce median trajectories with IQR error bars. Per-seed arrays stored as additive NPZ keys (R_sk_seeds,R_xi_seeds,third_metric_seeds,R_sk_err,R_xi_err,third_metric_err).All three
ordering_kinetics.pyscripts (Ising, XY, Clock) now accept--seedsand--base-seedCLI arguments for multi-seed runs.Generated
results/xy/correlation_comparison.npz(\(L = 128\)) from existingscripts/xy/compare_correlations.py.
Changed
Transitioned project package and virtual environment management to use
uv.Configured
.devcontainer/devcontainer.jsonpostCreateCommand to globally installuvand useuv sync --all-extrasfor deterministic environment provisioning.Pinned and locked all direct and transitive dependencies into
uv.lock.Regenerated standard
requirements.txtusinguv pip compileto ensure backward compatibility.Updated
README.mdto recommenduv syncanduv runcommands for local installation and test suites.notebooks/Correlation_and_Coarsening.ipynb: quench-depth (cell 31), crossover (cell 34), and stochastic ensemble (cell 39) cells now load precomputed data fromresults/ising/coarsening_analysis.npzwith inline computation as fallback only. Clock correlation cell (cell 13) and XY correlation cell (cell 8) similarly load from cached NPZ files. Methodology section updated to describe multi-seed ensemble averaging.
Added
Part II of
notebooks/Correlation_and_Coarsening.ipynbnow renders the ordering-evolution snapshot figure inline via a live simulation cell (L=128, T=0.1), showing spin configurations, structure factor, and correlation length \(\xi\) at \(t = 1, 10, 100, 1000\) Monte Carlo sweeps. The figure is no longer loaded from a pre-generated PNG; it is generated reproducibly within the notebook kernel on each run.Part II of
notebooks/Correlation_and_Coarsening.ipynbnow includes a new “Vortex Spacing vs Structure Factor and Correlation Length” subsection for the XY and Clock models, showing \(R_v = n_v^{-1/2}\) (mean vortex spacing) alongside \(R_{S(k)}\) and \(R_\xi\) on log-log axes with Allen-Cahn reference, mirroring the Ising MIL comparison. All three estimators show exponents \(n \approx 0.4\)–\(0.5\).Part II of
notebooks/Correlation_and_Coarsening.ipynbnow includes a “Domain Coarsening vs Boundary-Wall Decay” subsection with a unified log-log comparison plot overlaying all three coarsening-length estimators (\(R_{S(k)}\), \(R_\xi\), \(R_{\mathrm{MIL}}\)) against the Allen-Cahn \(t^{1/2}\) reference line.Kinetics loading cell now exposes
pre_third(the MIL power-law prefactor) so the boundary-wall proxy fit line can be drawn in the comparison plot.
Changed
Improved Ising ordering kinetics generation defaults in
scripts/ising/ordering_kinetics.py:max_stepsreduced from 1000 to 400,samplesincreased from 10 to 25,fit_minreduced from 20 to 5. The regeneratedresults/ising/ordering_kinetics.npzyields fitted exponents \(n \approx 0.490\) (\(R_{S(k)}\)), \(0.487\) (\(R_\xi\)), \(0.517\) (\(R_{\mathrm{MIL}}\)), close to the Allen-Cahn prediction \(n = 1/2\).Improved XY ordering kinetics generation defaults in
scripts/xy/ordering_kinetics.py:tempchanged from 0.1 to 0.5 (well below \(T_{\mathrm{BKT}} \approx 0.893\), better vortex mobility),max_stepsincreased to 1500,samplesincreased to 30,fit_minreduced to 5. Fitted exponents: \(n \approx 0.448\) (\(R_{S(k)}\)), \(0.477\) (\(R_\xi\)).Improved Clock ordering kinetics generation defaults in
scripts/clock/ordering_kinetics.py: same parameter changes as XY. Fitted exponents: \(n \approx 0.413\) (\(R_{S(k)}\)), \(0.449\) (\(R_\xi\)).Regenerated
results/xy/ordering_kinetics.npzandresults/clock/ordering_kinetics.npzwith new parameters (L=256, T=0.50). The exponent comparison table innotebooks/Correlation_and_Coarsening.ipynbnow shows all three models with finite, physically meaningful values instead of NaN.Regenerated
results/ising/correlation_comparison.npzwith \(L=128\) (64 radial points, \(r \in [0, 63]\)) and 10 000 measurement steps. The previous production cache had been overwritten by the test suite with \(L=16\) and only 5 steps. The Part I Ising correlation plot now shows clear separation between the three temperature regimes over more than a decade in \(r\).Fallback
_compute_ising_correlationsfunction innotebooks/Correlation_and_Coarsening.ipynbupdated to use \(L=128\) and 2 000 measurement steps (was \(L=40\), 1 500 steps).\(r^{-1/4}\) guide in the Ising \(G(r)\) plot is now anchored dynamically to the critical data at \(r = 2\) and spans the full data range; previously it was hardcoded to \([1, 15]\) regardless of \(L\).
Domain Growth Curves figure: y-axis relabelled from “Domain size \(R(t)\)” to “Characteristic length \(R(t)\) (lattice units)” and suptitle changed from “Coarsening: domain growth after infinite-temperature quench” to “Coarsening kinetics after infinite-temperature quench”. For the XY model, \(R(t)\) tracks the vortex-antivortex spacing, not a domain size.
Part II prose updated throughout to replace “domain size” and “domain-size proxies” with physically accurate language (“coarsening length scale”, “coarsening-length estimators”) that applies to both the Ising (domain-wall) and XY (vortex annihilation) regimes.
Fixed
scripts/xy/compare_correlations.py: replaced naive fixed-stepsim.equilibrate(n_steps=2000)withconvergence_equilibrate_with_statusand ordered-start fallback. At \(T = 0.4\) (deep BKT phase) the random-start simulation was stuck in a metastable state; the script now detects this and falls back to the ordered start. Regeneratedresults/xy/correlation_comparison.npz: \(G(50) \approx 0.67\) (was 0.017), fitted \(\eta \approx 0.07\) (was 0.57, theory: 0.064).XY and Clock correlation plots in
notebooks/Correlation_and_Coarsening.ipynbnow apply an \(r \leq L/4\) cutoff to exclude periodic-boundary wrap-around artefacts, matching the established practice in the Clock plot.Part I notebook prose rewritten for all three models: XY and Clock sections now state the spin-wave formula \(\eta(T) = T/(2\pi J)\) with explicit numerical predictions at the plotted temperatures (\(\eta \approx 0.064\) at \(T = 0.4\) for XY, \(\eta \approx 0.13\) at \(T = 0.8\) for Clock \(q = 6\)). Clock section specifies the exponent bounds \(4/q^2 = 1/9\) at \(T_1\) and \(1/4\) at \(T_2\). Removed stale references to the old two-panel XY layout and incorrect claim of \(\eta \approx 0.65\) from broken data.
Added
New notebook
notebooks/XY_Temperature_Sweep.ipynb: full thermodynamic sweep across the BKT crossover for the XY model, with data loading/fallback, convergence diagnostics, and autocorrelation analysis.New notebook
notebooks/Clock_Temperature_Sweep.ipynb: temperature sweep for the q-state clock model showing the two-crossover regime structure, with entropy reference at ln(q).New notebook
notebooks/BKT_Transition.ipynb: dedicated notebook examining vortex density, helicity modulus, and correlation function across the BKT transition.New notebook
notebooks/Correlation_and_Coarsening.ipynb: combined notebook covering equilibrium correlation functions (Ising, XY) and non-equilibrium coarsening dynamics across all three models.NPZ output for
scripts/xy/bkt_transition.py,scripts/xy/helicity_modulus.py,scripts/xy/compare_correlations.py,scripts/ising/correlation_comparison.py,scripts/ising/correlation_divergence.py.Optional
npz_pathparameter inutils/kinetics_helpers.run_ordering_kineticsfor persisting kinetics data. All three ordering_kinetics scripts now save NPZ output.Data Pipeline mapping table in
SCRIPTS.mddocumenting the script-to-NPZ-to-notebook data flow.
Changed
utils/observables.py: replaced upward dependency onmodels.simulation_base.MonteCarloSimulationwith a structuralProtocolclass_Sim, eliminating the utils-to-models import cycle.
Added
utils/kinetics_helpers.py: new shared module providing the ordering-kinetics simulation loop for the Ising, XY, and Clock scripts. Exportscompute_mean_intercept_length(stereological domain-size estimator for scalar-spin lattices) andrun_ordering_kinetics(loop over logarithmically spaced step targets, power-law fitting, and figure generation).utils/evolution_helpers.py: new shared module providing the ordering-evolution snapshot loop for the Ising, XY, and Clock scripts. Exportsrun_ordering_evolution, which captures spin configurations, correlation functions, and (for vector-spin models) vorticity maps at each target step, then writes the multi-panel figure.utils/sweep_helpers.py: new shared module providing the two-layer temperature-sweep worker infrastructure used by all three model sweep scripts. ExportsThermoPoint(typed NamedTuple worker payload),RawThermoData(raw measurement arrays),simulate_at_temperature(Layer 1: physics and equilibration),compute_thermo_observables(Layer 2: statistical summarization),simulate_thermo_point(convenience wrapper),build_uncertainty_bundle, andbuild_quality_flags.
Changed
Refactored
utils/analysis.pyintoutils/statistics.py(domain-agnostic statistical estimators and schemas) andutils/observables.py(physics observables and spatial tools).Refactored
scripts/ising/ordering_kinetics.py,scripts/xy/ordering_kinetics.py, andscripts/clock/ordering_kinetics.pyto delegate the full simulation loop, power-law fitting, and figure generation toutils/kinetics_helpers.run_ordering_kinetics. Each script is now a thin argument-parsing wrapper.Refactored
scripts/ising/ordering_evolution.py,scripts/xy/ordering_evolution.py, andscripts/clock/ordering_evolution.pyto delegate the snapshot loop and figure generation toutils/evolution_helpers.run_ordering_evolution. Vorticity capture is controlled by thecapture_vorticityflag (True for XY and Clock, False for Ising).Refactored
scripts/ising/temperature_sweep.py,scripts/xy/temperature_sweep.py, andscripts/clock/temperature_sweep.pyto delegate all worker, uncertainty-bundle, and quality-flag logic toutils/sweep_helpers.Updated integration tests in
tests/integration/test_script_infrastructure.pyto import fromutils.sweep_helpersrather than private script symbols. AddedTestSweepHelpersContractclass covering picklability, required return keys, and bundle schema shapes.
Performance
Fixed excessive memory allocation in
wolff_step_numbaacross Ising, XY, and Clock models by pre-allocating the cluster mask and stack buffers once per simulation run, significantly lowering garbage collection overhead during large sweeps.
Changed
Refactored
utils/analysis.pyintoutils/statistics.py(domain-agnostic statistical estimators and schemas) andutils/observables.py(physics observables and spatial tools).Removed deprecated
system_helpers.pyre-exports (ensure_results_dir,adaptive_equilibrate, etc.). All tests and Jupyter notebooks have been updated to explicitly import fromutils.equilibrationandutils.plottingdirectly.Renamed
run_scaling_benchmark()tomain()inscripts/benchmarks/throughput.pyfor consistency with other analysis scripts.
Fixed
Improved robustness of
blocking_errorandsummarize_primary_observableinutils/physics_helpers.pywhen handling all-NaN time series.Fixed indentation in
tests/style/test_docstring_style.pythat caused test collection failures.
Test
Increased project test coverage from 63% to 75% by adding integration tests for the
main()entry points of numerous analysis scripts (ordering kinetics, evolution, throughput, BKT transition, and helicity modulus).Expanded coverage of
utils/plotting.pyby exercising optional diagnostics and error-marking paths inplot_temperature_sweep.Strengthened
utils/physics_helpers.pyvalidation by adding tests for invalid parameter ranges and edge-case physical conditions.Enforced NumPy-style docstring sections and docstring presence for all public core modules in
tests/style/test_docstring_style.py.
Chores
Raise
requires-pythonfloor from>=3.9to>=3.12to match Ruff, mypy, and runtime targets.Add
scripts/to pytest coverage tracking (--cov=scripts) and[tool.coverage.run]source list.Replace hard-coded
test_results/fixture path intests/utility/test_system_helpers.pywithtmp_path/tempfile.mkdtemp()to eliminate leaked test artifacts.Remove stale
notebooks/results/directory (leftover from an older notebook version; canonical path is../results/).Remove orphaned development result directories (
results/ising_n5/,results/ising_replacement_demo/,results/ising_replacement_stress/) and unreferenced test images (results/_smoke.png,results/_test.png,results/ising_simulation.png).Remove
test_results/from.gitignore(no longer written by any test).
0.1.0 — 2026-03-25
This is the baseline release capturing the full initial development history. The entries below summarize the major milestones grouped by category.
Added
Models:
IsingSimulation,XYSimulation,ClockSimulation, andDiscreteClockSimulationwith Numba-accelerated checkerboard, random-site, and Wolff cluster update schemes. Each model exposes amain()CLI entry point.Equilibration: Two-Start Convergence protocol with mutual cross-band criterion and Quasi-Steady Stuck Detection for low-temperature metastable trapping. Adaptive equilibration fallback for lightweight use cases.
Parallelization: Granular point-level parallelization — every
(T, seed)pair is an independent worker task, maximizing CPU utilization even for single-seed sweeps.Uncertainty schema: Standardized NPZ contract for all temperature-sweep outputs:
<obs>_value,<obs>_err,<obs>_ci_low,<obs>_ci_high,<obs>_tau_int,<obs>_n_eff,<obs>_samples, plus entropy andtau_intasymmetric interval extras. Legacy keys preserved for backward compatibility.Scripts — Ising:
temperature_sweep.py,ordering_kinetics.py,ordering_evolution.py,correlation_divergence.py,correlation_comparison.py,wolff_efficiency.py,measure_z.py,diag_eq_traces.py.Scripts — XY:
temperature_sweep.py,ordering_kinetics.py,ordering_evolution.py,bkt_transition.py,helicity_modulus.py,compare_correlations.py.Scripts — Clock:
temperature_sweep.py,ordering_kinetics.py,ordering_evolution.py,compare_discrete_vs_continuous.py.Scripts — Benchmarks:
throughput.pyfor cross-model scaling and per-call analysis cost profiling.Notebooks:
Ising_Temperature_Sweep.ipynb,Ising_Relaxation_and_Autocorrelation_Analysis.ipynb,Dynamic_Critical_Exponents.ipynb,Wolff_Efficiency.ipynb,Performance_Benchmarks.ipynb.Documentation:
README.md,PHYSICS.md,CODE.md,SCRIPTS.md,BIBLIOGRAPHY.md,AGENTS.md, Sphinx HTML docs with nbsphinx notebook rendering and API autodoc.CI: GitHub Actions workflows for tests (
tests.yml) and documentation (docs.yml). Pre-commit hooks for ruff, mypy, markdown link validation, API docs sync, Sphinx build, and docstring style.Seed management: Deterministic seeding for full reproducibility of all stochastic trajectories.
Transition presets, diagnostics overlays, and quality summary panels for temperature-sweep plots.
Entropy uncertainty via replicate aggregation, block-bootstrap, and single-seed propagation from specific-heat errors.
Hierarchical multi-seed uncertainty combining within-seed blocking error with between-seed spread.
Performance
Numba JIT (
@njit(cache=True, fastmath=True)) on all simulation kernels;parallel=True+prangeon checkerboard kernels.Pre-calculated neighbor index arrays (
idx_next,idx_prev) replace modulo for periodic boundary conditions.Discrete state representation for Clock models replaces per-site trigonometric evaluations with lookup tables (~2.5x speedup).
Vectorized angle extraction for vorticity calculation; radial mask pre-computation for correlation functions.
Changed
Refactored
utils/analysis.pyintoutils/statistics.py(domain-agnostic statistical estimators and schemas) andutils/observables.py(physics observables and spatial tools).ordering_kineticsscripts unified and refactored; renamed fromdomain_growth.ordering_evolutionscripts unified from earlierdomain_snapshots.Test suite reorganized from a flat layout into five layer directories:
algorithm/,model/,utility/,style/,integration/.Equilibration and plotting logic extracted from
utils/system_helpers.pyinto dedicatedutils/equilibration.pyandutils/plotting.pymodules; re-exports maintained insystem_helpers.pyfor backward compatibility.
Fixed
Diagnostics header/title overlap in temperature-sweep diagnostic plots.
Restored notebook JSON after corruption; ensured stuck-detection prose and figures are consistent.
Low-temperature sweep relaxation logic now correctly accepts stable ordered starts as converged.
Default
--eq-max-stepslowered from 200,000 to 20,000 to prevent excessively long equilibration runs.
Unreleased
Refactored
utils/analysis.pyhas been split intoutils/statistics.py(domain-agnostic statistical estimators and NPZ schemas) andutils/observables.py(physics observables and spatial analysis) to separate concerns and improve maintainability without introducing subfolders.