This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Ionic forces and stress tensor in all-electron DFT calculations using enriched finite element basis

Nelson D. Rufus Department of Mechanical Engineering, University of Michigan, Ann Arbor, Michigan 48109, USA    Vikram Gavini Department of Mechanical Engineering, University of Michigan, Ann Arbor, Michigan 48109, USA Department of Materials Science & Engineering, University of Michigan, Ann Arbor, Michigan 48109, USA
Abstract

The enriched finite element basis—wherein the finite element basis is enriched with atom-centered numerical functions—has recently been shown to be a computationally efficient basis for systematically convergent all-electron DFT ground-state calculations. In this work, we present the expressions to compute variationally consistent ionic forces and stress tensor for all-electron DFT calculations in the enriched finite element basis. In particular, we extend the formulation of configurational forces in [Motamarri & Gavini (2018)] Motamarri and Gavini (2018) to the enriched finite element basis and elucidate the additional contributions arising from the enrichment functions. We demonstrate the accuracy of the formulation by comparing the computed forces and stresses for various benchmark systems with those obtained from finite-differencing the ground-state energy. Further, we also benchmark our calculations against Gaussian basis for molecular systems and against the LAPW+lo basis for periodic systems.

I Introduction

Density functional theory Hohenberg and Kohn (1964)(DFT) has been the workhorse of electronic structure calculations for many decades, providing important qualitative and quantitative insights into many materials properties. The success of DFT is attributed to the reduced computational complexity—cubic scaling with system size—via the Kohn-Sham (KS) formulation Kohn and Sham (1965), which reduces the many-body Schrödinger equation to an effective single-electron problem for ground-state properties. Thus, the electronic ground-state, for given positions of nuclei, can be computed by solving the Kohn-Sham eigenvalue problem. However, computing the ground-state energy of the system also requires structural relaxations, which necessitates the evaluation of ionic forces, and, in the context of periodic geometries, also the stress tensor associated with the cell geometry.

The ionic force on a nucleus is simply the negative derivative of the electronic ground-state energy with respect to the position of the nucleus. The dependence of the electronic ground-state energy on the position of nuclei comes about in the following two ways. Firstly, a change in nuclear positions results in a change in the electrostatic interaction energy, specifically the electron-nuclear and the nuclear-nuclear electrostatic energy. Secondly, the wavefunctions and the electron-density, implicitly depend on the nuclear positions. However, the latter does not contribute to the ionic forces as the first variation of the electronic ground-state energy with respect to the wavefunctions and the electron density vanishes. Thus, in principle, in a continuous setting, the ionic force is simply the classical electrostatic force, which is the celebrated Hellman-Feynman theoremHellmann (1937); Feynman (1939). However, in practice, in a discrete setting, there is often a need to account for additional contributions known as Pulay forces Pulay (1987), arising due to the dependence of the basis set on the positions of the nuclei. Similar considerations are needed while computing the stress tensor, which is the derivative of the electronic ground-state energy with respect to the strain tensor. As a consequence, there exists a large body of work describing the calculation of nuclear forcesIhm et al. (1979); Bendt and Zunger (1983); Scheffler et al. (1985); Nielsen and Martin (1985a); Fournier et al. (1989); Soler and Williams (1989); Jackson and Pederson (1990); Soler and Williams (1990); Yu et al. (1991); Delley (1991); Goedecker and Maschke (1992); Savrasov and Savrasov (1992); Pople et al. (1992); Methfessel and van Schilfgaarde M (1993); Fähnle et al. (1995); Kohler et al. (1996); Kresse and Furthmüller (1996); Wills et al. (2000); Soler et al. (2002); Alemany et al. (2004); Miyazaki et al. (2004); Blum et al. (2009); Hine et al. (2011); Ruiz-Serrano et al. (2012); Zhang et al. (2017) and stress tensorSlater (1972); Janak (1974); Nielsen and Martin (1983); Yin (1983); Nielsen and Martin (1985b, a); Dal Corso and Resta (1994); Kresse and Joubert (1999); Kudin and Scuseria (2000); Soler et al. (2002); Thonhauser et al. (2002); Doll et al. (2004); Torrent et al. (2008); Nagasako and Oguchi (2011); Knuth et al. (2015); Sharma and Suryanarayana (2018); Becker and Sierka (2019); Belbase et al. (2021) in the discrete basis-sets used to solve the Kohn-Sham problem.

In this work, we derive the expressions for ionic forces and stress tensor in DFT calculations using the enriched finite element (EFE) basis, and conduct verification studies to ascertain the accuracy. The finite element (FE) basis, which comprises of local piecewise continuous polynomials as basis functions, offers systematic convergence and excellent parallel scalability in DFT calculations, given the local nature of the basis. While many prior efforts have developed and explored the use of FE basis for DFT calculations (cf. e.g. White et al. (1989); Tsuchida and Tsukada (1996, 1998); Pask et al. (1999, 2001); Pask and Sterne (2005); Zhang et al. (2008); Suryanarayana et al. (2010); Fang et al. (2012); Bao et al. (2012); Motamarri et al. (2013)), recent developments Motamarri et al. (2020); Das et al. (2022) have demonstrated the utility of FE basis for conducting fast and accurate large-scale pseudopotential DFT calculations involving many tens of thousands of electrons Das et al. (2019); Motamarri et al. (2020); Zhuravel et al. (2020); Das et al. (2022). However, for all-electron electronic structure calculations, although prior works White et al. (1989); Tsuchida and Tsukada (1996); Batcho (2000); Bylaska et al. (2009); Lehtovaara et al. (2009); Alizadegan et al. (2010); Bao et al. (2012); Motamarri et al. (2013); Schauer and Linder (2013); Motamarri and Gavini (2014); Maday (2014); Davydov et al. (2016); Kanungo and Gavini (2019); Ghosh et al. (2019, 2021) have demonstrated the systematic convergence of the FE basis, the computational cost remains high, given the large number of FE basis functions that are needed to accurately describe the all-electron wavefunctions. The EFE basis, which enriches the FE basis with compactly supported enrichment functions—such as, for e.g., those constructed from single-atom wavefunctions—can be used to significantly reduce the number of FE basis functions, and consequently improve the computational efficiency of all-electron calculations. While EFE basis has been employed for both all-electron calculations Sukumar and Pask (2009); Kanungo and Gavini (2017); Yamakawa and Hyodo (2005); Rufus et al. (2021) as well as calculations involving hard pseudopotentials Pask and Sukumar (2017); Pask et al. (2012), in the present work we consider the framework of all-electron density functional theory.

The general approach to computing atomic forces or stresses in most numerical implementations relies on the outer variations of the Kohn-Sham energy functional with respect to the position of atoms (for computing forces) or the lattice vectors (for computing stress tensor). In the present work, however, we adopt a configurational force approach, which is based on inner variations of the Kohn-Sham energy functional. The configurational forces correspond to the generalized variational derivative of the Kohn-Sham energy functional with respect to the position of a material point x. The formulation is closely related to a recent work by Motamarri and Gavini Motamarri and Gavini (2018), who proposed the configurational force approach for the FE basis. In the present work, we extend the formulation of configurational forces to the enriched FE basis proposed in  Kanungo and Gavini (2017); Rufus et al. (2021), and derive the additional contributions that arise from the atom-centered enrichment functions. An advantage of the configurational force approach is that it provides a unified framework to compute ionic forces as well as cell stresses for geometry optimization.

We present numerical results that demonstrate the accuracy and efficacy of the proposed formulation to compute forces and cell stresses using the enriched FE basis for all-electron calculations. We perform calculations on two molecular systems—carbon monoxide (CO) and sulfur trioxide (SO3)—to demonstrate the applicability of the formulation to compute ionic forces in non-periodic systems. Further, we consider two periodic calculations, involving stress computations for the diamond 8-atom unit cell as well as ionic forces for silicon carbide (SiC) with a divacancy. In each case, we find convergence rates of close to 𝒪(h2p1)\mathcal{O}(h^{2p-1}) with respect to the mesh size hh and the FE order pp. Additionally, the ionic forces and stresses computed from finite-differencing the electronic ground-state energy were in excellent agreement with those obtained from the derived expression, thus ascertaining the accuracy and variational consistency of the expressions. Moreover, we also compare the obtained ionic forces and cell-stresses against other widely used codes, and demonstrate good agreement.

The remainder of the paper is organized as follows. In Sec. II, we derive expressions for the ionic forces and stress tensor for all-electron Kohn-Sham density functional theory calculations using the enriched FE basis. We do so by first presenting the real-space formulation of the Kohn-Sham variational problem employed in this work in Sec. II.1 and Sec. II.2. Subsequently, we provide details of the enriched finite element basis employed in this work in Sec. II.3. The expressions of the configurational forces are derived in Sec. II.4 for the enriched finite element basis. We conclude the section by describing the utility of configurational forces to evaluate ionic forces and the stress tensor in Sec. II.5. Next, in Sec. III, we present the numerical study and results that demonstrate the accuracy and efficacy of the proposed formulation to compute ionic forces and cell stresses. Finally, in Sec. IV, we summarize our findings and present an outlook.

II Formulation

In this section, we derive the expressions for ionic forces and stress tensor in all-electron Kohn-Sham density functional theory calculations using the enriched FE basis. In particular, we use the configurational forces approach which facilitates the computation of both the ionic forces and cell stresses in a unified framework. A configurational force is simply the Gâteaux derivative of the Kohn-Sham electronic ground-state energy functional along the direction of a prescribed deformation of the underlying space, with the deformation being characterized by a generator function. The configurational forces corresponding to an appropriate choice of generator functions are in turn used to evaluate the ionic forces and the stress tensor. The idea of using configurational forces to evaluate ionic forces and stress tensor in the context of FE basis was previously proposed for orbital-free DFT Das et al. (2015) and Kohn-Sham DFT Motamarri and Gavini (2018). In this work, we extend the formulation to all-electron Kohn-Sham DFT calculations using enriched FE basis, which is a mixed basis constructed by augmenting the FE basis with atom-centered numerical enrichment functions. While the derivation presented in this work is similar in spirit to Motamarri and Gavini (2018), there are some key differences. Firstly, we consider the discrete Kohn-Sham energy functional as our starting point, as opposed to the continuous setting in which the configurational forces were derived in the previous work Motamarri and Gavini (2018). This is essential in order to account for, as well as delineate, the contributions from the enrichment functions to the configurational forces. In the absence of basis enrichment functions, the expressions derived in this work would reduce to the ones presented in Motamarri and Gavini (2018). Secondly, in this work, we use the smeared charge approach proposed in Pask et al. (2012), which enables a more efficient treatment of the electrostatic interactions arising from nuclear charges.

In the following subsections, we present the formulation and derive the expressions for computing the ionic forces and stress tensor. For brevity, we only consider periodic systems. The expressions for the non-periodic case may be deduced by simply replacing the Brillouin zone sampling by an evaluation at k=0\boldsymbol{\textbf{k}}=0. In Sec. II.1 and II.2, we present the Kohn-Sham energy functional and the real-space formulation used in this work. This is followed by a brief description of the enriched FE employed in this work in Sec. II.3. We present the configurational forces in Sec. II.4, and present the approach to evaluate the ionic forces and stress tensor in Sec. II.5.

II.1 Kohn-Sham Density Functional Theory

Consider a periodic unit cell Ω\Omega containing NeN_{e} electrons and NaN_{a} nuclei with ionic position vectors R={R1,R2,,RNa}\boldsymbol{\textbf{R}}=\{\boldsymbol{\textbf{R}}_{1},\boldsymbol{\textbf{R}}_{2},\cdots,\boldsymbol{\textbf{R}}_{N_{a}}\}. Neglecting spin, the free energy of the system in Kohn-Sham density functional theory Hohenberg and Kohn (1964); Kohn and Sham (1965) at finite temperature Mermin (1965) is given by

(𝚪𝐮k,𝐮k,𝐑)=Ts(𝚪𝐮k,𝐮k,𝐑)+Exc(ρ)+Eel(ρ,𝐑)Eent(𝚪𝐮k),\begin{split}\mathcal{F}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\mathbf{R})=T_{\mathrm{s}}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\mathbf{R})+&E_{\mathrm{xc}}(\rho)+E_{\mathrm{el}}(\rho,\mathbf{R})-\\ &E_{\mathrm{ent}}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}})\>,\end{split} (1)

where 𝐮k={u1,k(x),u2,k(x),,uN,k(x)}(N>Ne/2)\mathbf{u}_{\boldsymbol{\textbf{k}}}=\{u_{1,\boldsymbol{\textbf{k}}}(\boldsymbol{\textbf{x}}),u_{2,\boldsymbol{\textbf{k}}}(\boldsymbol{\textbf{x}}),\cdots,u_{N,\boldsymbol{\textbf{k}}}(\boldsymbol{\textbf{x}})\}\>\>(N>N_{e}/2) represent electronic wavefunctions corresponding to k, a point in the reciprocal space. These wavefunctions are considered to be non-orthogonal, in general. 𝚪𝐮k\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}} represents the matrix corresponding to the single-particle density operator (Γ^\hat{\Gamma}) expressed in the non-orthogonal basis 𝐮k\mathbf{u}_{\boldsymbol{\textbf{k}}}. Hence, the elements of the matrix are given by Γpq𝐮k=r=1NSkpr1ur,k|Γ^|uq,k\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}=\sum_{r=1}^{N}{{S^{\boldsymbol{\textbf{k}}}}^{-1}_{pr}}\langle u_{r,\boldsymbol{\textbf{k}}}|\hat{\Gamma}|u_{q,\boldsymbol{\textbf{k}}}\rangle, where SkS^{\boldsymbol{\textbf{k}}} is the overlap matrix whose elements are given by

Sm,nk=Ωum,k(x)un,k(x)𝑑x.S^{\boldsymbol{\textbf{k}}}_{m,n}=\int_{\Omega}u_{m,\boldsymbol{\textbf{k}}}^{*}(\boldsymbol{\textbf{x}})\,u_{n,\boldsymbol{\textbf{k}}}(\boldsymbol{\textbf{x}})d\boldsymbol{\textbf{x}}\>. (2)

The superscript ‘’ in the above expression denotes complex conjugate. The electron density ρ(x)\rho(\boldsymbol{\textbf{x}}) in Eq. (1) can be written in terms of the density matrix and non-orthogonal wavefunctions as follows:

ρ(𝐱)=2ΩBZ{p,q,r=1NΓpq𝐮kSkqr1ur,k(x)up,k(x)}𝑑k,\rho(\mathbf{x})=2\fint_{\Omega_{\text{BZ}}}\left\{\sum_{p,q,r=1}^{N}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\,\,{{S^{\boldsymbol{\textbf{k}}}}^{-1}_{qr}}u_{r,\boldsymbol{\textbf{k}}}^{*}(\boldsymbol{\textbf{x}})\,u_{p,\boldsymbol{\textbf{k}}}(\boldsymbol{\textbf{x}})\right\}d\boldsymbol{\textbf{k}}\>, (3)

