Luthaf / rascaline

Computing representations for atomistic machine learning
https://luthaf.fr/rascaline/
BSD 3-Clause "New" or "Revised" License
44 stars 13 forks source link

Center contributions and/or coefficients for (l,m)=(0,0) disagree with librascal and pyLODE #90

Closed kvhuguenin closed 2 years ago

kvhuguenin commented 2 years ago

While experimenting with the notebook https://github.com/ceriottm/lode/blob/main/notebooks/librascal_comparison.ipynb that compares the spherical expansion coefficients between librascal, rascaline and pyLODE with each other and also analytical results, I discovered two issues that both seem to be related to the way the center atom contribution is treated in the implementation:

  1. If the input frame only contains a single atom, rascaline does not compute any coefficients (the array containing the values has size 0, for all spherical_harmonics_l including 0), while in reality, even the Gaussian density of the center atom should contribute to the coefficients unless the center_atom_weight is set to zero

  2. The coefficients between librascal, rascaline and pyLODE agree for all values of (l,m) (in the case of librascal: up to a global factor) for generic molecules except for (l,m)=(0,0). For this case, pyLODE and librascal both agree, while rascaline is an outlier. Since all other coefficients agree and (l,m)=(0,0) is the only angular channel for which the center atom has a nonzero contribution, I would assume that this is related to the implementation of the center atom contribution as well. (Reference: last cell in the notebook above)

Luthaf commented 2 years ago

Should be fixed by #91!