Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2011.11690

Automatic differentiation for coupled cluster methods

Fabijan Pavošević, Sharon Hammes‐Schiffer

Published Nov 23, 2020• 5 citations
arXivHTMLPDF

Abstract

Automatic differentiation is a tool for numerically calculating derivatives of a given function up to machine precision. This tool is useful for quantum chemistry methods, which require the calculation of gradients either for the minimization of the energy with respect to wave function parameters or for the calculation of molecular responses to external perturbations. Herein, we apply automatic differentiation to the coupled cluster with doubles method, in which the wave function parameters are obtained by minimizing the energy Lagrangian. The benefit of this approach is that the l amplitudes can be obtained without implementation of the usual L-equations, thereby reducing the coding effort by approximately a factor of two. We also show that the excitation energies at the coupled cluster level can be ontained with only a few lines of the code using automatic differentiation. We further apply automatic differentiation to the multicomponent coupled cluster with doubles method, which treats more than one type of particle, such as electrons and protons, quantum mechanically. This approach will be especially useful for prototyping, debugging, and testing multicomponent quantum chemistry methods because reference and benchmark data are limited in this emerging field.

DOI
10.48550/arxiv.2011.11690

Related papers

Automatic differentiation in quantum chemistry

Tamayo Mendoza, Teresa

Automatic differentiation (AD) is a well-established tool that allows us to compute exact derivatives of implemented functions with respect to all their parameters. It does so without requiring any extra coding or knowledge of the analytical derivatives. Derivatives of quantum chemistry algorithms are generally very hard to obtain and often cumbersome to implement. AD shows great potential to solve this problem and to facilitate the implementation of gradients in the context of electronic structure methods. In this dissertation, we have applied AD in a broader context and demonstrate that AD tools can compute arbitrary gradients of quantum chemistry methods with respect to any input parameter and any intermediate function. To this end, we have developed the open-source code DiffiQult, a fully differentiable Hartree-Fock (HF) software package. DiffiQult is a python package that uses AD tools using the external libraries JAX and Algopy. As a proof of concept, DiffiQult is an example of an end-to-end differentiable software package of a quantum chemistry algorithm based solely on AD tools. This application has helped us understand the challenges of AD in quantum chemistry. We outline the details, benefits, and caveats of AD for the HF algorithm in this work. We have chosen HF as a starting point since it contains all the functions included in correlated electronic structure methods. In this way, it opens the door for the development of AD for more accurate algorithms. As an application, we describe DiffiQult within the framework of the fully variational HF method, where we use a gradient-based optimization method to compute system-specific basis functions. As a result, the wavefunction can capture more molecular features, and we obtain a set of basis functions for correlated methods in quantum and classical algorithms. This proves that these functions improve variationally energy while keeping a compact representation in correlated methods by interfacing with the quantum chemistry library PySCF, and with Tequila, a platform for rapid development of quantum algorithms. First, we present optimization results of minimal basis sets with respect to all parameters of the molecules H2O, CH4, NH3, HF. Later we include optimization of the potential energy surface of two isomerization mechanisms of diazene and hydrogens chains. Here, we use a minimal optimized basis set to compute FCI when possible with PySCF and VQE energies of hydrogen chains with Tequila. We obtain similar results compared to a bigger basis set with considerably fewer configurations. Also, we show how this approach improves the estimation of the thermodynamic limit in the hydrogen chain at the HF level. Finally, we apply this approach to the optimization of all atomic orbitals of benzene and compute electronic correlations restricting the active space to the 6 π orbitals of benzene using the UpCCGSD ansatz implemented in Tequila.

•Jan 1, 2021•0 citations

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

Teresa Tamayo-Mendoza, Christoph Kreisbeck, Roland H. Lindh +1 more

Abstract 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.

arXiv:1711.08127•ACS Central Science•May 9, 2018•95 citations

DQC: A Python program package for differentiable quantum chemistry

Muhammad Kasim, Susi Lehtola, Sam M. Vinko

Automatic differentiation represents a paradigm shift in scientific programming, where evaluating both functions and their derivatives is required for most applications. By removing the need to explicitly derive expressions for gradients, development times can be shortened and calculations can be simplified. For these reasons, automatic differentiation has fueled the rapid growth of a variety of sophisticated machine learning techniques over the past decade, but is now also increasingly showing its value to support ab initio simulations of quantum systems and enhance computational quantum chemistry. Here, we present an open-source differentiable quantum chemistry simulation code and explore applications facilitated by automatic differentiation: (1) calculating molecular perturbation properties, (2) reoptimizing a basis set for hydrocarbons, (3) checking the stability of self-consistent field wave functions, and (4) predicting molecular properties via alchemical perturbations.