where the average integral over the Brillouin zone, in practice, is computed as a discrete sum over k-points lying in the Brillouin zone (BZBZ) with an associated weight wkw_{\boldsymbol{\textbf{k}}}. A common choice for the kk-point grid is the Monkhorst-Pack (MP) scheme Monkhorst and Pack (1976), which is adopted in this work. In the present work, we restrict our analysis to spin-independent systems. However, all the ideas discussed subsequently can be generalized to spin-dependent systems.

The first constituent of the free energy functional in Eq. (1) is the kinetic energy of the non-interacting electrons, TsT_{s}, which is given by

Ts(𝚪𝐮k,𝐮k)=2ΩBZ{p,q,r=1NΩΓpq𝐮kSkqr1ur,k(𝐱)(12(+ik)2)up,k(𝐱)𝑑𝐱}𝑑k.T_{\text{s}}\left(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\mathbf{u}_{\boldsymbol{\textbf{k}}}\right)=2\fint_{\Omega_{\text{BZ}}}\left\{\sum_{p,q,r=1}^{N}\int_{\Omega}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}{S^{\boldsymbol{\textbf{k}}}}^{-1}_{qr}u_{r,\boldsymbol{\textbf{k}}}^{*}(\mathbf{x})\left(-\frac{1}{2}(\nabla+i\boldsymbol{\textbf{k}})^{2}\right)u_{p,\boldsymbol{\textbf{k}}}(\mathbf{x})d\mathbf{x}\right\}d\boldsymbol{\textbf{k}}\>. (4)

The exchange-correlation functional in the local density approximation (LDA)Ceperley and Alder (1980); Perdew and Zunger (1981) adopted in this work is given by

Exc(ρ)=ΩF(ρ)𝑑x=Ωεxc(ρ)ρ(x)𝑑x.E_{\text{xc}}(\rho)=\int_{\Omega}F(\rho)d\boldsymbol{\textbf{x}}=\int_{\Omega}\varepsilon_{xc}(\rho)\rho(\boldsymbol{\textbf{x}})d\boldsymbol{\textbf{x}}\,. (5)

EelE_{\text{el}} represents the classical electrostatic interaction energy between the electrons and nuclei and can be written as follows:

Eel(ρ,𝐑)=EH(ρ)+Eext(ρ,𝐑)+EZZ(R),E_{\text{el}}(\rho,\mathbf{R})=E_{\text{H}}(\rho)+E_{\text{ext}}(\rho,\mathbf{R})+E_{\text{ZZ}}(\boldsymbol{\textbf{R}})\>, (6)

where EHE_{\text{H}} and EZZE_{\text{ZZ}} are the Hartree energy and the nuclear repulsive energy, respectively, and are given by

EH(ρ)=12Ω3ρ(x)ρ(x)|xx|𝑑x𝑑x,E_{\mathrm{H}}(\rho)=\frac{1}{2}\int_{\Omega}\int_{\mathbb{R}^{3}}\frac{\rho(\boldsymbol{\textbf{x}})\rho(\boldsymbol{\textbf{x}}^{\prime})}{|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{x}}^{\prime}|}d\boldsymbol{\textbf{x}}^{\prime}d\boldsymbol{\textbf{x}}\>, (7)

and

Ezz(R)=12IJ,JIZIZJ|𝐑I𝐑J|.E_{\mathrm{zz}}(\boldsymbol{\textbf{R}})=\frac{1}{2}\sum_{I}\sum_{J,\,J\neq I}\frac{Z_{I}Z_{J}}{\left|\mathbf{R}_{I}-\mathbf{R}_{J}\right|}\>. (8)

Note that, in the above equation, the sum over JJ represents all nuclei in 3\mathbb{R}^{3} while the sum over II includes only those in the domain Ω\Omega. EextE_{\text{ext}} in Eq. (6) represents the interaction between electrons and nuclei and is given by

Eext(ρ,R)=JΩρ(𝐱)ZJ|𝐱𝐑J|𝑑𝐱.E_{\mathrm{ext}}(\rho,\boldsymbol{\textbf{R}})=-\sum_{J}\int_{\Omega}\rho(\mathbf{x})\frac{Z_{J}}{\left|\mathbf{x}-\mathbf{R}_{J}\right|}d\mathbf{x}\>. (9)

Lastly, the entropic energy of the electrons in Eq. (1) is given by

Eent(𝚪𝐮k)=2σΩBZtr[𝚪𝐮kln𝚪𝐮k+(𝑰𝚪𝐮k)ln(𝑰𝚪𝐮k)]𝑑k,E_{\text{ent}}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}})=-2\sigma\fint_{\Omega_{\text{BZ}}}\text{tr}\left[\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\ln\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}+\left(\boldsymbol{I}-\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\right)\ln\left(\boldsymbol{I}-\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\right)\right]d\boldsymbol{\textbf{k}}\>, (10)

where σ=kBT\sigma=k_{B}T with kBk_{B} denoting the Boltzmann constant and TT denoting the electronic temperature.

The electronic ground-state, for given nuclear positions, is given by the following variational problem:

min𝚪𝐮kN×Nmin𝐮k(Hper1(Ω))Nc(𝚪𝐮k,𝐮k,𝐑),kBZ\min_{\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\in\mathbb{R}^{N\times N}}\min_{\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\in(H_{\text{per}}^{1}(\Omega))^{N}}\mathcal{F}_{c}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\mathbf{R})\>,\quad\forall\,\boldsymbol{\textbf{k}}\in BZ (11)

where c\mathcal{F}_{c} is a constrained free-energy functional given by

c=μ[2tr(ΩBZ𝚪𝐮k𝑑k)Ne].\mathcal{F}_{c}=\mathcal{F}-\mu\left[2\operatorname{tr}\left(\fint_{\Omega_{\text{BZ}}}\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}d\boldsymbol{\textbf{k}}\right)-N_{e}\right]\>. (12)

In the above equation, μ\mu, which is the Lagrange multiplier corresponding to the constraint on the number of electrons, also denotes the Fermi level. We note that Hper1(Ω)H_{\text{per}}^{1}(\Omega) denotes the Hilbert space of periodic functions such that the functions and their first-order derivatives are square-integrable in Ω\Omega.

II.2 Local real-space formulation of Kohn-Sham DFT

Here we present the local real-space formulation that forms the basis for the derivation of the configurational forces expression. To begin with, the electrostatic interaction energy Eq. (6) presented in the last section are extended in real-space. However, these extended interactions can be recast into a local variational formulation using auxiliary electrostatic potentials (cf. Das et al. (2015)) as:

EH(ρ)+Eext(ρ,R)+Ezz(R)=maxϕHper1(Ω){Ω[(ρ(x)+b(x,R))ϕ(x)18π|ϕ(x)|2]𝑑x}I=1NamaxVIH1(3){[bI(x,R)VI(x)18π|VI(x)|2]𝑑x}.\begin{split}E_{\mathrm{H}}(\rho)+E_{\mathrm{ext}}(\rho,\boldsymbol{\textbf{R}})+E_{\mathrm{zz}}(\boldsymbol{\textbf{R}})=\max_{\phi\in H_{\text{per}}^{1}(\Omega)}\left\{\int_{\Omega}\Big{[}(\rho(\boldsymbol{\textbf{x}})+b(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}}))\phi(\boldsymbol{\textbf{x}})-\frac{1}{8\pi}\left|\nabla\phi(\boldsymbol{\textbf{x}})\right|^{2}\Big{]}d\boldsymbol{\textbf{x}}\right\}-\\ \sum_{I=1}^{N_{a}}\max_{V_{I}\in H^{1}\left(\mathbb{R}^{3}\right)}\left\{\int\Big{[}b_{I}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}})V_{I}(\boldsymbol{\textbf{x}})-\frac{1}{8\pi}\left|\nabla V_{I}(\boldsymbol{\textbf{x}})\right|^{2}\Big{]}d\boldsymbol{\textbf{x}}\right\}\>.\end{split} (13)

In the above equation, b(x,R)=IbI(x,R)=IZIδ~(|x𝐑I|)b(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}})=\sum_{I}b_{I}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}})=\sum_{I}-Z_{I}\tilde{\delta}\left(\left|\boldsymbol{\textbf{x}}-\mathbf{R}_{I}\right|\right) is the nuclear charge density represented using regularized Dirac-delta functions centered at the nucleus. Also, the second term in Eq. (13) serves the purpose of removing the nuclear self-interaction contribution contained in the first term.

In the present work, however, we adopt the smeared charge representation for the nuclear charge Pask et al. (2012) which is computationally more efficient in a discrete setting. To this end, the nuclear charge density is written as

bs(x)=Ibs,I(x)=IZIg(|xRI|,rc,I),b_{s}(\boldsymbol{\textbf{x}})=\sum_{I}b_{s,I}(\boldsymbol{\textbf{x}})=\sum_{I}-Z_{I}g(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I})\,, (14)

where g(|xRI|,rc,I)g(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I}) denotes a smeared charge which is localized within |xRI|<rc,I|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|<r_{c,I} and integrates to unity. We employ the following form for the unit smeared charge Pask et al. (2012)

g(r,rc)={21(rrc)3(6r2+3rrc+rc2)5πrc8,0rrc,0,r>rcg(r,r_{c})=\begin{cases}\frac{-21(r-r_{c})^{3}(6r^{2}+3rr_{c}+r_{c}^{2})}{5\pi r_{c}^{8}},&0\leq r\leq r_{c},\\ 0,&r>r_{c}\end{cases} (15)

The rc,Ir_{c,I}’s are chosen to be the largest possible values that avoid overlap between two neighboring smeared charges. We note that, while not explicitly indicated, the smeared charge sphere is considered to wrap around the periodic boundary should it breach the boundaries of the computational domain. The local reformulation for the electrostatic energy using smeared nuclear charge is given by

Eel(ρ,𝐑)=EH(ρ)+Eext(ρ,R)+Ezz(R)=maxϕHper1(Ω)el(ϕ,ρ,𝐑),\begin{split}E_{\text{el}}(\rho,\mathbf{R})&=E_{\mathrm{H}}(\rho)+E_{\mathrm{ext}}(\rho,\boldsymbol{\textbf{R}})+E_{\mathrm{zz}}(\boldsymbol{\textbf{R}})\\ &=\max_{\phi\in H_{\text{per}}^{1}(\Omega)}\mathcal{L}_{\text{el}}(\phi,\rho,\mathbf{R})\>,\end{split} (16)

where

el(ϕ,ρ,𝐑)=Ω[(ρ(x)+bs(x,R))ϕ(x)18π|ϕ(x)|2]𝑑x+IΩIρ(x)[VI(|xRI|)Vs,I(|xRI|,rc,I)]𝑑xI12ΩIbs,I(x)Vs,I(|xRI|,rc,I)𝑑x.\begin{split}\mathcal{L}_{\text{el}}(\phi,\rho,\mathbf{R})=&\int_{\Omega}\Big{[}(\rho(\boldsymbol{\textbf{x}})+b_{s}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}}))\phi(\boldsymbol{\textbf{x}})-\frac{1}{8\pi}\left|\nabla\phi(\boldsymbol{\textbf{x}})\right|^{2}\Big{]}d\boldsymbol{\textbf{x}}+\sum_{I}\int_{\Omega_{I}}\rho(\boldsymbol{\textbf{x}})\Big{[}V_{I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|\right)-V_{s,I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I}\right)\Big{]}d\boldsymbol{\textbf{x}}\\ &-\sum_{I}\frac{1}{2}\,\int_{\Omega_{I}}b_{s,I}(\boldsymbol{\textbf{x}})V_{s,I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I}\right)d\boldsymbol{\textbf{x}}\>.\end{split} (17)

In the above, (ρ(x)+bs(x,R))(\rho(\boldsymbol{\textbf{x}})+b_{s}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}})) constitutes a charge-neutral system. The second term is a correction term containing the difference between the exact nuclear potential (VIV_{I}) corresponding to the point nuclear charge and the smeared nuclear potential (Vs,IV_{s,I}) corresponding to bs,Ib_{s,I}. These are given by

VI(r)=ZIr,V_{I}(r)=-\frac{Z_{I}}{r}\,, (18)
Vs,I(r,rc,I)=ZIvg(r,rc,I),V_{s,I}(r,r_{c,I})=-Z_{I}v_{g}(r,r_{c,I})\,, (19)

where vg(r,rc)v_{g}(r,r_{c}) is the potential corresponding to the g(r,rc)g(r,r_{c}) and is given by

vg(r,rc)={9r730r6rc+28r5rc214r2rc5+12rc75rc8,0rrc1r,r>rc.v_{g}(r,r_{c})=\begin{cases}\frac{9r^{7}-30r^{6}r_{c}+28r^{5}r_{c}^{2}-14r^{2}r_{c}^{5}+12r_{c}^{7}}{5r_{c}^{8}},&0\leq r\leq r_{c}\\ \frac{1}{r},&r>r_{c}\,.\end{cases} (20)

We note that since VIV_{I} and Vs,IV_{s,I} are identical for r>rc,Ir>r_{c,I}, the correction for each nucleus is evaluated only inside the sphere of radius rc,Ir_{c,I} around RI\boldsymbol{\textbf{R}}_{I}, whose domain is denoted by ΩI\Omega_{I}. The last term in Eq. (17) removes the self-interaction energy corresponding to the smeared nuclear charges.

Finally, the electronic ground-state energy for a given positions of the nuclei R can be computed using Eq. (11) and Eq. (16) as the following variational problem:

E0(𝐑)=(𝚪¯𝐮k,𝐮¯k,ϕ¯,𝐑)=min𝚪𝐮kN×Nmin𝐮k(Hper1(Ω))NmaxϕHper1(Ω)(𝚪𝐮k,𝐮k,ϕ,𝐑),E_{0}(\mathbf{R})=\mathcal{L}(\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},{\bar{\mathbf{u}}_{\boldsymbol{\textbf{k}}}},\bar{\phi},\mathbf{R})=\min_{\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\in\mathbb{R}^{N\times N}}\min_{\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\in(H_{\text{per}}^{1}(\Omega))^{N}}\max_{\phi\in H_{\text{per}}^{1}(\Omega)}\mathcal{L}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\phi,\mathbf{R})\>, (21)

where

(𝚪𝐮k,𝐮k,ϕ,𝐑)=Ts(𝚪𝐮k,𝐮k,𝐑)+Exc(ρ)+el(ϕ,ρ,𝐑)Eent(𝚪𝐮k)μ[2tr(ΩBZ𝚪𝐮k𝑑k)Ne].\mathcal{L}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\phi,\mathbf{R})=T_{\mathrm{s}}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\boldsymbol{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\mathbf{R})+E_{\mathrm{xc}}(\rho)+\mathcal{L}_{\text{el}}(\phi,\rho,\mathbf{R})-E_{\mathrm{ent}}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}})-\mu\left[2\operatorname{tr}\left(\fint_{\Omega_{\text{BZ}}}\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}d\boldsymbol{\textbf{k}}\right)-N_{e}\right]\>. (22)

