pyscfad icon indicating copy to clipboard operation
pyscfad copied to clipboard

Conversion function between pyscf and pyscfad

Open sunqm opened this issue 11 months ago • 1 comments

The conversion interface to gpu4pyscf repo is mostly completed. I'm considering to create a similar conversion function for pyscfad. What is your opinion?

sunqm avatar Mar 12 '24 17:03 sunqm

Currently, the most common practice of AD is something like

mol = gto.Mole()
def fn(mol):
    return RHF(mol).kernel()
g = jax.grad(fn)(mol)

Only the perturbations are defined outside the function being differentiated, and fn in principle should be pure. I guess simply creating a conversion method within Mole may be good enough. And inside the function, we can do something like mol.RHF().kernel(), although I'm not 100% sure if this would work. I'm also adding a Pytorch backend. Maybe we can wait until that is done.

fishjojo avatar Mar 12 '24 21:03 fishjojo