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.

Technology

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).
Errors of B3LYP-D3(BJ) and GraphicalXC on part of GMTKN55
Comparison with B3LYP-D3(BJ) on part of GMTKN55. (a) Partial WTMAD-2 over 5 subsets and 293 reactions. (b) Mean absolute error per subset. Self-consistent calculations with the def2-TZVP basis set.

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.

Exc= ∑gwg [ exFx+ ecFc+ evvFvv ]rg

Here wg are the quadrature weights, and ex, ec and evv are the energy densities of LDA exchange, PW92 correlation [5] and VV10 nonlocal correlation [6, 7]. The three factors Fx, Fc and Fvv are outputs of the neural network and are all 1 before training. Dispersion is learned through Fvv, so no empirical dispersion correction is added. Exact exchange is not included either.

Electron density ρσ, ∇ρσ, τσ Descriptors (log of 7 components) and mask M(ρ) Projector (MLP): field h (4 channels) Convolution with the adjacency correlation 3 spherical kernels, truncated at about 4.7 Bohr Interaction MLP: residual update of the field Readout (MLP) Fx, Fc, Fvv → Exc × 2
Flow of a GraphicalXC calculation. The two purple steps (convolution and residual update) are repeated twice.

Descriptors and mask function

The input is the logarithm of the same seven-component descriptor q 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.

x=ln(|q|+ϵ), ϵ=10−5

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.

M(ρ)=12 erfc(− ln(ρ/ρc)2σ )

We use ρc=10−4 Bohr−3 and σ=0.6. 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 h, and a spherically symmetric kernel then gathers the surrounding field. The kernel is a Gaussian of width κi averaged over a spherical shell of radius Ri.

ai(d)= fie−(d−Ri)2/2κi2 (2π)3/2κi3 ⋅ 1−e−2s2s , s=dRiκi2

The convolution is a real-space sum over grid points.

yic(r)= MD ∑g′ wg′ ai(|r−rg′|) hc(rg′)

Here D=exp(−ρ) 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 z, which an MLP uses to update the field residually. After two such steps, a readout MLP gives the three enhancement factors.

(Fx,Fc,Fvv) =2sigmoid(MLP(z))

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.

TypeSourceTrainingValidation
Atomization energiesMSR-ACC/TAE251,600104
Noncovalent interactionsDES370K67999
Reaction barriersRDB780096
Total3,079299

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 ΔE is used.

LE= (ΔE−ΔEref)2 10−4Eh+|ΔEref|

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.

ΔESCF= ∑σ∑ia Fia2εa−εi

Here Fia are the Fock matrix elements of the model between occupied orbitals i and virtual orbitals a 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.

SubsetContentsReactionsB3LYP-D3(BJ)GraphicalXC
W4-11Total atomization energies of small molecules1403.222.28
G2RCReaction energies of small molecules254.142.09
BH76Barriers of hydrogen transfer, heavy-atom transfer, nucleophilic substitution, etc.766.005.31
BH76RCReaction energies of the BH76 reactions302.771.94
S22Interaction energies of hydrogen-bonded and dispersion-bound dimers220.700.36
Partial WTMAD-2From the five subsets above2936.595.35
BHPERIBarriers of pericyclic reactions261.331.31
BHDIV10Barriers of 10 diverse reactions103.241.76
PX13Proton-exchange barriers in water, ammonia and hydrogen fluoride clusters135.962.59
WCPT18Barriers of water-assisted proton transfer183.321.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

  1. W. Kohn and L. J. Sham, Phys. Rev. 140, A1133 (1965)
  2. A. D. Becke, J. Chem. Phys. 98, 5648 (1993)
  3. J. Kirkpatrick et al., Science 374, 1385 (2021)
  4. G. Luise et al., arXiv:2506.14665 (2025)
  5. J. P. Perdew and Y. Wang, Phys. Rev. B 45, 13244 (1992)
  6. O. A. Vydrov and T. Van Voorhis, J. Chem. Phys. 133, 244103 (2010)
  7. R. Sabatini, T. Gorni, and S. de Gironcoli, Phys. Rev. B 87, 041108(R) (2013)
  8. K. Mathew et al., J. Chem. Phys. 140, 084106 (2014)
  9. Q. Sun et al., J. Chem. Phys. 153, 024109 (2020)
  10. S. Ehlert et al., arXiv:2506.14492 (2025)
  11. A. G. Donchev et al., Sci. Data 8, 55 (2021)
  12. K. A. Spiekermann, L. Pattanaik, and W. H. Green, Sci. Data 9, 417 (2022)
  13. K. Jordan, Muon optimizer, https://github.com/KellerJordan/Muon
  14. L. Goerigk et al., Phys. Chem. Chem. Phys. 19, 32184 (2017)
  15. S. Grimme, S. Ehrlich, and L. Goerigk, J. Comput. Chem. 32, 1456 (2011)