In the above, \mathcal{L} denotes the local reformulation of the constrained free-energy functional c\mathcal{F}_{c}, and 𝚪¯𝐮k,𝐮¯k\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bar{\mathbf{u}}_{\boldsymbol{\textbf{k}}} and ϕ¯\bar{\phi} denote the extremizers of the variational problem.

II.3 Enriched Finite Element basis

The enriched finite element (EFE) basis used in this work is constructed by augmenting the finite element (FE) basis with atom-centered enrichment functions. The enrichment functions, which attempt to capture the highly oscillatory behavior of the wavefunctions around the nuclei, obviate the need for highly refined finite element mesh near the nuclei, thus greatly reducing the computational cost. In this work, we derive configurational forces in the context of enriched finite element basis presented by Kanungo and Gavini Kanungo and Gavini (2017). We note that using the EFE basis tends to yield ill-conditioned matrices in both the generalized eigenvalue problem and the linear system of equations (electrostatics). This affects the robustness of the self-consistent field iterations. There are many approaches Schweitzer (2011); Albrecht et al. (2018) proposed in recent years to address this problem. In particular, Rufus et. al. Rufus et al. (2021) have proposed the orthogonalized enriched FE (OEFE) basis, in which, the atomic solutions are orthogonalized with respect to the underlying FE basis before augmenting as enrichments. The OEFE basis yields well-conditioned matrices ensuring numerical robustness. However, we note that the EFE basis presented in Kanungo and Gavini (2017) and the OEFE basis presented in  Rufus et al. (2021) span the same function space. Thus, in this work we employ the following strategy to compute ionic forces and cell stresses. First, we compute the electronic ground-state using the OEFE basis. We subsequently transform the fields from the OEFE to the EFE basis. Finally, we evaluate the forces and stresses using the expressions presented in this work. We derive the configurational force expressions in the EFE basis to avoid accounting for the additional contributions arising from the orthogonalizing terms in the OEFE basis.

Next, we provide a brief overview of the EFE basis. In the EFE basis, the wavefunctions uα,k(x)u_{\alpha,\boldsymbol{\textbf{k}}}(\boldsymbol{\textbf{x}}) are approximated as

uα,𝐤(x)uα,𝐤h(x)=i=1nhNiC(x)uα,k,iCClassical FE+I=1Naj=1nINj,IE,uk(xRI)uα,k,j,IEEnrichment.\begin{split}u_{\alpha,\mathbf{k}}(\boldsymbol{\textbf{x}})\approx\,&u_{\alpha,\mathbf{k}}^{h}(\boldsymbol{\textbf{x}})\\ =&\underbrace{\sum_{i=1}^{n_{h}}N^{C}_{i}(\boldsymbol{\textbf{x}})u_{\alpha,\boldsymbol{\textbf{k}},i}^{C}}_{\text{Classical FE}}+\underbrace{\sum_{I=1}^{N_{a}}\sum_{j=1}^{n_{I}}N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})u_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}}_{\text{Enrichment}}\,.\end{split} (23)

In the above equation, the superscript hh indicates a discrete field, and the superscript CC and EE are used to distinguish the classical and the enrichment components, respectively. In particular, NiC(x)N^{C}_{i}(\boldsymbol{\textbf{x}}) denotes the ithi\textsuperscript{th} classical FE basis function, and uα,k,iCu_{\alpha,\boldsymbol{\textbf{k}},i}^{C} denotes the expansion coefficient of NiC(x)N^{C}_{i}(\boldsymbol{\textbf{x}}) for uα,𝐤u_{\alpha,\mathbf{k}}. Similarly, Nj,IE,uk(x)N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}) denotes the kk-point dependent enrichment function for uα,𝐤(α)u_{\alpha,\mathbf{k}}~{}(\forall\alpha). The index II runs over all the atoms (NaN_{a}) in the system, and the index jj runs over all the atomic Kohn-Sham orbitals (nIn_{I}) we include for the atom II. In other words, the IIth atom, situated at RI\boldsymbol{\textbf{R}}_{I}, contributes nIn_{I} enrichment functions, each centered around RI\boldsymbol{\textbf{R}}_{I}. uα,k,j,IEu_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E} represents the expansion coefficient of Nj,IE,uk(xRI)N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}) corresponding to uα,𝐤u_{\alpha,\mathbf{k}}. The reader is referred to Kanungo and Gavini (2017); Rufus et al. (2021) for the form of Nj,IE,uk(xRI)N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}).

In a similar vein, the electrostatic potential ϕ\phi is given as

ϕ(x)ϕh(x)=j=1nhNjC(x)ϕjCClassical FE+I=1NaNIE,ϕ(xRI)ϕIEEnrichment.\phi(\boldsymbol{\textbf{x}})\approx\phi^{h}(\boldsymbol{\textbf{x}})=\underbrace{\sum_{j=1}^{n_{h}}N^{C}_{j}(\boldsymbol{\textbf{x}})\phi_{j}^{C}}_{\text{Classical FE}}+\underbrace{\sum_{I=1}^{N_{a}}N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\phi_{I}^{E}}_{\text{Enrichment}}\,. (24)

As with the discretization of uα,𝐤u_{\alpha,\mathbf{k}} (Eq.( 23)), NjC(x)N^{C}_{j}(\boldsymbol{\textbf{x}}) denotes the jthj\textsuperscript{th} classical FE basis function and ϕjC\phi_{j}^{C} denotes its corresponding coefficient. Similarly, NIE,ϕ(xRI)N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}) is the IthI\textsuperscript{th} enrichment function with a corresponding coefficient ϕIC\phi_{I}^{C}.

Thus, in the finite-dimensional EFE basis, the electronic ground-state energy is given by

E0h(R)=(𝚪¯𝐮k,{uα,kh({NiC(x)},{u¯α,k,iC},{Nj,IE,uk(xRI)},{u¯α,k,j,IE})},ϕh({NjC(x)},{ϕ¯jC},{NIE,ϕ(xRI)},{ϕ¯IE}),𝐑)=min𝚪𝐮kN×Nmin{uα,k,iC}N×nhmin{uα,k,νE}N×nEukmax{ϕjC}nhmax{ϕjE}Na(𝚪𝐮k,{uα,kh({NiC(x)},{uα,k,iC},{Nj,IE,uk(xRI)},{uα,k,j,IE})},ϕh({NjC(x)},{ϕjC},{NIE,ϕ(xRI)},{ϕIE}),𝐑).\begin{split}E_{0}^{h}(\boldsymbol{\textbf{R}})&=\mathcal{L}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u^{h}_{\alpha,\boldsymbol{\textbf{k}}}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\bar{\phi}_{I}^{E}\}\Big{)},\mathbf{R}\bigg{)}\\ &=\min_{\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\in\mathbb{R}^{N\times N}}\min_{\{u_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\}\in\mathbb{C}^{N\times{n_{h}}}}\min_{\{u_{\alpha,\boldsymbol{\textbf{k}},\nu}^{E}\}\in\mathbb{C}^{N\times{n_{E}^{u_{\boldsymbol{\textbf{k}}}}}}}\max_{\{\phi_{j}^{C}\}\in\mathbb{R}^{n_{h}}}\max_{\{\phi_{j}^{E}\}\in\mathbb{R}^{N_{a}}}\\ &\,\,\mathcal{L}\bigg{(}\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u^{h}_{\alpha,\boldsymbol{\textbf{k}}}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{u_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{u_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\phi_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\phi_{I}^{E}\}\Big{)},\mathbf{R}\>\bigg{)}\>.\end{split} (25)

In the above equation, {.}\{\,.\,\} are used to denote lists of functions or scalar coefficients running over all indices. 𝚪¯𝐮k,{u¯α,k,iC},{u¯α,k,j,IE},{ϕ¯jC} and {ϕ¯IE}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\},\{\bar{\phi}_{j}^{C}\}\text{ and }\{\bar{\phi}_{I}^{E}\} denote the discrete ground-state solution (stationarity point of \mathcal{L}) for given nuclear positions R and basis functions. These quantities can be computed by solving the Kohn-Sham equations in the EFE basis. In particular, in the context of canonical eigenfunctions, {u¯α,k,iC}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\} and {u¯α,k,νE}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},\nu}^{E}\} are the solution of the generalized Kohn-Sham eigenvalue problem; 𝚪¯𝐮k\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}} contains the fractional occupancies of the eigenstates given by the Fermi-Dirac distribution; {ϕ¯jC} and {ϕ¯IE}\{\bar{\phi}_{j}^{C}\}\text{ and }\{\bar{\phi}_{I}^{E}\} are solutions to the Poisson problem governing the electrostatic interactions.

II.4 Configurational forces

We now derive expressions for the configurational force corresponding the electronic ground-state free energy in Eq. (21). We employ the approach of inner variations, where the generalized force corresponding to a perturbation of underlying space is evaluated. To this end, we define a bijective mapping 𝝉ε:33\boldsymbol{\tau}^{\varepsilon}\,:\mathbb{R}^{3}\mapsto\mathbb{R}^{3} which represents an infinitesimal perturbation of the underlying space, mapping a material point x to a new point xε=𝝉ε(x)\boldsymbol{\textbf{x}}^{\mathbf{\varepsilon}}=\boldsymbol{\tau}^{\varepsilon}(\boldsymbol{\textbf{x}}). Using a Taylor series expansion in ε\varepsilon, this mapping can be written as

𝝉ε(x)=x+ε𝚼(x)+𝒪(ε2),\boldsymbol{\tau}^{\varepsilon}(\boldsymbol{\textbf{x}})=\boldsymbol{\textbf{x}}+\varepsilon\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})+\mathcal{O}(\varepsilon^{2})\>, (26)

where 𝚼(x)=ddε𝝉ε(x)|ε=0\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})=\left.\frac{d}{d\varepsilon}\boldsymbol{\tau}^{\varepsilon}(\boldsymbol{\textbf{x}})\right|_{\varepsilon=0} is the generator of the spatial perturbation. We note that x0=x\boldsymbol{\textbf{x}}^{0}=\boldsymbol{\textbf{x}} denotes the reference configuration.

The configurational force corresponding to a prescribed 𝝉ε(x)\boldsymbol{\tau}^{\varepsilon}(\boldsymbol{\textbf{x}}) is given by

ddεε(𝚪¯𝐮k,ε,𝐮¯kε,ϕ¯ε,𝐑ε)|ε=0,\left.\frac{d}{d\varepsilon}\mathcal{L}^{\varepsilon}(\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon},\bar{\mathbf{u}}^{\varepsilon}_{\boldsymbol{\textbf{k}}},\bar{\phi}^{\varepsilon},\mathbf{R}^{\varepsilon})\right|_{\varepsilon=0}\,, (27)

where 𝚪¯𝐮k,ε\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon}, 𝐮¯kε\bar{\mathbf{u}}^{\varepsilon}_{\boldsymbol{\textbf{k}}} and ϕ¯ε\bar{\phi}^{\varepsilon} are the extremizers of constrained free energy functional in the perturbed configuration (ε\mathcal{L}^{\varepsilon}). In other words, the configurational force is the Gâteaux derivative of ε\mathcal{L}^{\varepsilon} in the direction of 𝚼(x)\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}) with all the electronic fields set to the electronic ground-state.

In the discrete setting with the enriched finite element basis, the configurational force is given by

F^h(𝚼(x))=ddεε(𝚪¯𝐮k,ε,{uα,kh({NiC,ε(xε)},{u¯α,k,iC,ε},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE,ε})},ϕh({NjC,ε(xε)},{ϕ¯jC,ε},{NIE,ϕ(xεRIε)},{ϕ¯IE,ε}),𝐑ε)|ε=0.\begin{split}\hat{F}^{h}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=\frac{d}{d\varepsilon}\mathcal{L}^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C,\varepsilon}_{i}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C,\varepsilon}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E,\varepsilon}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C,\varepsilon}_{j}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{\phi}_{j}^{C,\varepsilon}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E,\varepsilon}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}\bigg{|}_{\varepsilon=0}\,.\end{split} (28)

We note that in computing the configurational force in the discrete setting, we choose the generator from the subspace spanned by the FE basis (cf. Sec II.5) as it allows us to take advantage of the isoparametric nature of FE basis functions. In the above, 𝚪¯𝐮k,ε,{u¯α,k,iC,ε},{u¯α,k,j,IE,ε},{ϕ¯jC,ε}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C,\varepsilon}\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E,\varepsilon}\},\{\bar{\phi}_{j}^{C,\varepsilon}\} and {ϕ¯IE,ε}\{\bar{\phi}_{I}^{E,\varepsilon}\} represent the ground-state electronic fields in the discrete setting, i.e., the extremizers of ε\mathcal{L}^{\varepsilon} in subspace spanned by the enriched FE basis. It is important to note here that the enrichment functions {Nj,IE,uk(xεRε)}\{N_{j,I}^{E,u_{\boldsymbol{\textbf{k}}}}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}^{\varepsilon})\} and {NIE,ϕ(xεRε)}\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}^{\varepsilon})\} retain their form even when the underlying space is deformed, as these are a priori computed enrichment functions independent of the finite element discretization.

For the sake of further simplification, we express the constrained free energy functional in terms of the energy density ff as

(𝚪𝐮k,{uα,kh({NiC(x)},{uα,k,iC},{Nj,IE,uk(xRI)},{uα,k,j,IE})},ϕh({NjC(x)},{ϕjC},{NIE,ϕ(xRI)},{ϕIE}),𝐑)=Ωf(𝚪𝐮k,{uα,kh({NiC(x)},{uα,k,iC},{Nj,IE,uk(xRI)},{uα,k,j,IE})},ϕh({NjC(x)},{ϕjC},{NIE,ϕ(xRI)},{ϕIE}),𝐑)𝑑x.\begin{split}&\mathcal{L}\bigg{(}\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{u_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{u_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\phi_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\phi_{I}^{E}\}\Big{)},\mathbf{R}\bigg{)}\\ &=\int_{\Omega}f\bigg{(}\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{u_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{u_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\phi_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\phi_{I}^{E}\}\Big{)},\mathbf{R}\bigg{)}d\boldsymbol{\textbf{x}}\>.\end{split} (29)

The configurational force is decomposed as follows (refer to Appendix for details):

