Abstract
We introduce DeePKS-kit, an open-source software package for developing machine learning based energy and density functional models. DeePKS-kit is interfaced with PyTorch, an open-source machine learning library, and PySCF, an ab initio computational chemistry program that provides simple and customized tools for developing quantum chemistry codes. It supports the DeePHF and DeePKS methods. In addition to explaining the details in the methodology and the software, we also provide an example of developing a chemically accurate model for water clusters.
Introduction
In computational chemistry, a significant gap exists between high-accuracy "gold standard" methods like CCSD(T) and computationally efficient methods like Density Functional Theory (DFT). While CCSD(T) provides the precision necessary for predicting real-world chemical behavior, its $O(N^7)$ scaling makes it impractical for large systems. Conversely, DFT scales at $O(N^3)$ but often lacks "chemical accuracy"—the precision required to reliably model complex chemical processes.
DeePKS-kit addresses this challenge by providing a flexible, open-source framework that integrates machine learning (ML) corrections directly into the self-consistent field (SCF) iterations of quantum chemistry. This ensures that both energy and electronic density remain physically consistent, bridging the gap between speed and accuracy.
Methods and Software Architecture
DeePKS-kit implements two primary frameworks: DeePHF, a post-processing approach where a neural network predicts energy corrections based on baseline orbitals, and DeePKS, a variational approach where ML corrections are integrated into the Hamiltonian itself.
The software leverages PyTorch for model training and PySCF for the underlying quantum chemical simulations. A key technical innovation is the use of local density matrices projected onto atomic basis functions as descriptors. By using the eigenvalues of these matrices, the model maintains physical requirements like rotational invariance. The package also features an automated iterative command that refines the model by generating new data from self-consistent solutions until the model is robust.
Case Study: Water Clusters
The package was demonstrated using water clusters, with training labels generated at the CCSD(T)/cc-pVDZ level. The model was trained on small clusters (monomers to trimers) and validated on tetramers. To test generalizability, the model was evaluated on water hexamers—larger systems than those encountered during training.
Key Results and Insights
The DeePKS model successfully achieved chemical accuracy, with errors falling below the 1 mH (milli-Hartree) threshold. It consistently outperformed widely used conventional functionals like SCAN0 in predicting binding energies.
A significant result was the model's performance on complex chemical processes like proton transfer. As shown in the figure above, the model accurately mapped the energy barrier for simultaneous proton transfer in a water hexamer ring. Despite never seeing bond-broken configurations during training, the DeePKS model's predictions remained within the accuracy range of the CCSD(T) reference, demonstrating the power of using electronic density as a physics-informed descriptor.
Conclusion and Future Work
DeePKS-kit provides a robust foundation for developing physics-informed ML models that do not treat molecules as simple black boxes but rather respect the underlying electronic structure. While currently limited to restricted calculations and non-periodic systems, future updates will include support for unrestricted SCF (for radicals) and periodic boundary conditions (for solid-state materials). The ultimate goal is to foster a community-driven effort to develop universal, accurate, and efficient functional models for the broader chemical community.
Summary updated