English

peapods: A Rust-Accelerated Monte Carlo Package for Ising Spin Systems

Statistical Mechanics 2026-03-05 v3 Computational Physics

Abstract

We present peapods (github.com/PeaBrane/peapods), an open-source Python package for Monte Carlo simulation of Ising spin systems with arbitrary coupling constants on periodic Bravais lattices with user-specified neighbor offsets. The computational core is written in Rust and exposed to Python via PyO3, combining the ergonomic interface of Python with the performance of compiled, memory-safe code. The package implements Metropolis and Gibbs single-spin-flip algorithms, Swendsen-Wang and Wolff cluster updates, parallel tempering, and three replica cluster moves for spin glasses: the Houdayer isoenergetic cluster move, the Jorg stochastic variant, and the Chayes-Machta-Redner (CMR) blue-bond algorithm. Overlap statistics between replica pairs enable computation of the spin glass order parameter and Binder ratio. Replica-level parallelism is achieved through the Rayon work-stealing scheduler. We validate the implementation against the exact critical temperatures of the two-dimensional Ising model on the square and triangular lattices via finite-size scaling of the Binder cumulant.

Keywords

Cite

@article{arxiv.2602.19045,
  title  = {peapods: A Rust-Accelerated Monte Carlo Package for Ising Spin Systems},
  author = {Yan Ru Pei},
  journal= {arXiv preprint arXiv:2602.19045},
  year   = {2026}
}
R2 v1 2026-07-01T10:46:03.322Z