|
| 1 | +.. _nve_energy_conservation: |
| 2 | + |
| 3 | +NVE energy conservation |
| 4 | +======================= |
| 5 | + |
| 6 | +Purpose |
| 7 | +------- |
| 8 | + |
| 9 | +To assess how well a machine-learned interatomic potential (**MLIP**) conserves the total |
| 10 | +mechanical energy during microcanonical (**NVE**) molecular dynamics (**MD**). Energy |
| 11 | +conservation is a fundamental physical requirement: under **NVE** dynamics, with no |
| 12 | +thermostat exchanging energy with the environment, the total energy |
| 13 | +:math:`E(t) = \mathrm{PE}(t) + \mathrm{KE}(t)` should stay constant. A systematic drift |
| 14 | +indicates unphysical forces or an inconsistency between the model's energy and its |
| 15 | +gradient. |
| 16 | + |
| 17 | +Description |
| 18 | +----------- |
| 19 | + |
| 20 | +For each system in the dataset, the benchmark runs a short **NVE** (velocity-Verlet, no |
| 21 | +thermostat) **MD** simulation with the **MLIP**, with velocities initialized from a |
| 22 | +Maxwell-Boltzmann distribution at **300 K**, leveraging |
| 23 | +`jax-md <https://github.com/google/jax-md>`_ as integrated via the |
| 24 | +`mlip <https://github.com/instadeepai/mlip>`_ library. The potential and kinetic energies |
| 25 | +are recorded at regular snapshots, and the total-energy drift relative to the first frame, |
| 26 | +:math:`\Delta E(t) = E(t) - E(0)`, is fitted with a linear model. |
| 27 | + |
| 28 | +The **energy-conservation metric** is the magnitude of the fitted drift over the whole |
| 29 | +trajectory, normalized by the kinetic-energy fluctuation scale: |
| 30 | + |
| 31 | +.. math:: |
| 32 | +
|
| 33 | + r = \frac{\lvert \text{slope} \rvert \cdot T}{\sigma_{\mathrm{KE}}} |
| 34 | +
|
| 35 | +where :math:`T` is the trajectory duration and :math:`\sigma_{\mathrm{KE}}` is the |
| 36 | +standard deviation of the kinetic energy along the trajectory. This dimensionless ratio is |
| 37 | +mapped to a score in :math:`[0, 1]` via the standard soft threshold: a ratio at or below |
| 38 | +**1.0** scores **1.0**, and larger ratios decay exponentially. |
| 39 | + |
| 40 | +The threshold of **1.0** is set at the point where the systematic energy drift accumulated |
| 41 | +over the whole trajectory reaches the same magnitude as the natural kinetic-energy |
| 42 | +fluctuations: a ratio :math:`r \le 1` keeps the drift within the thermal noise floor, while |
| 43 | +:math:`r > 1` means the drift dominates over those fluctuations. This is a deliberately |
| 44 | +lenient threshold. Analogous energy-conservation tests for classical force fields typically |
| 45 | +use a far tighter ratio, on the order of **0.01**; the more permissive value here reflects |
| 46 | +a fundamental difference between the two. A classical force field is an analytic expression |
| 47 | +whose potential-energy surface is smooth by construction, whereas an **MLIP** is a highly |
| 48 | +parameterized model whose potential-energy surface is learned from finite training data. |
| 49 | +While the model is trained to reproduce the training data, it is not guaranteed to be |
| 50 | +smooth in between training points, as the interpolation between them can exhibit |
| 51 | +high-frequency roughness. This roughness manifests as steep, sudden gradients, which the |
| 52 | +MD integrator can struggle with. The resulting numerical error can accumulate and drive |
| 53 | +larger integration drift compared to a classical force field. The threshold of **1.0** is |
| 54 | +therefore chosen to be lenient enough to accommodate this behavior, while still being |
| 55 | +strict enough to flag models that are clearly unphysical. |
| 56 | + |
| 57 | +Dataset |
| 58 | +------- |
| 59 | + |
| 60 | +The dataset comprises four representative systems spanning vacuum, bulk liquid and solvated |
| 61 | +regimes: |
| 62 | + |
| 63 | + - Small molecule (HCNO) in vacuum |
| 64 | + - Bulk water (500 molecules) |
| 65 | + - Solvated peptide (Oxytocin) |
| 66 | + - Solvated peptide with counter-ions (Neurotensin) |
| 67 | + |
| 68 | +Systems whose elements the model cannot handle are skipped individually rather than |
| 69 | +skipping the whole benchmark. |
| 70 | + |
| 71 | +Interpretation |
| 72 | +-------------- |
| 73 | + |
| 74 | +A score of **1.0** indicates excellent energy conservation, i.e. the total-energy drift is |
| 75 | +small relative to the natural kinetic-energy fluctuations. A score approaching **0.0** |
| 76 | +indicates a strongly drifting, non-conservative trajectory. |
0 commit comments