F^h(𝚼(x))=ddε[Ωεfε(𝚪¯𝐮k,ε,{uα,kh({NiC,ε(xε)},{u¯α,k,iC,ε},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE,ε})},ϕh({NjC,ε(xε)},{ϕ¯jC,ε},{NIE,ϕ(xεRIε)},{ϕ¯IE,ε}),𝐑ε)dxε]|ε=0=F^1(𝚼(x))+F^2(𝚼(x)),\begin{split}\hat{F}^{h}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))&=\frac{d}{d\varepsilon}\Bigg{[}\int_{\Omega^{\varepsilon}}f^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C,\varepsilon}_{i}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C,\varepsilon}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E,\varepsilon}\}\Big{)}\bigg{\}},\\ &\qquad\qquad\qquad\phi^{h}\Big{(}\{N^{C,\varepsilon}_{j}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{\phi}_{j}^{C,\varepsilon}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E,\varepsilon}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}d\boldsymbol{\textbf{x}}^{\varepsilon}\Bigg{]}\bigg{|}_{\varepsilon=0}\\ &=\hat{F}_{1}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))+\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))\>,\end{split} (30)

where F^1\hat{F}_{1} denotes the contribution to the configurational force that arise from all dependencies on ε\varepsilon excepting those that arise from the enrichment functions, and F^2\hat{F}_{2} denotes the contribution to the configurational force that arise from the enrichment functions. In particular,

F^1(𝚼(x))=ddε[Ωεfε(𝚪¯𝐮k,ε,{uα,kh({NiC(x)},{u¯α,k,iC,ε},{Nj,IE,uk(xRI)},{u¯α,k,j,IE,ε})},ϕh({NjC(x)},{ϕ¯jC,ε},{NIE,ϕ(xRI)},{ϕ¯IE,ε}),𝐑ε)dxε]|ε=0.\begin{split}\hat{F}_{1}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))&=\frac{d}{d\varepsilon}\Bigg{[}\int_{\Omega^{\varepsilon}}f^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C,\varepsilon}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E,\varepsilon}\}\Big{)}\bigg{\}},\\ &\qquad\qquad\qquad\phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C,\varepsilon}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\bar{\phi}_{I}^{E,\varepsilon}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}d\boldsymbol{\textbf{x}}^{\varepsilon}\Bigg{]}\bigg{|}_{\varepsilon=0}\,.\end{split} (31)

We note that, in writing the above expression, we have made use of the isoparametric nature of the FE basis functions, i.e., NiC,ε(xε)=NiC(x)N^{C,\varepsilon}_{i}(\boldsymbol{\textbf{x}}^{\varepsilon})=N^{C}_{i}(\boldsymbol{\textbf{x}}). We note that the configurational force is of a similar form as the one considered in Motamarri & Gavini Motamarri and Gavini (2018), albeit in a discrete setting. Thus, using the previously derived results Motamarri and Gavini (2018), we note that we can evaluate F^1(𝚼(x))\hat{F}_{1}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) in terms of the canonical Kohn-Sham eigenfunctions as follows:

F^1(𝚼(x))=Ω𝐄:𝚼(𝐱)d𝐱+FK+FS,\begin{split}\hat{F}_{1}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=\int_{\Omega}\mathbf{E}:\nabla\boldsymbol{\Upsilon}(\mathbf{x})d\mathbf{x}+\mathrm{F}^{K}+\mathrm{F}^{\text{S}}\>,\end{split} (32)

where the Eshelby tensor 𝐄\mathbf{E} is given by

𝐄=(ΩBZ[αf¯α,k{u¯α,kh,(x)u¯α,kh(x)2iu¯α,kh,(x)ku¯α,kh(x)+(|k|22ϵ¯α,𝐤)|u¯α,kh(x)|2}]dk+εxc(ρ¯h)ρ¯h(x)+(ρ¯h(x)+bs(x,R))ϕ¯h(x)18π|ϕ¯h(x)|2)𝑰ΩBZ[αf¯α,k{u¯α,kh,(x)u¯α,kh(x)+u¯α,kh(x)u¯α,kh,(x)2iu¯α,kh,(x)(u¯α,kh(x)k)}]𝑑k+14πϕ¯h(x)ϕ¯h(x),\begin{split}\mathbf{E}=\Bigg{(}\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\>\bigg{\{}\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\cdot\nabla\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})\,-2i\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\boldsymbol{\textbf{k}}\cdot\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+(|\boldsymbol{\textbf{k}}|^{2}-2\bar{\epsilon}_{\alpha,\mathbf{k}})|\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})|^{2}\bigg{\}}\Bigg{]}d\boldsymbol{\textbf{k}}\>\\ +\varepsilon_{xc}(\bar{\rho}^{h})\bar{\rho}^{h}(\boldsymbol{\textbf{x}})+(\bar{\rho}^{h}(\boldsymbol{\textbf{x}})+b_{s}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}}))\bar{\phi}^{h}(\boldsymbol{\textbf{x}})-\frac{1}{8\pi}\big{|}\nabla\bar{\phi}^{h}(\boldsymbol{\textbf{x}})\big{|}^{2}\Bigg{)}\boldsymbol{I}\\ -\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\>\bigg{\{}\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\otimes\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})\otimes\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})-2i\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\big{(}\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})\otimes\boldsymbol{\textbf{k}}\big{)}\bigg{\}}\Bigg{]}d\boldsymbol{\textbf{k}}\\ +\frac{1}{4\pi}\nabla\bar{\phi}^{h}(\boldsymbol{\textbf{x}})\otimes\nabla\bar{\phi}^{h}(\boldsymbol{\textbf{x}})\>,\end{split} (33)

and

FK=ΩBZ[αf¯α,kΩ{2iu¯α,kh,(x)ddεkε|ε=0u¯α,kh(x)+ddε|kε|2|ε=0|u¯α,kh(x)|2}𝑑x]𝑑k.\mathrm{F}^{K}=\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\int_{\Omega}\>\bigg{\{}-2i\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\left.\frac{d}{d\varepsilon}\boldsymbol{\textbf{k}}^{\varepsilon}\right|_{\varepsilon=0}\cdot\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\left.\frac{d}{d\varepsilon}|\boldsymbol{\textbf{k}}^{\varepsilon}|^{2}\right|_{\varepsilon=0}|\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})|^{2}\bigg{\}}d\boldsymbol{\textbf{x}}\Bigg{]}d\boldsymbol{\textbf{k}}\>. (34)

We note that, in the above expression, kε\boldsymbol{\textbf{k}}^{\varepsilon} depends on the nature of the generator. For a Gaussian-type generator used in the force calculations (cf. Sec. II.5), since there is no change in the lattice vectors, we have

kε(k)=kddεkε|ε=0=𝟎\boldsymbol{\textbf{k}}^{\varepsilon}(\boldsymbol{\textbf{k}})=\boldsymbol{\textbf{k}}\implies\left.\frac{d}{d\varepsilon}\boldsymbol{\textbf{k}}^{\varepsilon}\right|_{\varepsilon=0}=\mathbf{0} (35)

However, under affine deformations, this dependence is given by:

kε(k)=(𝐈ε𝐂T)kddεkε|ε=0=𝐂Tk,\boldsymbol{\textbf{k}}^{\varepsilon}(\boldsymbol{\textbf{k}})=(\mathbf{I}-\varepsilon\mathbf{C}^{T})\boldsymbol{\textbf{k}}\implies\left.\frac{d}{d\varepsilon}\boldsymbol{\textbf{k}}^{\varepsilon}\right|_{\varepsilon=0}=-\mathbf{C}^{T}\boldsymbol{\textbf{k}}\>, (36)

where 𝐂\mathbf{C} is a second order tensor independent of x.
FS\mathrm{F}^{\text{S}} in Eq.(33) contains contributions from the smeared nuclear charges, and is given by

FS=I[ΩIρ¯h(x)(VI(|xRI|)Vs,I(|xRI|,rc,I))(𝚼(x)𝚼(RI))𝑑x]+I[ΩIρ¯h(x){VI(|xRI|)Vs,I(|xRI|,rc,I)}𝚼(x)𝑑x]I[ΩIϕ¯h(x)ZIg(|xRI|,rc,I)(𝚼(x)𝚼(RI))𝑑x].\begin{split}\mathrm{F}^{\text{S}}=\sum_{I}\Bigg{[}\int_{\Omega_{I}}\bar{\rho}^{h}(\boldsymbol{\textbf{x}})\nabla\Big{(}V_{I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|\right)-V_{s,I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I}\right)\Big{)}\cdot\Big{(}\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})-\boldsymbol{\Upsilon}(\boldsymbol{\textbf{R}}_{I})\Big{)}d\boldsymbol{\textbf{x}}\Bigg{]}\\ +\sum_{I}\Bigg{[}\int_{\Omega_{I}}\bar{\rho}^{h}(\boldsymbol{\textbf{x}})\Big{\{}V_{I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|\right)-V_{s,I}\left(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I}\right)\Big{\}}\nabla\cdot\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})d\boldsymbol{\textbf{x}}\Bigg{]}\\ -\sum_{I}\Bigg{[}\int_{\Omega_{I}}\bar{\phi}^{h}(\boldsymbol{\textbf{x}})Z_{I}\nabla g(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|,r_{c,I})\cdot\Big{(}\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})-\boldsymbol{\Upsilon}(\boldsymbol{\textbf{R}}_{I})\Big{)}d\boldsymbol{\textbf{x}}\Bigg{]}\>.\end{split} (37)

We now turn our attention to F^2(𝚼(x))\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) in Eq.(30), which contains the contributions arising from the ε\varepsilon-dependence of the enrichment functions. We provide here the expression for F^2(𝚼(x))\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})), and refer to the Appendix for the details of the derivation:

F^2(𝚼(x))=ΩBZ[αf¯α,kΩ{(ddεuα,𝐤h,ε~(xε)|ε=0)u¯α,kh(x)+u¯α,kh,(x)(ddεuα,𝐤h,ε~(xε)|ε=0)2iddεuα,𝐤h,ε~(xε)|ε=0ku¯α,kh(x)2iu¯α,kh,(x)kddεuα,𝐤h,ε~(xε)|ε=0+|k|2ddεuα,𝐤h,ε~(xε)|ε=0u¯α,kh(x)+|k|2u¯α,kh,(x)ddεuα,𝐤h,ε~(xε)|ε=0}dx]dk+Ωddερh,ε~(xε)|ε=0[Vxc(x)+ϕ¯h(x)+I(VI(|xRI|)Vs,I(|xRI|))]dx+Ω(ρ¯h(x)+bs(x,R))ddεϕh,ε~(xε)|ε=0dxΩ14π(ddεϕh,ε~(xε))|ε=0ϕ¯h(x)dxΩBZ[αf¯α,kΩ 2ϵ¯α,𝐤{ddεuα,𝐤h,ε~(xε)|ε=0u¯α,kh(x)+u¯α,kh,(x)ddεuα,𝐤h,ε~(xε)|ε=0}𝑑x]𝑑k,\begin{split}\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=&\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\int_{\Omega}\>\bigg{\{}\nabla\,\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\cdot\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\cdot\nabla\,\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\\ &-2i\,\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\boldsymbol{\textbf{k}}\cdot\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})-2i\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\boldsymbol{\textbf{k}}\cdot\nabla\,\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+|\boldsymbol{\textbf{k}}|^{2}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})\\ &\qquad\qquad+|\boldsymbol{\textbf{k}}|^{2}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bigg{\}}d\boldsymbol{\textbf{x}}\Bigg{]}d\boldsymbol{\textbf{k}}\\ &+\int_{\Omega}\left.\frac{d}{d\varepsilon}\widetilde{\rho^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\big{[}V_{\text{xc}}(\boldsymbol{\textbf{x}})+\bar{\phi}^{h}(\boldsymbol{\textbf{x}})+\sum_{I}(V_{I}(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|)-V_{s,I}(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|))\big{]}d\boldsymbol{\textbf{x}}\\ &\qquad\qquad+\int_{\Omega}(\bar{\rho}^{h}(\boldsymbol{\textbf{x}})+b_{s}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}}))\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\bigg{|}_{\varepsilon=0}d\boldsymbol{\textbf{x}}-\int_{\Omega}\frac{1}{4\pi}\nabla\big{(}\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\big{)}\bigg{|}_{\varepsilon=0}\cdot\nabla\bar{\phi}^{h}(\boldsymbol{\textbf{x}})d\boldsymbol{\textbf{x}}\\ &-\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\int_{\Omega}\>2\bar{\epsilon}_{\alpha,\mathbf{k}}\bigg{\{}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bigg{\}}d\boldsymbol{\textbf{x}}\Bigg{]}d\boldsymbol{\textbf{k}}\>,\end{split} (38)

where

ddεuα,𝐤h,ε~(xε)|ε=0ddεuα,kh({NiC(x)},{u¯α,k,iC},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE})|ε=0=I=1Naj=1nIu¯α,k,j,IENj,IE,uk(xRI)(𝚼(x)𝚼(RI))\begin{split}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}&\coloneqq\left.\frac{d}{d\varepsilon}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\right|_{\varepsilon=0}\\ &=\sum_{I=1}^{N_{a}}\sum_{j=1}^{n_{I}}\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\>\nabla N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\cdot\Big{(}\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})-\boldsymbol{\Upsilon}(\boldsymbol{\textbf{R}}_{I})\Big{)}\>\end{split} (39)

and

ddεϕh,ε~(xε)|ε=0ddεϕh({NjC(x)},{ϕ¯jC},{NIE,ϕ(xεRIε)},{ϕ¯IE})|ε=0=I=1Naϕ¯IENIE,ϕ(xRI)(𝚼(x)𝚼(RI))\begin{split}\left.\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}&\coloneqq\frac{d}{d\varepsilon}\phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E}\}\Big{)}\bigg{|}_{\varepsilon=0}\\ &=\sum_{I=1}^{N_{a}}\bar{\phi}_{I}^{E}\>\nabla N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\cdot\Big{(}\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})-\boldsymbol{\Upsilon}(\boldsymbol{\textbf{R}}_{I})\Big{)}\end{split} (40)

account for contributions from the enrichment functions. We note that ddερh,ε~(xε)|ε=0\left.\frac{d}{d\varepsilon}\widetilde{\rho^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0} can be computed using Eq. (39). We remark that F^2(𝚼(x))\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) vanishes when the enrichment functions are absent, i.e., when u¯α,k,j,IE=ϕ¯IE=0\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}=\bar{\phi}_{I}^{E}=0.

II.5 Computation of ionic forces and stress tensor

We now discuss the approach to compute the ionic forces and stress tensor from the configurational force. In order to compute the force on a nucleus along the ith direction, we choose a generator whose ith component is a function centered at the nucleus with all other components to be zero. For instance, to compute the force on the Ith\text{I}^{\text{th}} nucleus in the x-direction, we consider the following generator

𝚼(x)={f(x)00}.\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})=\begin{Bmatrix}f(\boldsymbol{\textbf{x}})\\ 0\\ 0\end{Bmatrix}\>. (41)

In particular, as the FE basis functions can also be used to perturb the space, owing to the isoparametric nature of the basis functions, we choose generators constructed from the FE basis. To this end, we use the lowest order subspace of the typically higher-order finite element function space employed. In other words, we choose ff to be given by

