Skip to content

v1.5.0

Latest

Choose a tag to compare

@github-actions github-actions released this 20 Oct 20:45
· 24 commits to main since this release

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.compile are 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 SphericalCell or DomeCell surface, or above a CustomCell top, are rejected. Atoms can no longer get stranded where no deletion reaches them. This includes PermutationMove swaps.
  • CustomCell scales 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, DisplacementMove and MoleculeDisplacementMove honour FixAtoms.
  • FixAtoms rows are restored in float64 after an Alchemi relaxation (they drifted by about 5e-7 Å).
  • MPI ReplicaExchange uses 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), and derive_mu_bulk fits 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_che and mu_o_che: pH- and potential-dependent chemical potentials from the computational hydrogen electrode.
  • derive_mu_bulk and derive_mu_gas: reference chemical potentials from the running potential.
  • min_insert sets a seed clearance for relaxed insertions (ADR 0004).
  • trajectory_file option on BrownianMove and AlchemiBrownianMove to 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.xyz holds one frame per rung whenever the rungs' μ differ.
  • A failed energy call or setup leaves no half state.
  • write_xyz keeps pbc, constraints and tags.
  • Free-volume sampling adapts the sample count to about 0.5% relative noise.
  • find_molecules is about 12x faster.
  • Adapted to nvalchemi-toolkit 0.2.0.

Removed and changed APIs

  • CanonicalEnsemble(units_type=), BaseEnsemble(units_type=, user_tag=) and RandomNumberGenerator(warm_up=) are removed. They had no effect.
  • MoveSelector.get_acceptance_ration (typo alias) is removed. Use get_acceptance_ratio.
  • Unused modules mcpy/moves/go_moves.py, mcpy/calculators/mace_calculator.py and mcpy/utils/utils.py are 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