1 Introduction

Over the past decade, finite element methods have been applied successfully and competitively in the context of electronic structure calculation [1]. In particular within the context of the Kohn-Sham density functional theory, efficient ab initio methods are desirable in order to access nonphenomenological predictions of material and interface behavior at small length scales [2]. From an engineering perspective, one aim is to subsequently upscale this information by connecting different length scales using numerical methods which operate efficiently at each scale in order to reach at multiscale descriptions of deformation and failure for material and interface design. The triggering role of ab initio methods in this hierarchy of transitions is pivotal because it is able to initiate this process with a truly nonphenomenological seed. Therefore, there is an ongoing need for numerical methods which can attain desired levels of chemical accuracy faster and more efficiently, particularly in view of the very high computational cost of the problems involved [3,4,5]. From this perspective, the advantages of the finite element method are numerous [6]. First, in comparison to plane-wave approaches, it is a real-space method that does not require transforms that typically scale up rapidly in cost with increasing numerical resolution. Moreover, its structure naturally accommodates both periodic material systems such as crystals in addition to nonperiodic ones such as isolated molecules, unlike plane waves which assume periodicity from the outset. Second, in comparison to a real-space approach such as the finite-difference method, it preserves the variational structure that underlies density functional theory, similar to plane-wave discretizations. When combined with systematic improvability due to the completeness of the basis sets, this property ensures monotonic convergence in total energy–a property that is critical when one wishes to assess the solution quality. Such systematic improvability is missing in widely employed real-space methods based on Gaussian basis sets which retain the variational structure but cannot ensure that convergence achieved through the addition of multiple basis members is indeed due to having achieved the minimum total energy and not an artifact of incompleteness.

Density functional theory is an approach to solving the Schrödinger equation and the Kohn-Sham formalism is a theoretical framework that renders this approach feasible in a numerical setting [7]. The finite element method has recently been applied as a particular numerical setting in various contexts which range from time-independent periodic cases to time-dependent nonperiodic ones [6, 8,9,10,11,12,13,14]. Overall, the level of efficiency achieved is now competitive with, and in several cases already beyond, time-honored practices based on plane-waves for periodic problems and Gaussian basis sets for nonperiodic ones. The sparse structure of the matrices which emanate from finite element basis sets as well as the suitability of the framework to parallelization are contributing factors to this competitiveness. Moreover, higher-order basis sets are crucial if such problems are to be solved in reasonable times due to the insufficient convergence rate of linear ones, and the finite element method is naturally amenable to the incorporation of such discretizations. In the majority of these studies, and in all recent applications, basis sets are derived from Lagrange-type elements. As an alternative discretization scheme, following various earlier studies [15,16,17] but by building upon and benefiting from efficient eigensolvers to address comparatively larger material systems [18], the use of NURBS and B-splines was explored in [19], motivated by the isogeometric analysis approach [20]. The goal of this contribution is to summarize the finite element formulation of this ab initio problem and to present examples which indicate routes to even higher efficiency if isogeometric basis sets are employed as higher-order finite elements.

2 Density Functional Theory

The focus of the present study is on an isolated material system \(\mathcal {M}\) consisting of N electrons and M nuclei, each with charge \(Z_A\) (\(A\in {1,\ldots ,M}\)). In a pseudopotential setting, the set of electrons is associated with the valence structure only and the nuclei are replaced by ions that are assigned a net charge that is augmented by those of the core electrons. The configuration of \(\mathcal {M}\) is determined through the nucleus locations \({\boldsymbol{R}}_A\) that define \({\boldsymbol{r}}_A = {\boldsymbol{r}} - {\boldsymbol{R}}_A\) where the spatial position vector in unbounded space is indicated as \({\boldsymbol{r}}\) and integration over this space will be denoted by \(\langle \cdot \rangle \). The external local potential generated by the nuclei can then be expressed as \(\nu _\text {ext} = \sum _A \nu _A(r_A)\) where, introducing \(r_A = |{\boldsymbol{r}}_A|\), \(\nu _A = -Z_A m_A(r_A)\) are spherically symmetric potentials. For the all-electron setting \(m_A(x) = 1/x\) delivers the classical Coulomb expression of the potential whereas in the local pseudopotential setting \(m_A(x)\) acts as an ion-dependent mollifier which is chosen such that it delivers the regularized form of 1/x, i.e. m(0) is well-defined and m(x) matches or rapidly approaches 1/x beyond a prescribed distance. In the case of nonlocal pseudopotentials, the electron-ion interaction is nonlocal such that the external potential as well as the corresponding energy contribution will entail additional terms that will be shortly commented upon.