f(x)=i=18NiC,lin(x)ci,f(\boldsymbol{\textbf{x}})=\sum_{i=1}^{8}N^{C,\text{lin}}_{i}(\boldsymbol{\textbf{x}})c_{i}\>, (42)

where NiC,lin(x)N^{C,\text{lin}}_{i}(\boldsymbol{\textbf{x}}) are trilinear FE basis functions which constitute a subspace of the original classical FE basis spanned by functions NiC(x)N^{C}_{i}(\boldsymbol{\textbf{x}}). The coefficients, cic_{i}’s, are computed to be the value of ff at the corner vertices of finite element cells. The typical form of ff we employ in this work is a Gaussian centered at the nucleus whose ionic force we are interested in computing. Thus,

ck=f(xk)=g(|xkRI|).c_{k}=f(\boldsymbol{\textbf{x}}_{k})=g(|\boldsymbol{\textbf{x}}_{k}-\boldsymbol{\textbf{R}}_{I}|)\,. (43)

We note that g(r)g(r) is chosen such that it satisfies the following constraints: a) the support of the function is such that it does not contain any other nuclei other than the one under consideration, and b) g(0)=1g(0)=1. The former constraint is essential to ensure that the sole contribution to the configurational force is from the nucleus of interest. The latter constraint mimics the perturbation of the underlying space displacing the Ith\text{I}^{\text{th}} nucleus by ε\varepsilon (Eq. (26)). In the present work we choose

g(r)=exp(αrβ),g(r)=\exp(\alpha r^{\beta})\>, (44)

with α=0.8\alpha=-0.8 and β=4\beta=4. The force on the Ith\text{I}^{\text{th}} nucleus in the x-direction is simply the negative of the configurational force evaluated using the above generator (Eq. (41)). More importantly, in the context of structural relaxation, the value of the computed force and the nature of the generator determine not only the next position of the given nucleus, but also the FE mesh around it.

In order to compute the stress tensor associated with cell relaxations, the prescribed perturbations correspond to an affine deformation of the periodic domain Ωp\Omega_{p}, which preserves the periodicity of the cell. To elaborate, the generator is given by 𝚼(x)=𝐂x\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})=\mathbf{C}\boldsymbol{\textbf{x}}, where 𝐂\mathbf{C}, a second order tensor, is independent of x. By writing the stress tensor in terms of the derivative of the energy density with respect to strain tensor, and expanding the energy density in terms of the strain, it can be shown that Motamarri and Gavini (2018)

ddεcε(𝐮¯ε,𝐟¯ε,ϕ¯ε,Rε)|ε=0=Ωp12((𝐂+𝐂T):𝝈),\left.\frac{d}{d\varepsilon}\mathcal{F}_{c}^{\varepsilon}(\bar{\mathbf{u}}^{\varepsilon},\bar{\mathbf{f}}^{\varepsilon},\bar{\phi}^{\varepsilon},\boldsymbol{\textbf{R}}^{\varepsilon})\right|_{\varepsilon=0}=\Omega_{p}\frac{1}{2}\left(\left(\mathbf{C}+\mathbf{C}^{\text{T}}\right):\boldsymbol{\sigma}\right)\,, (45)

where 𝝈\boldsymbol{\sigma} is the stress tensor whose individual components can be computed by appropriately selecting the components of 𝐂\mathbf{C}. For instance, to compute σxx\sigma_{\text{xx}}, we choose 𝐂\mathbf{C} to be

C={100000000}.\text{C}=\begin{Bmatrix}1&0&0\\ 0&0&0\\ 0&0&0\end{Bmatrix}\;.

III Results and Discussion

In this section, we present numerical results that demonstrate the accuracy of the proposed formulation to compute forces and stresses using the enriched FE basis for all-electron calculations. We first consider two molecular systems, carbon monoxide (CO) and sulfur trioxide (SO3\text{SO}_{3}), to demonstrate the applicability of the formulation to non-periodic systems. This is followed by two periodic calculations, diamond 8-atom cubic cell and silicon carbide (SiC) cubic cell with a divacancy. For each of these benchmark systems, we perform the following studies. Firstly, we study the rate of convergence of the ionic force or stress tensor component with respect to discretization, i.e., decreasing finite element mesh size. We also benchmark the accuracy of our calculations with Gaussian basis for non-periodic systems and the linearized augmented planewave with local orbitals (LAPW+lo) basis for periodic systems. In the next study, we use the finite difference test wherein the underlying space is deformed by an infinitesimal amount using a generator and the force or the stress component is computed by finite-difference of the electronic ground-state energy at each configuration. This is compared against the values obtained using the configurational force expression. This finite difference test serves as a verification of the derived expressions, as well as establishes the variationality of the expression. Finally, to further ascertain the variationality of the computed ionic force or stress tensor component, we vary the position of the nucleus or the lattice vector and study the agreement between the ionic force/stress tensor obtained by fitting the electronic ground-state energy to a higher order polynomial and the corresponding value evaluated using the configurational force expression.

In all the following simulations, we use an n-stage Anderson mixing Anderson (1965) for density mixing with a stopping criterion of 10810^{-8} on the L2L_{2} norm of the density difference. Moreover, we set the electronic temperature, TT, to 500K.

III.1 Non-periodic systems

III.1.1 Carbon monoxide

We consider a CO molecule of bond length 2.4 Bohr (cf. Fig. 1) in a simulation box of 80 Bohr. We consider the x-component of the force acting on the O atom as metric to ascertain the accuracy.

Refer to caption
Figure 1: Schematic: CO molecule of bond length 2.4 Bohr .

In order to demonstrate the convergence with respect to discretization, for a given set of enrichment functions, we compute the force FhF_{h} using three levels of increasingly refined finite element meshes. We conduct this study using quadratic and cubic spectral finite elements. Figure 2 plots the error in the force against (1/Nel)1/3(1/N_{el})^{1/3}, where NelN_{el} represents the number of finite elements. We note that (1/Nel)1/3(1/N_{el})^{1/3} provides a measure of the finite element mesh size for convergence studies. The exact value of force, F0F_{0}, is computed by performing the same calculation using an EFE basis containing a highly refined quartic FE mesh. We find the F0F_{0} to be 0.202802 Ha/Bohr. The corresponding force value using a pc-4 Gaussian basis in NWChem is 0.202830 Ha/Bohr. The error in the force for finite element discretization is expected to be of the form,

|FhF0|=C(1Nel)q/3,|F_{h}-F_{0}|=C\left(\frac{1}{N_{el}}\right)^{q/3}\,, (46)
Refer to caption
Figure 2: Convergence of force on the O atom of CO molecule.

with qq denoting the rate of convergence. We note that, for both the element types, we find the value of qq to be close to 2p12p-1, which is the optimal rate of convergence. Next, we conduct the finite difference test by applying the perturbations (Eq. (26)) to the underlying space based on a generator (Eq. (41)) centered at the O atom by setting the ε\varepsilon to 0.02-0.02, 0.01-0.01, 0.00.0, 0.010.01, and 0.020.02. In each case, we perform the ground-state calculation to obtain the electronic ground-state energy. Using the energy values, we obtain the ionic force on the O atom in the x-direction, by using a 5-point stencil. We find that the finite-difference value and the configurational force agree to within 2.5×1062.5\times 10^{-6} Ha/Bohr.

In order to demonstrate the variationality of the computed ionic force, we keep the C atom fixed and vary the x-coordinate of the O atom as shown in Fig. 3. In each case, we compute the electronic ground-state energy and the ionic force, FF, on the O atom in the x-direction.

Refer to caption
Figure 3: Schematic: CO variationality test
Refer to caption
Figure 4: Comparison of computed force FF on the O atom and the derivative of energy fit E(t)E(t) for CO.

Fitting the energy using a fourth-order polynomial, we compare the force obtained using the derivative of the energy with that obtained from the configurational force expression in Fig. 4. This agreement between the calculated ionic force and the force deduced from the energy ascertains the variational consistency of the formulation.

III.1.2 Sulfur trioxide

We consider the planar SO3 molecule of bond length 3 Bohr (cf. Fig. 5) in a simulation box of 80 Bohr. We consider the x-component of the force acting on the O atom as the metric of interest.

Refer to caption
Figure 5: Schematic: SO3 molecule of bond length 3 Bohr .
Refer to caption
Figure 6: Convergence of force on the O atom for SO3 .

For a given set of enrichment functions, we compute the force, FhF_{h}, using three levels of increasingly refined finite element meshes, using quadratic and cubic spectral finite elements. Figure 6 plots the error in the force against (1/Nel)1/3(1/N_{el})^{1/3}. The value of F0F_{0} is computed by performing the same calculation using an enriched basis containing a highly refined quartic FE mesh, which is computed to be 0.121280 Ha/Bohr. The corresponding force value using a pc-3 Gaussian basis (performed using NWChem) is 0.121051 Ha/Bohr. We note that the more accurate pc-4 basis calculations could not be performed due to SCF non-convergence arising from linear dependence in the basis. The rates of convergence, q=2.7q=2.7 and q=4.5q=4.5 for quadratic and cubic finite elements, respectively, are close to the optimal rates of convergence.

The finite-difference test by perturbing the underlying space, in a manner similar to the CO molecule, is in agreement with the configurational force to within 3.5×1063.5\times 10^{-6} Ha/Bohr. Further, Fig. 7 demonstrates the variationality by varying the x-coordinate of the O atom lying on the x-axis.

Refer to caption
Figure 7: Comparison of computed force FF on the O atom and derivative of the energy fit E(t)E(t) for SO3 .

Again, we find an excellent agreement between the computed force and the force deduced from the energy.

III.2 Periodic systems

III.2.1 Silicon carbide periodic cell with a divacancy

We consider a silicon carbide cubic diamond-structured periodic cell with vacancies introduced as shown in Table  1. The quantity of interest we consider here is the force on the first C atom in the x-direction. All calculations performed for this material system involve sampling the Brillouin zone at the Γ\Gamma-point. As with the previous two systems, we perform the convergence study using quadratic and cubic spectral finite elements.

Figure 8 plots the error in the force against (1/Nel)1/3(1/N_{el})^{1/3}. As evident from the figure, close to optimal rates of convergence are obtained for both the element types. The exact value of force F0F_{0} is computed by performing the same calculation using an enriched basis containing a highly refined quartic FE mesh. We find the F0F_{0} to be 0.0237091 Ha/Bohr. The corresponding force value obtained using the LAPW+lo basis in the Elk code is 0.0237962 Ha/Bohr. We note that this value was obtained using a low muffin-tin radius of 1.0 Bohr, as opposed to 1.8-2.0 Bohr typically used for the energy calculations. The spherical averaging inside the muffin-tins may have a more pronounced effect on the forces as compared to the energies. Calculations with muffin-tin radius lower than 1.0 Bohr were not performed in this study due to the steep increase in the cost associated with reducing the muffin-tin radius.

Species Fractional Coordinates
C (0.0,0.0,0.0)
C (0.5,0.5,0.0)
C (0.0,0.5,0.5)
x (0.5,0.0,0.5)
Si (0.25,0.25,0.25)
Si (0.75,0.75,0.25)
Si (0.75,0.25,0.75)
x (0.25,0.75,0.75)
Table 1: SiC Divacancy fractional coordinates. x denotes vacancy site
Refer to caption
Figure 8: Convergence of the force on the C atom of SiC divacancy.
Refer to caption
Figure 9: Comparison of computed force FF and derivative of the energy fit E(t)E(t) for SiC.

In the the finite difference test, we observe that the computed force and the finite-difference force agree to within 3.3×1063.3\times 10^{-6} Ha/Bohr. Next, we vary the z-coordinate of the first C atom to study the variationality of the computed force. The comparison between the calculated force and the force obtained using the derivative of the energy is shown in Fig. 9. In the figure, t is used to denote the z-coordinate of the first C atom.

III.2.2 Diamond unit cell

We consider an 8-atom diamond unit cell of lattice constant a=7.0a=7.0 Bohr. The quantity of interest we consider for this system is the hydrostatic stress. We first study the convergence rates of the stress with respect to the mesh size. We perform this study using quadratic and cubic spectral finite elements. For these calculations, the Brillouin zone is sampled at k=(0.2,0.3,0.4)\boldsymbol{\textbf{k}}=(0.2,0.3,0.4) to verify the accuracy of the derived expressions and implementation when the computed KS wavefunctions are complex-valued.

Figure 10 plots the error in the force against (1/Nel)1/3(1/N_{el})^{1/3}. As evident from the figure, close to optimal rates of convergence are obtained for both the element types. An enriched FE calculation using a highly refined quartic mesh yielded σ0=0.00155146\sigma_{0}=0.00155146 Ha/Bohr3. The corresponding value of stress obtained using the LAPW+lo basis is 0.001547240.00154724 Ha/Bohr3. We note that this value was obtained by performing a finite-difference on the energy since the Elk code, used for benchmarking, does not currently have the capability to directly evaluate the value of stress.

Refer to caption
Figure 10: Convergence of hydrostatic stress for diamond unit cell.

In order to conduct the finite difference test, we first deduce the value of hydrostatic stress from the electronic ground-state energies at lattice constants a,a(1±ε),a(1±2ε)a,a(1\pm\varepsilon),a(1\pm 2\varepsilon) using ε=0.01\varepsilon=0.01. This value is then compared with the hydrostatic stress evaluated using configurational forces, and we find an agreement of 1.1×1061.1\times 10^{-6} Ha/Bohr3. Finally, to study the variationality of the computed hydrostatic stress, we compare the computed value of stress using configurational forces at various lattice constants with the stress obtained by fitting the the electronic ground-state energy to a polynomial of the lattice constant. The comparison is shown in Fig. 11, and we observe good agreement ascertaining the variational nature of the formulation.

Refer to caption
Figure 11: Comparison of computed stress σ\sigma & derivative of energy fit E(t)E(t) for diamond.

IV Summary

In the present work, we derived and implemented the configurational force approach in the context of enriched finite element basis to compute ionic forces and the stress tensor in all-electron density functional theory calculations. The approach provides a unified expression for both ionic forces and stress tensor to conduct structural relaxations. The derived configurational force is variational, and inherently accounts for Pulay corrections arising from the dependence of the basis on the nuclear positions. Further, both periodic and non-periodic calculations can be handled using the same framework.

The accuracy of the formulation was verified using the four benchmark systems. Force calculations were demonstrated for CO and SO3 molecules, and SiC periodic cell with a divacancy. Stress calculations were demonstrated for the diamond unit cell. In each case, we found convergence rates of 𝒪(hα)\mathcal{O}(h^{\alpha}), α2p1\alpha\approx 2p-1, with respect to mesh size hh, where pp denotes the polynomial order of the finite element basis. The finite difference test for each system showed a tight agreement between the force deduced from the energy and that evaluated using the derived configurational force expression. Moreover, for all systems we demonstrated the variationality of the proposed approach by showing a good agreement between the evaluated configurational force and the derivative of the polynomial fit of the electronic ground-state energy.

