lab-cosmo / librascal

A scalable and versatile library to generate representations for atomic-scale learning
https://lab-cosmo.github.io/librascal/
GNU Lesser General Public License v2.1
80 stars 17 forks source link

Feat/cpp gradient interface enhancements #394

Closed curiosity54 closed 2 years ago

curiosity54 commented 3 years ago

Implemented "get number of coefficients" for spherical expansion and invariants on the C++ side with Alex.

Tasks before review:

agoscinski commented 2 years ago

Because the CRTP made the error messages hard to understand and I thought I just try this implementation, since we anyway don't use any other stacking for gradients (except the upcoming LODE stuff). In terms of development time this was faster than now figuring out the within structure manager solution.

The problem was that I used a const function, which works in the adaptors and structure manager collection but not in the structure, since we are not changing any member variable. But in structure manager one needs to create a non const Iterator passing this to it which changes the this object, so it cannot be const.