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
BatchedReplicaExchangefor 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_fileof strictly improving configurations alongside the sampling trajectory, and replica-exchange runs add a globalglobal_minimum.xyzat 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 compoundn_swaps/n_stepsperturbations 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).
Diving deeper
API reference
Reference