Skip to content

Fix neighbor lists and DSF/D3 stress for zero-volume cells - #623

Merged
CompRhys merged 3 commits into
mainfrom
fix/549-zero-volume-cells
Oct 27, 2026
Merged

CompRhys merged 3 commits into
mainfrom
fix/549-zero-volume-cells

Conversation

@abhijeetgangan

@abhijeetgangan abhijeetgangan commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of #549.

  • Neighbor lists fill zero-length cell vectors on non-periodic axes the way ASE's complete_cell does, so graphene(), nanotube() and similar cells keep their periodic-image pairs in every backend.
  • DSFCoulombModel and D3DispersionModel return zero stress instead of NaN for zero-volume cells such as molecules, matching Ewald and MACE.
  • Remove torch.jit.script from the package (normalize_inputs, math.torch_divmod).

Checklist

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format.
  • Run ruff on your code.
  • Tests have been added for any new functionality or bug fixes.

@abhijeetgangan

Copy link
Copy Markdown
Collaborator Author

Mattersim test failure fixed in #622

@lil-lon lil-lon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Returning zero stress for zero-volume cells makes sense. This departs from ASE, whose get_stress() raises for such cells, so it'd be good to document the convention.
Applying the same zero fill to pair potentials and Ewald / PME would make the behavior consistent.
I left the follow-ups in #549.

@CompRhys
CompRhys merged commit 5e93175 into main Oct 27, 2026
64 checks passed
@CompRhys
CompRhys deleted the fix/549-zero-volume-cells branch October 27, 2026 15:26
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.

3 participants