betaFeedback

WorksPhysics and Astronomy

Nonlocal Machine-Learned Exchange Functional for Molecules and Solids

Abstract

The design of better exchange-correlation functionals for Density Functional Theory (DFT) is a central challenge of modern electronic structure theory. However, current developments are limited by the mathematical form of the functional, with efficient semilocal functionals being inaccurate for many technologically important systems and the more accurate hybrid functionals being too expensive for large solid-state systems due to the use of the exact exchange operator. In this work, we use machine learning combined with exact physical constraints to design an exchange functional that is both orbital-dependent and nonlocal, but which can be evaluated at roughly the cost of semilocal functionals and is significantly faster than hybrid DFT in plane-wave codes. By training functionals with several different feature sets, we elucidate the roles of orbital-dependent and nonlocal features in learning the exchange energy and determine that both types of features provide vital and independently important information to the model. Having trained our new exchange functional with an expressive, nonlocal feature set, we substitute it into existing hybrid functionals to achieve hybrid-DFT accuracy on thermochemical benchmark sets and improve the accuracy of band gap predictions over semilocal DFT. To demonstrate the scalability of our approach as well as the practical benefits of improved band gap prediction, we compute charged defect transition levels in silicon using large supercells. Due to its transferability and computational efficiency for both molecular and extended systems, our model overcomes the cost-accuracy trade-off between semilocal and hybrid DFT, and our general approach provides a feasible path toward a universal exchange-correlation functional with post-hybrid DFT accuracy and semilocal DFT cost.

Introduction

One of the central challenges of density functional theory (DFT) research is to design accurate approximations to the exchange-correlation (XC) functional [1]. As the one unknown term in Kohn-Sham DFT [2], errors in the XC functional limit the predictive power of DFT for a wide variety of technological problems, including catalysis [3], battery materials [4], and semiconductor physics [5, 6]. Increasing the complexity of the XC functional can improve its accuracy, but often at drastically increased computational cost, which can be prohibitive for large condensed matter simulations. In this work, we use machine learning (ML) to overcome this cost-accuracy trade-off by training a functional that obeys exact physical constraints and is accurate, transferable across a broad range of chemistries, and scalable to hundreds of atoms.

The key cost-accuracy trade-off we address is that between semilocal and hybrid XC functionals. Semilocal functionals, which include the local density approximation (LDA), generalized gradient approximation (GGA), and meta-generalized gradient approximation (meta-GGA) [7], are computationally efficient but insufficiently accurate for many applications. For example, LDA and GGA functionals are incapable of correctly predicting band gaps due to their lack of derivative discontinuity [8, 9], and they are of limited accuracy for many molecular systems [1, 10]. Meta-GGAs introduce derivative discontinuities into the XC functional and can therefore improve band gap predictions, but they typically account for only 20-50% of the GGA band gap error [11]. Meta-GGAs can be designed to further improve band gap prediction [12, 13], but modifying a given meta-GGA form to predict larger, more accurate band gaps typically reduces the accuracy of that functional for other chemical and material properties, such as bond dissociation energies [13, 14]. On the other hand, hybrid functionals, which mix a fraction of the nonlocal, orbital-dependent exact exchange energy into an XC functional [15], provide significantly improved predictions of band gaps [11, 16] and thermochemical properties [1, 10] over semilocal DFT, but this accuracy comes at a steep additional computational cost, especially within plane-wave DFT. In spite of the remarkable recent progress of efficient implementations for solids [17–22], hybrid DFT is not as efficient or practical as semilocal DFT for these calculations.

Several approaches to design improved XC functionals have been pursued in the literature. Many popular functionals, like PBE [23] and SCAN [24], are designed primarily or entirely based on mathematical constraints obeyed by the exact functional. Constraint-based functionals are often considered trustworthy because they can predict molecular properties without being explicitly tuned to match them, reducing the risk of bias toward a particular property or set of systems [25, 26]. However, some of the most popular and accurate XC functionals for main-group chemistry are empirically fit to chemical data [27, 28]. Recently, significant progress has been made toward combining constraint and data-based design approaches using machine learning [29–35], culminating in the development of the DM21 functional [36], which achieves state-of-the-art accuracy on main-group chemistry benchmarks and also improves the description of static correlation by fitting fractional charge constraints.

