Automatic Differentiation in Quantum Chemistry with Applications to Fully Variational Hartree–Fock

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.

[1]  K. Ruud,et al.  The ab initio calculation of molecular electric, magnetic and geometric properties. , 2011, Physical chemistry chemical physics : PCCP.

[2]  Sebastian Walter,et al.  Structured higher-order algorithmic differentiation in the forward and reverse mode with application in optimum experimental design , 2012 .

[3]  Michael J. Frisch,et al.  Transformation between Cartesian and pure spherical harmonic Gaussians , 1995 .

[4]  Björn O. Roos,et al.  Second-order perturbation theory with a complete active space self-consistent field reference function , 1992 .

[5]  Johannes Grotendorst,et al.  Modern methods and algorithms of quantum chemistry , 2000 .

[6]  Trygve Helgaker,et al.  Molecular Electronic-Structure Theory: Helgaker/Molecular Electronic-Structure Theory , 2000 .

[7]  Toru Shiozaki,et al.  Communication: automatic code generation enables nuclear gradient computations for fully internally contracted multireference theory. , 2015, The Journal of chemical physics.

[8]  S. Sorella,et al.  Structural Optimization by Quantum Monte Carlo: Investigating the Low-Lying Excited States of Ethylene. , 2012, Journal of chemical theory and computation.

[9]  Antje Winkel,et al.  Modern Quantum Chemistry , 2016 .

[10]  Hanspeter Huber Geometry optimization inab initio SCF calculations , 1980 .

[11]  John Salvatier,et al.  Theano: A Python framework for fast computation of mathematical expressions , 2016, ArXiv.

[12]  Uwe Naumann,et al.  Combinatorial Scientific Computing , 2012 .

[13]  Stephen J. Wright,et al.  Numerical Optimization , 2018, Fundamental Statistical Inference.

[14]  Henry F. Schaefer,et al.  Analytic Derivative Methods in Molecular Electronic Structure Theory: A New Dimension to Quantum Chemistry and its Applications to Spectroscopy , 2011 .

[15]  Marc Henrard,et al.  Calibration in Finance: Very Fast Greeks Through Algorithmic Differentiation and Implicit Function , 2013, ICCS.

[16]  Alán Aspuru-Guzik,et al.  A variational eigenvalue solver on a photonic quantum processor , 2013, Nature Communications.

[17]  Keiji Morokuma,et al.  Energy gradient in a multi-configurational SCF formalism and its application to geometry optimization of trimethylene diradicals , 1979 .

[18]  Trygve Helgaker,et al.  Molecular wave functions and properties calculated using floating Gaussian orbitals , 1988 .

[19]  Trygve Helgaker,et al.  Gaussian basis sets for high-quality ab initio calculations , 1988 .

[20]  Susanne Hertz,et al.  Advances in Quantum Chemistry , 2019, Quantum Systems in Physics, Chemistry and Biology - Theory, Interpretation, and Results.

[21]  Enrico Clementi,et al.  Complete multi-configuration self-consistent field theory , 1967 .

[22]  Christian Bischof,et al.  Adifor 2.0: automatic differentiation of Fortran 77 programs , 1996 .

[23]  Andrew W. Cross,et al.  Demonstration of a quantum error detection code using a square lattice of four superconducting qubits , 2015, Nature Communications.

[24]  R. Barends,et al.  Superconducting quantum circuits at the surface code threshold for fault tolerance , 2014, Nature.

[25]  Toru Shiozaki,et al.  Nuclear Energy Gradients for Internally Contracted Complete Active Space Second-Order Perturbation Theory: Multistate Extensions. , 2016, Journal of chemical theory and computation.

[26]  W. Marsden I and J , 2012 .

[27]  B. M. Fulk MATH , 1992 .

[28]  Kenneth Ruud,et al.  Arbitrary-Order Density Functional Response Theory from Automatic Differentiation. , 2010, Journal of chemical theory and computation.

[29]  So Hirata,et al.  Combined coupled-cluster and many-body perturbation theories. , 2004, The Journal of chemical physics.

[30]  Moshe Shoham,et al.  Application of hyper-dual numbers to rigid bodies equations of motion , 2017 .

[31]  Lutz Lehmann,et al.  Algorithmic differentiation in Python with AlgoPy , 2013, J. Comput. Sci..

[32]  P. Joergensen,et al.  Second Quantization-based Methods in Quantum Chemistry , 1981 .

[33]  H. Jirari,et al.  Optimal control approach to dynamical suppression of decoherence of a qubit , 2009 .

[34]  René Lamour,et al.  On evaluating higher-order derivatives of the QR decomposition of tall matrices with full column rank in forward and reverse mode algorithmic differentiation , 2012, Optim. Methods Softw..

[35]  Yoshua Bengio,et al.  Practical Recommendations for Gradient-Based Training of Deep Architectures , 2012, Neural Networks: Tricks of the Trade.

[36]  S. Poletto,et al.  Detecting bit-flip errors in a logical qubit using stabilizer measurements , 2014, Nature Communications.

[37]  N. Wu,et al.  Optimal state transfer of a single dissipative two-level system , 2016, 1604.07891.

[38]  Shigeru Obara,et al.  Efficient recursive computation of molecular integrals over Cartesian Gaussian functions , 1986 .

