Skip to content

Check per-atom forces and strain through metatomic-core - #1

Closed
EricBoittier wants to merge 7 commits into
EricBoittier/metatomic-capi-updatefrom
plumed/core-gradient-tests
Closed

EricBoittier wants to merge 7 commits into
EricBoittier/metatomic-capi-updatefrom
plumed/core-gradient-tests

Conversation

@EricBoittier

Copy link
Copy Markdown
Owner

Fix sample-label iteration, which used iterators from different temporary vectors.

Add numerical checks for per-atom forces and all nine strain components, including reordered samples, selected atoms, and missing gradients. Add a focused Linux CI job.

Local checks pass: maximum errors are 3.6e-8 for forces and 7.7e-8 for strain. This is the first PR in the stack.

EricBoittier and others added 6 commits October 15, 2026 14:45
Add the --enable-libmetatomic-core configure option, which probes the
metatomic-core C++ API (metatomic::load_model / metatomic::execute_model)
and links libmetatomic and libmetatensor without requiring libtorch. It
defines __PLUMED_HAS_LIBMETATOMIC_CORE and the libmetatomic_core config key.

Add regtest/metatomic/rt-core, a two-atom distance model written as a
metatomic.NumpyModel Python script and loaded through metatomic's Python
plugin, with explicit positions and strain gradients. The second frame
crosses the periodic boundary.

Document plugin models in the METATOMIC action and the module page,
recommending Python NumpyModel scripts and linking PLUMED against the
libmetatomic shipped in the metatomic-core Python package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rename metatomic.cpp to MetatomicAction.cpp so MetatomicAction.h has a
  companion source (plmd_non_existing_cpp / plmd_non_included_h)
- value-initialise VesinOptions so `sorted` is no longer read uninitialised
  (cppcheck uninitvar)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`sorted` was never set, so vesin read an uninitialised bool (cppcheck
uninitvar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EricBoittier
EricBoittier force-pushed the EricBoittier/metatomic-capi-update branch 2 times, most recently from cc4d525 to ebd42f7 Compare October 26, 2026 10:36
@EricBoittier

Copy link
Copy Markdown
Owner Author

Closing: staging PR, the work continues in plumed#1510.

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