Skip to content

Rebase on main + review fixes#3

Open
orionarcher wants to merge 66 commits intothomasloux:feat/support-plumedfrom
orionarcher:orionarcher/rebase-plumed-pr
Open

Rebase on main + review fixes#3
orionarcher wants to merge 66 commits intothomasloux:feat/support-plumedfrom
orionarcher:orionarcher/rebase-plumed-pr

Conversation

@orionarcher
Copy link
Copy Markdown

Summary

  • Rebased both PLUMED commits onto current TorchSim main (resolved conflicts in tests/conftest.py, torch_sim/__init__.py, torch_sim/plumed.py)
  • Fixed pre-commit issues: removed stale use_neighbor_list param from tutorials, removed nonexistent StateDict import, added PlumedModel to __all__, added ty override for plumed.py
  • Return energy_bias and forces_bias separately so users can inspect the PLUMED correction (energy = model_energy + energy_bias)
  • Warn at construction time if wrapped model has compute_stress=True (virial not applied) or retain_graph=True (bias forces detached from autograd)
  • Deduplicated unit conversion constants between plumed.py and plumed_builder.py

Test plan

  • All 18 builder tests pass
  • 10 plumed tests skip gracefully (no PLUMED kernel in CI)
  • Run full plumed test suite in environment with PLUMED installed

🤖 Generated with Claude Code

falletta and others added 30 commits February 17, 2026 11:57
Co-authored-by: Orion Cohen <27712051+orionarcher@users.noreply.github.com>
Co-authored-by: orionarcher <orioncohen@gmail.com>
Co-authored-by: Daniel Zuegner <dzuegner@microsoft.com>
Co-authored-by: Orion Cohen <27712051+orionarcher@users.noreply.github.com>
Signed-off-by: Rhys Goodall <rhys.goodall@outlook.com>
thomasloux and others added 29 commits March 17, 2026 19:11
Co-authored-by: Abhijeet Gangan <abhijeetgangan@g.ucla.edu>
)

Co-authored-by: Rhys Goodall <rhys.goodall@outlook.com>
Co-authored-by: Stefano Falletta <49149059+falletta@users.noreply.github.com>
PlumedModel.forward() now returns "biased_energy" and "biased_forces"
keys in addition to the combined "energy" and "forces". This lets users
inspect the PLUMED bias contribution independently and integrates with
the extras system via store_model_extras().
PLUMED virial corrections are not applied to the stress tensor, so
emit a warning at construction time if the wrapped model has
compute_stress=True.
PLUMED bias forces are computed via numpy and detached from the
autograd graph, so they are incompatible with differentiable-force
workflows.
…r.py

Import _PLUMED_LENGTH_FACTOR and _PLUMED_ENERGY_FACTOR from plumed.py
instead of redefining them. No circular import risk since plumed.py only
imports from plumed_builder lazily inside functions.
These are the PLUMED bias corrections only, not the total biased values.
The total is in "energy" and "forces" (unbiased + correction). Users can
recover unbiased values via energy - plumed_bias_energy.
Clarify in the docstring that energy = model_energy + energy_bias and
forces = model_forces + forces_bias.
@orionarcher orionarcher force-pushed the orionarcher/rebase-plumed-pr branch from 4d3ed50 to d1ac7cb Compare April 13, 2026 13:57
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.