While promising, these developments have a few key shortcomings, the most notable of which is their computational cost. DM21 uses a local range-separated hybrid formalism, which is both computationally expensive (even more so than global hybrid DFT) and not widely available for the plane-wave DFT codes typically used for investigating large extended systems. As a result, DM21 has not been applied to solids. To the best of our knowledge, no nonlocal machine-learned functional has yet been implemented for both molecular (Gaussian-type orbital) and extended (plane-wave) DFT calculations, with the exception of the DeePKS approach [37, 38]. However, DeePKS uses geometry-dependent (rather than universal) functionals and is trained for specific systems, so it does not fulfill the role of a broadly chemically transferable model. All other ML XC functionals that have been applied to solids have been limited to the semilocal form [13, 32, 33, 39–41] (with the exception of minimally parameterized van der Waals functionals and one concurrent work by Riemelmoser et al. [42] that introduced a nonlocal functional for C, H, and O-containing systems). This limitation restricts the application space of ML functionals by preventing their use in applications where hybrid DFT accuracy is needed. For example, hybrid DFT has proven useful for studying problems in catalysis within both Gaussian-type orbital and plane-wave codes [43, 44] and for addressing the “band-gap problem” in DFT [45]. In addition to this technical limitation, applications of ML functionals to complex and heterogeneous systems are limited by their lack of transferability and universality, as they have previously only been trained on molecular systems.

These limitations raise the question of whether machine learning models can leverage more efficient features to balance accuracy and computational cost. One possible approach in this direction is to generate nonlocal features by taking integrals of the density over some set of kernel functions [30, 46]. This way, an ML model of the XC functional can capture nonlocal information about the density without evaluating the computationally demanding exact exchange operator required for hybrid DFT. In line with this strategy, we recently introduced the Compressed Scale-Invariant Density Representation (CIDER) formalism for learning the exchange functional [35], in which the nonlocal features were designed to enforce the uniform scaling rule [47] on the learned exchange functional. We demonstrated that the exchange functional can be accurately learned with the CIDER approach. However, the high computational cost of computing the features, lack of implementation for plane-wave DFT, and need to compute and fit the exchange energy density (rather than the total exchange energy) limited the practicality of our model and restricted its application to small molecules.

In this work, we overcome all of these limitations by revising the form of the features, implementing efficient algorithms to evaluate the new features for both molecular and extended systems, and redesigning our Gaussian process model to fit the total exchange energy. These improvements enable the construction of the first nonlocal, universal ML exchange functional for solids, which can be applied to large systems with similar computational cost to semilocal DFT. We use this exchange functional to implement efficient and accurate hybrid DFT surrogates that can be used in a variety of applications. Because our new functional form is both transferable and numerically stable, we believe that our approach will also be useful for learning the full XC functional, allowing us to address problems where DFT accuracy is limited by both exchange and correlation effects.

By training and testing exchange functionals with different feature sets, we find that to learn the exchange functional well enough to reproduce hybrid DFT accuracy, it is necessary to include both a semilocal orbital-dependent feature (i.e. the kinetic energy density) and nonlocal density-dependent features in the model input. Having developed this “nonlocal meta-GGA,” we show that it accurately predicts molecular properties and improves solid-state band gap predictions over standard meta-GGAs, which is a central problem in DFT. The performance for solid-state band gaps is particularly promising because only 9 systems in the training set are solids, with the others being isolated molecules and complexes. We also encounter only a few convergence problems in our self-consistent field (SCF) calculations of 2462 molecular and 453 periodic systems, indicating that the functional has good numerical stability. To demonstrate the transferability and efficiency of the model, we simulate systems with over 500 atoms to predict charged defect transition levels in silicon.

The paper is organized as follows. Section II describes the features and models used in this work. Section III presents our results and discusses the accuracy of the CIDER functionals as well as their computational efficiency within plane-wave DFT. Section IV contains our conclusion. Appendix A provides a detailed description of the computational methods used in this study, and Appendix B provides additional mathematical details for the plane-wave implementation of CIDER.

Theory

In Kohn-Sham DFT [2], it is often convenient to separate the XC energy into exchange and correlation parts, i.e. Exc[n]=Ex[n]+Ec[n]E_{\rm xc}[n] = E_{\rm x}[n] + E_{\rm c}[n]. The exchange energy Ex[n]E_{\rm x}[n] accounts for the antisymmetric nature of the fermionic wave function, while the correlation energy Ec[n]E_{\rm c}[n] accounts for additional many-body correlation effects between the electrons. The exchange energy is the main focus of this work and can be trivially generalized from non-spin-polarized DFT to spin-polarized DFT as [48]

