Repository navigation
mcpy is now on PyPI as mcpy-gcmc: pip install mcpy-gcmc.
The import name stays mcpy.
This release fixes bugs that can change simulation results.
Runs made with v1.4.0 or earlier can differ from runs made with this version.
Fixes that can change results
- Wrong forces for MACE models with non-linear interaction blocks (mh-1) when cuEq and
torch.compileare both on. Forces were off by up to 0.6 eV/Å while energies stayed correct. Compile is now turned off for such models, with a warning. - mh-1 under cuEq: the first interaction block was rebuilt with the wrong width and random weights (ACEsuit/mace#1298). The model is now repaired before conversion.
- Insertion proposals now use the same exclusion rule as the free volume, and deletions use the post-deletion volume, so the acceptance satisfies detailed balance.
- An error is raised when insertion and deletion attempt probabilities differ per species and cell, which silently shifted μ.
- Trials that move exchanged atoms across a
SphericalCellorDomeCellsurface, or above aCustomCelltop, are rejected. Atoms can no longer get stranded where no deletion reaches them. This includesPermutationMoveswaps. CustomCellscales the box c vector, so a tilted cell no longer strands wrapped insertions.- FixAtoms atoms are never deleted, and atom caps count free atoms only.
ShakeMove,DisplacementMoveandMoleculeDisplacementMovehonour FixAtoms. - FixAtoms rows are restored in float64 after an Alchemi relaxation (they drifted by about 5e-7 Å).
- MPI
ReplicaExchangeuses one general swap rule, exact for a per-rung μ(T), with the de Broglie term and NaN rejection on every ladder. - Replica exchange rejects replicas or ranks that share a random stream.
- Phase diagrams: frames are scored by E - Σ μ_m (N_m - N_m,ref) via
mu_metal, pressure axes use NIST-JANAF dμ0(T), andderive_mu_bulkfits an equation of state.
New features
AlchemiFCalculator(optimizer='lbfgs'): batched L-BFGS when the installed nvalchemi provides it. About 3x faster than FIRE per trial relaxation.- cuEq input padding to bucketed atom counts: 1.3-5x faster batched relaxations.
mu_h_cheandmu_o_che: pH- and potential-dependent chemical potentials from the computational hydrogen electrode.derive_mu_bulkandderive_mu_gas: reference chemical potentials from the running potential.min_insertsets a seed clearance for relaxed insertions (ADR 0004).trajectory_fileoption onBrownianMoveandAlchemiBrownianMoveto debug MD proposals.plot_phase_diagram: exact lower envelope, numbered phases, colourblind-safe colours, optional hatched region.- New example: H adsorption on a Pt nanoparticle with a CHE potential ladder.
- The outfile records the mcpy version.
Other fixes
- A second
run()appends to the trajectory, outfile and minima files. No duplicate final frame. - MPI runs abort on all ranks instead of hanging when one rank fails.
global_minimum.xyzholds one frame per rung whenever the rungs' μ differ.- A failed energy call or setup leaves no half state.
write_xyzkeeps pbc, constraints and tags.- Free-volume sampling adapts the sample count to about 0.5% relative noise.
find_moleculesis about 12x faster.- Adapted to nvalchemi-toolkit 0.2.0.
Removed and changed APIs
CanonicalEnsemble(units_type=),BaseEnsemble(units_type=, user_tag=)andRandomNumberGenerator(warm_up=)are removed. They had no effect.MoveSelector.get_acceptance_ration(typo alias) is removed. Useget_acceptance_ratio.- Unused modules
mcpy/moves/go_moves.py,mcpy/calculators/mace_calculator.pyandmcpy/utils/utils.pyare removed.
Docs and packaging
- Reworked README, examples and API reference (generated with autodoc).
- Release workflow: a version tag uploads the package to PyPI and creates this release.
Full changelog: v1.4.0...v1.5.0