[39]  Christian H. Bischof,et al.  Using automatic differentiation to compute derivatives for a quantum-chemical computer program , 2005, Future Gener. Comput. Syst..

[40]  Trygve Helgaker,et al.  Multi‐electron integrals , 2012 .

[41]  S. Hirata Tensor Contraction Engine: Abstraction and Automated Parallel Implementation of Configuration-Interaction, Coupled-Cluster, and Many-Body Perturbation Theories , 2003 .

[42]  Martin Head-Gordon,et al.  Efficient computation of two-electron - repulsion integrals and their nth-order derivatives using contracted Gaussian basis sets , 1990 .

[43]  Hanspeter Huber,et al.  Geometry optimization in AB initio calculations. Floating orbital geometry optimization applying the hellmann-feyman force , 1979 .

[44]  R. Barends,et al.  Digital quantum simulation of fermionic models with a superconducting circuit , 2015, Nature Communications.

[45]  Masanori Tachikawa,et al.  Simultaneous optimization of GTF exponents and their centers with fully variational treatment of Hartree-Fock molecular orbital calculation , 1999 .

[46]  Kyle E. Niemeyer,et al.  pyJac: Analytical Jacobian generator for chemical kinetics , 2016, Comput. Phys. Commun..

[47]  G. Verhaegen,et al.  Bond functions for ab initio calculations on polyatomic molecules. Molecules containing C, N, O and H , 1981 .

[48]  Peter R. Taylor,et al.  Molecular properties from perturbation theory: a unified treatment of energy derivatives , 1985 .

[49]  Kerstin Andersson,et al.  Second-order perturbation theory with a CASSCF reference function , 1990 .

[50]  Masanori Tachikawa,et al.  Analytical optimization of orbital exponents in Gaussian-type functions for molecular systems based on MCSCF and MP2 levels of fully variational molecular orbital method , 2011 .

[51]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[52]  J. Gambetta,et al.  Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets , 2017, Nature.

[53]  Christian Bischof,et al.  Computing derivatives of computer programs , 2000 .

[54]  Barbara Kirchner,et al.  Unrestricted Floating Orbitals for the Investigation of Open Shell Systems , 2016 .

[55]  Miles Lubin,et al.  Forward-Mode Automatic Differentiation in Julia , 2016, ArXiv.

[56]  Barbara Kirchner,et al.  Floating orbital molecular dynamics simulations. , 2014, Physical chemistry chemical physics : PCCP.

[57]  Christian H. Bischof,et al.  ADIC: an extensible automatic differentiation tool for ANSI‐C , 1997, Softw. Pract. Exp..

[58]  P. Coveney,et al.  Scalable Quantum Simulation of Molecular Energies , 2015, 1512.06860.

[59]  D. Schuster,et al.  Speedup for quantum optimal control from automatic differentiation based on graphics processing units , 2016, 1612.04929.

[60]  Trygve Helgaker,et al.  Analytical Calculation of Geometrical Derivatives in Molecular Electronic Structure Theory , 1988 .

[61]  Barak A. Pearlmutter,et al.  Automatic differentiation in machine learning: a survey , 2015, J. Mach. Learn. Res..

[62]  Laurent Hascoët,et al.  The Tapenade automatic differentiation tool: Principles, model, and specification , 2013, TOMS.

[63]  A. C. Hurley The computation of floating functions and their use in force constant calculations , 1988 .

[64]  Andreas Griewank,et al.  Evaluating derivatives - principles and techniques of algorithmic differentiation, Second Edition , 2000, Frontiers in applied mathematics.

[65]  Masanori Tachikawa,et al.  Simultaneous optimization of exponents, centers of Gaussian-type basis functions, and geometry with full-configuration interaction wave function: Application to the ground and excited states of hydrogen molecule , 2000 .

[66]  A. A. Frost Floating Spherical Gaussian Orbital Model of Molecular Structure. I. Computational Procedure. LiH as an Example , 1967 .

[67]  Aaas News,et al.  Book Reviews , 1893, Buffalo Medical and Surgical Journal.

[68]  Frank Jensen,et al.  Atomic orbital basis sets , 2013 .

[69]  Ryan P. Adams,et al.  Gradient-based Hyperparameter Optimization through Reversible Learning , 2015, ICML.

[70]  Richard B. Nelson,et al.  Simplified calculation of eigenvector derivatives , 1976 .

[71]  M. Giles Collected Matrix Derivative Results for Forward and Reverse Mode Algorithmic Differentiation , 2008 .

[72]  L. Capriotti,et al.  Algorithmic differentiation and the calculation of forces by quantum Monte Carlo. , 2010, The Journal of chemical physics.

[73]  P ? ? ? ? ? ? ? % ? ? ? ? , 1991 .

[74]  Jack Dongarra,et al.  LAPACK: a portable linear algebra library for high-performance computers , 1990, SC.

[75]  G. Verhaegen,et al.  Bond functions for AB initio calculations. MCSCF results for CH, NH, OH and FH , 1982 .

[76]  Andrea Walther,et al.  Getting Started with ADOL-C , 2009, Combinatorial Scientific Computing.

[77]  Jürgen Schmidhuber,et al.  Deep learning in neural networks: An overview , 2014, Neural Networks.