mcpy

Grand Canonical Monte Carlo for atomistic systems - with native Replica Exchange and machine-learning interatomic potentials.

mcpy predicts the composition and stability of surfaces and nanoparticles under realistic temperature and chemical-potential conditions. It is built on the Atomic Simulation Environment (ASE), so any ASE-compatible calculator - DFT, classical potentials, or MLIPs such as MACE - can drive the sampling.

Highlights

  • GCMC, NVT, and Replica-Exchange in a single, modular run loop, including a single-process BatchedReplicaExchange for single-GPU runs.

  • Hybrid scheme of Senftle et al. - every trial insertion/deletion is followed by a short local relaxation, which makes acceptance realistic in densely packed metallic systems.

  • Basin-hopping output for free - every ensemble can emit a running minima_file of strictly improving configurations alongside the sampling trajectory, and replica-exchange runs add a global global_minimum.xyz at the end.

  • Calibratable free volume via Monte Carlo sampling with element-wise exclusion radii.

  • Cell geometries out of the box - periodic box, rectangular sub-slab, sphere around a nanoparticle, and dome over a supported particle.

  • Modular trial moves - atomic and whole-molecule insertion, deletion and displacement, plus permutation, shake, and Brownian moves, mixed through a weighted MoveSelector; permutation and displacement support compound n_swaps / n_steps perturbations per trial for basin-hopping sampling.

  • MLIP-ready - dedicated MACE wrappers, plus any ASE-compatible potential (NequIP, ACE, classical force fields) through the generic calculator adapter, and an optional GPU-native NVIDIA Alchemi backend for large systems.

  • Phase-diagram utilities for post-processing GCMC ensembles into surface and nanoparticle phase diagrams.

Citing mcpy

If you use mcpy in a publication, please cite it with the metadata in CITATION.cff, and cite the methods it implements (see Bibliography).

Examples