This PR is intended to resolve #40 (and all derivatives).
Edit: I had some down time and implemented the PT, documented it, and added unit tests.
I sketched out the Derivative PT, but it's not implemented. The idea is that API looks like:
Tensor (args..., x);
where args... are the arguments to forward to underlying property type and x is the object you are taking the derivative with respect to. So for a nuclear gradient of an energy the call looks like:
auto [x] = mod.run_as<Derivative<AOEnergy, Molecule>>(aos, mol, mol);
(the molecule mol needs to be passed twice to signal it's the argument we're taking the derivative with respect to)
I also now realize NuclearGradient should be NuclearDerivative.
For convenience we should write some typedefs for common derivatives.
FWIW, Hessians are something like Derivative<Derivative<AOEnergy, Molecule>, Molecule> (or if the inner one is called NuclearGradient it becomes the more manageable Derivative<NuclearGradient, Molecule>).
This PR is intended to resolve #40 (and all derivatives).
Edit: I had some down time and implemented the PT, documented it, and added unit tests.
I sketched out the
Derivative
PT, but it's not implemented. The idea is that API looks like:where
args...
are the arguments to forward to underlying property type andx
is the object you are taking the derivative with respect to. So for a nuclear gradient of an energy the call looks like:(the molecule
mol
needs to be passed twice to signal it's the argument we're taking the derivative with respect to)I also now realize
NuclearGradient
should beNuclearDerivative
.For convenience we should write some typedefs for common derivatives.
FWIW, Hessians are something like
Derivative<Derivative<AOEnergy, Molecule>, Molecule>
(or if the inner one is calledNuclearGradient
it becomes the more manageableDerivative<NuclearGradient, Molecule>
).