arXiv:2110.11678•The Journal of Chemical Physics•Feb 22, 2022•52 citations

An Efficient Implementation of Second Quantization-Based Many-Body Methods for Electrons and its Application to Coupled-Cluster with Arbitrary Excitation Level

Anna Engels-Putzka

This thesis deals with selected aspects of a new implementation of many-body methods which can be formulated in the framework of second quantization, in particular the coupled-cluster (CC) method with arbitrary excitation level. Coupled-cluster is one of the most successful and widely used quantum chemical methods for accurate calculations on small to medium-sized molecules. Since it employs a nonlinear parametrization of the wave function, its implementation is rather difficult, in particular if higher (i.e. more than double) excitations are to be included. The latter is necessary to obtain highly accurate results and also as a prerequisite for the generalization to multi-reference cases. The implementation described here has a twofold focus. One is on generality and flexibility regarding the method to be implemented, the other is on efficiency. To achieve flexibility, it is useful to have a machinery which automatically derives working equations for a given method. We realize this by applying techniques of second quantization. This work treats in particular the last step of this procedure, namely the simplification of the resulting equations by the identification of equivalent terms. The algorithm used here is based on the interpretation of algebraic terms as graphs. The derived CC equations then have to be solved iteratively. The efficiency of the program is mainly determined by the evaluation of the occurring expressions, which has to be done in each iteration step. The evaluation is split up in a sequence of tensor contractions. Their generic implementation is complicated by the particular structure of the involved tensors. We reduce each contraction to a sequence of matrix multiplications, which requires a previous data rearranging. But since matrix multiplication is the most efficient operation on modern computers, this additional effort pays off. Preliminary tests show that our program is at least as fast as the most efficient general coupled-cluster implementation so far, and the relation is expected to improve for calculations with larger basis sets where the matrix multiplication becomes the time-determining step. Finally, we give an outlook to possible further developments. In particular, the preparation of the equations before the actual evaluation (factorization) offers much potential for optimizations which we do not exploit at the moment, in contrast to the program with which we compare, which employs at least a partial optimization at this point.

•Jan 1, 2009•0 citations

Automated Code Engine for Tensor HyperContraction: Derivation, Optimization and Implementation of Rank-reduced Coupled Cluster Theories

Zhao Yao

The ultimate goal of electronic structure theory is solving the electronic Schr¨odinger Equation. However, even accurate approximations of solving Schr¨odinger Equation, such as high order coupled cluster theories, require computational efforts that are too demanding to be applied on large chemical systems. This thesis tackles the problem of curse of dimensionality: how to reduce the time complexity of high-accuracy coupled cluster methods in order to accelerate computations of molecular energy. On one hand, we believe that low-rank approximation (i.e. Tensor HyperContraction) of high-order tensors appearing in coupled cluster theory is a promising way to achieve rank-reduced coupled cluster theory. On the other hand, we think that the work of deriving, optimizing and implementing low-rank approximated coupled cluster theory is both tedious and repetitious, and shall be performed by an automatic code engine other than chemists. In this thesis, we introduce our chemistry equation compiler, Autom: a code engine that is designed for automatically deriving, optimizing and implementing low-rank approximated coupled cluster theories. With Autom, the development of electronic theories is greatly simplified. Autom can easily generate runnable codes in minutes for tensor-algebra based chemistry equations with customized low-rank approximation rules; conventionally, such procedure may take an expert weeks or even months to manually program. This thesis roughly consists of two parts. In the first part, we aim to cover the lowrank approximation techniques for high-accuracy coupled cluster theories, emphasizing on two new factorization techniques we developed especially for several coupled cluster theories including triple contributions. In the second part, we demonstrate the algorithms of our automatic code engine. We also summarize recent advances of domain specific compilers in Machine Learning community and discuss future directions for compute graph optimization. We believe that this new software infrastructure holds great promise for future chemistry package designs.

•Jan 1, 2021•0 citations

An Alternative Algebraic Framework for the Simplification of Coupled Cluster Type Expectation Values

Daniel Pape

