Density grandient and its laplacian

I am currently using the Psi4 Python API for my phd project and I am guessing if it would be possible to obtain the gradient and the laplacian generated by the density from a dft calculation, i.e using the VBase class. Eventually these quantities have to be exported on the numerical integration grid. Any suggestion is welcome and really appreciated. Thank you for your time.

This tutorial might help:

The extension to derivatives is somewhat straightforward if you know the derivative formulas. I can try to dig up the papers if you need.

Edit here is the C++ code which may help as well:

If you get a python version working we would love a submission!

Thank you for your reply. If it is possible for you the reference to the papers would be useful.
kind regards.


Dear Daniel
which is eventually you preferred approach for a submission ? a fork and a pull ?

@lstorchi Right. We have more detailed instructions here if you need them. Let us know if anything is unclear.

Dear @jmisiewicz thanks, we will read carefully the instruction

Dear @dgasmith if you could share with us the reference would be great. Thanks


Eq 36/37 here: N.C. Handy, D.J. Tozer, G.J. Laming, C.W. Murray, and R.D. Amos, Israel Journal of Chemistry 33 , 331 (1993).

Eq 6/7/8 here: 1 B.G. Johnson and M.J. Fisch, J. Chem. Phys. 100 , 7429 (1994).

The present them in different ways, but are the same equations. Some are easier to read than others. I think Eq7 in the Fisch paper is particularly clear. It would be good to study the equations and the C++ code in conjunction.