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.
Hi,
this PR contains an environment provider based on the neighborpair implementation of TorchANI. I was talking about it in issue #96. It can be used either on a CPU or GPU and provides a speedup compared to the ASE implementation (tested on a TitanV with a 352 atom structure):
The switch to numpy after the calculation of the indices does not seem to bother the speed, as I also tried a Torch version of this.
A downside is that it requires a fairly new Pytorch version that contains new functions (for example cartesian products). I used Pytorch 1.1.0.dev20190411 for this one. So one would need to add that to the requirements to pass the tests. I didn't do it because I wasn't sure how you want to handle that.
I also added the TorchEnvironmentProvider to the existing tests for the environments and made sure it passes them. However, the returned neighborlists are sorted in contrast to the ASE ones, so that might trigger some asserts when testing with larger structures. I am also not an expert with neighborlists, so I'm not sure whether the different Torch and ASE implementations cause any problems. But as it is right now, it might be a nice option to have.
Hope it helps and if there is anything else let me know