Skip to content

Add Al example for symplectic integrator#44

Draft
johannes-spies wants to merge 4 commits into
symplectic-minimalfrom
symplectic-example
Draft

Add Al example for symplectic integrator#44
johannes-spies wants to merge 4 commits into
symplectic-minimalfrom
symplectic-example

Conversation

@johannes-spies

Copy link
Copy Markdown

Summary

Adds a self-contained Al example demonstrating the full workflow for the symplectic integrator introduced in #43:

  • Data preparation from a reference MLIP trajectory
  • Training a FlashMD model and a symplectic correction model with metatrain
  • NVE dynamics with i-PI using both plain FlashMD and the symplectic integrator

Also includes tests/test_example_al.py, which runs the example end-to-end in CI using EMT and tiny models.

Note: metatrain is currently pinned to the git main branch because experimental.flashmd_symplectic is not yet available in a PyPI release. This should be updated to a proper version pin once a release including the symplectic architecture is available.

This PR should be merged after #43.

johannes-spies and others added 4 commits May 19, 2026 14:50
Self-contained example showing data preparation, model training, and NVE
dynamics with both plain FlashMD and the symplectic integrator via i-PI.
Includes a test that runs the example end-to-end with EMT and tiny models.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use metatrain from git main until experimental.flashmd_symplectic is
  released on PyPI (TODO: pin to a release once available)
- Update ipi import: ipi.utils.scripting → ipi.scripting
- Add ipi, tqdm, pyyaml to test deps
- Suppress known deprecation/resource warnings in pytest config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Save mlip.pt with upet.save_upet() instead of the private
  _model.save() call, which produced a raw TorchScript file that
  metatomic's load_atomistic_model() cannot read
- Disable energy rescaling (rescale_energy=False) to avoid a NaN crash
  when the model is undertrained and predicts energy gains exceeding the
  kinetic energy
- Reduce default epoch count from 100 to 25 and step counts to values
  that complete quickly on CPU
- Update simulation-template.xml and test string replacements to match
  the new CPU-only, mlip.pt-based setup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The pinned metatrain version always includes experimental.flashmd_symplectic,
so the conditional dead code never ran. Drop the flag, the fallback code
path, and the now-unused find_all_architectures import.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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