Open Source Infrastructure for Differentiable Density Functional Theory

Advika Vidhyadhiraja, Arun Thiagarajan, Shang Zhu, Venkat Viswanathan, Bharath Ramsundar · DOI

Abstract

Learning exchange correlation functionals, used in quantum chemistry calculations, from data has become increasingly important in recent years, but training such a functional requires sophisticated software infrastructure. For this reason, we build open source infrastructure to train neural exchange correlation functionals. We aim to standardize the processing pipeline by adapting state-of-the-art techniques from work done by multiple groups. We have open sourced the model in the DeepChem library to provide a platform for additional research on differentiable quantum chemistry methods.

Introduction

Density Functional Theory (DFT) is a cornerstone of quantum chemistry, enabling the prediction of molecular and material properties by calculating electronic structures. The exchange-correlation (XC) functional is the critical component of DFT, accounting for complex electron-electron interactions. Historically, these functionals were manually crafted using physical intuition. However, as chemical systems grow in complexity, researchers are increasingly turning to Machine Learning (ML) to learn these functionals from data.

The primary obstacle to training neural XC functionals is the requirement for a fully differentiable pipeline. This allows for backpropagation through the iterative Self-Consistent Field (SCF) loop, a process known as "differentiable physics." Until now, the software infrastructure for such tasks has been fragmented and difficult for the broader community to access.

Methodology

We present XCModel, an implementation within the DeepChem library designed to provide a standardized infrastructure for training neural XC functionals. By "deepchemizing" the workflow, we make differentiable quantum chemistry accessible to a wider audience.

System architecture of the differentiable DFT training pipeline in DeepChem.

Key technical components include:

  • Hybrid Functional Approach: The model integrates a traditional functional (e.g., Local Density Approximation or LDA) with a neural network. This hybrid design ensures the model remains physically grounded while the neural network corrects for known deficiencies.
  • Differentiable Physics Stack: The infrastructure utilizes dqc and xitorch to enable gradient calculations through iterative solvers.
  • Modular Workflow: Integration with DeepChem allows for standardized data loading via DFTYamlLoader, alongside modular featurizers and trainers.

Data and Training

The model was trained using four primary data types: Atomization Energy (AE), Ionization Potential (IP), density profile regulations, and density matrix calculations. Ground truth values for energy metrics were obtained from NIST databases, while density data were generated using high-level CCSD calculations via the PySCF library.

Results and Discussion

A significant advantage of this infrastructure is the use of implicit gradient calculation (via xitorch), which permits training through iterative loops without the prohibitive memory costs of storing every intermediate step.

Performance comparison of the DeepChem implementation against standard LDA and original XCNN.

Our evaluation compared the DeepChem implementation (DC-XCNN-LDA-IP) against standard LDA and the original XCNN research code. On a test set of 16 hydrocarbons (AE 16 HC), standard LDA produced a Mean Absolute Error (MAE) of 48.7 kcal/mol. The DeepChem implementation reduced this error to 28.8 kcal/mol. While slightly behind the original research code (25.4 kcal/mol), it represents a major improvement over classical methods. Additionally, hydrogen dissociation tests confirmed that the model captures the correct physics of bond breaking, matching the trends of exact CCSD simulations.

Conclusion

This work transitions differentiable physics from bespoke research code to a standardized engineering tool within the DeepChem ecosystem. Future developments will include support for advanced functional classes like PBE and Meta-GGA, as well as the implementation of fractional constraints to further enhance physical fidelity. As the implementation matures and scales to GPU-based systems, it will provide a robust platform for the next generation of molecular modeling.

Summary updated

BibTeX
@misc{vidhyadhiraja2023open,
  author = {Advika Vidhyadhiraja and Arun Thiagarajan and Shang Zhu and Venkat Viswanathan and Bharath Ramsundar},
  title = {{Open Source Infrastructure for Differentiable Density Functional Theory}},
  year = {2023},
  eprint = {2309.15985},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.15985},
}
Figure