The Coupled-Cluster (CC) method is one of the most popular and efficient correlation methods in quantum chemistry. \nEspecially the CCSD(T) approximation, which includes single and double excitations by means of the application of the cluster operator \nto a reference determinant and triple excitations via a perturbative treatment, has become a standard tool \nin quantum chemical applications. However, the method is restricted to relatively small system sizes due to its unfavourable scaling (N^7, where N is the number of basis functions applied). \nFor the full treatment of triple excitations the scaling advances to N^8 and every further excitation level increases the exponent by two. \n \nThe goal of this work is to reduce the calculation time for closed shell systems at least by a factor growing with the excitation level for arbitrary truncation levels. \nThis is done by restricting the spatial parts of the spin orbitals and thus treat pairs of spin orbitals on the same footing. The restrictions can be easily constructed \nfor the CCSD model by spin integration. \nThe derivation of the restrictions arising in higher excited case will be done employing \nthe spatial orbital excitation operators E. \n \nIn the first part of this work an algorithm is derived that is capable of the derivation of the energy and amplitude equations for arbitrary excitation levels. In the second part \nan implementation of this algorithm is presented.

•Nov 12, 2013•0 citations
Automatic differentiation is a tool for numerically calculating derivatives of a given function up to machine precision. This tool is useful for quantum chemistry methods, which require the calculation of gradients either for the minimization of the energy with respect to wave function parameters or for the calculation of molecular responses to external perturbations. Herein, we apply automatic differentiation to the coupled cluster with doubles method, in which the wave function parameters are obtained by minimizing the energy Lagrangian. The benefit of this approach is that the l amplitudes can be obtained without implementation of the usual L-equations, thereby reducing the coding effort by approximately a factor of two. We also show that the excitation energies at the coupled cluster level can be ontained with only a few lines of the code using automatic differentiation. We further apply automatic differentiation to the multicomponent coupled cluster with doubles method, which treats more than one type of particle, such as electrons and protons, quantum mechanically. This approach will be especially useful for prototyping, debugging, and testing multicomponent quantum chemistry methods because reference and benchmark data are limited in this emerging field.
Automatic differentiation (AD) is a well-established tool that allows us to compute exact derivatives of implemented functions with respect to all their parameters. It does so without requiring any extra coding or knowledge of the analytical derivatives. Derivatives of quantum chemistry algorithms are generally very hard to obtain and often cumbersome to implement. AD shows great potential to solve this problem and to facilitate the implementation of gradients in the context of electronic structure methods. In this dissertation, we have applied AD in a broader context and demonstrate that AD tools can compute arbitrary gradients of quantum chemistry methods with respect to any input parameter and any intermediate function. To this end, we have developed the open-source code DiffiQult, a fully differentiable Hartree-Fock (HF) software package. DiffiQult is a python package that uses AD tools using the external libraries JAX and Algopy. As a proof of concept, DiffiQult is an example of an end-to-end differentiable software package of a quantum chemistry algorithm based solely on AD tools. This application has helped us understand the challenges of AD in quantum chemistry. We outline the details, benefits, and caveats of AD for the HF algorithm in this work. We have chosen HF as a starting point since it contains all the functions included in correlated electronic structure methods. In this way, it opens the door for the development of AD for more accurate algorithms. As an application, we describe DiffiQult within the framework of the fully variational HF method, where we use a gradient-based optimization method to compute system-specific basis functions. As a result, the wavefunction can capture more molecular features, and we obtain a set of basis functions for correlated methods in quantum and classical algorithms. This proves that these functions improve variationally energy while keeping a compact representation in correlated methods by interfacing with the quantum chemistry library PySCF, and with Tequila, a platform for rapid development of quantum algorithms. First, we present optimization results of minimal basis sets with respect to all parameters of the molecules H2O, CH4, NH3, HF. Later we include optimization of the potential energy surface of two isomerization mechanisms of diazene and hydrogens chains. Here, we use a minimal optimized basis set to compute FCI when possible with PySCF and VQE energies of hydrogen chains with Tequila. We obtain similar results compared to a bigger basis set with considerably fewer configurations. Also, we show how this approach improves the estimation of the thermodynamic limit in the hydrogen chain at the HF level. Finally, we apply this approach to the optimization of all atomic orbitals of benzene and compute electronic correlations restricting the active space to the 6 π orbitals of benzene using the UpCCGSD ansatz implemented in Tequila.
Abstract 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.
Automatic differentiation represents a paradigm shift in scientific programming, where evaluating both functions and their derivatives is required for most applications. By removing the need to explicitly derive expressions for gradients, development times can be shortened and calculations can be simplified. For these reasons, automatic differentiation has fueled the rapid growth of a variety of sophisticated machine learning techniques over the past decade, but is now also increasingly showing its value to support ab initio simulations of quantum systems and enhance computational quantum chemistry. Here, we present an open-source differentiable quantum chemistry simulation code and explore applications facilitated by automatic differentiation: (1) calculating molecular perturbation properties, (2) reoptimizing a basis set for hydrocarbons, (3) checking the stability of self-consistent field wave functions, and (4) predicting molecular properties via alchemical perturbations.
This thesis deals with selected aspects of a new implementation of many-body methods which can be formulated in the framework of second quantization, in particular the coupled-cluster (CC) method with arbitrary excitation level. Coupled-cluster is one of the most successful and widely used quantum chemical methods for accurate calculations on small to medium-sized molecules. Since it employs a nonlinear parametrization of the wave function, its implementation is rather difficult, in particular if higher (i.e. more than double) excitations are to be included. The latter is necessary to obtain highly accurate results and also as a prerequisite for the generalization to multi-reference cases. The implementation described here has a twofold focus. One is on generality and flexibility regarding the method to be implemented, the other is on efficiency. To achieve flexibility, it is useful to have a machinery which automatically derives working equations for a given method. We realize this by applying techniques of second quantization. This work treats in particular the last step of this procedure, namely the simplification of the resulting equations by the identification of equivalent terms. The algorithm used here is based on the interpretation of algebraic terms as graphs. The derived CC equations then have to be solved iteratively. The efficiency of the program is mainly determined by the evaluation of the occurring expressions, which has to be done in each iteration step. The evaluation is split up in a sequence of tensor contractions. Their generic implementation is complicated by the particular structure of the involved tensors. We reduce each contraction to a sequence of matrix multiplications, which requires a previous data rearranging. But since matrix multiplication is the most efficient operation on modern computers, this additional effort pays off. Preliminary tests show that our program is at least as fast as the most efficient general coupled-cluster implementation so far, and the relation is expected to improve for calculations with larger basis sets where the matrix multiplication becomes the time-determining step. Finally, we give an outlook to possible further developments. In particular, the preparation of the equations before the actual evaluation (factorization) offers much potential for optimizations which we do not exploit at the moment, in contrast to the program with which we compare, which employs at least a partial optimization at this point.
The ultimate goal of electronic structure theory is solving the electronic Schr¨odinger Equation. However, even accurate approximations of solving Schr¨odinger Equation, such as high order coupled cluster theories, require computational efforts that are too demanding to be applied on large chemical systems. This thesis tackles the problem of curse of dimensionality: how to reduce the time complexity of high-accuracy coupled cluster methods in order to accelerate computations of molecular energy. On one hand, we believe that low-rank approximation (i.e. Tensor HyperContraction) of high-order tensors appearing in coupled cluster theory is a promising way to achieve rank-reduced coupled cluster theory. On the other hand, we think that the work of deriving, optimizing and implementing low-rank approximated coupled cluster theory is both tedious and repetitious, and shall be performed by an automatic code engine other than chemists. In this thesis, we introduce our chemistry equation compiler, Autom: a code engine that is designed for automatically deriving, optimizing and implementing low-rank approximated coupled cluster theories. With Autom, the development of electronic theories is greatly simplified. Autom can easily generate runnable codes in minutes for tensor-algebra based chemistry equations with customized low-rank approximation rules; conventionally, such procedure may take an expert weeks or even months to manually program. This thesis roughly consists of two parts. In the first part, we aim to cover the lowrank approximation techniques for high-accuracy coupled cluster theories, emphasizing on two new factorization techniques we developed especially for several coupled cluster theories including triple contributions. In the second part, we demonstrate the algorithms of our automatic code engine. We also summarize recent advances of domain specific compilers in Machine Learning community and discuss future directions for compute graph optimization. We believe that this new software infrastructure holds great promise for future chemistry package designs.
The Coupled-Cluster (CC) method is one of the most popular and efficient correlation methods in quantum chemistry. \nEspecially the CCSD(T) approximation, which includes single and double excitations by means of the application of the cluster operator \nto a reference determinant and triple excitations via a perturbative treatment, has become a standard tool \nin quantum chemical applications. However, the method is restricted to relatively small system sizes due to its unfavourable scaling (N^7, where N is the number of basis functions applied). \nFor the full treatment of triple excitations the scaling advances to N^8 and every further excitation level increases the exponent by two. \n \nThe goal of this work is to reduce the calculation time for closed shell systems at least by a factor growing with the excitation level for arbitrary truncation levels. \nThis is done by restricting the spatial parts of the spin orbitals and thus treat pairs of spin orbitals on the same footing. The restrictions can be easily constructed \nfor the CCSD model by spin integration. \nThe derivation of the restrictions arising in higher excited case will be done employing \nthe spatial orbital excitation operators E. \n \nIn the first part of this work an algorithm is derived that is capable of the derivation of the energy and amplitude equations for arbitrary excitation levels. In the second part \nan implementation of this algorithm is presented.