Conversation
Exact energy conservation only fixes the total energy, so a model that systematically mispredicts a subset of degrees of freedom can keep some atoms hotter or colder than others without it showing up as an energy-conservation violation. The monitor tracks per-species (and custom-group) kinetic temperature as an ASE dynamics observer so this kind of bias is easy to catch. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Clarify the impact of global rescaling on temperature distribution among atoms.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Removed redundant explanation about energy conservation and restructured the description of the EquipartitionMonitor.
Refactor comment for clarity and conciseness.
The logfile "step" column was actually a call counter (len(self.history)), which only matches the true dynamics step when attached with interval=1. With interval=10 (the documented example), a "step 3" entry was really step 30, silently corrupting any downstream time axis. EquipartitionMonitor now takes the dynamics object itself instead of atoms, reading dyn.atoms for momenta and dyn.nsteps for the real step count, mirroring how ase.md.MDLogger accesses dyn. Also switch the logfile from append to write mode, since silently appending to a stale file from an earlier/unrelated run produced a malformed, doubly-headered log. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Removed redundant phrase about diagnostic availability for i-PI and LAMMPS users.
Custom groups added API surface (name-clash validation, extra constructor arg) for a use case (arbitrary spatial regions) that isn't core to the diagnostic; per-species grouping alone covers the main failure mode this monitor targets. Also document that "system" and the per-species entries use different degrees-of-freedom conventions (many MD codes subtract 3 DOF from the global temperature for the conserved center-of-mass motion, which can't be meaningfully attributed to an arbitrary subgroup), so users don't mistake the resulting small, systematic offset for a real equipartition violation. Co-Authored-By: Claude Sonnet 5 <[email protected]>
The previous wording cited LAMMPS/i-PI conventions, but this monitor only involves ASE. Reframe the note around ase.Atoms.constraints directly: with no constraints, "system" and per-species entries agree on the 3N convention; the mismatch only appears once you impose a constraint that removes degrees of freedom (e.g. FixCom), since that correction can't be meaningfully attributed to an arbitrary subgroup. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Remove redundant explanation about convention mismatch in equipartition.
Removed redundant explanation regarding convention mismatch in equipartition.
Added note about fluctuations in per-group temperatures and clarified degrees-of-freedom conventions.
Added note about fluctuations in instantaneous per-group temperatures for small cells.
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
EquipartitionMonitor, an ASE dynamics observer that reports instantaneous kinetic temperature for the whole system, and for one group per chemical speciesrescale_energy=True) only fixes the total energy by rescaling all momenta by a single global factor each step — it says nothing about how kinetic energy is distributed, so a model that systematically mispredicts a subset of degrees of freedom can leave some atoms hotter or colder than others without tripping any energy-conservation checkdocs/equipartition.mdexplaining the issue and how to use the monitor, and link to it from the README energy-conservation sectionVelocityVerletrunTest plan
pytest tests/test_equipartition.py -k "not attaches_as_a_dynamics_observer"passes locallytest_attaches_as_a_dynamics_observer(downloads a pretrained model) should be run in CI🤖 Generated with Claude Code