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

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.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…