Previous works Kanungo and Gavini (2017); Rufus et al. (2021) have shown the merits of enriched finite elements for all-electron DFT calculations, such as systematic convergence, numerical efficiency and scalability. This work extends the utility of the enriched finite element basis by presenting an approach to compute the ionic forces and stress tensor for performing structural relaxations in all-electron DFT calculations.

Acknowledgements.
We gratefully acknowledge the support from the Department of Energy, Office of Basic Energy Sciences, grant number DE-SC0017380, under the auspices of which this work was conducted. V.G. also acknowledges the support from Toyota Research Institute that supported later parts of this work. This research used resources of the National Energy Research Scientific Computing Center, a DOE Office of Science User Facility supported by the Office of Science of the U.S. Department of Energy under Contract No. DE-AC02-05CH11231. V.G. also acknowledges the support of the Army Research Office through the DURIP grant W911NF1810242, which also provided the computational resources for this work.

V Appendix

We present the details of the derivation of the configurational force expression given in Sec. II. The notation used here is consistent with the main text. We recall from Eq.(28) that the configurational force is defined as

F^h(𝚼(x))=ddεε(𝚪¯𝐮k,ε,{uα,kh({NiC,ε(xε)},{u¯α,k,iC,ε},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE,ε})},ϕh({NjC,ε(xε)},{ϕ¯jC,ε},{NIE,ϕ(xεRIε)},{ϕ¯IE,ε}),𝐑ε)|ε=0.\begin{split}\hat{F}^{h}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=\frac{d}{d\varepsilon}\mathcal{L}^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C,\varepsilon}_{i}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C,\varepsilon}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E,\varepsilon}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C,\varepsilon}_{j}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{\phi}_{j}^{C,\varepsilon}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E,\varepsilon}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}\bigg{|}_{\varepsilon=0}\,.\end{split} (47)

Since 𝚪¯𝐮k,ε\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}},\varepsilon}, {u¯α,k,iC,ε}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C,\varepsilon}\}, {u¯α,k,j,IE,ε}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E,\varepsilon}\},{ϕ¯jC,ε}\{\bar{\phi}_{j}^{C,\varepsilon}\} and {ϕ¯IE,ε}\{\bar{\phi}_{I}^{E,\varepsilon}\} constitute the stationarity point of the constrained free-energy functional ε\mathcal{L}^{\varepsilon}, the partial derivative of ε\mathcal{L}^{\varepsilon} with respect to any of these quantities vanishes. Hence, the configurational force expression reduces to

F^h(𝚼(x))=ddεε(𝚪¯𝐮k,{uα,kh({NiC,ε(xε)},{u¯α,k,iC},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE})},ϕh({NjC,ε(xε)},{ϕ¯jC},{NIE,ϕ(xεRIε)},{ϕ¯IE}),𝐑ε)|ε=0,\begin{split}\hat{F}^{h}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=\frac{d}{d\varepsilon}\mathcal{L}^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C,\varepsilon}_{i}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C,\varepsilon}_{j}(\boldsymbol{\textbf{x}}^{\varepsilon})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}\bigg{|}_{\varepsilon=0}\,,\end{split} (48)

where 𝚪¯𝐮k\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}, {u¯α,k,iC}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\}, {u¯α,k,j,IE}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\},{ϕ¯jC}\{\bar{\phi}_{j}^{C}\} and {ϕ¯IE}\{\bar{\phi}_{I}^{E}\} are computed in the unperturbed (ε=0\varepsilon=0) configuration.

Next, we turn our attention to the basis functions. We note that, under a spatial perturbation, the form of the classical finite element basis function changes owing to the deformation of the underlying finite element mesh. However, the form of the enrichment functions, which are a priori constructed, remains the unchanged. As noted in the main text, given the isoparametric nature of the FE basis functions, we have

NiC,ε(xε)=NiC(x).N^{C,\varepsilon}_{i}(\boldsymbol{\textbf{x}}^{\varepsilon})=N^{C}_{i}(\boldsymbol{\textbf{x}})\,. (49)

Using the notion of the energy density ff defined in Eq.(29), the free-energy functional in the deformed configuration is given by

ε(𝚪¯𝐮k,{uα,kh({NiC(x)},{u¯α,k,iC},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE})},ϕh({NjC(x)},{ϕ¯jC},{NIE,ϕ(xεRIε)},{ϕ¯IE}),𝐑ε)=Ωεfε(𝚪¯𝐮k,{uα,kh({NiC(x)},{u¯α,k,iC},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE})},ϕh({NjC(x)},{ϕ¯jC},{NIE,ϕ(xεRIε)},{ϕ¯IE}),𝐑ε)dxε=Ωgε(𝚪¯𝐮k,{uα,kh({NiC(x)},{u¯α,k,iC},{Nj,IE,uk(xεRIε)},{u¯α,k,j,IE})},ϕh({NjC(x)},{ϕ¯jC},{NIE,ϕ(xεRIε)},{ϕ¯IE}),𝐑ε)dx,\begin{split}\mathcal{L}^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}\\ =\int_{\Omega^{\varepsilon}}f^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}d\boldsymbol{\textbf{x}}^{\varepsilon}\\ =\int_{\Omega}g^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})\},\{\bar{\phi}_{I}^{E}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}d\boldsymbol{\textbf{x}}\>,\end{split} (50)

where, gε()=fε()det(xεx).g^{\varepsilon}(\cdots)=f^{\varepsilon}(\cdots)det(\frac{\partial\boldsymbol{\textbf{x}}^{\varepsilon}}{\partial\boldsymbol{\textbf{x}}}).

We note that the expression for the configurational force derived in Motamarri & Gavini (2018)  Motamarri and Gavini (2018) holds for classical finite element basis. However, it the case of enriched finite element basis, the enrichment functions in the perturbed space ({(Nj,IE,uk(xεRIε)N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})}, {NIE,ϕ(xεRIε)N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}^{\varepsilon}-\boldsymbol{\textbf{R}}_{I}^{\varepsilon})}) are dependent on ε\varepsilon. We perform the following simplification to arrive at the additional contributions arising from the enrichment functions:

F^h(𝚼(x))=Ω[α{gεuα,kh|ε=0ddεuα,𝐤h,ε~(xε)|ε=0+gεuα,kh,|ε=0ddεuα,𝐤h,ε,~(xε)|ε=0+gεuα,kh,|ε=0ddεuα,𝐤h,ε,~(xε)|ε=0+gεuα,kh|ε=0ddεuα,𝐤h,ε~(xε)|ε=0}+gεϕh|ε=0ddεϕh,ε~(xε)|ε=0+gεϕh|ε=0ddεϕh,ε~(xε)|ε=0]dx+ddεΩgε(𝚪¯𝐮k,{uα,kh({NiC(x)},{u¯α,k,iC},{Nj,IE,uk(xRI)},{u¯α,k,j,IE})},ϕh({NjC(x)},{ϕ¯jC},{NIE,ϕ(xRI)},{ϕ¯IE}),𝐑ε)dx|ε=0.\begin{split}\hat{F}^{h}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=\int_{\Omega}\Bigg{[}\sum_{\alpha}\bigg{\{}\frac{\partial g^{\varepsilon}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{|}_{\varepsilon=0}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\frac{\partial g^{\varepsilon}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}\bigg{|}_{\varepsilon=0}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon,*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\frac{\partial g^{\varepsilon}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}\bigg{|}_{\varepsilon=0}\cdot\left.\frac{d}{d\varepsilon}\nabla\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon,*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\\ +\frac{\partial g^{\varepsilon}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{|}_{\varepsilon=0}\cdot\left.\frac{d}{d\varepsilon}\nabla\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bigg{\}}+\frac{\partial g^{\varepsilon}}{\partial\phi^{h}}\bigg{|}_{\varepsilon=0}\left.\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\frac{\partial g^{\varepsilon}}{\partial\nabla\phi^{h}}\bigg{|}_{\varepsilon=0}\cdot\left.\frac{d}{d\varepsilon}\nabla\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Bigg{]}d\boldsymbol{\textbf{x}}\\ +\frac{d}{d\varepsilon}\int_{\Omega}g^{\varepsilon}\bigg{(}\bar{\boldsymbol{\Gamma}}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\bigg{\{}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\Big{(}\{N^{C}_{i}(\boldsymbol{\textbf{x}})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},i}^{C}\},\{N^{E,u_{\boldsymbol{\textbf{k}}}}_{j,I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}},j,I}^{E}\}\Big{)}\bigg{\}},\\ \phi^{h}\Big{(}\{N^{C}_{j}(\boldsymbol{\textbf{x}})\},\{\bar{\phi}_{j}^{C}\},\{N^{E,\phi}_{I}(\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I})\},\{\bar{\phi}_{I}^{E}\}\Big{)},\mathbf{R^{\varepsilon}}\bigg{)}d\boldsymbol{\textbf{x}}\bigg{|}_{\varepsilon=0}\,.\end{split} (51)

The last term in the above equation is denoted by F^1(𝚼(x))\hat{F}_{1}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) in the main text (cf.  Eq. (30)), which is the contribution to the configurational force from the classical finite element basis, and it is written out using the expressions presented in Motamarri & Gavini (2018) Motamarri and Gavini (2018). The additional contribution arising from the enrichment functions is given by

F^2(𝚼(x))=Ω[α{gεuα,kh|ε=0ddεuα,𝐤h,ε~(xε)|ε=0+gεuα,kh,|ε=0ddεuα,𝐤h,ε,~(xε)|ε=0+gεuα,kh,|ε=0ddεuα,𝐤h,ε,~(xε)|ε=0+gεuα,kh|ε=0ddεuα,𝐤h,ε~(xε)|ε=0}+gεϕh|ε=0ddεϕh,ε~(xε)|ε=0+gεϕh|ε=0ddεϕh,ε~(xε)|ε=0]dx,\begin{split}\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=\int_{\Omega}\Bigg{[}\sum_{\alpha}\bigg{\{}\frac{\partial g^{\varepsilon}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{|}_{\varepsilon=0}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\frac{\partial g^{\varepsilon}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}\bigg{|}_{\varepsilon=0}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon,*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\frac{\partial g^{\varepsilon}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}\bigg{|}_{\varepsilon=0}\cdot\left.\frac{d}{d\varepsilon}\nabla\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon,*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\\ \frac{\partial g^{\varepsilon}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{|}_{\varepsilon=0}\cdot\left.\frac{d}{d\varepsilon}\nabla\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bigg{\}}+\frac{\partial g^{\varepsilon}}{\partial\phi^{h}}\bigg{|}_{\varepsilon=0}\left.\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+\frac{\partial g^{\varepsilon}}{\partial\nabla\phi^{h}}\bigg{|}_{\varepsilon=0}\cdot\left.\frac{d}{d\varepsilon}\nabla\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Bigg{]}d\boldsymbol{\textbf{x}}\>,\end{split} (52)

where ddεuα,𝐤h,ε~(xε)|ε=0\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0} and ddεϕh,ε~(xε)|ε=0\left.\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0} are defined in Eq.(39) and Eq.(40), respectively.

In the above equation, we also require the derivatives of gεg^{\varepsilon} with respect to various fields, evaluated at ε=0\varepsilon=0, which we present next. For clarity, we drop the ε\varepsilon suffix when we derive expressions for these derivatives. We note that gg can be written as

g=gKE+gxc+gelec+gent+gconst,g=g_{\text{KE}}+g_{\text{xc}}+g_{\text{elec}}+g_{\text{ent}}+g_{\text{const}}\>, (53)

where gKEg_{\text{KE}}, gxcg_{\text{xc}}, gelecg_{\text{elec}}, gentg_{\text{ent}} and gconstg_{\text{const}} represent energy densities corresponding to the kinetic energy, exchange-correlation energy, electrostatic energy, entropic energy and the constraint, respectively. From Eq. (4), gKEg_{\text{KE}} can be written as

gKE(𝚪𝐮k,{uα,kh},{uα,kh})=2p,q,r=1NΩBZΓpq𝐮kSqrk1(12ur,kh,up,khiur,kh,k.up,kh+12|k|2ur,kh,up,kh)dk.\begin{split}g_{\text{KE}}(\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}},\{u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\},\{\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\})\\ =2\sum_{p,q,r=1}^{N}&\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}{S^{\boldsymbol{\textbf{k}}}_{qr}}^{-1}\bigg{(}\frac{1}{2}\nabla u_{r,\boldsymbol{\textbf{k}}}^{h,*}\cdot\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}-iu_{r,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}.\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}+\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}\bigg{)}d\boldsymbol{\textbf{k}}\>.\end{split} (54)

Hence,

gKEuα,kh=2p,q,r=1NΩBZΓpq𝐮kSqrk1[12ur,kh,δpαiur,kh,kδpα]𝑑k,\begin{split}\frac{\partial g_{\text{KE}}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}{S^{\boldsymbol{\textbf{k}}}_{qr}}^{-1}\bigg{[}\frac{1}{2}\nabla u_{r,\boldsymbol{\textbf{k}}}^{h,*}\delta_{p\alpha}-iu_{r,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}\delta_{p\alpha}\bigg{]}d\boldsymbol{\textbf{k}}\>,\end{split} (55)

where δij\delta_{ij} is the Kronecker delta. When wavefunctions are given by the canonical (orthogonal) Kohn-Sham eigenfunctions, SkS^{\boldsymbol{\textbf{k}}} is an identity matrix and 𝚪𝐮k\boldsymbol{\Gamma}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}} is simply a diagonal matrix containing fractional occupancies fα,kf_{\alpha,\boldsymbol{\textbf{k}}}. Hence, the above expression can be further simplified as follows:

gKEuα,kh=ΩBZfα,k[uα,kh,2iuα,kh,k]𝑑k=C1.\frac{\partial g_{\text{KE}}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=\fint_{\Omega_{\text{BZ}}}f_{\alpha,\boldsymbol{\textbf{k}}}\bigg{[}\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}-2iu_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}\bigg{]}d\boldsymbol{\textbf{k}}=C_{1}\>. (56)

On similar lines, we have

gKEuα,kh,=ΩBZfα,kuα,khdk=C2.\frac{\partial g_{\text{KE}}}{\partial\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}=\fint_{\Omega_{\text{BZ}}}f_{\alpha,\boldsymbol{\textbf{k}}}\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\>d\boldsymbol{\textbf{k}}=C_{2}\>. (57)

The derivative of gKEg_{\text{KE}} with respect to the wavefunction is given by