Ex[n↑,n↓]=12Ex[2n↑]+12Ex[2n↓],(1)E_{\mathrm{x}}[n_{\uparrow},n_{\downarrow}] = \frac{1}{2}E_{\mathrm{x}}[2n_{\uparrow}] + \frac{1}{2}E_{\mathrm{x}}[2n_{\downarrow}], \tag*{(1)}

so all formulas in the theory section are written for the non-spin-polarized case for simplicity.

The exact exchange energy can be expressed in terms of the occupied Kohn-Sham orbitals {ϕi(r)}\{\phi_i(\mathbf{r})\} as

Exexact[n]=−∑ij∫d3r∫d3r′ϕi∗(r)ϕj(r)ϕi(r′)ϕj∗(r′)∣r−r′∣.(2)E_{\mathrm{x}}^{\mathrm{exact}}[n] = -\sum_{ij}\int\mathrm{d}^{3}r \int\mathrm{d}^{3}r' \frac{\phi_i^*(\mathbf{r})\phi_j(\mathbf{r})\phi_i(\mathbf{r}')\phi_j^*(\mathbf{r}')}{\lvert\mathbf{r}-\mathbf{r}'\rvert}. \tag*{(2)}

Evaluating Eq. (2) is computationally expensive. However, the improved accuracy of hybrid DFT arises from mixing a fraction of Exexact[n]E_{\mathrm{x}}^{\mathrm{exact}}[n] into an otherwise semilocal XC functional. These considerations explain the cost-accuracy trade-off between semilocal and hybrid DFT. Our goal is to fit Eq. (2) as accurately as possible with a computationally efficient surrogate model.

The remainder of this section sets up our machine learning-based approach to this problem. Specifically, Sections II A-II C cover the design of the exchange functional form, nonlocal features, and Gaussian process models, and Sections II D-II F cover the computationally efficient implementation of the nonlocal features. The feature implementation requires different algorithms for Gaussian-type orbital and plane-wave DFT codes due to the use of different basis sets and integration grids within these codes.

Uniform Scaling and Semilocal Exchange Functionals

The simplest approximate exchange functional is the local density approximation (LDA), in which the exchange energy is written as an integral over a function of the density n(r)n(\mathbf{r}) at each point in space

Ex[n]=∫d3r exLDA(n(r)),(3)E_{\mathrm{x}}[n] = \int\mathrm{d}^{3}r\,e_{\mathrm{x}}^{\mathrm{LDA}}(n(\mathbf{r})), \tag*{(3)}

where in the Kohn-Sham formalism [2], the density is expressed in terms of the occupied orbitals as

n(r)=∑i∣ϕi(r)∣2.(4)n(\mathbf{r}) = \sum_i \lvert\phi_i(\mathbf{r})\rvert^2. \tag*{(4)}

Typically, exLDA(n)e_{\mathrm{x}}^{\mathrm{LDA}}(n) is defined as the exchange energy density of the uniform electron gas [49]

exLDA(n)=−34(3π)1/3n4/3.(5)e_{\mathrm{x}}^{\mathrm{LDA}}(n) = -\frac{3}{4}\left(\frac{3}{\pi}\right)^{1/3}n^{4/3}. \tag*{(5)}

In addition to making Eq. (3) exact for the uniform electron gas, Eq. (5) also satisfies an important property of the exchange functional known as uniform scaling [47, 50], which states that for a scaled density distribution nλ(r)=λ3n(λr)n_{\lambda}(\mathbf{r}) = \lambda^3 n(\lambda\mathbf{r}),

Ex[nλ]=λEx[n],(6)E_{\mathrm{x}}[n_{\lambda}] = \lambda E_{\mathrm{x}}[n], \tag*{(6)}

where λ\lambda is a positive scalar.

More sophisticated functionals that obey Eq. (6) can be designed by writing the exchange energy density as the product of Eq. (5) and an exchange enhancement factor FxF_{\mathrm{x}}:

Ex[n]=∫d3r exLDA(n(r))Fx(x(r)).(7)E_{\mathrm{x}}[n] = \int\mathrm{d}^{3}r\,e_{\mathrm{x}}^{\mathrm{LDA}}(n(\mathbf{r}))F_{\mathrm{x}}(\mathbf{x}(\mathbf{r})). \tag*{(7)}

