Open collinlewin opened 2 weeks ago
Hi @collinlewin!
Could you post the full script you are using to create and compare the derivatives? Something that I could run directly to reproduce your problem?
Note that when calculating numerical derivatives, you have to be careful with floating point precision: too small $\Delta x$ will cause problems, and also you should always use double-precision numbers.
Hello, I would greatly appreciate any feedback on why Dscribe seems to be inconsistent with my own finite difference test for computing the derivatives, equal to an non-negligible error on the order of 10^-2. Specifically, I was interested in comparing the derivative of the atoms with respect to the x direction of the first atom (atom index 0, hence why centers = [0]) produced by DScribe vs. my own finite difference test. I perturbed the position of atom 0 along the x direction by +1e-8 and -1e-8 as two new structure files, and then compute the difference between them to estimate the derivative. That is:
$$ \frac{\partial p}{\partial x_0} = \frac{p(x_0 + \Delta x) - p(x_0 - \Delta x)}{2h} $$
The result of this test differs from the results of fitsnap by roughly 1e-2, using the derivatives function please. Perhaps I am missing something? Thank you very much.
if relevant, here are my SOAP parameters, which shouldn't matter?