gKEuα,kh=2p,q,r=1NΩBZΓpq𝐮k{δSqrk1δuα,kh(12ur,kh,up,khiur,kh,k.up,kh+12|k|2ur,kh,up,kh)+Sqrk112|k|2ur,kh,δpα}dk.\begin{split}\frac{\partial g_{\text{KE}}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\Bigg{\{}\frac{\delta{S^{\boldsymbol{\textbf{k}}}_{qr}}^{-1}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{(}\frac{1}{2}\nabla u_{r,\boldsymbol{\textbf{k}}}^{h,*}\cdot\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}-iu_{r,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}.\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}+\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}\bigg{)}+\\ {S^{\boldsymbol{\textbf{k}}}_{qr}}^{-1}\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{r,\boldsymbol{\textbf{k}}}^{h,*}\delta_{p\alpha}\Bigg{\}}d\boldsymbol{\textbf{k}}\>.\end{split} (58)

Using SkSk1=IS^{\boldsymbol{\textbf{k}}}{S^{\boldsymbol{\textbf{k}}}}^{-1}=I, we can show the following in the context of orthogonal Kohn-Sham eigenfunctions:

δSk1δuα,kh=δSkδuα,kh.\frac{\delta{S^{\boldsymbol{\textbf{k}}}}^{-1}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=-\frac{\delta S^{\boldsymbol{\textbf{k}}}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\>. (59)

Using this result in Eq.(58), we have

gKEuα,kh=A1+C3:\begin{split}\frac{\partial g_{\text{KE}}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=A_{1}+C_{3}:\,\end{split} (60)

where,

A1=2p,q,r=1NΩBZΓpq𝐮kδSqrkδuα,kh(12ur,kh,up,khiur,kh,k.up,kh+12|k|2ur,kh,up,kh)dkA_{1}=-2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\frac{\delta S^{\boldsymbol{\textbf{k}}}_{qr}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{(}\frac{1}{2}\nabla u_{r,\boldsymbol{\textbf{k}}}^{h,*}\cdot\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}-iu_{r,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}.\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}+\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}\bigg{)}d\boldsymbol{\textbf{k}} (61)

and

C3=2ΩBZfα,k12|k|2uα,kh,𝑑k.C_{3}=2\fint_{\Omega_{\text{BZ}}}f_{\alpha,\boldsymbol{\textbf{k}}}\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}d\boldsymbol{\textbf{k}}\>. (62)

Similarly, we can show that the derivative of gKEg_{\text{KE}} with respect to uα,kh,u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*} can be given by

gKEuα,kh,=B1+C4,\begin{split}\frac{\partial g_{\text{KE}}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}=B_{1}+C_{4}\>,\end{split} (63)

where

B1=2p,q,r=1NΩBZΓpq𝐮kδSqrkδuα,kh,(12ur,kh,up,khiur,kh,k.up,kh+12|k|2ur,kh,up,kh)dk,B_{1}=-2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\frac{\delta S^{\boldsymbol{\textbf{k}}}_{qr}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}\bigg{(}\frac{1}{2}\nabla u_{r,\boldsymbol{\textbf{k}}}^{h,*}\cdot\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}-iu_{r,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}.\nabla u_{p,\boldsymbol{\textbf{k}}}^{h}+\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}\bigg{)}d\boldsymbol{\textbf{k}}\>, (64)

and

C4=2ΩBZfα,k(ikuα,kh+12|k|2uα,kh)𝑑k.C_{4}=2\fint_{\Omega_{\text{BZ}}}f_{\alpha,\boldsymbol{\textbf{k}}}\bigg{(}-i\boldsymbol{\textbf{k}}\cdot\nabla u_{\alpha,\boldsymbol{\textbf{k}}}^{h}+\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}\bigg{)}d\boldsymbol{\textbf{k}}\>. (65)

We note that the derivative of gKEg_{\text{KE}} with respect to the potential ϕh\phi^{h} is zero. Before we move on to the terms beyond kinetic energy, we derive a useful result for the electron density. Recall that the electron density (cf. Eq.(3)) is given by

ρh(x)=2p,q,r=1NΩBZΓpq𝐮kSqrk1ur,kh,up,kh𝑑k.\rho^{h}(\boldsymbol{\textbf{x}})=2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}{S^{\boldsymbol{\textbf{k}}}_{qr}}^{-1}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}d\boldsymbol{\textbf{k}}\>. (66)

Hence, we have the following results for the electron density:

δρhδuα,kh=A2+C5andδρhδuα,kh,=B2+C6,\begin{split}\frac{\delta\rho^{h}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=A_{2}+C_{5}\quad\quad\text{and}\quad\quad\frac{\delta\rho^{h}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}=B_{2}+C_{6}\>,\end{split} (67)

where,

A2=2p,q,r=1NΩBZΓpq𝐮kδSqrkδuα,khur,kh,up,kh𝑑kandC5=2ΩBZfα,kuα,kh,𝑑k,A_{2}=-2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\frac{\delta S^{\boldsymbol{\textbf{k}}}_{qr}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}d\boldsymbol{\textbf{k}}\quad\quad\text{and}\quad\quad C_{5}=2\fint_{\Omega_{\text{BZ}}}f_{\alpha,\boldsymbol{\textbf{k}}}u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}d\boldsymbol{\textbf{k}}\>, (68)

and

B2=2p,q,r=1NΩBZΓpq𝐮kδSqrkδuα,kh,ur,kh,up,kh𝑑kandC6=2ΩBZfα,kuα,kh𝑑k.B_{2}=-2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\frac{\delta S^{\boldsymbol{\textbf{k}}}_{qr}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}u_{r,\boldsymbol{\textbf{k}}}^{h,*}u_{p,\boldsymbol{\textbf{k}}}^{h}d\boldsymbol{\textbf{k}}\quad\quad\text{and}\quad\quad C_{6}=2\fint_{\Omega_{\text{BZ}}}f_{\alpha,\boldsymbol{\textbf{k}}}u_{\alpha,\boldsymbol{\textbf{k}}}^{h}d\boldsymbol{\textbf{k}}\>. (69)

Moving on to the other terms in Eq. (5), beyond gKEg_{\text{KE}}, we can write the energy density for the exchange-correlation energy as

gxc=F(ρh).g_{\text{xc}}=F(\rho^{h})\>. (70)

Therefore, the derivative with respect to the wavefunctions are given by

δgxcδuα,kh=Vxcδρhδuα,kh=C7andδgxcδuα,kh,=Vxcδρhδuα,kh,=C8,\frac{\delta g_{\text{xc}}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=V_{\text{xc}}\frac{\delta\rho^{h}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=C_{7}\quad\mathrm{and}\quad\frac{\delta g_{\text{xc}}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}=V_{\text{xc}}\frac{\delta\rho^{h}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}=C_{8}\>, (71)

where Vxc=δFδρhV_{\text{xc}}=\frac{\delta F}{\delta\rho^{h}} is the exchange-correlation potential. The derivative of gxcg_{\text{xc}} with respect to the potential ϕh\phi^{h} is zero. From Eq. (17), the electrostatic energy density is given by

gelec=(ρh+bs)ϕh18π|ϕh|2+Iρh(VIVs,I)I12bs,IVs,I.\begin{split}g_{\text{elec}}=(\rho^{h}+b_{s})\phi^{h}-\frac{1}{8\pi}\left|\nabla\phi^{h}\right|^{2}+\sum_{I}\rho^{h}(V_{I}-V_{s,I})-\sum_{I}\frac{1}{2}\,b_{s,I}V_{s,I}\>.\end{split} (72)

Hence, we can write derivatives of gelecg_{\text{elec}} with respect to the wavefunctions as follows:

gelecuα,kh=δρhδuα,kh(ϕh+I(VIVs,I))=C9andgelecuα,kh,=δρhδuα,kh,(ϕh+I(VIVs,I))=C10.\begin{split}\frac{\partial g_{\text{elec}}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}=\frac{\delta\rho^{h}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h}}\bigg{(}\phi^{h}+\sum_{I}(V_{I}-V_{s,I})\bigg{)}=C_{9}\quad\mathrm{and}\quad\frac{\partial g_{\text{elec}}}{\partial u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}=\frac{\delta\rho^{h}}{\delta u_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}}\bigg{(}\phi^{h}+\sum_{I}(V_{I}-V_{s,I})\bigg{)}=C_{10}\>.\end{split} (73)

The derivative with respect to the electrostatic potential and its gradient are given by:

gelecϕh=ρh+bs=C11andδgelecδϕh=14πϕh=C12.\frac{\partial g_{\text{elec}}}{\partial\phi^{h}}=\rho^{h}+b_{s}=C_{11}\quad\mathrm{and}\quad\frac{\delta g_{\text{elec}}}{\delta\nabla\phi^{h}}=-\frac{1}{4\pi}\nabla\phi^{h}=C_{12}\,. (74)

We note that gentg_{\text{ent}} and gconstg_{\text{const}} do not contribute to F^2(𝚼(x))\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) since they are not directly dependent on the wavefunctions or the electrostatic potential.

We now substitute all constituents derived above into Eq.(52), and write the expression for F^2(𝚼(x))\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) as follows:

F^2(𝚼(x))=A+B+C.\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}}))=A+B+C\>. (75)

In the above, CC includes all terms excepting those involving A1A_{1}, A2A_{2}, B1B_{1} and B2B_{2}, and is given by

C=ΩBZ[αf¯α,kΩ{(ddεuα,𝐤h,ε~(xε)|ε=0)u¯α,kh(x)+u¯α,kh,(x)(ddεuα,𝐤h,ε~(xε)|ε=0)2iddεuα,𝐤h,ε~(xε)|ε=0ku¯α,kh(x)2iu¯α,kh,(x)kddεuα,𝐤h,ε~(xε)|ε=0+|k|2ddεuα,𝐤h,ε~(xε)|ε=0u¯α,kh(x)+|k|2u¯α,kh,(x)ddεuα,𝐤h,ε~(xε)|ε=0}dx]dk+Ω[Vxc(x)+ϕ¯h(x)+I(VI(|xRI|)Vs,I(|xRI|))]ddερh,ε~(xε)|ε=0dx+Ω(ρ¯h(x)+bs(x,R))ddεϕh,ε~(xε)|ε=0dxΩ14π(ddεϕh,ε~(xε))|ε=0ϕ¯h(x)dx,\begin{split}C=&\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\int_{\Omega}\>\bigg{\{}\nabla\,\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\cdot\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\cdot\nabla\,\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\\ &-2i\,\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\boldsymbol{\textbf{k}}\cdot\nabla\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})-2i\,\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\boldsymbol{\textbf{k}}\cdot\nabla\,\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}+|\boldsymbol{\textbf{k}}|^{2}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})\\ &\qquad\qquad+|\boldsymbol{\textbf{k}}|^{2}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bigg{\}}d\boldsymbol{\textbf{x}}\Bigg{]}d\boldsymbol{\textbf{k}}\\ &+\int_{\Omega}\big{[}V_{\text{xc}}(\boldsymbol{\textbf{x}})+\bar{\phi}^{h}(\boldsymbol{\textbf{x}})+\sum_{I}(V_{I}(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|)-V_{s,I}(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|))\big{]}\left.\frac{d}{d\varepsilon}\widetilde{\rho^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}d\boldsymbol{\textbf{x}}\\ &+\int_{\Omega}(\bar{\rho}^{h}(\boldsymbol{\textbf{x}})+b_{s}(\boldsymbol{\textbf{x}},\boldsymbol{\textbf{R}}))\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\bigg{|}_{\varepsilon=0}d\boldsymbol{\textbf{x}}-\int_{\Omega}\frac{1}{4\pi}\nabla\big{(}\frac{d}{d\varepsilon}\widetilde{\phi^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\big{)}\bigg{|}_{\varepsilon=0}\cdot\nabla\bar{\phi}^{h}(\boldsymbol{\textbf{x}})d\boldsymbol{\textbf{x}}\>,\end{split} (76)

where,

ddερh,ε~(xε)|ε=02ΩBZαf¯α,k[(ddεuα,𝐤h,ε~(xε)|ε=0)u¯α,kh(x)+u¯α,kh,(x)(ddεuα,𝐤h,ε~(xε)|ε=0)]dk.\left.\frac{d}{d\varepsilon}\widetilde{\rho^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\coloneqq 2\fint_{\Omega_{\text{BZ}}}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\Bigg{[}\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\Bigg{]}d\boldsymbol{\textbf{k}}\>. (77)

In Eq. (75), AA and BB include all terms not accounted by CC. These can be rearranged and written as follows:

A+B=2p,q,r=1NΩBZddεSqrk~|ε=0Γpq𝐮kΩ(12u¯r,kh,u¯p,khiu¯r,kh,k.u¯p,kh+12|k|2u¯r,kh,u¯p,kh+[Vxc(x)+ϕ¯h(x)+I(VI(|xRI|)Vs,I(|xRI|)]u¯r,kh,u¯p,kh)dxdk,\begin{split}A+B=-2\sum_{p,q,r=1}^{N}\fint_{\Omega_{\text{BZ}}}\left.\frac{d}{d\varepsilon}\widetilde{S^{\boldsymbol{\textbf{k}}}_{qr}}\right|_{\varepsilon=0}\Gamma_{pq}^{\mathbf{u}_{\boldsymbol{\textbf{k}}}}\int_{\Omega}\Bigg{(}\frac{1}{2}\nabla\bar{u}_{r,\boldsymbol{\textbf{k}}}^{h,*}\cdot\nabla\bar{u}_{p,\boldsymbol{\textbf{k}}}^{h}-i\bar{u}_{r,\boldsymbol{\textbf{k}}}^{h,*}\boldsymbol{\textbf{k}}.\nabla\bar{u}_{p,\boldsymbol{\textbf{k}}}^{h}+\frac{1}{2}|\boldsymbol{\textbf{k}}|^{2}\bar{u}_{r,\boldsymbol{\textbf{k}}}^{h,*}\bar{u}_{p,\boldsymbol{\textbf{k}}}^{h}\\ +\bigg{[}V_{\text{xc}}(\boldsymbol{\textbf{x}})+\bar{\phi}^{h}(\boldsymbol{\textbf{x}})+\sum_{I}(V_{I}(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|)-V_{s,I}(|\boldsymbol{\textbf{x}}-\boldsymbol{\textbf{R}}_{I}|)\bigg{]}\bar{u}_{r,\boldsymbol{\textbf{k}}}^{h,*}\bar{u}_{p,\boldsymbol{\textbf{k}}}^{h}\Bigg{)}d\boldsymbol{\textbf{x}}d\boldsymbol{\textbf{k}}\>,\end{split} (78)

where the integral over Ω\Omega in the above equation reduces to the eigenvalues of the Kohn-Sham equation for canonical Kohn-Sham eigenfunctions {u¯α,kh}\{\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}\}. Further, ddεSk~|ε=0\left.\frac{d}{d\varepsilon}\widetilde{S^{\boldsymbol{\textbf{k}}}}\right|_{\varepsilon=0} is a diagonal matrix with elements given by

ddεSααk~|ε=0Ω(ddεuα,𝐤h,ε~(xε)|ε=0)u¯α,kh(x)+u¯α,kh,(x)(ddεuα,𝐤h,ε~(xε)|ε=0)dx.\begin{split}\left.\frac{d}{d\varepsilon}\widetilde{S^{\boldsymbol{\textbf{k}}}_{\alpha\alpha}}\right|_{\varepsilon=0}\coloneqq\int_{\Omega}\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\Big{(}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\Big{)}d\boldsymbol{\textbf{x}}\>.\end{split} (79)

Hence, we have

A+B=2ΩBZ[αf¯α,kΩϵ¯α,𝐤{ddεuα,𝐤h,ε~(xε)|ε=0u¯α,kh(x)+u¯α,kh,(x)ddεuα,𝐤h,ε~(xε)|ε=0}𝑑x]𝑑k.A+B=-2\fint_{\Omega_{\text{BZ}}}\Bigg{[}\sum_{\alpha}\bar{f}_{\alpha,\boldsymbol{\textbf{k}}}\int_{\Omega}\>\bar{\epsilon}_{\alpha,\mathbf{k}}\bigg{\{}\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon\>*}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h}(\boldsymbol{\textbf{x}})+\bar{u}_{\alpha,\boldsymbol{\textbf{k}}}^{h,*}(\boldsymbol{\textbf{x}})\left.\frac{d}{d\varepsilon}\widetilde{u_{\alpha,\mathbf{k}}^{h,\varepsilon}}(\boldsymbol{\textbf{x}}^{\varepsilon})\right|_{\varepsilon=0}\bigg{\}}d\boldsymbol{\textbf{x}}\Bigg{]}d\boldsymbol{\textbf{k}}\>. (80)

Using the results in Eq. (76) and Eq. (80), we obtain the the expression for F^2(𝚼(x))\hat{F}_{2}(\boldsymbol{\Upsilon}(\boldsymbol{\textbf{x}})) presented in Eq. (38).

References

  • Motamarri and Gavini (2018) P. Motamarri and V. Gavini, Phys. Rev. B 97, 165132 (2018).
  • Hohenberg and Kohn (1964) P. Hohenberg and W. Kohn, Phys. Rev. 136, B864 (1964).
  • Kohn and Sham (1965) W. Kohn and L. J. Sham, Phys. Rev. 140, A1133 (1965).
  • Hellmann (1937) H. Hellmann, Einfhrung in die Quantenchemie. 285  (1937).
  • Feynman (1939) R. P. Feynman, Phys. Rev. 56, 340 (1939).
  • Pulay (1987) P. Pulay, Adv. Chem. Phys 69, 241 (1987).
  • Ihm et al. (1979) J. Ihm, A. Zunger,  and M. L. Cohen, Journal of Physics C: Solid State Physics 12, 4409 (1979).
  • Bendt and Zunger (1983) P. Bendt and A. Zunger, Phys. Rev. Lett. 50, 1684 (1983).
  • Scheffler et al. (1985) M. Scheffler, J. P. Vigneron,  and G. B. Bachelet, Phys. Rev. B 31, 6541 (1985).
  • Nielsen and Martin (1985a) O. H. Nielsen and R. M. Martin, Phys. Rev. B 32, 3780 (1985a).
  • Fournier et al. (1989) R. Fournier, J. Andzelm,  and D. R. Salahub, J. Chem. Phys. 90, 6371 (1989).
  • Soler and Williams (1989) J. M. Soler and A. R. Williams, Phys. Rev. B 40, 1560 (1989).
  • Jackson and Pederson (1990) K. Jackson and M. R. Pederson, Phys. Rev. B 42, 3276 (1990).
  • Soler and Williams (1990) J. M. Soler and A. R. Williams, Phys. Rev. B 42, 9728 (1990).
  • Yu et al. (1991) R. Yu, D. Singh,  and H. Krakauer, Phys. Rev. B 43, 6411 (1991).
  • Delley (1991) B. Delley, J. Chem. Phys. 94, 7245 (1991).
  • Goedecker and Maschke (1992) S. Goedecker and K. Maschke, Phys. Rev. B 45, 1597 (1992).
  • Savrasov and Savrasov (1992) S. Y. Savrasov and D. Y. Savrasov, Phys. Rev. B 46, 12181 (1992).
  • Pople et al. (1992) J. A. Pople, P. M. W. Gill,  and B. G. Johnson, Chem. Phys. Lett. 199, 557 (1992).
  • Methfessel and van Schilfgaarde M (1993) M. Methfessel and van Schilfgaarde M, Phys. Rev. B 48, 4937 (1993).
  • Fähnle et al. (1995) M. Fähnle, C. Elsässer,  and H. Krimmel, phys. stat. sol. (b) 191, 9 (1995).
  • Kohler et al. (1996) B. Kohler, S. Wilke, M. Scheffler, R. Kouba,  and C. Ambrosch-Draxl, Comput. Phys. Commun. 94, 31 (1996).
  • Kresse and Furthmüller (1996) G. Kresse and J. Furthmüller, Phys. Rev. B 54, 11169 (1996).
  • Wills et al. (2000) J. M. Wills, O. Eriksson, M. Alouani,  and D. L. Price, in Electronic Structure and Physical Properies of Solids (Springer Berlin Heidelberg, 2000) pp. 148–167.
  • Soler et al. (2002) J. M. Soler, E. Artacho, J. D. Gale, A. García, J. Junquera, P. Ordejón,  and D. Sánchez-Portal, J. Phys. Condens. Matter 14, 2745 (2002).
  • Alemany et al. (2004) M. M. G. Alemany, M. Jain, L. Kronik,  and J. R. Chelikowsky, Phys. Rev. B 69, 075101 (2004).
  • Miyazaki et al. (2004) T. Miyazaki, D. R. Bowler, R. Choudhury,  and M. J. Gillan, J. Chem. Phys. 121, 6186 (2004).
  • Blum et al. (2009) V. Blum, R. Gehrke, F. Hanke, P. Havu, V. Havu, X. Ren, K. Reuter,  and M. Scheffler, Comput. Phys. Commun. 180, 2175 (2009).
  • Hine et al. (2011) N. D. M. Hine, M. Robinson, P. D. Haynes, C.-K. Skylaris, M. C. Payne,  and A. A. Mostofi, Phys. Rev. B 83, 195102 (2011).
  • Ruiz-Serrano et al. (2012) Á. Ruiz-Serrano, N. D. M. Hine,  and C.-K. Skylaris, J. Chem. Phys. 136, 234101 (2012).
  • Zhang et al. (2017) G. Zhang, L. Lin, W. Hu, C. Yang,  and J. E. Pask, J. Comput. Phys. 335, 426 (2017).
  • Slater (1972) J. C. Slater, J. Chem. Phys. 57, 2389 (1972).
  • Janak (1974) J. F. Janak, Phys. Rev. B 9, 3985 (1974).
  • Nielsen and Martin (1983) O. H. Nielsen and R. M. Martin, Phys. Rev. Lett. 50, 697 (1983).
  • Yin (1983) M. T. Yin, Phys. Rev. B 27, 7769 (1983).
  • Nielsen and Martin (1985b) O. H. Nielsen and R. M. Martin, Phys. Rev. B 32, 3792 (1985b).
  • Dal Corso and Resta (1994) A. Dal Corso and R. Resta, Phys. Rev. B 50, 4327 (1994).
  • Kresse and Joubert (1999) G. Kresse and D. Joubert, Phys. Rev. B 59, 1758 (1999).
  • Kudin and Scuseria (2000) K. N. Kudin and G. E. Scuseria, Phys. Rev. B 61, 16440 (2000).
  • Thonhauser et al. (2002) T. Thonhauser, C. Ambrosch-Draxl,  and D. J. Singh, Solid State Commun. 124, 275 (2002).
  • Doll et al. (2004) K. Doll, R. Dovesi,  and R. Orlando, Theor. Chem. Acc. 112, 394 (2004).
  • Torrent et al. (2008) M. Torrent, F. Jollet, F. Bottin, G. Zérah,  and X. Gonze, Comput. Mater. Sci. 42, 337 (2008).
  • Nagasako and Oguchi (2011) N. Nagasako and T. Oguchi, J. Phys. Soc. Jpn. 80, 024701 (2011).
  • Knuth et al. (2015) F. Knuth, C. Carbogno, V. Atalla, V. Blum,  and M. Scheffler, Comput. Phys. Commun. 190, 33 (2015).
  • Sharma and Suryanarayana (2018) A. Sharma and P. Suryanarayana, J. Chem. Phys. 149, 194104 (2018).
  • Becker and Sierka (2019) M. Becker and M. Sierka, J. Comput. Chem. 40, 2563 (2019).
  • Belbase et al. (2021) K. Belbase, A. Tröster,  and P. Blaha, Physical Review B 104, 174113 (2021).
  • White et al. (1989) S. R. White, J. W. Wilkins,  and M. P. Teter, Phys. Rev. B 39, 5819 (1989).
  • Tsuchida and Tsukada (1996) E. Tsuchida and M. Tsukada, Physical Review B 54, 7602 (1996).
  • Tsuchida and Tsukada (1998) E. Tsuchida and M. Tsukada, Journal of the Physical Society of Japan 67, 3844 (1998).
  • Pask et al. (1999) J. E. Pask, B. M. Klein, C. Y. Fong,  and P. A. Sterne, Phys. Rev. B 59, 12352 (1999).
  • Pask et al. (2001) J. E. Pask, B. M. Klein, P. A. Sterne,  and C. Y. Fong, Computer Physics Communications 135, 1 (2001).
  • Pask and Sterne (2005) J. E. Pask and P. A. Sterne, Modelling and Simulation in Materials Science and Engineering 13, R71 (2005).
  • Zhang et al. (2008) D. Zhang, L. Shen, A. Zhou,  and X.-G. Gong, Physics Letters A 372, 5071 (2008).
  • Suryanarayana et al. (2010) P. Suryanarayana, V. Gavini, T. Blesgen, K. Bhattacharya,  and M. Ortiz, Journal of the Mechanics and Physics of Solids 58, 256 (2010).
  • Fang et al. (2012) J. Fang, X. Gao,  and A. Zhou, Journal of Computational Physics 231, 3166 (2012).
  • Bao et al. (2012) G. Bao, G. Hu,  and D. Liu, Journal of Computational Physics 231, 4967 (2012).
  • Motamarri et al. (2013) P. Motamarri, M. R. Nowak, K. Leiter, J. Knap,  and V. Gavini, Journal of Computational Physics 253, 308 (2013).
  • Motamarri et al. (2020) P. Motamarri, S. Das, S. Rudraraju, K. Ghosh, D. Davydov,  and V. Gavini, Computer Physics Communications 246, 106853 (2020).
  • Das et al. (2022) S. Das, P. Motamarri, V. Subramanian, D. M. Rogers,  and V. Gavini, arXiv:2203.07820  (2022).
  • Das et al. (2019) S. Das, P. Motamarri, V. Gavini, B. Turcksin, Y. W. Li,  and B. Leback, in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (2019) pp. 1–11.
  • Zhuravel et al. (2020) R. Zhuravel, H. Huang, G. Polycarpou, S. Polydorides, P. Motamarri, L. Katrivas, D. Rotem, J. Sperling, L. A. Zotti, A. B. Kotlyar, J. C. Cuevas, V. Gavini, S. S. Skourtis,  and D. Porath, Nat. Nanotechnol. 15, 836 (2020).
  • Batcho (2000) P. F. Batcho, Phys. Rev. E 61, 7169 (2000).
  • Bylaska et al. (2009) E. J. Bylaska, M. Holst,  and J. H. Weare, Journal of Chemical Theory and Computation 5, 937 (2009).
  • Lehtovaara et al. (2009) L. Lehtovaara, V. Havu,  and M. Puska, The Journal of Chemical Physics 131, 054103 (2009).
  • Alizadegan et al. (2010) R. Alizadegan, K. J. Hsia,  and T. Martinez, The Journal of chemical physics 132, 034101 (2010).
  • Schauer and Linder (2013) V. Schauer and C. Linder, Journal of Computational Physics 250, 644 (2013).
  • Motamarri and Gavini (2014) P. Motamarri and V. Gavini, Phys. Rev. B 90, 115127 (2014).
  • Maday (2014) Y. Maday, in Partial Differential Equations: Theory, Control and Approximation (Springer, 2014) pp. 349–377.
  • Davydov et al. (2016) D. Davydov, T. D. Young,  and P. Steinmann, International Journal for Numerical Methods in Engineering 106, 863 (2016).
  • Kanungo and Gavini (2019) B. Kanungo and V. Gavini, Phys. Rev. B 100, 115148 (2019).
  • Ghosh et al. (2019) K. Ghosh, H. Ma, V. Gavini,  and G. Galli, Phys. Rev. Materials 3, 043801 (2019).
  • Ghosh et al. (2021) K. Ghosh, H. Ma, M. Onizhuk, V. Gavini,  and G. Galli, npj Comput. Mater. 7, 123 (2021).
  • Sukumar and Pask (2009) N. Sukumar and J. Pask, International Journal for Numerical Methods in Engineering 77, 1121 (2009).
  • Kanungo and Gavini (2017) B. Kanungo and V. Gavini, Phys. Rev. B 95, 035112 (2017).
  • Yamakawa and Hyodo (2005) S. Yamakawa and S.-a. Hyodo, Phys. Rev. B 71, 035113 (2005).
  • Rufus et al. (2021) N. D. Rufus, B. Kanungo,  and V. Gavini, Phys. Rev. B 104, 085112 (2021).
  • Pask and Sukumar (2017) J. E. Pask and N. Sukumar, Extreme Mechanics Letters 11, 8 (2017).
  • Pask et al. (2012) J. Pask, N. Sukumar,  and S. Mousavi, International Journal for Multiscale Computational Engineering 10 (2012).
  • Das et al. (2015) S. Das, M. Iyer,  and V. Gavini, Physical Review B 92, 014104 (2015).
  • Mermin (1965) N. D. Mermin, Phys. Rev. 137, A1441 (1965).
  • Monkhorst and Pack (1976) H. J. Monkhorst and J. D. Pack, Physical review B 13, 5188 (1976).
  • Ceperley and Alder (1980) D. M. Ceperley and B. J. Alder, Physical Review Letters 45, 566 (1980).
  • Perdew and Zunger (1981) J. P. Perdew and A. Zunger, Physical Review B 23, 5048 (1981).
  • Schweitzer (2011) M. A. Schweitzer, Numerische Mathematik 118, 137 (2011).
  • Albrecht et al. (2018) C. Albrecht, C. Klaar, J. E. Pask, M. A. Schweitzer, N. Sukumar,  and A. Ziegenhagel, Computer Methods in Applied Mechanics and Engineering 342, 224 (2018).
  • Anderson (1965) D. G. Anderson, J. ACM 12, 547 (1965).