Assuming a closed-shell structure without consideration for spin effects and degeneracy, N/2 real orthonormal spatial orbitals \(\psi _i({\boldsymbol{r}})\) are introduced which describe a noninteracting reference system of N electrons in the Kohn-Sham formalism of density functional theory. The electron density can then be expressed as \(\rho ({\boldsymbol{r}}) = 2 \sum _i \psi _i^2\) and, in atomic units, the energy as a functional of the density takes the form

$$\begin{aligned} E = T_s + E_H + E_{en} + E_{nn} + E_{xc} \;. \end{aligned}$$
(1)

Here, \(T_s\) is the exact kinetic energy of the reference system, \(E_H\) is the Hartree energy that corresponds to the classical electrostatic interactions among the electrons, \(E_{en}\) is associated with the electron-nucleus interactions while \(E_{nn}\) is associated with nucleus-nucleus ones and, finally, \(E_{xc}\) is the exchange-correlation energy which accounts for errors in the kinetic energy and electron-electron interaction expressions:

$$\begin{aligned} T_s = 2 \sum _i \langle&\psi _i&(\textstyle {-\frac{1}{2}} \nabla ^2) \; \psi _i \rangle \quad ,\quad E_H = \textstyle {\frac{1}{2}} \langle \rho \, v_H \rangle \quad ,\quad E_{en} = \langle \rho \, v_\text {ext}\rangle \quad ,\quad \end{aligned}$$
(2)
$$\begin{aligned} E_{nn}= & {} \frac{1}{2}\sum _A \sum _{B \ne A} \frac{Z_A Z_B}{|{\boldsymbol{R}}_A - {\boldsymbol{R}}_B|} \quad ,\quad E_{xc} = \langle \rho \,\varepsilon _{xc} \rangle \;. \end{aligned}$$
(3)

Within these expressions, \(\varepsilon _{xc}\) is the exchange-correlation energy per electron and \(v_H\) is the Hartree potential that is defined through the Poisson equation

$$\begin{aligned} \textstyle {-\frac{1}{4\pi }} \nabla ^2 v_H = \rho \;. \end{aligned}$$
(4)

Each contribution to the total energy E depends on the set of orbitals \(\psi _i\), either directly or indirectly through \(\rho \). The ground state electronic structure is determined through the minimization of E over \(\psi _i\), leading to the Kohn-Sham equation

$$\begin{aligned} (\textstyle {-\frac{1}{2}} \nabla ^2 + v_\text {eff})\,\psi _i = \epsilon _i \, \psi _i \end{aligned}$$
(5)

where \(v_\text {eff} = v_H + v_\text {ext} + v_{xc}\), \(\epsilon _i\) are the orbital energies and the exchange-correlation potential \(v_{xc}\) is defined through the variation \(\delta E_{xc} = \langle v_{xc} \,\delta \rho \rangle \). Although the definition of \(v_{xc}\) is general, the present study will be restricted to the local density approximation where \(\varepsilon _{xc}\) will be a function of \(\rho \) only and therefore \(v_{xc} = \varepsilon _{xc} + \rho \, \partial \varepsilon _{xc} / \partial \rho \). Overall, the summarized theory can also easily be extended to account for open-shell problems and degeneracies through the incorporation of fractional occupancy, although this will not be explicitly indicated in this presentation.

In comparison to the all-electron setting, the pseudopotential setting delivers a significantly more efficient numerical approach because it eliminates the explicit presence of the core electrons, thereby reducing the stringent requirements on the discretization as well as the number of orbitals which need to be calculated [21]. Although local pseudopotentials may suffice for some material systems [22], most cases require nonlocal pseudopotentials for accuracy and transferability [23]. For this purpose, the total energy (1) is augmented by a contribution

$$\begin{aligned} E_{NL} = \sum _i \langle \psi _i({\boldsymbol{r}}) \,v_{NL}({\boldsymbol{r}},{\boldsymbol{r}}^\prime ) \,\psi _i({\boldsymbol{r}}^\prime ) \rangle \quad ,\quad v_{NL} = \sum _A \Lambda _A({\boldsymbol{r}}_A,{\boldsymbol{r}}_A{}\!\!\!^\prime \,) \end{aligned}$$
(6)

where nonlocality explicitly manifests itself. Similarly, the effective potential \(v_\text {eff}\) in the Kohn-Sham equation (5) is augmented by the nonlocal part \(v_{NL}\) of the pseudopotential that is composed of a sum of atom-dependent nucleus-centered nonlocal contributions \(\Lambda _A\). For an efficient numerical implementation, the preferred form of these contributions is based on a separable form. Presently, this implementation will not be explicitly discussed.

It is noted that it is possible to evaluate the exact Hartree potential \(v_H\) corresponding to a given electron density \(\rho \), albeit at a high numerical cost. This cost is circumvented by solving the Poisson equation (4) instead. Now, however, \(v_H\) will be obtained to within the numerical error that is associated with the chosen discretization. Consequently, the overall problem for rendering the energy stationary towards the ground state electronic structure takes on a saddle-point form rather than one of minimization [24]. The practical consequence of this is that nonvariational results may be obtained if the finite element discretization is not chosen carefully, thereby rendering difficulties in the assessment of the solution quality. The finite element formulation to be discussed next assumes a single discretization that is chosen judiciously for the solution of both the Poisson and Kohn-Sham equations.

3 Finite Element Discretization

Because \(v_\text {eff}\) within (5) is nonlinear in the set of orbitals \(\psi _i\), (4) and (5) must be solved iteratively to self-consistency in order to determine the ground state electronic structure, typically together with a mixing scheme in order to tune convergence. Presently, this solution approach will be built on the finite element method. Introducing test functions \(\{\eta ,\varphi \}\) and carrying out standard manipulations, the weak forms of the Poisson and Kohn-Sham equations may be expressed as

$$\begin{aligned} \textstyle {\frac{1}{4\pi }} \langle \nabla \eta \cdot \nabla v_H \rangle = \langle \eta \,\rho \rangle \quad ,\quad \textstyle {\frac{1}{2}} \langle \nabla \varphi \cdot \nabla \psi _i \rangle + \langle \varphi \, v_\text {eff} \, \psi _i \rangle = \epsilon _i \langle \varphi \, \psi _i \rangle \end{aligned}$$
(7)

Invoking a single discretization for both problems that is described by a set of shape functions \(N_I\), these expressions take the form

$$\begin{aligned}{}[P]\{v_H\} = \{d\} \quad ,\quad [H]\{\psi _i\} = \epsilon _i [M] \{\psi _i\} \;. \end{aligned}$$
(8)

Here, defining \(L_{IJ} = \langle \nabla N_I \cdot \nabla N_J \rangle \),

$$\begin{aligned} P_{IJ} = \textstyle {\frac{1}{4\pi }} L_{IJ} \quad ,\quad d_I = \langle N_I\,\rho \rangle \quad ,\quad H_{IJ} = \textstyle {\frac{1}{2}} L_{IJ} + \langle N_I \,v_\text {eff}\, N_J \rangle \end{aligned}$$
(9)

while, based on the discretizations \(v_H = \sum _I v_H^I N_I\) and \(\psi _i = \sum _I \psi _i^I N_I\), \(\{v_H\}\) and \(\{\psi _i\}\) collect the degrees of freedom \(v_H^I\) and \(\psi _i^I\), respectively. Overall, in view of the spherical symmetry of the potentials involved in all-electron and pseudopotential settings for a single atom, virtually the same formulation applies to the radial case as well, which is advantageous in comparing different finite element discretizations as well as in generating discrete orbital solutions for possible use as enrichment functions in the three-dimensional case [12, 13].

The solution of the generalized eigenvalue problem (8)\(_2\) can scale in a prohibitively unfavorable fashion depending on the solution algorithm. Presently, a subspace iteration method will be employed based on the Chebyshev filtering of the spectrum through a modification of the original algorithm that was proposed for a standard eigenvalue problem [18]. Clearly, the ability to modify the finite element discretization or to process the mass matrix in order to arrive at a standard version is desirable to attain faster solutions. For isogeometric discretizations, such as those that are based on NURBS or B-splines, row-sum lumping retains the positive-definiteness of the mass matrix. However, without additional modification of the original solution algorithm for a standard version, this leads to significantly reduced accuracies. On the other hand, lumping is not suitable for classical higher-order Lagrange elements but the combination of reduced-order Gauss-Lobatto quadrature schemes in combination with spectral finite elements delivers a diagonal mass matrix which allows invoking the original algorithm [6]. Because the aim is to carry out the electronic structure calculation at a level that matches the desired chemical accuracy, these aspects additionally influence how different discretizations compete in terms of efficiency, in particular in view of the fact that isogeometric discretizations typically deliver significantly higher accuracy per degree of freedom. A detailed comparison of various competing factors remains an open issue.

