Skip to content

fix(neighbors): zero dummy cell for non-periodic systems in alchemiops naive NL#576

Merged
CompRhys merged 1 commit into
TorchSim:mainfrom
lil-lon:fix/alchemiops-naive-nonperiodic-cell
Jun 15, 2026
Merged

fix(neighbors): zero dummy cell for non-periodic systems in alchemiops naive NL#576
CompRhys merged 1 commit into
TorchSim:mainfrom
lil-lon:fix/alchemiops-naive-nonperiodic-cell

Conversation

@lil-lon

@lil-lon lil-lon commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Related to #575.

Fix

The alchemiops naive backend returns a wrong neighbor list for non-periodic systems carrying a non-zero (dummy) cell, because the kernel wraps on every axis ignoring pbc.

Test

Extended test_neighbor_list_implementations with a molecule_dummy_cell axis: non-periodic molecules carrying a dummy cell must still match the ASE reference across all backends.
Confirmed that newly added tests fail without this patch.

Note

Slabs / partial pbc (e.g. [T, T, F]) are not covered and still need the upstream fix (NVIDIA/nvalchemi-toolkit-ops#104).
So, even after this PR is merged, we cannot close the above issue, but this PR would resolve the major path where molecule is called with dummy cell.

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.

@CompRhys CompRhys merged commit 3753209 into TorchSim:main Jun 15, 2026
57 of 64 checks passed
@CompRhys

Copy link
Copy Markdown
Member

Thanks! when the upstream issue is resolved will you make another PR for the slab case?

@lil-lon

lil-lon commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Thank you too for the review and merge!

when the upstream issue is resolved will you make another PR for the slab case?

Yes. Once the upstream issue is fixed, the kernel will handle both the slab case and the non-periodic molecule case (the case I patched in this PR) natively.
I plan to open a follow-up PR to bump the nvalchemi-toolkit-ops dependency and add unit tests covering slab-like partial-pbc systems. (Also, it's possible to drop this patch after the fix if you want.)

This PR only patched the molecule case since it was easy to fix; the slab fix is more complex, so I thought it was better to wait for the upstream fix.

@lil-lon lil-lon deleted the fix/alchemiops-naive-nonperiodic-cell branch June 15, 2026 14:37
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.

2 participants