Feat/nls share - #63
Open
sayeg84 wants to merge 21 commits into
Open
Conversation
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.
PR Checklist
Describe your changes here:
Currently the implementations of the repulsions with cutoffs are naive, in the sense that they compute all the distances and then filter the ones inside the cutoff. It was originally designed like this for consistency with the previous approach, but this is clearly a bad strategy.
This modification allows for sharing the neighbor list between SchNet and the cutoffs by modifying the AtomicData object when it passes through the forward pass and saving the neighborlist in a field called
neighbor_list["from_mpnn"], which then is cached by the repulsion and thrown away afterwards.It should be noted that, given that the repulsion typically excludes some beads that are already restrained by bonds and angles, the neighbor list sharing needs to account for this. Due to this, the neighbor list associated to the repulsion needs now an
index_mapping_excludedentry of shape (2,k) with "k" the number of excluded pairs, which will be excluded from the repulsion. This PR also provides a scriptsrc/mlcg/scripts/mlcg_add_exclusion_list.pyto incorporate thisEmpirically, this has increased speed of simulations by a significant factor.
One modification that remains to be done: to generalize this to the other MLIPs