4 Numerical Investigations

As a radial case, the Magnesium atom will be considered. In the all-electron setting, Slater exchange is employed together with Vosko-Wilk-Nusair parametrization of correlation. The resolution is controlled through a parameter \(e_o\) which would scale with the number of elements in a linear discretization, not shown due to low accuracy. The error in the total energy E (in hartrees) is assessed with respect to the reference result \(E_o = -199.139\,406\,315\) that is converged to \(10^{-9}\) accuracy. In the pseudopotential setting, Perdew-Zunger parameterization of correlation is employed together with the evanescent core local pseudopotential [22]. The reference result that is converged to \(10^{-11}\) accuracy is \(E_o = -0.847\,598\,456\,26\). The target chemical accuracy is \(10^{-3}\) in the all-electron setting and \(2\times 10^{-4}\) in the pseudopotential one.

Fig. 1
figure 1

All-electron and local pseudopotential results for the Magnesium atom in the radial case

The results in Fig. 1 indicate the significantly less stringent discretization requirements in the pseudopotential case where the target accuracy is already achieved at very coarse discretizations. Here, classical Lagrange discretizations are denoted by L whereas N denotes an isogeometric discretization based on NURBS or B-splines, the following number being associated with the order chosen in each case. The asymptotic convergence rates are measured from the last three points in the data set for a given discretization and noted next to the corresponding line as half of the negative slope. The optimal value of the convergence rate measured in this fashion is equal to the discretization order and it is clear that this value has been achieved in all cases. However, the factor in the finite element error estimate expression also significantly contributes to the efficiency with which target accuracy is achieved. Indeed, it is observed that in both cases N3 delivers a faster route to convergence than both L4 and L5 choices and this trend is preserved until significantly low errors are observed. Because the number of elements does not decrease in an isogeometric discretization as the order increases in a standard implementation that is based on the classical finite element structure, it is advantageous to limit the order. In this respect, cubic NURBS and B-splines appear to offer competitive accuracy in return for the computational burden in the context of electronic structure calculation [19].

As a large-scale three-dimensional example with nonlocal pseudopotentials, the buckyball (C\(_{60}\) molecule) is considered. The setup of this analysis follows the details in [19] and requires the calculation of 120 orbitals. Therein, however, it was not possible to approach the target accuracy. Presently, an error of \(1.07\times 10^{-4}\) Ha per atom has been achieved with an N3 discretization that contains 790,773 degrees of freedom, which satisfies the stringent pseudopotential calculation accuracy requirement. The corresponding solution is visualized in Fig. 2. It is noted that the error for an L5 discretization with 1,357,579 degrees of freedom on the same mesh structure remained above \(4\times 10^{-4}\) Ha per atom. Recalling that the Kohn-Sham formalism leads to a generalized nonlinear eigenvalue problem, the efficient extraction of a large number of eigenpairs towards the solution of such problems on discretizations with \(\mathcal {O}(10^6)\) degrees of freedom continues to pose a computational challenge.

Fig. 2
figure 2

Isosurfaces for \(\rho \) (left) and \(v_H\) (right) for the buckyball where red spheres indicate the ions

5 Conclusion

Kohn-Sham density functional theory provides a rich foundation for constructing nonphenomenological multiscale approaches through which the understanding of material and interface behavior can be advanced. The finite element method offers an effective numerical framework in addressing the corresponding computational complexity, specifically in the context of higher-order discretizations. Numerous challenges must still be addressed in order to further explore and harness its potential advantages in electronic structure calculation. Presently, the accuracy gains per degree of freedom have been limited due to nearly uniform meshes employed. Adaptive mesh refinement in classical and isogeometric discretizations is an important next step towards a more effective utilization of the computational resources. This will enable addressing larger scale problems where geometry optimization may be required towards the determination of equilibrium structures or ab initio molecular dynamics may be pursued at the next scale towards the continuum.