Skip to content

ES/05 metadynamics - #178

Open
samarjeet wants to merge 41 commits into
NVIDIA:mainfrom
samarjeet:es/05-metadynamics
Open

ES/05 metadynamics#178
samarjeet wants to merge 41 commits into
NVIDIA:mainfrom
samarjeet:es/05-metadynamics

Conversation

@samarjeet

Copy link
Copy Markdown

ALCHEMI Toolkit Pull Request

WellTemperedMetaDynamicsBias (all three storage policies; periodic CV; independent and state-owned history); RMSDMetaDynamicsBias (xTB-style); unit + GPU integration tests; gallery examples

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or infrastructure change

Related Issues

Changes Made

Testing

  • Unit tests pass locally (make pytest)
  • Linting passes (make lint)
  • New tests added for new functionality meets coverage expectations?

Checklist

  • I have read and understand the Contributing Guidelines
  • I have updated the CHANGELOG.md
  • I have performed a self-review of my code
  • I have added docstrings to new functions/classes
  • I have updated the documentation (if applicable)

Additional Notes

Tip

This repository uses Greptile, an AI code review service, to help conduct
pull request reviews. We encourage contributors to read and consider suggestions
made by Greptile, but note that human maintainers will provide the necessary
reviews for merging: Greptile's comments are not a qualitative judgement
of your code, nor is it an indication that the PR will be accepted/rejected.
We encourage the use of emoji reactions to Greptile comments, depending on
their usefulness and accuracy.

…riable

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…tputs

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…rough for AFTER_STEP captures

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…state_id

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…ponent state

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…d of skipped verification

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…n-zero cell with pbc=False

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
…absent

Signed-off-by: Samarjeet Prasad <p.samar.j@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces the enhanced-sampling framework, including conservative and adaptive biases, replica exchange, checkpoint/restore support, metadynamics variants, collective variables, documentation, examples, and tests.

  • Adds well-tempered and RMSD metadynamics with configurable history and storage policies.
  • Adds synchronous replica exchange and thermodynamic-state rebinding for supported NVT integrators.
  • Adds transactional enhanced-sampling checkpoints and force-priming lifecycle integration.
  • Deprecates the legacy biased-potential hook in favor of the conservative-bias API.

Important Files Changed

Filename Overview
nvalchemi/enhanced_sampling/biases/metadynamics.py Implements well-tempered metadynamics and storage/history policies, but free_energy() silently selects owner 0 for private histories.
nvalchemi/enhanced_sampling/biases/rmsd_metad.py Adds batched, non-periodic RMSD metadynamics with reference storage, atom selection, and rigid-motion-invariant energy.
nvalchemi/enhanced_sampling/_runner.py Coordinates bias evaluation, hook ordering, adaptive updates, force priming, exchange, and checkpoint lifecycle.
nvalchemi/enhanced_sampling/_exchange.py Implements synchronous temperature and umbrella exchange with deterministic pairing and acceptance draws.
nvalchemi/enhanced_sampling/_checkpoint.py Adds checksummed transactional serialization for runner, dynamics, bias, exchange, and batch state.
nvalchemi/enhanced_sampling/_bias.py Defines conservative autograd-derived bias outputs and aggregation across independent biases.
nvalchemi/dynamics/base.py Adds dynamics state serialization and thermodynamic-state extension points used by enhanced sampling.
nvalchemi/dynamics/integrators/nvt_langevin.py Adds temperature-state rebinding and corresponding velocity rescaling for replica exchange.
nvalchemi/dynamics/integrators/nvt_nose_hoover.py Adds temperature rebinding that consistently transforms velocities and thermostat-chain state.
docs/userguide/enhanced_sampling.md Documents enhanced-sampling concepts, supported biases, replica exchange, lifecycle guarantees, and checkpoint workflows.

Reviews (1): Last reviewed commit: "biases now raise for history=walker/stat..." | Re-trigger Greptile

Comment on lines +699 to +705
if owner_key is None:
owner_key = torch.full(
(values.shape[0],),
-1 if self.history == "shared" else 0,
dtype=torch.long,
device=values.device,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Private history defaults to owner zero

When free_energy(values) is called for history="walker" or history="state" without an owner_key, this branch silently selects owner 0 and excludes every other owner's hills, causing an incomplete but plausible free-energy profile despite the docstring claiming a shared-history default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant