Repository navigation
Preserve nonperiodic coordinates in graph conversion - #182
Open
Davis Rens (davrens101) wants to merge 1 commit into
Open
Davis Rens (davrens101) wants to merge 1 commit into
Davis Rens (davrens101) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree [company=] |
|
Davis Rens (@davrens101) the command you issued was incorrect. Please try again. Examples are: and |
This branch has not been deployed
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
Preserve nonperiodic coordinates when
GraphConverterprepares mixed-PBC structures. Replace unconditional fractional-coordinate modulo with ASE'satoms.wrap(), matching the existing batch converter's treatment of periodic axes.For a 10 Å cubic cell with
pbc=[True, True, False], Si atoms at z = 1, 1.5 and 11.2 Å, and a 2 Å cutoff, the old converter moves the last atom to z = 1.2 Å. This creates six directed edges and six three-body entries instead of the physically expected two directed edges and no triplets. The same error occurs for a wire withpbc=[True, False, False].The legacy converter remains the default calculator path (
batch_converter=False,direct_graph=False). This therefore changes actual inference inputs, not just a deprecated helper in isolation.Changes
atoms.wrap()to respect the per-axis PBC mask.Verification
Base:
e59b088ee621cafe0df1b399a27299f3e9092ede.python -m pytest -q tests/datasets --disable-warnings: 11 passed after the fix.MatterSimCalculatorwith a seeded, tiny initialized M3Gnet (no checkpoint download): the remote atom's spurious force disappears; the genuinely nearby geometry retains interactions. This is an execution smoke check, not a pretrained-model accuracy or performance claim.Local runtime: Windows, Python 3.12.10, PyTorch 2.15.0+cpu, torch-geometric 2.8.1, NumPy 2.5.4. Optional workflow dependencies were not all installed; no full-project-suite, CUDA, macOS or hosted-CI pass is claimed.
ASE may choose periodically equivalent representations near cell boundaries; bitwise identity of coordinates or image offsets is not promised. The reproduction uses a nonsingular cell and does not establish support for singular slab/wire cells.
AI assistance was used to investigate and draft this change; the regression and real graph/calculator execution were run locally. No independent human review is claimed.