Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap atom coordinates in ase.Atoms preprocessing #783

Merged
merged 4 commits into from
Aug 7, 2024
Merged

Conversation

kyonofx
Copy link
Collaborator

@kyonofx kyonofx commented Jul 26, 2024

In our PBC graph construction algorithm, when a pair of atoms become very far away from each other in terms of unwrapped coordinates (which usually happens in long simulations), they may lose track of each other because only a finite number of supercells are considered during the graph construction process. To resolve this, we wrap the atom coordinates before feeding them into the graph construction algorithm and the neural network model when converting ase.Atoms.

Two test cases under tests/core/preprocessing/test_atoms_to_graphs.py that directly check the output from AtomsToGraphs will need to be updated.

@kyonofx kyonofx marked this pull request as ready for review July 30, 2024 19:53
@kyonofx
Copy link
Collaborator Author

kyonofx commented Jul 30, 2024

@mshuaibii @lbluque Would be great if you could take a look :)

@mshuaibii
Copy link
Collaborator

mshuaibii commented Aug 5, 2024

Looks good. Let's update the tests to get them to pass. Rather than replacing the source of truth we can actually change this line -

np.testing.assert_allclose(act_positions, positions)
Rather than verifying the positions are identical, we should be able to compute a distance accounting for pbc to verify they are correct -

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
src/fairchem/core/preprocessing/atoms_to_graphs.py 88.42% <100.00%> (+0.81%) ⬆️

@mshuaibii
Copy link
Collaborator

LGTM!

@mshuaibii mshuaibii enabled auto-merge August 7, 2024 02:09
@mshuaibii mshuaibii added this pull request to the merge queue Aug 7, 2024
Merged via the queue into main with commit bc1307f Aug 7, 2024
7 checks passed
@mshuaibii mshuaibii deleted the aseatoms-pbc branch August 7, 2024 04:10
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