Table of Contents
Fetching ...

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

Yan Ru Pei

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 arbitrary-dimensional hypercubic lattices with periodic boundary conditions. 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, and parallel tempering. Replica-level parallelism is achieved through the Rayon work-stealing scheduler. We validate the implementation against the exact critical temperature of the two-dimensional Ising model via finite-size scaling of the Binder cumulant.

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 arbitrary-dimensional hypercubic lattices with periodic boundary conditions. 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, and parallel tempering. Replica-level parallelism is achieved through the Rayon work-stealing scheduler. We validate the implementation against the exact critical temperature of the two-dimensional Ising model via finite-size scaling of the Binder cumulant.
Paper Structure (19 sections, 5 equations, 1 figure)

This paper contains 19 sections, 5 equations, 1 figure.

Figures (1)

  • Figure 1: Binder cumulant $U_L$ vs. temperature for $L = 8, 16, 32, 64$ on the square lattice. The dashed line marks the exact critical temperature $T_c \approx 2.269$. All four sizes cross near $U \approx 0.61$.