In the above equation, x(r)\mathbf{x}(\mathbf{r}) is a vector of scale-invariant features xix_i, where scale-invariance is defined as

xi[nλ](r)=xi[n](λr).(8)x_i[n_{\lambda}](\mathbf{r}) = x_i[n](\lambda\mathbf{r}). \tag*{(8)}

For example, a generalized gradient approximation (GGA) exchange functional is constructed by making FxF_{\mathrm{x}} a function of the reduced gradient ss of the density

s=∣∇n∣2(3π2)1/3n4/3.(9)s = \frac{\lvert\nabla n\rvert}{2(3\pi^2)^{1/3}n^{4/3}}. \tag*{(9)}

Because ss satisfies Eq. (8), the GGA form

Ex[n]=∫d3r exLDA(n(r))Fx(s(r))(10)E_{\mathrm{x}}[n] = \int\mathrm{d}^{3}r\,e_{\mathrm{x}}^{\mathrm{LDA}}(n(\mathbf{r}))F_{\mathrm{x}}(s(\mathbf{r})) \tag*{(10)}

satisfies Eq. (6). Likewise, a meta-GGA can be constructed by making the exchange enhancement factor a function of two ingredients Fx(s,α)F_{\mathrm{x}}(s,\alpha), where

α=τ−τWτ0(11)\alpha= \frac{\tau-\tau_{\mathrm{W}}}{\tau_0} \tag*{(11)}

is a scale-invariant quantity that depends on the kinetic energy density

τ(r)=12∑i∣∇ϕi(r)∣2,(12)\tau(\mathbf{r}) = \frac{1}{2}\sum_i \lvert\nabla\phi_i(\mathbf{r})\rvert^2, \tag*{(12)}

and τW=∣∇n∣28n\tau_{\mathrm{W}} = \frac{\lvert\nabla n\rvert^2}{8n} and τ0=310(3π2)2/3n5/3\tau_0 = \frac{3}{10}(3\pi^2)^{2/3}n^{5/3} are the single-orbital and uniform electron gas kinetic energies, respectively.

Updated Nonlocal Features for CIDER

In our initial construction of the CIDER formalism [35], the exchange functional is defined as

Ex[n]=∫d3r exLDA(n(r))×Fx(s(r),α(r),{Gnlm(r)}).(13)\begin{aligned} E_{\mathrm{x}}[n] &= \int\mathrm{d}^{3}r\,e_{\mathrm{x}}^{\mathrm{LDA}}(n(\mathbf{r}))\\ &\quad\times F_{\mathrm{x}}(s(\mathbf{r}),\alpha(\mathbf{r}),\{G_{nlm}(\mathbf{r})\}). \tag*{(13)} \end{aligned}

In Eq. (13), the functions {Gnlm(r)}\{G_{nlm}(\mathbf{r})\} are nonlocal features of the density defined by

