Automatic
differentiation (AD) is a powerful tool that allows calculating
derivatives of implemented algorithms with respect to all of their
parameters up to machine precision, without the need to explicitly
add any additional functions. Thus, AD has great potential in quantum
chemistry, where gradients are omnipresent but also difficult to obtain,
and researchers typically spend a considerable amount of time finding
suitable analytical forms when implementing derivatives. Here, we
demonstrate that AD can be used to compute gradients with respect
to any parameter throughout a complete quantum chemistry method. We
present DiffiQult, a Hartree–Fock implementation,
entirely differentiated with the use of AD tools. DiffiQult is a software package written in plain Python with minimal deviation
from standard code which illustrates the capability of AD to save
human effort and time in implementations of exact gradients in quantum
chemistry. We leverage the obtained gradients to optimize the parameters
of one-particle basis sets in the context of the floating Gaussian
framework.