Add Al example for symplectic integrator#44
Draft
johannes-spies wants to merge 19 commits into
Draft
Conversation
Pass model=(flashmd_model, (symplectic_model, config_dict)) to use the fixed-point midpoint-rule integrator instead of plain FlashMD. The plain single-model API is completely unchanged. Works in both i-PI and ASE (VelocityVerlet, Bussi, Langevin). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
The `._nl.algorithm = "cell_list"` workaround guards against a vesin CUDA bug with triclinic cells (vesin#157), but accesses a private attribute. It was not present in the original PR#32 design, and verified to be unnecessary on CPU (the only target for now). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…per" This reverts commit 7c1aa52.
Allow passing the symplectic model directly as the second tuple element, without wrapping it in a (model, config) pair. Defaults to empty config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
VelocityVerlet assumed the symplectic model was always passed as (model, config); passing just a plain model crashed with TypeError. Also adds pytest filterwarnings for torch.jit and metatomic 0.1.12+ deprecations (renamed output names/quantities) that now surface with newer dependency versions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extend get_pretrained() with symplectic=True to download and export the symplectic FlashMD checkpoint from HuggingFace. Add tests covering both the plain-model and (model, config) tuple API. Metatrain is pinned to the git HEAD for now since experimental.flashmd_symplectic is not yet in a released version. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pin metatrain to 2026.2.1 in pyproject.toml. In get_pretrained, check the mtt export return code and give a helpful error if the experimental.flashmd_symplectic architecture is missing. Override metatrain with a pinned metatensor/metatrain commit in CI so the symplectic tests can actually run the export. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
warp-lang>=1.14.0 deprecated warp.config.quiet, which is used by nvalchemi-toolkit-ops==0.3.0. Suppress it so pytest's filterwarnings error mode doesn't turn it into a failure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The existing filter only matched APICLaunchParamRecord; warp-lang 1.14.0 triggers the same warning for other ctypes structures (e.g. APICLaunchPtrLocation) on Python 3.14. Use .* to suppress all of them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validate that the symplectic correction model's timestep matches the FlashMD model's in SymplecticStepper, covering both the i-PI and ASE paths. Add a test pairing mismatched-timestep models. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
metatrain 2026.3 ships the experimental.flashmd_symplectic architecture, so the temporary measures for symplectic support are no longer needed: - Pin metatrain==2026.3 and remove the git-override step in the tests CI. - Drop the "install a compatible metatrain" fallbacks in get_pretrained; export failures now surface the real error directly. The newer ASE pulled in by the bump deprecates MaxwellBoltzmannDistribution, so migrate the README and tests to thermalize_momenta (ASE >= 3.29) and filter the NumPy 2.5 shape-setting deprecation raised inside ASE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The 2026.3.1 release includes the symplectic requested_inputs fix (metatrain PR #1174), so test_symplectic.py now passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a self-contained Al example demonstrating the full workflow for the symplectic integrator introduced in #43:
Also includes
tests/test_example_al.py, which runs the example end-to-end in CI using EMT and tiny models.This PR should be merged after #43.