Gnlm(r)=∫d3r′ gnlm(r′;r)n(r+r′),(14)G_{nlm}(\mathbf{r}) = \int\mathrm{d}^{3}r'\,g_{nlm}(\mathbf{r}';\mathbf{r})n(\mathbf{r}+\mathbf{r}'), \tag*{(14)}

where gnlm(r′;r)g_{nlm}(\mathbf{r}';\mathbf{r}) is the kernel function

gnlm(r′;r)=MYlm(r^′)(a(r)∣r′∣2)n+l/2e−a(r)∣r′∣2,(15)g_{nlm}(\mathbf{r}';\mathbf{r}) = M Y_{lm}(\hat{\mathbf{r}}')\left(a(\mathbf{r})\lvert\mathbf{r}'\rvert^2\right)^{n+l/2}e^{-a(\mathbf{r})\lvert\mathbf{r}'\rvert^2}, \tag*{(15)}

with Ml=B03/24π−1(8π3)1/3M_l = B_0^{3/2}\sqrt{4\pi^{-1}\left(\frac{8\pi}{3}\right)^{1/3}}. The position-dependent exponent a(r)a(r) is defined as a semilocal quantity

a[n](r)=π(n(r)2)2/3[B0+C0(τ(r)τ0(r)−1)],(16)a[n](\mathbf{r})=\pi\left(\frac{n(\mathbf{r})}{2}\right)^{2/3}\left[B_0+C_0\left(\frac{\tau(\mathbf{r})}{\tau_0(\mathbf{r})}-1\right)\right], \tag*{(16)}

where B0B_0 and C0C_0 are adjustable constants that control how quickly the width of the Gaussian-type function in Eq. (15) decreases as the density and kinetic energy density increase. Equation 16 behaves quadratically under uniform scaling, i.e.

a[nλ](r)=λ2a[n](λr).(17)a[n_\lambda](\mathbf{r})=\lambda^2a[n](\lambda\mathbf{r}). \tag*{(17)}

This property ensures that Gnlm(r)G_{nlm}(\mathbf{r}) is scale-invariant (Eq. (8)) and therefore that Eq. (13) satisfies the uniform scaling rule (Eq. (6)).

Using these scale-invariant nonlocal features, we were able to train an ML exchange functional that accurately reproduced hybrid DFT atomization energies [35], but there is room for improvement in making the features more physically intuitive and easier to implement with production-level performance. In this work, we simplify the features by removing the spherical harmonics and instead adding a second position-dependent exponent to the kernel function, resulting in the new features

Gi(r1)=(Bi+B02)3/2∫d3r2 Φ(a(r2),bi(r1),r12)n(r2)(18)G_i(\mathbf{r}_1)=\left(\frac{B_i+B_0}{2}\right)^{3/2}\int\mathrm{d}^3\mathbf{r}_2\,\Phi\left(a(\mathbf{r}_2),b_i(\mathbf{r}_1),r_{12}\right)n(\mathbf{r}_2) \tag*{(18)}
Φ(a,b,r)=exp⁡[−(a+b)r2],(19)\Phi(a,b,r)=\exp\left[-(a+b)r^2\right], \tag*{(19)}

References

  1. [1]L. Goerigk, A. Hansen, C. Bauer, S. Ehrlich, A. Naijbi, and S. Grimme, A look at the density functional theory zoo with the advanced GMTKN55 database for general main group thermochemistry, kinetics and noncovalent interactions, Phys. Chem. Chem. Phys. 19, 32184 (2017).DOI
  2. [2]P. Borlido, T. Aull, A. W. Huran, F. Tran, M. A. L. Marques, and S. Botti, Large-Scale Benchmark of Exchange–Correlation Functionals for the Determination of Electronic Band Gaps of Solids, J. Chem. Theory Comput. 15, 5069 (2019).DOI
  3. [3]D. R. Hamann, Optimized norm-conserving Vanderbilt pseudopotentials, Phys. Rev. B 88, 085117 (2013).DOI
  4. [4]G.-X. Zhang, A. M. Reilly, A. Tkatchenko, and M. Scheffler, Performance of various density-functional approximations for cohesive properties of 64 bulk solids, New J. Phys. 20, 063020 (2018).DOI
  5. [5]K. Trepte and J. Voss, Data-driven and constrained optimization of semi-local exchange and nonlocal correlation functionals for materials and surface chemistry, J. Comput. Chem. 43, 1104 (2022).DOI
  6. [6]G. D. Watkins and J. R. Troxell, Negative-U Properties for Point Defects in Silicon, Phys. Rev. Lett. 44, 593 (1980).
  7. [7]D. W. Fischer and J. J. Rome, Additional structure in infrared excitation spectra of group-III acceptors in silicon, Phys. Rev. B 27, 4826 (1983).DOI
  8. [8]C. Jaganath, Z. W. Grabowski, and A. K. Ramdas, Linewidths of the electronic excitation spectra of donors in silicon, Phys. Rev. B 23, 2082 (1981).
  9. [9]S. Knack, J. Weber, H. Lemke, and H. Riemann, Copper-hydrogen complexes in silicon, Phys. Rev. B 65, 165203 (2002).
  10. [10]M. Schulz, T. Dalibor, W. Martienssen, H. Landolt, and R. Börnstein, Impurities Defects Gr. IV Elem. IV-IV IV-V Compd. Part a Gr. IV Elem., edited by O. Madelung, U. Rössler, and M. Schulz, Landolt-Börnstein - Group III Condensed Matter, Vol. 41A2a (Springer-Verlag, Berlin/Heidelberg, 2002).

Paper details

vlnc:W_2f6maj8h
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents