mir-group / allegro

Allegro is an open-source code for building highly scalable and accurate equivariant deep learning interatomic potentials
https://www.nature.com/articles/s41467-023-36329-y
MIT License
327 stars 46 forks source link

Allow calculation of well-separated dimers #84

Closed tjgiese closed 4 months ago

tjgiese commented 5 months ago

When an atom is isolated, there are no edges, and the array dimensions can be 0. This causes ambiguity problems when trying to use -1 as an argument to reshape. The proposed modifications catch a few cases where the 0-sized dimensions prevent calculation of well-separated dimers. For more info, see #82 In the context of that discussion, these changes let the following command work, whereas the original version did not: plot_dimers.py --r-min=5.1 --r-max=5.2 --n-samples 2 si-deployed.pth

To calculate the energy of isolated atoms (as opposed to well-separated dimers), one needs to make modifications to nequip. Those modifications can be found here: mir-group/nequip#426

This pull request is merge into the develop branch, whereas the closed request #83 was a merge into main.