cersonsky-lab / AniSOAP

Library for computing anisotropy extension to SOAP descriptors
Apache License 2.0
8 stars 1 forks source link

Bug in orthonormalization code does not handle multiple species properly. #17

Closed arthur-lin1027 closed 11 months ago

arthur-lin1027 commented 1 year ago

If there are multiple species, then the radial channels within a tensor block will repeat for each species, like this:

Labels(
    n  neighbor_species
    0         1
    1         1
    2         1
    3         1
    0         2
    1         2
    2         2
    3         2
)

We are indexing into our orthonormalization matrix using these n, but since there are repeats, it creates a slice of our original GTO overlap matrix that thus also repeats. This resulting matrix will not be positive semidefinite and therefore cannot be orthonormalized, so it's caught by our positive semidefinite checkers.

To fix this, we iterate through each neighbor species and orthonormalize the individual sub blocks.