News / Technology
GraphicalXC: the Graphical applied to
the exchange-correlation functional
We applied the Graphical, the deep learning technology behind the kinetic energy functional of Advance/OF-DFT, to the exchange-correlation (XC) functional of density functional theory. A small model trained on only 3,079 reactions taken from public data gave smaller errors than the widely used hybrid functional B3LYP-D3(BJ) on part of the GMTKN55 benchmark.
GraphicalXC is not a feature of Advance/OF-DFT. It is a research and development case that shows the scope of the Graphical, the deep learning technology used in Advance/OF-DFT. The calculations in this article are a simplified demonstration of the Graphical, not an attempt to complete a high-accuracy XC functional.
Summary
- We developed GraphicalXC, which applies the Graphical, AdvanceSoft's own deep learning model, to the exchange-correlation (XC) functional of density functional theory (DFT).
- The model has about 43,000 parameters and was trained on only 3,079 reactions taken from public high-accuracy data. It contains no exact exchange.
- On all nine evaluated subsets of the GMTKN55 benchmark, its errors are equal to or smaller than those of the hybrid functional B3LYP-D3(BJ). The partial WTMAD-2 over five subsets (293 reactions) is 5.35 kcal/mol, compared with 6.59 kcal/mol for B3LYP-D3(BJ).
Background
Density functional theory is the most widely used method for electronic structure calculations of materials and molecules [1]. Its accuracy is set by the quality of an approximation, the exchange-correlation (XC) functional. More accurate functionals tend to be more expensive: hybrid functionals such as B3LYP [2], for example, require the calculation of exact exchange.
In recent years, XC functionals have been built by machine learning, using the results of high-accuracy quantum chemistry as training data. DM21 [3] and Skala [4] are representative examples. DM21 uses 2,235 high-accuracy data points including 1,074 fractional-charge and fractional-spin systems, and Skala about 400,000 including about 120,000 atomization energies; Skala reports an accuracy on par with hybrid functionals.
The Graphical and its scope
The Graphical is a deep learning model that takes a field distributed in space as input and outputs a functional of that field. Local quantities at each point are mapped by a neural network to a field of features, and the surrounding field is convolved with a spherically symmetric kernel called the adjacency correlation. Repeating this yields features that incorporate nonlocal interactions. Whereas graph neural networks propagate information between atoms as nodes, the Graphical treats every point in space as a node and propagates information on the field itself (see Technology).
In Advance/OF-DFT, the Graphical represents the kinetic energy functional of the electron density. The Graphical is a general framework that does not depend on a particular physical quantity: it can represent any functional of the electron density, not only the kinetic energy. The XC energy is, like the kinetic energy, a functional of the electron density, and it governs the accuracy of DFT. To demonstrate the scope of the Graphical, we therefore applied it to the XC functional. Advance/OF-DFT performs the convolution in reciprocal space on the FFT mesh of a periodic system; GraphicalXC replaces it with a real-space sum on the integration grid of a molecule.
Model
Energy expression
The XC energy is obtained by multiplying three base energy densities by enhancement factors at each grid point and integrating.
Here are the quadrature weights, and , and are the energy densities of LDA exchange, PW92 correlation [5] and VV10 nonlocal correlation [6, 7]. The three factors , and are outputs of the neural network and are all 1 before training. Dispersion is learned through , so no empirical dispersion correction is added. Exact exchange is not included either.
Descriptors and mask function
The input is the logarithm of the same seven-component descriptor as in Skala [4]: the electron density of each spin , the square of its gradient, the kinetic energy density , and the square of the gradient of the total density.
A convolution lets features leak into regions without electrons. To prevent this, the complement of the cavity function of VASPsol [8] is used as a mask.
We use Bohr−3 and . The mask is applied to the input, to the features after each convolution and to the update of every layer.
Convolution with the adjacency correlation
A multilayer perceptron (MLP) maps the descriptors to a four-channel field , and a spherically symmetric kernel then gathers the surrounding field. The kernel is a Gaussian of width averaged over a spherical shell of radius .
The convolution is a real-space sum over grid points.
Here is a damping factor that weakens nonlocal information in high-density regions [4]. The kernel is truncated at a finite distance, and the grid points are grouped into spatial clusters so that only nearby pairs are computed. This double loop is implemented in C++ (OpenMP, AVX2) and on GPUs (CUDA).
The convolved features and the field at the point itself are concatenated into a vector , which an MLP uses to update the field residually. After two such steps, a readout MLP gives the three enhancement factors.
GraphicalXC is a standalone module written in PyTorch and is connected to the quantum chemistry code PySCF [9] for self-consistent field (SCF) calculations. The functional derivative is obtained by automatic differentiation and passed to PySCF in the form it uses for the integrals with atomic orbitals.
Training
Training data
Only public high-accuracy data were used: atomization energies from MSR-ACC/TAE25 [10], noncovalent interactions from DES370K [11] and reaction barriers from RDB7 [12]. Systems that overlap with the benchmark used for validation were removed from DES370K and RDB7. The electron densities were fixed to those of B3LYP/def2-TZVP calculations.
| Type | Source | Training | Validation |
|---|---|---|---|
| Atomization energies | MSR-ACC/TAE25 | 1,600 | 104 |
| Noncovalent interactions | DES370K | 679 | 99 |
| Reaction barriers | RDB7 | 800 | 96 |
| Total | 3,079 | 299 |
The 1,600 atomization energies are only 1/75 of the about 120,000 used by Skala [4], and the whole training set is less than 1/100 of Skala's about 400,000. Training was limited to pretraining on fixed electron densities; no fine-tuning with SCF calculations was performed.
Loss function
Following Skala [4], the following loss on reaction energies is used.
This loss constrains only the energies and leaves the functional derivative undetermined. To make the reference density a stationary point of the model, the estimated energy lowering of one SCF step is added as a penalty.
Here are the Fock matrix elements of the model between occupied orbitals and virtual orbitals of B3LYP. The parameter derivative of this term is a second derivative, which we implemented for both the convolution and the VV10 sum. With this term added at a weight of 0.03, the difference between evaluations on fixed densities and self-consistent evaluations became small.
Optimization
The weight matrices of the hidden layers are updated with Muon [13] and all other parameters with Adam. The hyperparameters were chosen from about 110 trials on small data. The final model has two convolutions, three kernels and 42,635 parameters.
Results
Evaluation conditions
The trained model was evaluated on part of the GMTKN55 benchmark [14]. GMTKN55 is a database of 1,505 relative energies in 55 subsets covering main-group thermochemistry, kinetics and noncovalent interactions, and is widely used for comprehensive evaluations of XC functionals.
To keep the cost down, nine of the 55 subsets were used. W4-11, G2RC, BH76, BH76RC and S22 were chosen to cover atomization energies, reaction energies, reaction barriers and noncovalent interactions; all of them are also used in earlier work on machine-learned functionals [3, 4]. The other four (BHPERI, BHDIV10, PX13, WCPT18) were added to check the effect of the barrier training data. These subsets are independent of the training data.
All calculations are SCF calculations with the def2-TZVP basis set, restricted for closed-shell and unrestricted for open-shell systems. The reference B3LYP-D3(BJ) [2, 15] was computed with the same program under the same conditions. The error measures are the mean absolute error (MAE) of each subset and the weighted error WTMAD-2 defined for GMTKN55. In this article, the value computed from the five subsets (293 reactions) only is called the "partial WTMAD-2"; it cannot be compared directly with the full WTMAD-2 over all 55 subsets.
Comparison with B3LYP-D3(BJ)
On all nine evaluated subsets, GraphicalXC gives errors equal to or smaller than those of B3LYP-D3(BJ). The partial WTMAD-2 is 5.35 kcal/mol, below the 6.59 kcal/mol of B3LYP-D3(BJ). The SCF calculations converged for all systems.
| Subset | Contents | Reactions | B3LYP-D3(BJ) | GraphicalXC |
|---|---|---|---|---|
| W4-11 | Total atomization energies of small molecules | 140 | 3.22 | 2.28 |
| G2RC | Reaction energies of small molecules | 25 | 4.14 | 2.09 |
| BH76 | Barriers of hydrogen transfer, heavy-atom transfer, nucleophilic substitution, etc. | 76 | 6.00 | 5.31 |
| BH76RC | Reaction energies of the BH76 reactions | 30 | 2.77 | 1.94 |
| S22 | Interaction energies of hydrogen-bonded and dispersion-bound dimers | 22 | 0.70 | 0.36 |
| Partial WTMAD-2 | From the five subsets above | 293 | 6.59 | 5.35 |
| BHPERI | Barriers of pericyclic reactions | 26 | 1.33 | 1.31 |
| BHDIV10 | Barriers of 10 diverse reactions | 10 | 3.24 | 1.76 |
| PX13 | Proton-exchange barriers in water, ammonia and hydrogen fluoride clusters | 13 | 5.96 | 2.59 |
| WCPT18 | Barriers of water-assisted proton transfer | 18 | 3.32 | 1.30 |
Mean absolute error of each subset (kcal/mol). SCF calculations with the def2-TZVP basis set.
Effect of the training data
The kind of training data was directly reflected in the accuracy. A model trained on atomization energies only had an S22 error above 4 kcal/mol, which fell below 0.4 kcal/mol when noncovalent data were added. Adding barrier data more than halved the barrier errors of PX13, WCPT18 and others, and improved the partial WTMAD-2 from 7.18 to 5.35 kcal/mol.
On BH76, however, the barriers are still underestimated by about 5 kcal/mol on average. Most BH76 transition states are radicals with unpaired electrons, whereas our barrier data are limited to reactions of closed-shell molecules. Adding open-shell transition states to the training data is a task for the future.
Summary and outlook
We developed GraphicalXC by applying the Graphical, AdvanceSoft's own deep learning model, to the XC functional. In a simplified demonstration trained on only 3,079 reactions taken from public data, it gave smaller errors than the hybrid functional B3LYP-D3(BJ), which includes exact exchange, on part of GMTKN55. B3LYP has been the de facto standard for molecular calculations for more than 30 years. That a small model without exact exchange outperforms it with so little training data shows that the Graphical represents functionals of the electron density efficiently.
The validation is, however, limited to part of GMTKN55 and the def2-TZVP basis set, and the accuracy does not yet reach chemical accuracy. Next steps are more training data including open-shell transition states, fine-tuning with SCF calculations, evaluation on the whole benchmark, and atomic forces, aiming at a functional that reaches chemical accuracy at the cost of a calculation without exact exchange.
For inquiries about this technology, please contact us.
Download
A two-page technical note (PDF) summarizes this article. A Japanese edition is also available.
GraphicalXC technical note (PDF, 2 pages)
References
- W. Kohn and L. J. Sham, Phys. Rev. 140, A1133 (1965)
- A. D. Becke, J. Chem. Phys. 98, 5648 (1993)
- J. Kirkpatrick et al., Science 374, 1385 (2021)
- G. Luise et al., arXiv:2506.14665 (2025)
- J. P. Perdew and Y. Wang, Phys. Rev. B 45, 13244 (1992)
- O. A. Vydrov and T. Van Voorhis, J. Chem. Phys. 133, 244103 (2010)
- R. Sabatini, T. Gorni, and S. de Gironcoli, Phys. Rev. B 87, 041108(R) (2013)
- K. Mathew et al., J. Chem. Phys. 140, 084106 (2014)
- Q. Sun et al., J. Chem. Phys. 153, 024109 (2020)
- S. Ehlert et al., arXiv:2506.14492 (2025)
- A. G. Donchev et al., Sci. Data 8, 55 (2021)
- K. A. Spiekermann, L. Pattanaik, and W. H. Green, Sci. Data 9, 417 (2022)
- K. Jordan, Muon optimizer, https://github.com/KellerJordan/Muon
- L. Goerigk et al., Phys. Chem. Chem. Phys. 19, 32184 (2017)
- S. Grimme, S. Ehrlich, and L. Goerigk, J. Comput. Chem. 32, 1456 (2011)