Fix related to performing AD on molecular integrals#22
Fix related to performing AD on molecular integrals#22tansongchen wants to merge 1 commit intoFermiQC:mainfrom
Conversation
|
Hi @tansongchen, I have played with this idea before. The main roadblock is introducing derivatives for the integrals. Since we are using an external As for the parts of the code assuming |
|
Hi @gustavojra , I agree that libcint is a bit hard to get differentiated, but I'm thinking about improving your ACSint performance and run Enzyme (or ForwardDiff) on it to synthesize efficient derivatives. I understand the math behind it (Hermite Gaussians etc.) and I have some experience on this kind of scalar code optimization on other projects. This isn't easy, but if we can get to a similar performance with hand-coded derivative, this will be a great demonstration of Julia language's differentiable programming capability. As a background, many other "differentiable" quantum chemistry frameworks (such as https://arxiv.org/abs/2207.13836 ) cannot do well on differentiating molecular integrals because they are highly scalar and mutating routines. With Julia and especially ForwardDiff / Enzyme, we could do better. Right now, I have been able to AD the ACSint to compute force with both ForwardDiff and Enzyme, the efficiency is not perfect but promising. https://github.com/tansongchen/GaussianBasis.jl/blob/bench/bench/adtest.jl |
Hi there,
I'm trying to make automatic differentiation work on molecular integrals, as a part of attempts to implement differentiable Hartree-Fock. Most of the code base is compatible with AD, but I did find some places where
Float64is assumed which cause ForwardDiff to fail.In addition, the multithreading seems to be not compatible with AD. I'm currently figuring out why it isn't, and once I understand how to do AD under multithreading, I will add it back.