-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOAP polynomial RBF error #133
Comments
Hi @pujaltes! Thank you for your note and keen observations on the code. I had a quick look on the subject, and found a probable explanation. The equation by Bartok et. al. in the original paper has a small problem in that the integrals over the radial component do not contain the spherical coordinate Jacobian (r^2). This is mentioned in the errata that the authors have posted, and you can find it here. After you include it, you should find that our implementation is correct (when checking orthogonality, you also have to include the r^2 in the integration). I'm not sure about the figures in our paper: I will have to take a deeper look at whether we have plotted them with the incorrect data. |
Here is an example that demonstrates that the radial basis functions are orthonormal (within numerical accuracy) when integrated under spherical coordinates: import numpy as np
import matplotlib.pyplot as plt
from dscribe.descriptors import SOAP
n_max = 4
soap = SOAP(
species=["H"],
r_cut=3,
n_max=n_max,
l_max=2,
rbf="polynomial",
)
r, g = soap.get_basis_poly(3, n_max)
integrals = np.empty((n_max, n_max))
for i in range(n_max):
for j in range(n_max):
# note the r^2 coming from the Jacobian of the spherical coordinates
integrals[i, j] = np.trapz(g[i, :]*g[j, :]*r**2, r)
print(integrals) This means that the plot in our original paper is done using the incorrect basis set, but our current implementation should be correct. |
@lauri-codes thank you very much for taking a look at this and for your detailed response! This makes a lot of sense, thanks for clearing it up. |
Hello,
Thanks for providing this amazing resource!
I believe I found an error in the construction of the polynomial RBF for the soap descriptor when trying to replicate figure 5b (below) in the original Dscribe paper:
The following code should provide the exact same result as in the paper:
However, this instead results in the following RBFs which are not orthonormal:
The error seems to originate from the
get_basis_poly
method, specifically in the construction of the Lowdwin orthogonalization matrix S:dscribe/dscribe/descriptors/soap.py
Lines 1076 to 1085 in 8379685
The calculation used for
S
in the for loop does not follow the original equations from BartókModifying the above section of code to the following produces the correct/expected result:
I would be happy to correct this and open a pull request if the error is confirmed.
The text was updated successfully, but these errors were encountered: