Repository navigation
Fix stress normalization for left-handed cells - #818
Merged
stefaanhessmann merged 1 commit intoNov 9, 2026
Merged
stefaanhessmann merged 1 commit into
stefaanhessmann merged 1 commit into
Conversation
stefaanhessmann
approved these changes
Nov 9, 2026
Collaborator
|
Hi @davrens101, |
stefaanhessmann
merged commit Nov 9, 2026
69d26f3
into
atomistic-machine-learning:master
4 checks passed
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.
Problem
Both
ForcesandResponsedivide stress by the signed cell volume. Swapping two lattice basis vectors leaves the physical lattice and model energy unchanged, but reverses the reported stress.Change
Normalize by the absolute physical volume in both response paths. The energy, force, API and checkpoint formats are unchanged. Existing docstrings clarify the volume convention.
Verification
python -m pytest tests/atomistic -q --tb=short: 15 passed, with four existing ASE/NumPy deprecation warnings.9.86e-5to2.43e-14in both response APIs.Verified on Windows CPU, Python 3.12.10 / Torch 2.14.1. No GPU, full-repository, or scientific-accuracy benchmark claim. Stress-dependent results for left-handed cells intentionally change and should be reevaluated.
AI-assisted implementation and numerical validation. The submitting user confirmed reviewing the changes before submission; this is not maintainer approval.