-
Notifications
You must be signed in to change notification settings - Fork 15
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
Problems with first and second derivatives o splines of density #10
Comments
I don't see anything wrong with the simple (non-log) spline. I think it may be that we should spline the derivatives directly rather than just taking derivatives of the original spline. By the way, I think the proper use of I'm not sure what else we can do here. |
After computing derivative values at the available points, I think that (re)splining the derivative and storing them is a good idea. In some cases we could do that directly from reference data, but I'm not sure it is worth it.... |
We could do it for the databases based on Hartree-Fock numeric and using Slater basis. The problem are the other two that use Gaussian basis sets. For those we have the issue with the need to spherically average the density property. So we ended only storing the densities (spherically averaged in the case where Gaussian basis are used), and getting the derivatives from the splines. |
I was thinking something simpler: spline the density and compute the first derivative at the initial points. Then make a new spline of the derivative from that numeric data. This is slightly different from just taking the derivative of the spline, as it accomodates higher-order differentiation and (more importantly) means that one doesn't compute, but merely accesses, derivatives from their corresponding spline. Does this make sense? |
I am sorry if this is a dumb question (this is new to me). If I understand it correctly the problem is for the database using gaussian functions. Yesterday @gabrielasd and I were playing with the following idea:
Can this approach be used? |
@PaulWAyers I tried this but I didn't found it to work either. |
@PaulWAyers @msricher @marco-2023 Like @msricher commented above, there doesn't seem to be any problem with the function The bigger problem is the 2nd derivative, all tests for this fail for all datasets. On the other hand, @marco-2023 figured a way to get the spherically averaged gradient and laplacian for the datasets that rely on gaussian basis sets; with this we would not need to get them through the splines of the density anymore. In the API we would still build the interpolation functions, but it would be directly from the stored arrays. |
There's likely nothing we can do about the close-to-the-nucleus problem, the function can't be modelled by a cubic there. I think it's okay to test from a certain radius outwards. We should just check, when evaluating quantities that involve integrating over 3D space (esp. for a promolecule), that we recover sensible results. |
I'll close this issue since after PR #41 we no longer evaluate the derivatives of the density from its cubic splines. |
Description
A common issue across the compiled datasets with density properties (gaussian, numeric, slater) is that the tests for the 1st and 2nd derivatives of the density fail:
AtomDB/atomdb/test/test_gaussian.py
Line 78 in 85031c5
AtomDB/atomdb/test/test_numeric.py
Line 143 in 85031c5
AtomDB/atomdb/test/test_wfn_slater.py
Line 128 in 85031c5
The wrong derivatives are computed through the interpolated splines of the density (cubic splines). E.g. evaluation of 1st derivative of density from the Slater dataset tests:
AtomDB/atomdb/test/test_wfn_slater.py
Lines 137 to 138 in 85031c5
rather than done analytically.
The reference data being used to compare against comes from the raw data (usually the 1st derivatives were stored), for e.g in the case of the Slater dataset:
https://github.com/theochem/AtomDB/blob/85031c5fc08b7c920a093c84ab4f6458b5d48825/atomdb/test/test_wfn_slater.py#L139-142
or by using Numpy gradient.
One problem may be that the
log
keyword argument should be set to True, although I haven't seen before that it fixes the problem. It also may be that the values that make the tests crash are derivatives of the density close to the atomic center.Tasks & Progress
The text was updated successfully, but these errors were encountered: