Introduction

Ab initio calculations using Kohn-Sham (KS) density functional theory (DFT)1,2 can accurately describe the fundamental properties of various materials. However, its computational cost scales with the cube of the number of electrons in the simulation cell, which poses a major challenge to large-scale simulations. In contrast, orbital-free (OF) DFT is inherent of the lower computational cost that scales linearly with the number of atoms in the system, as it relies only on the electron density and the use of KS orbitals is avoided. As a result, OF-DFT is successfully applied to large-scale simulations of systems with up to millions of atoms3,4,5,6.

The accuracy of OF-DFT simulations depends strongly on the quality of the non-interacting kinetic energy and the electron-ion (or electron-pseudocore) interaction energy employed in the simulations. Many approximate kinetic energy density functionals (KEDFs) have been proposed to evaluate the non-interacting kinetic energy in OF-DFT7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39. Their use in combination with local pseudopotentials40,41,42,43,44 can achieve results that agree reasonably with those derived by KS-DFT, especially for main-group metals, III–V semiconductors24,34,36,45, and even systems with inhomogeneous electron density such as metal clusters and quantum dots37,39.

Unfortunately, the local pseudopotentials28,31,32,40,41,43 used to evaluate the electron-ion interaction energy suffer from a lack of transferability43, as they fail to reproduce the correct scattering behavior of the all-electron potentials46,47,48. Overcoming the transferability problem requires a reliance on either all-electron potential or nonlocal pseudopotentials (NLPPs), which are widely used in orbital-based approaches. However, it is practically unfeasible to use the all-electron potential, as an accurate all-electron KEDF for OF-DFT calculations is not yet available49,50. Furthermore, the use of NLPPs46,51 runs against conventional understanding, as no orbitals are available in the traditional framework of OF-DFT41,42,44,52,53.

A crucial nonlocal energy term with a set of angular-momentum-dependent energies has recently been added to OF-DFT calculations54,55 in an effort to correct errors arising from the use of KEDFs and local pseudopotentials. This approach has successfully reproduced the bulk properties of several standard structures of Ti. However, special care must be taken when applying it to a wide range of practical simulations, as frozen on-site orbitals and empirically directed fitting parameters are part of the model52. There is substantial demand for a general approach to evaluate the electron-ion interaction energy using NLPPs in OF-DFT calculations. In this manuscript, we developed a theoretical scheme that allows the direct use of the NLPPs for the calculation of electron-ion interaction energy in OF-DFT, together with a specially designed theoretical framework of OF-DFT. This development leads to an OF-DFT calculation that gives a better transferability than the existing OF-DFT method based on local pseudopotentials.

Results and discussion

Nonlocal pseudopotential energy density functional

In general, the total energy density functional of OF-DFT can be expressed as:

$$E[\rho ]= \, {T}_{s}[\rho ]+{E}_{H}[\rho ]+{E}_{XC}[\rho ]+{E}_{II}\left(\{{R}_{a}\}\right)\\ +\int \rho ({{{{{{{\bf{r}}}}}}}}){V}_{loc}({{{{{{{\bf{r}}}}}}}}){d}^{3}{{{{{{{\bf{r}}}}}}}},$$
(1)

where ρ, Ts, EH, EXC, EII, {Ra}, and Vloc are the electron density, KEDF, Hartree energy, exchange-correlation energy, ion-ion repulsion energy, the set of atomic positions, and local pseudopotential, respectively. To include the nonlocal electron-ion interactions, the total energy density functional of OF-DFT is reformulated as:

$$E[\rho ]= \; {T}_{s}[\rho ]+{E}_{H}[\rho ]+{E}_{XC}[\rho ]+{E}_{II}\left(\{{R}_{a}\}\right)\\ +\underbrace{\int\rho ({{{{{{{\bf{r}}}}}}}){V}_{loc}({{{{{{{\bf{r}}}}}}}}){d}^{3}{{{{{{{\bf{r}}}}}}}}+{E}_{nl}[\rho ]}}_{\begin{array}{c}{E}_{EI}[\rho ]\end{array}},$$
(2)

where the total electron-ion interaction energy EEI[ρ] can be separated into two parts: a local part Eloc[ρ] = ∫ρ(r)Vloc(r)d3r and a nonlocal part Enl[ρ]. All of the terms in Eq. (2) except the nonlocal part of pseudopotential (Enl[ρ]) can be evaluated easily.

The exact NLPP energy depends on the KS orbitals or the density matrix:

$${E}_{nl} \equiv \mathop{\sum }_{i}{f}_{i}\int \int {\psi }_{i}^{* }({{{{{{{{\bf{r}}}}}}}}}^{\prime}){V}_{nl}({{{{{{{{\bf{r}}}}}}}}}^{\prime},{{{{{{{\bf{r}}}}}}}}){\psi }_{i}({{{{{{{\bf{r}}}}}}}}){d}^{3}{{{{{{{\bf{r}}}}}}}}{d}^{3}{{{{{{{{\bf{r}}}}}}}}}^{\prime}\\ = \int \int {V}_{nl}({{{{{{{{\bf{r}}}}}}}}}^{\prime},{{{{{{{\bf{r}}}}}}}}){\gamma }_{s}({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime}){d}^{3}{{{{{{{\bf{r}}}}}}}}{d}^{3}{{{{{{{{\bf{r}}}}}}}}}^{\prime},$$
(3)

where fi, \({V}_{nl}({{{{{{{{\bf{r}}}}}}}}}^{\prime},{{{{{{{\bf{r}}}}}}}})=\langle {{{{{{{{\bf{r}}}}}}}}}^{\prime}| {\hat{V}}_{nl}| {{{{{{{\bf{r}}}}}}}}\rangle\), and \({\gamma }_{s}({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})={\sum }_{i}{f}_{i}{\psi }_{i}({{{{{{{\bf{r}}}}}}}}){\psi }_{i}^{* }({{{{{{{{\bf{r}}}}}}}}}^{\prime})\) represent the occupation number of the ith KS orbital ψi, the real-space representation of the nonlocal part pseudopotential, and the non-interacting density matrix, respectively. Considering that the density matrices \({\gamma }_{s}[\rho ]({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})\) can be used to approximate the KEDFs7,56,57, an NLPP energy density functional (NLPPF) relying directly on the density matrix is proposed to evaluate the nonlocal electron-ion interaction energy. The nonlocal electron-ion interaction energy is then rewritten as a function of electron density

$${E}_{nl}[\rho ]=\int \int {V}_{nl}({{{{{{{{\bf{r}}}}}}}}}^{\prime},{{{{{{{\bf{r}}}}}}}}){\gamma }_{s}[\rho ]({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime}){d}^{3}{{{{{{{\bf{r}}}}}}}}{d}^{3}{{{{{{{{\bf{r}}}}}}}}}^{\prime}.$$
(4)

By taking the Kleinman-Bylander form58 of norm-conserving NLPPs, the nonlocal part pseudopotential59 can be written as

$${V}_{nl}({{{{{{{{\bf{r}}}}}}}}}^{\prime},{{{{{{{\bf{r}}}}}}}})=\mathop{\sum}\limits_{a,lm}{E}_{KB}^{a,lm}{\chi }_{lm}^{a}({{{{{{{{\bf{r}}}}}}}}}^{\prime}){\chi }_{lm}^{a* }({{{{{{{\bf{r}}}}}}}}),$$
(5)

where \({E}_{KB}^{a,lm}={[\int{\phi }_{lm}^{a* }({{{{{{{\bf{r}}}}}}}})\delta {V}_{l}^{a}({{{{{{{\bf{r}}}}}}}}){\phi }_{lm}^{a}({{{{{{{\bf{r}}}}}}}}){d}^{3}{{{{{{{\bf{r}}}}}}}}]}^{-1}\) and \({\chi }_{lm}^{a}({{{{{{{\bf{r}}}}}}}})=\delta {V}_{l}^{a}({{{{{{{\bf{r}}}}}}}}){\phi }_{lm}^{a}({{{{{{{\bf{r}}}}}}}})\). The terms \({\phi }_{lm}^{a}\) and \(\delta {V}_{l}^{a}\) are the atomic pseudo-wave-function and the short-range pseudopotential corresponding to the lmth angular momentum of ath atom, respectively. γs[ρ] denotes the density matrix as a function of electron distribution ρ. Although there is no exact analytic form available for the density matrix functional, a modified Gaussian (MG)60 form derived from the second-order Taylor expansions of the density matrix61 was employed to approximate the density matrix functional:

$${\gamma }_{s}^{MG}[\rho ]({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})=\rho (\bar{{{{{{{{\bf{r}}}}}}}}}){e}^{-\frac{{s}^{2}}{2\beta (\bar{{{{{{{{\bf{r}}}}}}}}})}}\left[1+A{\left(\frac{{s}^{2}}{2\beta (\bar{{{{{{{{\bf{r}}}}}}}}})}\right)}^{2}\right],$$
(6)

where \(s=| {{{{{{{\bf{r}}}}}}}}-{{{{{{{{\bf{r}}}}}}}}}^{\prime}|\) and \(\bar{{{{{{{{\bf{r}}}}}}}}}=({{{{{{{\bf{r}}}}}}}}+{{{{{{{{\bf{r}}}}}}}}}^{\prime})/2\). The second term in the square bracket is O(s4) correction60, where A is an adjustable parameter. β(r) denotes the “local temperature” \(\beta ({{{{{{{\bf{r}}}}}}}})=\frac{3}{2}\frac{\rho ({{{{{{{\bf{r}}}}}}}})}{{t}_{s}({{{{{{{\bf{r}}}}}}}})}\)62,63, where ts(r) is the exact kinetic energy density defined as \({t}_{s}({{{{{{{\bf{r}}}}}}}})={t}_{s}^{KS}({{{{{{{\bf{r}}}}}}}})\equiv \mathop{\sum }\nolimits_{i = 1}^{Occ.}\frac{1}{8}| \nabla {\rho }_{i}({{{{{{{\bf{r}}}}}}}}){| }^{2}/{\rho }_{i}({{{{{{{\bf{r}}}}}}}})-\frac{1}{8}{\nabla }^{2}\rho ({{{{{{{\bf{r}}}}}}}})\) and ρi(r) = ψi(r)2 is ith KS orbital’s density (see Refs. 60,61). To remove the orbital-dependent problem in ts(r) and obtain a solely density-dependent form of the density matrix functional, the kinetic energy density is obtained directly from the integrand of KEDFs to replace the exact one: ts(r) ≈ ts[ρ](r). The widely used Wang-Teter (WT) KEDF28 is chosen as an exemplary case, and ts[ρ](r) can be expressed as

$${t}_{s}^{WT}[\rho ]({{{{{{{\bf{r}}}}}}}})= \, \frac{3}{10}{\left(3{\pi }^{2}\right)}^{2/3}{\rho }^{5/3}({{{{{{{\bf{r}}}}}}}})+\frac{1}{8}\frac{{\left|\nabla \rho ({{{{{{{\bf{r}}}}}}}})\right|}^{2}}{\rho ({{{{{{{\bf{r}}}}}}}})}\\ +{\rho }^{5/6}({{{{{{{\bf{r}}}}}}}})\int {\omega }_{WT}({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime}){\rho }^{5/6}({{{{{{{{\bf{r}}}}}}}}}^{\prime}){d}^{3}{{{{{{{{\bf{r}}}}}}}}}^{\prime},$$
(7)

where \({\omega }_{WT}({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})\) is the kernel of WT functional. The Supplementary Notes give the details of the kinetic energy densities obtained from WT and Xu-Wang-Ma38 KEDFs.

The direct numerical evaluations of \(\rho (\bar{{{{{{{{\bf{r}}}}}}}}})\) and \(\beta (\bar{{{{{{{{\bf{r}}}}}}}}})\) at the average position \(\bar{{{{{{{{\bf{r}}}}}}}}}\) are very complicated. They are therefore approximated using q-mean “nonlocal density” \({\rho }_{q}({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})={\left[\frac{{\rho }^{q}({{{{{{{\bf{r}}}}}}}})+{\rho }^{q}({{{{{{{{\bf{r}}}}}}}}}^{\prime})}{2}\right]}^{1/q}\) and two-point average temperature \(\beta ({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})=[\beta ({{{{{{{\bf{r}}}}}}}})+\beta ({{{{{{{{\bf{r}}}}}}}}}^{\prime})]/2\) for systems with slowly varying electron densities. The density matrix functional of Eq. (6) can then be reformulated as

$${\tilde{\gamma }}_{s}^{MG}[\rho ]({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})={\rho }_{q}({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime}){e}^{-\frac{{s}^{2}}{2\beta ({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})}}\left[1+A{\left(\frac{{s}^{2}}{2\beta ({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime})}\right)}^{2}\right].$$
(8)

Combining Eqs. (4), (5), and (8) gives the NLPPF as

$${E}_{nl}[\rho ]\approx \mathop{\sum }_{a,lm}{E}_{KB}^{a,lm}\int_{{{{\Omega }}}_{a}}\int_{{{{\Omega }}}_{a}}{\chi }_{lm}^{a}({{{{{{{{\bf{r}}}}}}}}}^{\prime}){\chi }_{lm}^{a* }({{{{{{{\bf{r}}}}}}}}){\tilde{\gamma }}_{s}^{MG}[\rho ]({{{{{{{\bf{r}}}}}}}},{{{{{{{{\bf{r}}}}}}}}}^{\prime}){d}^{3}{{{{{{{\bf{r}}}}}}}}{d}^{3}{{{{{{{{\bf{r}}}}}}}}}^{\prime},$$
(9)

where the integral domain Ωa is the ath ionic core region. Owing to the short-range nature of \(\{{\chi }_{lm}^{a}({{{{{{{\bf{r}}}}}}}})\}\), the computational cost of Eq. (9) scales linearly \({{{{{{{\mathcal{O}}}}}}}}[c{N}_{a}]\) with the number of atoms (Na), where c can be regarded as a constant derived from the double integral within the near-core region. Within the NLPPF scheme, a new theoretical framework of OF-DFT has been built and implemented in ATLAS5,64. The further computational details are provided in Methods Section. The parameters of pseudopotential and NLPPF are presented in Supplementary Tables 1 and 2, respectively.

Computational accuracy of NLPPF scheme

We first applied this scheme for OF-DFT calculations of Li, Mg, and Cs within hexagonal-close-packed (HCP), face-centered cubic (FCC), body-centered cubic (BCC), simple cubic (SC), and cubic diamond structures. For each structure, 13 energy-volume points were calculated by expanding and compressing the approximate equilibrium volume by up to 20%, and the bulk properties (the equilibrium cell volume V0, bulk modulus B0, and the relative energy ER with respect to HCP structure) were determined by fitting the energy-volume curve against Murnaghan’s equation of state65. The comparison of the results obtained by OF-DFT using both local pseudopotentials (BLPS41 and OEPP43) and NLPPs against those calculated by KS-DFT using the projector augmented-wave (PAW)66 method are presented in Supplementary Table 3. For Li and Mg solids, the OF-DFT calculations within both local pseudopotentials and NLPPs give reasonable predictions of V0, B0, and ER, which are comparable with the KS-DFT results. It is noteworthy that our scheme shows an improvement over the local pseudopotentials of OEPP for bulk Cs. The accurate bulk properties of Li/Mg/Cs obtained by the current scheme demonstrate its valid applicability to simple metallic solids.

Further assessment of the accuracy of our scheme was demonstrated by molecular dynamics calculations for Li-Mg alloy. The calculations used a canonical ensemble (at 1000 K) in a supercell containing 108 atoms (Li54Mg54). The calculated pair distribution functions g(r) for Li-Mg alloy are shown in Fig. 1. Overall, the predicted shapes and peak neighbors of pair distribution functions by OF-DFT within NLPPF match the results calculated by KS-DFT. Especially notable are the resulting contributions of the partial distributions (Fig. 1b–d) calculated by OF-DFT within the NLPPF being almost identical to the KS-DFT calculations, which are superior to those obtained by the local pseudopotentials.

Fig. 1: Pair distribution functions for Li54Mg54 alloy.
figure 1

a Total, b Mg-Mg, c Li-Mg, and d Li-Li pair distribution functions.

Transferability of NLPPF scheme

To demonstrate the transferability of our scheme, we randomly generated 50 structures of Li systems using CALYPSO67,68. The total energies of these structures were calculated by OF-DFT and KS-DFT. The comparisons of total energy relative to the HCP structure (ER) are shown in Fig. 2. The orderings of energy are well captured by OF-DFT within NLPPF. The relative energies of different phases are overall well reproduced and in reasonable agreement with the KS-DFT results. The least-square fitting lines of WT-NLPPF are generally closer to the KS-PAW results than those from the local pseudopotentials. For example, the mean error of ER for Li systems obtained by OF-DFT within the WT-NLPPF is 45 meV/atom, which is lower than that within BLPS (73 meV/atom), or OEPP (201 meV/atom). Therefore, this framework of OF-DFT with improved transferability is superior to the traditional one.

Fig. 2: Relative energies for random structures of elemental Li.
figure 2

The results are calculated by OF-DFT using BLPS, OEPP and NLPPF in comparison with that by KS-DFT using the PAW method. Blue dash-dotted and red dashed lines are the least-square fittings of WT-BLPS and WT-NLPPF results, respectively.

Previous studies have shown that OF-DFT with local pseudopotentials can be applied to most s- and p-block metals. However, OF-DFT simulation using the local pseudopotential OEPP shows unacceptable errors for various crystalline phases of Be (Fig. 3): the curves of energy with respect to volume for HCP and FCC structures show the total energy monotonically decreasing with increasing volume. In contrast, the curves with clear minima predicted by OF-DFT within NLPPF agree well with those produced by KS-DFT. These findings indicate the significant superiority of our proposed framework over the conventional one.

Fig. 3: Relative energy versus volume curves for Be systems.
figure 3

a The calculated energy-volume curves of Be-HCP. b The calculated energy-volume curves of Be-FCC. The total energy shift of WT-OEPP is −33.030 eV/atom.

Note that the bulk properties (e.g., equilibrium volume, bulk modulus, and relative energy) calculated by OF-DFT within NLPPF reproduce the results of KS-DFT for Li and Mg almost exactly (Table 1), considering the maximal deviation of ER is within 32 meV/atom. However, there are some discrepancies for crystalline phases of Be: in particular, the deviation of ER for the SC structure is larger than 400 meV/atom. To explore the causes of these discrepancies, we estimated the errors of the kinetic energy density of the WT-KEDF with respect to the KS kinetic energy density along the [100] and [111] directions in the SC structures of Li, Mg, and Be (Fig. 4). The kinetic energy density of KS-DFT is clearly reproduced accurately by the WT-KEDF for Li and Mg with slow variations of electron densities. However, it is seriously underestimated for Be, in which the electron distribution rapidly varies in the near-core region. Therefore, we believe that errors in the kinetic energy densities for Be lead to the discrepancy in its bulk properties obtained by the framework of OF-DFT within the NLPPF. The findings are fairly consistent with our expectation that the performance of the NLPPF relies strongly on the accuracy of kinetic energy density, as manifested by Eqs. (7) and (8).

Table 1 B0 (GPa), ER (eV/atom), and V03/atom) for bulk Li, Mg, and Be by KS-DFT and OF-DFT.
Fig. 4: Kinetic energy differences in SC structure for Li, Mg, and Be systems.
figure 4

a The calculated differences along [100] direction. b The calculated differences along [111] direction. Note that \({{\Delta }}t({{{{{{{\bf{r}}}}}}}})\equiv {t}_{s}^{WT}[{\rho }^{KS}]({{{{{{{\bf{r}}}}}}}})-{t}_{s}^{KS}({{{{{{{\bf{r}}}}}}}})\).

Due to the existence of significant differences in kinetic energy density between WT and the exact one for Cd systems including localized d-channel electrons (see Supplementary Fig. 1), the NLPPF using WT cannot be applicable to investigate Cd systems with d-channel electrons. Therefore, the NLPP of Cd was constructed without d-channel electrons for the additional calculations. As listed in Table 2, the bulk properties predicted by the OF-DFT within NLPPF framework agree fairly well with the predictions by KS-DFT using the same NLPP, whereas WT-OEPP gives serious discrepancies compared with KS-NLPP results in all bulk properties. Although the calculations using NLPP without d-channel electrons cannot give the accurate bulk properties for Cd systems (Table 2), OF-DFT within NLPPF works superior to that within OEPP. Overall, it can be expected this NLPPF scheme using accurate KEDF and its kinetic energy density can be applied to the systems including localized electrons, such as the transition metals or covalent systems.

Table 2 B0 (GPa), ER (eV/atom), and V03/atom) for bulk Cd by KS-DFT and OF-DFT.

Computational efficiency of NLPPF scheme

To assess the computational efficiency of the current scheme, static simulations of Cs BCC supercells containing 128–16,000 atoms were performed by OF-DFT within NLPPF. The total wall time of the single point energy calculations is plotted with respect to the number of atoms in Supplementary Fig. 2. The computational cost of this framework clearly scales linearly with the number of atoms in the simulation cell, in sharp contrast to the cubic scaling of KS-DFT. This shows that the OF-DFT within NLPPF is potentially applicable to the simulation of large-scale systems containing millions of atoms.

In summary, we proposed an NLPPF scheme that allows the direct use of NLPPs in OF-DFT calculations. The static and dynamic properties of s- and p-block metals calculated within this scheme agree well with KS-DFT predictions and show significant improvements in the computational accuracy and transferability over conventional OF-DFT with local pseudopotentials. With this work, we defy the conventional wisdom of orbital-dependent NLPPs being incompatible with OF-DFT, leading to the creation of an alternative framework of OF-DFT, which opens up new avenues for further development of the theory.

Methods

Pseudopotential generations

The Troullier-Martins NLPPs59 are generated by the FHI98PP47 code for all considered systems [see Supplementary Table 1] and the p-channel of the NLPPs is used as the local pseudopotential of Vloc(r) in OF-DFT.

Numerical calculations

The KS-DFT calculations using the PAW66 and NLPP are performed by VASP69,70 and ARES packages71, respectively. The k-point meshes are generated using the Monkhorst-Pack method72 with the k-spacing of 0.10 Å−1. The kinetic energy cutoff is 500 eV for all the simulations using VASP. The OF-DFT calculations are carried out by ATLAS5,64 using WT28 as KEDF, and the corresponding kinetic energy density is used to construct the NLPPF. The generalized gradient approximation with the form of Perdew-Burke-Ernzerhof73 is employed for both OF-DFT and KS-DFT calculations. The grid spacings of 0.18, 0.18, 0.22, 0.10, 0.15, 0.22, 0.12, and 0.15 Å are used in ATLAS/ARES for Li, Mg, Cs, Be, Cd, K, Zn, and Li-Mg alloy, respectively. The parameters of A and q in NLPPFs are presented in Supplementary Table 2 carefully tuned to yield the bulk properties, which agree with the KS-DFT (NLPPs) predictions.

Molecular dynamics

The molecular dynamic simulations of Li-Mg alloy are performed in the canonical ensemble (at 1000 K) applying the Nosé-Hoover thermostat74,75 simulations up to 10 ps (0.5 fs/step), with the first 10,000 steps for equilibrating the system. The data for further analysis were collected from the subsequent 10,000 steps.