Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of...

50
Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti Report/Preprint No. 12–I–02 Institute of Applied Mechanics (CE) · Micromechanics of Materials Group University of Stuttgart, 70550 Stuttgart, Pfaffenwaldring 7, Germany · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Contents 1. Acknowledgements. 2. Introduction. 3. Orbital-Free Density Functional Theory. 3.1. The Orbital-Free Density Functional Theory Framework. 3.2. The Variational Problem. 3.3. Finite Element Formulation. 4. Multi-dimensional Optimization Methods for Orbital-Free DFT. 4.1. Steepest Descent Method. 4.2. Conjugate Gradient Method. 4.3. Root-Finding Newton Method. 5. Numerical Implementation. 5.1. Mesh Generation. 5.2. Implementation with DUNE Numerics. 6. Numerical Examples. 6.1. Atoms. 6.2. Molecules. 6.3. Aluminium Clusters. 6.4. Computational Time. 7. Conclusion and Future Directions. A. Required Derivatives. A.1. Derivatives with respect to {u i }. A.2. Derivatives with respect to {φ i }. Master Thesis supervised by Dipl.-Phys. V. Schauer & Jun.-Prof. Dr. C. Linder Stuttgart, April 2012 (modified Dec 2013)

Transcript of Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of...

Page 1: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Finite Element Implementation of Orbital-Free Density

Functional Theory for Electronic Structure Calculations

Soumya Swayamjyoti

Report/Preprint No. 12–I–02Institute of Applied Mechanics (CE) · Micromechanics of Materials Group

University of Stuttgart, 70550 Stuttgart, Pfaffenwaldring 7, Germany

⋄·⋄· ⋄· ⋄· ⋄· ⋄· ⋄· ⋄· ⋄·

⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·

⋄·⋄·⋄·⋄·

⋄·⋄· ⋄·⋄· ⋄·⋄·⋄·

⋄· ⋄·⋄·⋄·

⋄· ⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·

⋄·⋄·⋄·⋄·

⋄·⋄·⋄·⋄·

⋄·⋄·⋄·⋄·⋄· ⋄·⋄·

⋄·⋄· ⋄·⋄·

⋄·⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·

⋄·

⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·

⋄·⋄·⋄·

⋄·⋄·

⋄·⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·⋄·⋄·⋄·⋄·⋄·⋄·⋄·

⋄· ⋄·⋄· ⋄·⋄·⋄·

⋄· ⋄·⋄·

⋄·⋄· ⋄·

⋄·⋄·

⋄·⋄·

⋄·⋄·

⋄·

⋄·⋄·

Contents

1. Acknowledgements.

2. Introduction.

3. Orbital-Free Density Functional Theory.

3.1. The Orbital-Free Density Functional Theory Framework.

3.2. The Variational Problem.

3.3. Finite Element Formulation.

4. Multi-dimensional Optimization Methods for Orbital-Free DFT.

4.1. Steepest Descent Method.

4.2. Conjugate Gradient Method.

4.3. Root-Finding Newton Method.

5. Numerical Implementation.

5.1. Mesh Generation.

5.2. Implementation with DUNE Numerics.

6. Numerical Examples.

6.1. Atoms.

6.2. Molecules.

6.3. Aluminium Clusters.

6.4. Computational Time.

7. Conclusion and Future Directions.

A. Required Derivatives.

A.1. Derivatives with respect to ui.A.2. Derivatives with respect to φi.

Master Thesis supervised by Dipl.-Phys. V. Schauer & Jun.-Prof. Dr. C. LinderStuttgart, April 2012 (modified Dec 2013)

Page 2: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Acknowledgements 1

1. Acknowledgements

First of all, I would like to thank Jun.-Prof. Christian Linder for giving me theopportunity to do my master thesis in his group. I thank him for his encouragement andsupport during this interesting study. Additionally, I would like to express my gratituteto him for his help and advice during a period of personal difficulties.

I want to thank Dipl.-Phys Volker Schauer for his guidance and supervision of thisthesis. I am thankful to him for his constant support and help. It was a great learningexperience to work with him. I am grateful to him for his valuable suggestions. Thediscussions we had pertaining to this thesis and about physics in general motivated myinterest in computational physics to a great extent. I would also like to thank him for hisfriendship during my studies in Stuttgart. I seize this opportunity to wish him the bestin his future endeavors.

Many thanks to Prof. Christian Miehe for his timely advice and institutional support.

I would like to thank my PhD supervisors Dr. Peter M. Derlet and Prof. Jorg Lofflerfor the confidence they reposed in my profile following my seminar at Paul Scherrer Institutand subsequent discussions.

Thanks to our collaborators Prof. Vikram Gavini and his group (in particular, Mr.Phani Sudheer Motamarri) for useful inputs.

Thanks to all my colleagues in the Micromechanics of Materials Group and the In-stitute of Applied Mechanics (Chair I) of University of Stuttgart for the cordial workatmosphere.

I thank Prof. Christian Linder, Prof. Eugenio Onate and Prof. Pedro Diez fortheir help during my PhD applications. A strong reference by Prof. Christian Linderas my Master Thesis Supervisor, a reference letter of Outstanding Performance in thefirst semester in Barcelona by Prof. Eugenio Onate and support of my abilities by Prof.Pedro Diez as the coordinator of my master program helped me find a very good PhDposition at Paul Scherrer Institut and ETH Zurich. It is also relevant to point out that Ienjoyed Prof. Christian Linder’s interactive lectures on Atomistic Modeling of Materialsvery much during my Masters. I look upto Prof. Eugenio Onate for the pioneeringresearch he has done in the field of computational mechanics and his active managementof CIMNE Barcelona as its director and founder. I acknowledge Prof. Pedro Diez’s,Prof. Sergio Zlotnik’s and Mr. Gautam Ethiraj’s excellent coordination of the ErasmusMundus Master Program in Computational Mechanics from Barcelona and Stuttgart.Thanks to Prof. Sergio Zlotnik for organizational support for hosting the next EMAGeneral Assembly in Barcelona in June 2013.

I gratefully acknowledge the contributions to the formative years of my scientific careerof Prof. K. Swaminathan as my Bachelor Thesis Advisor and Prof. Lakshman Nandagirias a mentor at my home university National Institute of Technology Karnataka, Surathkal.I thank Dr. Brijesh Eshpuniyani as one of the first persons to introduce me to researchwhile interning with him at IIT Delhi and IIT Kanpur during two consecutive summers.

Special mention to Mr. Gautam Ethiraj (Stuttgart) andMs. Lelia Zielonka (Barcelona)for their help with administrative affairs during my studies in the Erasmus Mundus Masterof Science in Computational Mechanics. I thank my teachers at University of Stuttgartand UPC Barcelona for helping me build up my knowledge base in computational me-

Page 3: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Acknowledgements 2

chanics.

Thanks to my colleague and my best friend in Europe Mr. Anuj Sharma for a verygenerous friendship in Stuttgart. I thank Mr. Rodolfo Fleury (Swansea) and Mr. FabienPoulhaon (Nantes) for the good times in Barcelona. I wish Anuj, Rodolfo and Fabien(who are also my classmates in the Erasmus Mundus Master of Science in ComputationalMechanics) the very best in their doctoral studies at TU Darmstadt, Oxford Universityand Ecole Centrale Nantes respectively.

I thank my family in India for their unconditional love and support.

I gratefully acknowledge the financial support of the European Commission. My stud-ies in Europe were funded by the prestigious Erasmus Mundus Scholarship (A grant of42k EUR by the European Commission for two years of master studies). I thank theselection consortium comprising of CIMNE (International Center for Numerical Methodsin Engineering, Barcelona), University of Stuttgart, Ecole Centrale Nantes and SwanseaUniversity.

Page 4: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Introduction 3

2. Introduction

At the fundamental level, ground state properties of materials depend only on elec-tron density and hence are obtainable from first principles. However, a complete ab-initiocalculation by solving the Schrodinger equation is computationally ambitious for a widerange of length scales involved in material modeling and thus separation of scales becomenecessary. At the microscopic scale, one can aim at ab-initio electronic structure calcula-tions in the framework of approximate theories developed over the last decades, the mostprominent being the density functional theory which was pioneered by [24] and [25]. In theKohn-Sham Density Functional Theory (KSDFT) the kinetic energy is computed by solv-ing an eigenvalue problem involving the wave-functions or orbitals of a material system.The computational complexity associated with this calculation is high and thus limits thepotential system size to a few hundred atoms. This has inspired interest in orbital-free ki-netic energy functionals. This form of density functional theory where the kinetic energyis modeled by orbital-free kinetic energy functionals is referred to as Orbital-Free DensityFunctional Theory (OFDFT). This theory has its roots in the Thomas-Fermi model whichfinds mention in the early papers of [39], [27], [26].

In the context of material science, the electronic structure of a material determinesthe behavior of the material at the macroscopic level, which is the length scale of interestfor engineering applications. Processes that occur at a certain length scale govern thebehaviour of the material at larger length scales. Hence, it becomes necessary to success-fully bridge scales that can couple quantum mechanical, molecular mechanical or classicalatomistic and continuum mechanics simulations in a unified theory. A feature of thesemultiscale simulations is to use accurate and computationally complex techniques to treatregions of small length scale and “coarse-grain” the rest of the system, that is, use lessaccurate and computationally faster methods for the rest of the system.

In the atomistic framework, each atom is tracked during a deformation process andthis information is used for predicting the macroscopic properties. While such resolutiongives the exact description of a material, the computational demand associated with largesystem sizes makes most problems intractable in a completely atomistic framework. Thisis where the quasi-continuum (QC) methods come into play. Extensively discussed in[38], [42] and [16], QC methods aims at the right balance between fully atomistic andfully continuum techniques. They involve an adaptive use of both methodologies, that is,retaining the atomistic resolution in spatial regions of the problem only where required anduse of continuum appoximations elsewhere to reduce the computational expense. Initially,the QC method was limited to atomistic interactions at the highest resolution. But itturns out that, a complete material description depends on the electronic structure, inparticular, to predict material phenomenon such as bond breaking at the crack tip duringfailure in solids. To put the present work in context, we have implemented numericalmethods to compute electronic structure of materials. The mathematical frameworks usedin the current study can be programmed into a QC formalism. A natural question thatarises here is our choice of OFDFT as the quantum mechanical sub-framework in the largerframework of multiscale method development. Arguably, Kohn-Sham-DFT will suit betterfor it’s accuracy and theoretical robustness, refer [52] and [41] for recent developmentsin finite-element implementation of KSDFT. However, a direct implementation of Kohn-Sham-DFT with classical atomistic molecular dynamics leads to an algorithm that scalescubically with number of atoms due to orthonormalization of orbitals. Cubical scaling

Page 5: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Introduction 4

is a serious complication from a computational perspective. OFDFT presents us with asimple solution. Lack of orbitals in OFDFT simplifies this computational bottleneck andlinear scaling with system size has been achieved in the QC-OFDFT formalism adoptedby [17]. The computational simplicity of OFDFT is a major motivation for the presentstudy.

An efficient coupling method for simple metals based on OFDFT has been implementedin [13]. A quasi-continuum scheme based on OFDFT (QC-OFDFT) has been developedby [17] which concurrently bridges electronic and continuum length scales. [17] have usedfinite-element bases in their quasi-continuum scheme which have the added advantagethat there are no restrictions on boundary conditions, unlike plane-wave bases whichrepresents problems only with periodic boundary conditions. In the present work also,the finite element basis set is selected for minimizing the orbital-free density functional.Finite element represent a versatile basis set, for its flexibility which makes it one ofthe most preferred choices in several engineering applications and have been previouslyused by the principal investigator (PI) in simulating failure in purely mechanical solids[37], [30], [1], [31], [2], [33], [36], [46], [47], [44], [45] failure in electromechanical coupledmaterials [34], [32], [28], [29], and to understand microscopic deformation mechanisms insoft matter materials [35], [57], [55], [56], [63].

In the present work, we have implemented numerical methods for Orbital-Free DensityFunctional Theory. In chapter 3, we have set up the OFDFT framework. Subsequently,we describe the two numerical methods which we have implemented in chapter 4. Thenumerical implementation and algorithmical controls are detailed in chapter 5. We havecome up with very good and reasonably accurate numerical results of our implementationin chapter 6. Chapter 7 concludes our work giving future directions to this research.Further informations on the presented material and also on the embedding into the widerfield of electronic structure calculations can be found in [52], [41], [49], [50], [51].

Page 6: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 5

3. Orbital-Free Density Functional Theory

In this chapter, the OFDFT framework is set up. The OFDFT energy functional isdescribed and different kinetic energy terms of the functional are discussed. In additionto that, the relation with respect to Kohn-Sham DFT is presented. Different solutionprocedures and basis functions used by other researchers solving OFDFT are detailed.Furthermore, the development of FEM based OFDFT implementations in the last decadeis taken note of. Subsequently, the variational problem is presented followed by thediscrete formulation of the problem in finite element spaces.

3.1. The Orbital-Free Density Functional Theory Framework

The Orbital-Free Density Functional Theory is used to study atomic systems. Anatomic system consists of nuclei and surrounding electrons. A neutral atomic systemconsists of equal amount of positive charge in the nuclei and negative charge as electrons.The OFDFT uses electron density as an input which is the number of electrons per unitvolume. The negative charge in the system is thus represented by a smeared and smootheletron density which has higher concentration around a nucleus or an atomic core. Theelectron density is denoted as ρ which has the properties ρ ≥ 0 and

∫ρ dr = N where N

is the total number of electrons. In this study, we use atomic units for our study of atomicsystems. In the atomic units, which is the conventional units used in atomic physics, thefour physical constants, namely the electron mass, the elementary charge, the Planck’sconstant and the Coulomb’s constant are defined as unity. The unit of energy we use isHartree, which is the atomic unit of energy.

The ground state energy functional in density functional theory is given by [48]

E(ρ,R) = Ts(ρ) + Exc(ρ) + EH(ρ) + Eext(ρ,R) + Ezz(R), (3.1)

where ρ is the electron-density and R is the vector containing the nuclear positions in thesystem.

Ts is the kinetic energy of non-interacting electrons. In orbital-free density func-tional theory, Ts is modeled by orbital-free kinetic energy functionals. The first directapproximations of the kinetic energy dates back to the Thomas-Fermi model [27]. In theThomas-Fermi model, the kinetic energy is expressed as

Ts(ρ) = CF

Ω

ρ5/3(r) dr, (3.2)

where CF = 310(3π2)2/3.

It is usual practice to write the energy functional for interacting electrons as a sum ofthe kinetic energy and the interaction terms comprising of the electrostatic energy and theexchange-correlation energy where the exchange-correlation term is a quantum correctionterm. As the true form of the energy functional is unknown, approximations for Exc(ρ)must be used. The most widely used approximation is the local-density approximation(LDA), where the functional depends locally only on the electron density.

The Local Density Approximation (LDA) [43] used in the present work, is written inthe form by

Exc(ρ) =

Ω

ǫxc(ρ(r))ρ(r) dr, (3.3)

Page 7: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 6

where ǫxc = ǫx + ǫc is the exchange and correlation energy per electron given by

ǫx(ρ) = −3

4(3

π)1/3ρ1/3, (3.4)

ǫc(ρ) =

γ1+β1

√rs+β2rs

if rs ≥ 1,

A log rs +B + Crs log rs +Drs if rs < 1,

(3.5)

where rs = ( 34πρ

)(1/3). For unpolarized medium, the values of the constants are γ =−0.1471, β1 = 1.1581, β2 = 0.3446, A = 0.0311, B = −0.048, C = 0.0014, D = −0.0108.

The last three terms in the energy functional are electrostatic

EH(ρ) =1

2

Ω

Ω

ρ(r)ρ(r’)

|r− r’|drdr’

︸ ︷︷ ︸

electron−electron

, (3.6)

Eext(ρ,R) =

Ω

ρ(r)Vext(r)dr

︸ ︷︷ ︸

electron−nuclei

, Vext =

Ω

b(r′)

|r− r′|dr′, (3.7)

Ezz(R) =1

2

I,J,I 6=J

ZIZJ

|RI − RJ |︸ ︷︷ ︸

nuclei−nuclei

. (3.8)

The point charge ZI is regularized with a smooth function ZIδ(r). Ezz is thus givenby

Ezz(R) =1

2

Ω

Ω

b(r)b(r′)

|r− r′|dr dr′, (3.9)

where b(r) =∑M

I=1 ZIδ(r).

This differs from the earlier formulation by the self-energy of the nuclei. As the self-energy of the nuclei is a constant, it does not affect the subsequent derivations. EH is theHartree energy, which is the interaction energy of electron-density. Eext is the interactionenergy with external field induced by nuclear charges. Ezz is the repulsive energy betweennuclei.

The Thomas-Fermi model has several shortcomings [8]. A major drawback of thismodel is that it does not predict atomic binding to form molecules and solids. In light

Page 8: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 7

of this, Weizsacker [60] introduced a correction term to the kinetic energy functional andthe derived model is known as Thomas-Fermi-Weizsacker (TFW) model which has theform

Ts(ρ) = CF

Ω

ρ5/3(r) dr+λ

8

Ω

|∇ρ(r)|2

ρ(r)dr, (3.10)

where CF = 310(3π2)2/3 and λ is a parameter. The Weizsacker [60] correction facilitates

prediction of atomic binding. This problem of non-binding has been later discussed inTeller non-binding theorem [48]. Weizsacker type corrections include different values of λand the corresponding models are known as TFλWmodels. In the present work, λ = 2/10is used unless otherwise stated. This value of λ is the most optimum value [61]. A com-parative study (TFDW and HF models) of variation of relative deviation of ground stateenergies with λ as a parameter has been presented in [61]. Figure 1 depicts that study.The relative deviation of the total ground state energies has been studied with λ as aparameter and at λ = 2/10, we find the least deviation. Hence we use λ = 2/10 for ourcomputations.

Unfortunately, the kinetic energy given by the TFW model is not significantly betterthan the TF model, the reason being the highly non-local nature of the exact kinetic en-ergy functional. There have been several attempts to accurately model the kinetic energyfunctional as studied in [10], [59], [?], [9], [54], [58], [12]. The new kinetic energy kernelsdeveloped in the aforementioned papers are non-local in nature and hence model the ki-netic energy functional more accurately. A prominent non-local kinetic energy functionalis shown below, taken from [40]

Ts(ρ) = CF

Ω

ρ5/3(r) dr+λ

8

Ω

|∇ρ(r)|2

ρ(r)dr+ Tk(ρ), (3.11)

Tk(ρ) =

Ω

Ω

ρα(r)K(|r− r’|, ρ(r), ρ(r’))ρβ(r’) drdr’, (3.12)

where α and β are parameters. The kernels can be defined as Density Dependant (DD) orDensity Independent depending on whether K is dependant on ρ(r) or not, respectively[40].

But the disadvantage of the newly developed kinetic energy kernels is that it’s compu-tationally expensive to evaluate the non-local terms. This computational expense balancesout the computational simplicity inherent in the OFDFT models when compared withKohn-Sham-DFT. To see the latest developments in this field interested readers can referto [62], [23], [?], [11].

The energy components of Orbital-Free DFT are different to those of Orbital-BasedDFT, but sum up to a total energy that is same. This is due to the fact that, OFDFTcomputations lead to a difference in the electron density, which does not show the charac-teristic shell structure as shown in figure 2. It is this correctness of total energies togetherwith its numerical advantages, which makes the Orbital-Free DFT also interesting forcoupling to macroscopic scales, as was already shown in the quasicontinuum framework[17]. The accuracies required in chemistry, e.g. for the evaluation of reaction paths, can-not be met by the Orbital-Free DFT, however qualitative insights into the mechanical

Page 9: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 8

Figure 1: Figure taken from [61]. A comparative study of variation of relative deviationof ground state energies with λ as a parameter.

Figure 2: Electron density of Argon for various models [48].

Page 10: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 9

behavior of materials are still possible. The absence of the orbitals makes the solutionprocess simpler and faster.

To discuss the properties of the Thomas-Fermi energy functional, we refer to [27]. Theuniqueness of the solutions of the Thomas-Fermi equations has been established in thispaper. These solutions also minimize the Thomas-Fermi energy functional. The Thomas-Fermi functional is non-linear which poses the biggest challenge in numerical solvabilityof the same.

3.2. The Variational Problem

The electrostatic interaction energy of the electrons and repulsive energy of the nucleiare non-local terms. The evaluation of these terms is the most computationally intensivepart of the energy functional. Hence, the problem is reformulated into a local variationalproblem [21], as follows,

EH(ρ) + Eext(ρ,R) + Ezz(R) = − infφ∈H1(R3)

1

R3

|∇φ|2dr −

R3

(ρ(r) + b(r)φ(r) dr

,

(3.13)

where φ is the electrostatic potential and ρ is the electron density.

Now, we introduce Euler-Lagrange equations which are differential equations whosesolutions are functions for which the functional is stationary. Euler-Lagrange equationcorresponding to the variational problem above is,

−1

4π∆φ = ρ+ b. (3.14)

These have an unique solution

φ(r) =

Ω

ρ(r′)

|r− r′|dr′ +

Ω

b(r′)

|r− r′|dr′ =

Ω

ρ(r′)

|r− r′|dr′ + Vext, (3.15)

where

Vext =

Ω

b(r′)

|r− r′|dr′. (3.16)

Substituting the above ansatz into the variational problem gives us back the euler-lagrange equation.

The energy functional in the local form is then transformed to,

E(ρ,R) = supφ∈H1(R3)

L(ρ,R, φ). (3.17)

The complete expression then reads as a saddle-point problem which is thus given by,

Page 11: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 10

E0(ρ,R) = infρ∈Y,R∈R3M

supφ∈H1(R3)

L,

subject to ρ(r) ≥ 0,∫ρ(r) dr = N,

(3.18)

where the Lagrangian is given by

L(ρ,R, φ) := CF

Ωρ5/3(r) dr+ λ

8

Ω|∇ρ(r)|2ρ(r)

dr+∫

Ωǫxc(ρ(r))ρ(r) dr

− 18π

(R)3|∇φ(r)|2dr +

R3(ρ(r) + b(r))φ(r) dr.(3.19)

The constraint ρ(r) ≥ 0 can be imposed by substituting,

ρ = u2. (3.20)

The problem is re-stated as,

infu2∈H−1

0 ,R∈R3Msup

φ∈H1(R3)

L(u,R, φ), (3.21)

subject to

Ω

u2(r) dr = N. (3.22)

3.3. Finite Element Formulation

There have been several implementations of the OFDFT in plane-wave basis and splinebasis [61]. But such implementations can only simulate systems with periodic boundaryconditions. To predict defects in materials such as, vacancies, cracks, dislocations etc,plane wave basis sets are inadequate. In lieu of the same, in the present work a finiteelement implementation of OFDFT has been performed similar to the methodologiesdeveloped in [21], [18], [40]. Finite-element formulation of OFDFT has been successful instudying defects in materials as detailed in [19], [16], [18], [20], [?]. Additionally, finiteelements are local bases unlike plane wave bases. With finite elements the domain can beadaptively refined which is an added advantage.

The electron density and the electrostatic potential are discretized by a finite-elementscheme using 4-noded tetrahedral elements with linear shapefunctions, as follows,

u =∑

uiNi(x), (3.23)

φ =∑

φiNi(x). (3.24)

Page 12: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Orbital-Free Density Functional Theory 11

Plugging in the above discretizations into the lagrangian, we obtain,

L(u,R, φ) := CF

∑Me=1

Ωe(∑4

i=1 uiNi(x))10/3dr

+ λ2

∑Me=1

Ωe |∑4

i=1 ui∇Ni(x)|2dr

+∑M

e=1

Ωe ǫxc((∑4

i=1 uiNi(x))2)(

∑4i=1 uiNi(x))

2dr

− 18π

∑Me=1

Ωe |∑4

i=1 φi∇Ni(x)|2dr

+∑M

e=1

Ωe((∑4

i=1 uiNi(x))2 + b(r)) (

∑4i=1 φiNi(x))dr,

(3.25)

where M in the above expression is the number of elements.

Thus L is a multi-dimensional function of the nodal-coefficients.

L = L(u1, u2, u3, ..., uN , φ1, φ2, φ3, ..., φN) = L(ui, φi), (3.26)

where N in the above expression is the number of Degrees of Freedom (DOFs).

Multi-dimensional optimization algorithms are required to solve the above posed dis-crete problem in finite element spaces which is discussed in the next chapter.

Page 13: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 12

4. Multi-dimensional Optimization Methods for Orbital-Free DFT

The discrete problem posed in earlier chapters, can be solved by carrying out a multi-dimensional minimization of the energy functional. Several minimization algorithms canbe employed to this end, as detailed in [23]. A direct minimization algorithm to find theenergy minimum is by traversing the direction opposite to the gradient direction, whichis otherwise known as the steepest-descent method. In the present study though, we willuse a conjugate gradient (CG) method which has significant advantages over the steepestdescent method [23], [22], [53].

4.1. Steepest Descent Method

The steepest descent method is a minimum finding method where the traversal di-rection is the negative of the gradient direction. The gradient direction represents thedirection of maximum increase of the function and hence we move in the negative gradi-ent direction. The iterative scheme is given by

x(k+1) = x(k) + α(k)r(k), (4.1)

where α(k) = − <r(k),r(k)><r(k),Ar(k>

, which is obtained by solution of a 1-D minimization problem.< . > represents an inner product and this notation for inner product is used throughoutthis study.

Figure 3: Iterations of steepest descent method for a quadratic problem, figure fromCIMNE Virtual Center (Numerical Methods for PDEs lecture slides).

Figure 3 shows the iterations of the steepest descent method for a quadratic prob-lem. In the steepest descent method, the advance directions are often repeated and ittakes into account only the neighbourhood behavior of the function. In contrast, in theconjugate gradient method each direction is constructed taking into account previous di-rections which is why the CG method is more efficient than the steepest descent method.Therefore, we use the conjugate gradient method in our implementation.

4.2. Conjugate Gradient Method

The conjugate gradient method is a method to find the minimum of a function whosegradient can be computed. In this method, the advance direction is always the conjugatednegative gradient direction. A key feature of this method is that the advance directionsare never repeated. Two vectors u and v are said to be A-conjugate of each other if

Page 14: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 13

uTAv = 0 where A is a symmetric positive definite matrix. In the CG method theadvance directions are chosen to be A-conjugate and are given by,

p(k) =

r(0) k = 0,

r(k) + β(k)p(k−1) k > 0,(4.2)

where β(k) = − <r(k),Ap(k−1)><p(k−1),Ap(k−1>

. Thus we see that, the new direction in the conjugategradient method is constructed from a linear combination of the new residual and theprevious direction. In the above equations, r is the residual or the gradient, p is thedirection vector and β is a scalar.

Figure 4: Iterations of conjugate gradient method for a quadratic problem, figure fromCIMNE Virtual Center (Numerical Methods for PDEs lecture slides).

Figure 4 represents the iteration of a conjugate gradient method applied to a quadraticlandscape. For a quadratic problem, if m is the system dimension, the CG method con-verges in m iterations at the most. But usually, this method converges much before miterations. The convergence of the conjugate gradient method often depends on the con-dition number of the system matrix which is given by k = λmax

λminwhere λmax and λmin are

the maximum and minimum eigenvalues of the system matrix. The use of a precondi-tioner enables us to reduce the condition number which leads to faster convergence. Apreconditioned conjugate gradient method is given as follows [53]

r(0) = b−Ar(0), (4.3)

d(0) = M−1r(0), (4.4)

α(k) = −< r(i),M−1r(i) >

< d(i),Ap(i >, (4.5)

x(i+1) = x(i) + α(i)d(i), (4.6)

r(i+1) = r(i) − α(i)Ad(i), (4.7)

Page 15: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 14

β(i+1) = −< r(i+1),M−1r(i+1) >

< r(i+1),M−1r(i+1 >, (4.8)

d(i+1) = M−1r(i+1) + β(i+1)d(i), (4.9)

where M is the preconditioner matrix, r is the residual vector, d is the preconditionedresidual, α and β are scalars.

For application of the conjugate gradient method to our formulation, the problemof solving the saddle-point formulation in finite element spaces is broken down into twosub-problems, that is, the Poisson problem and the Thomas-Fermi problem. The energyfunctional is a multi-dimensional function of the nodal-coefficients ui and φi. Weadopt a solution procedure wherein the Poisson problem and the Thomas-Fermi problemare solved iteratively till self-consistency is achieved. The goal of the Poisson problem is tomaximize the energy functional with respect to the φi and the goal of the Thomas-Fermiproblem is to minimize the energy functional with respect to the ui. This is the wayto deal with the inf-sup OFDFT problem. To this end, we apply the conjugate-gradientmethod [53] to optimize each of the two sub-problems. The problem thus reduces to thefollowing form

L(u,R, φ) := CF

Ωu10/3(r) dr+ λ

2

Ω|∇u(r)|2dr+

Ωǫxc(u

2(r))u2(r) dr

− 18π

R3 |∇φ(r)|2dr +∫

R3(u2(r) + b(r))φ(r) dr+ µ(

Ω

u2(r)dr−N)2

︸ ︷︷ ︸

penalty−term

,

(4.10)

such that ∇φL = 0, ∇uL = 0.

In the above expression, µ is the penalty parameter to treat the constraint,∫

Ωu2(r)dr−

N = 0. This parameter is adaptively handled in our implementation. We start with asmall value of penalty (of the order of 10) and increase the penalty parameter by a factorafter each self-consistency loop. This factor is arbitrarily chosen such that the we achievefast convergence. If the penalty parameter is too high at the start, the solution can eitherdiverge or lead to very slow convergence. The stricter treatment of the constraint withhigh values of the penalty parameter towards the end makes sure that the constraint isaccurately satisfied.

An iterative minimization procedure is defined by the sequence u(n+1)i = u

(n)i +λ

(n)a h′(n)

where h′ is normalized h, that is, h′ = h||h|| . The residual r = −∇uiL is substituted into

the CG routine. For the scalar β(k), several approximations have been researched. Twoprominent substitutions for β(k) are the Fletcher-Reeves formula β(k) = r(k+1).r(k+1)

r(k).r(k)and

the Polak-Ribiere formula β(k) = r(k+1).(r(k+1)−r(k))

r(k).r(k). In our current implementation, we use

the Polak-Ribiere formula for efficiency purposes.

The above steps are followed to minimize L with respect to the coefficients ui. Asimilar CG method is also adopted to minimize −L with respect to φi.

4.2.1. Poisson Problem. As formulated earlier, the Lagrangian can be expressedas a multi-dimensional function of ui and φi,

L = L(u1, u2, u3, ..., uN , φ1, φ2, φ3, ..., φN) = L(ui, φi). (4.11)

Page 16: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 15

The Poisson problem is equivalent to solving the supremum part of the inf-sup saddle-point OFDFT problem, that is maximizing the Lagrangian with respect to φi whilekeeping the ui fixed. This involves computing the partial derivatives of the Lagrangianwith respect to φi as below and using this gradient in the conjugate gradient method,

∂L

∂φi|ui=const. =

−1

R3

∇φ(r)∇Ni(x) dr+

R3

(u2(r) + b(r))Ni(x) dr. (4.12)

4.2.2. Thomas-Fermi Problem. The Thomas-Fermi problem involves solving theinfinimum part of the inf-sup saddle-point OFDFT formulation, that is, minimizing theLagrangian with respect to ui while keeping the φi fixed. The partial derivative ofthe Lagrangian with respect to the ui is computed as below and is used in the conjugategradient algorithm for minimizing the Lagrangian.

∂L

∂ui|φi=const. =

∂Ts

∂ui+

∂Exc

∂ui+

∂(ES)

∂ui+

∂(Penalty)

∂ui, (4.13)

where Ts is the kinetic energy functional, Exc is the exchange-correlation functional, ESis the electrostatic part and Penalty is the penalty term.

Since the Thomas-Fermi problem is a non-linear problem, during it’s conjugate gra-dient minimization, a line-search is introduced during the CG iterations. For every newdirection, we take a step in the descent direction. But, we do not know the minimum inthat small step. So, unlike the Poisson problem which is quadratic, in the Thomas-Fermiproblem, we need to find the minimum on that line for every new CG direction. The goalhere is to obtain the µa, as computed below,

L can be expressed as a function of µa as L is minimized by a one-dimensional linesearch [53], where µa is how far one moves in the line.

f(µa) = L(u(n)i + µ(n)

a h(n)). (4.14)

For L to be minimum, f ′(µa) = 0. To find the root of the equation f ′(µa) = 0, secantmethod is used, as below,

µ(k+1)a = µ(k)

a −f ′(µ

(k)a )

f ′′(µ(k)a )

. (4.15)

The second order derivative is approximated by,

f ′′(µ(k)a ) =

f ′(µ(k)a )− f ′(µ

(k−1)a )

µ(k)a − µ

(k−1)a

. (4.16)

Substituting, we get,

µ(k+1)a = µ(k)

a −(µ

(k)a − µ

(k−1)a )f ′(µ

(k)a )

f ′(µ(k)a )− f ′(µ

(k−1)a )

, (4.17)

where f ′(µa) = (h(n))T∇uL(u(n)i + µ

(k)a h(n)). The line search is stopped when abs(µ

(k)a −

µ(k−1)a ) < tol. µa for a particular line is thus determined as µ

(n)a = µ

(k)a . The above line

search is embedded into the conjugate gradient method presented in the previous section.

Page 17: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 16

4.3. Root-Finding Newton Method

The Newton method is used to find the stationary point of a function. This methodassumes a quadratic curvature in the vicinity of the optimum which is why it is alsoimportant to start the iterations close enough to the real solution. A Taylor series ap-proximation around the iterate neglecting higher order terms is used in this method, asshown below,

f(xk +∆x) = f(xk) +∇f(xk)T∆x +

1

2∆xTB∆x, (4.18)

where B is the hessian matrix built with the second derivatives of f and ∇f(xk) is thegradient of f at the iterate. The gradient is computed as below,

∇f(xk +∆x) = ∇f(xk) +B∆x. (4.19)

Setting the gradient to zero, we get the Newton step

∆x = −B−1∇f(xk). (4.20)

Figure 5: Quadratic energy landscapes, figure taken from CIMNE Virtual Center (Nu-merical Methods for PDES lecture slides).

Figure 5 shows the quadratic approximations of multi-dimensional energy landscapes.The multi-dimensional root-finding Newton method is a method developed in the presentwork, which is identical to the staggered solution procedure adopted in [40]. In thismethod, we use the hessian of the lagrangian, that is, the matrix of the second derivativesof the lagrangian with respect to the nodal coefficients, to locate the minimum of thefunctional. A lagrange multiplier is introduced in the energy functional to perform con-strained optimization. If L has an extremum for the original constrained problem, thenthere exists a λ which maps this extremum to a stationary point of the Lagrangian (sta-tionary points are those points where the partial derivatives of L are zero).The functionalis at an extremum point where the gradient is zero. We need to find the roots of theequation that equates the gradient to zero. The formulation of this method is presentedbelow,

Page 18: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 17

L(u,R, φ) := CF

Ωu10/3(r) dr+ λ

2

Ω|∇u(r)|2dr+

Ωǫxc(u

2(r))u2(r) dr

− 18π

R3 |∇φ(r)|2dr +∫

R3(u2(r) + b(r))φ(r) dr+ θ(

Ω

u2(r)dr−N)

︸ ︷︷ ︸

lagrange−term

(4.21)

such that ∇φiL = 0, ∇uiL = 0 and ∇θL = 0, where θ is the lagrange multiplierintroduced to handle the constraint (

Ωu2(r)dr−N) = 0.

Thus, the energy functional is a multi-dimensional function of ui, φi and θ asshown below,

L = L(u1, u2, u3, ..., uN , φ1, φ2, φ3, ..., φN , θ) = L(ui, φi, θ), (4.22)

where the lagrange multiplier θ is considered here as another coefficient, that is, θ =uN+1.

It’s important to discuss the above treatment of the OFDFT problem. First of all, wehave approximated the non-linear Thomas-Fermi functional into a quadratic form. ThePoisson problem is already in the quadratic form, so that is straight-forward to solve.But, that is not the case with the Thomas-Fermi part. So, we expand this Thomas-Fermipart of the functional as a Taylor series expansion and neglect the higher-order terms.This treatment is being dealt with in the subsequent sections.

An obvious question that arises here is, why did not we treat the constraint using apenalty term as we did in the conjugate gradient method presented earlier. The technicalreason for the same is that, if we take the second derivative of the penalty term, weobtain a non-sparce term which makes the whole hessian non-sparce. Thus, it becomescomputationally impractical for us to store and solve this non-sparce hessian. Hence, wehave reformulated the optimization problem to make use of a lagrange multiplier instead.The mathematical explanation is presented below,

Penalty := µ(

Ω

u2(r) dr−N)2, (4.23)

∂(Penalty)

∂ui∂uj= 8µ(

Ω

uNi(x) dr)+ 4µ(

Ω

u2(r) dr−N)

Ω

Ni(x)Nj(x) dr

︸ ︷︷ ︸

non−sparce

. (4.24)

4.3.1. Poisson Problem. The Poisson part is a quadratic problem, that is a quadraticfunction of the Φ = φi. The Lagrangian is expressed in a quadratic form

L(Φ0 +∆Φ) ≈1

2∆ΦTA∆Φ+ bT∆Φ+ c. (4.25)

Page 19: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Multi-dimensional Optimization Methods for Orbital-Free DFT 18

The system Ax = −b is solved in every Newton iteration and the nodal coefficientsare updated as φi

(n+1) = φi(n)+ x, where n is the number of Newton steps and the

hessian matrix corresponding to the Poisson problem is given as,

∂L

∂φi∂φj= Aij =

−1

Ω

∇Ni(x)∇Nj(x) dr

︸ ︷︷ ︸

Stiffness−Matrix

. (4.26)

A linear potential mixing scheme is also incorporated to achieve convergence, that is,φi

(n+1) = (1/2)φi(n) + (1/2)φi

(n+1). The potential vector at a new Newton step isa linear combination of potential vector obtained from the previous Newton step and thepotential vector obtained from the current Newton step.

4.3.2. Thomas-Fermi Problem. An approach similar to the Poisson problem isadopted for the Thomas-Fermi problem. The important difference here is that, theThomas-Fermi problem is a non-linear problem unlike the Poisson problem. Hence, weneed to model the non-linear part into a quadratic form by neglecting the higher orderterms of it’s Taylor series expansion, as below,

L(u0 +∆u) ≈1

2∆uTA∆u+ bT∆u+ c. (4.27)

Taking the gradient,

∇L(u0 +∆u) = A∆u+ b!=0. (4.28)

Setting ∆u = 0, we get,

∇L(u0) = b. (4.29)

The system A∆u = −b is solved in every Newton iteration and the nodal coefficientsare updated as u(n+1) = u(n) + ξ∆u, where the Thomas-Fermi Hessian is given by,

∂L

∂ui∂uj|φi=const. =

∂Ts

∂ui∂uj+

∂Exc

∂ui∂uj+

∂(ES)

∂ui∂uj+

∂(Lagrange)

∂ui∂uj. (4.30)

The hessian matrix corresponding to the Thomas-Fermi problem now is,

R(N+1)×(N+1) ∋ A =

[B cc 0

]

,

where Bij =∂L

∂ui∂uj|φi=const. and c = ∂L

∂ui∂θ.

The system Ax = −b is solved in every newton iteration and the nodal coefficientsare updated as ui

(n+1) = ξui(n)+x. ξ is initially chosed to be 1, which implies that

the full newton step is taken. If the gradient computed is higher than the old gradient,then ξ is halvened. This process is repeated till calculated gradient is less than the oldgradient.

Page 20: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 19

5. Numerical Implementation

In the present work, the numerical implementation of the Orbital-Free Density Func-tional Theory has been carried out in a finite-element basis using the DUNE Numericspackage [5], [3], [4], [6], [7], [14], [15].

5.1. Mesh Generation

The meshes which we use have been created using C programs. We have createdtailor-made meshes for the problems that we intend to solve. We apply our OFDFTimplementation to single atoms, di-atomic molecules and small aluminium clusters.

The 3-D meshes for single atoms are generated such that the mesh is highly refinedaround the center of the domain where the atom will eventually be placed. There is anode at the center of the domain at which the atom is placed. The mesh coarsens awaygradually as we go away from the center. Figure 6 shows a single atom mesh.

Figure 6: Single atomic mesh

Special meshes are also created for di-atomic molecules such as CO and N2. Forgeneration of these meshes, the inter-atomic distance and the domain size are taken asmodifiable parameters. The mesh is refined around the atom positions and graduallycoarsened away towards the boundary. Figure 7 represents a typical mesh for a di-atomicmolecule.

The meshes for aluminium clusters are made up of two parts, the inner atom part andthe basic larger grid which is of the order of the lattice constant. The lattice constant andthe number of atoms are the modifiable parameters for generation of these meshes. Themeshes are so created that the region around the atom is highly refined and new nodalpoints are placed such that the mesh coarsens away as we move farther from the atompositions. Figure 8 shows the mesh for a small aluminium cluster.

Page 21: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 20

Figure 7: Di-atomic mesh

Figure 8: Mesh for Aluminium clusters

Page 22: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 21

5.2. Implementation with DUNE Numerics

As mentioned in the previous section, we use linear 3D 4-noded tetrahedral finiteelements for our implementation. Subsequently, the domain is discretized using thesefinite elements. The optimization procedures are applied on the Grid Function Space(GFS) of the FE mesh. Dirichlet boundary conditions are enforced such that ui andφi are zero on the boundary.

For numerical integration, 4th order quadrature rule has been used. A domain integralis broken down into sum of integrals over the elements. Each element integral is computedby iterating over the shape-functions of that element. In case of linear elements, thenumber of shapefunctions of the element is same as the number of vertices of that element.To sum it up, a domain integral is computed by nested iterations over the elements andthen over the quadrature rule and then over the shapefunctions of the element.

It is important to figure out how the local node numbering for each element is mappedto global node numbers. This is achieved by using the subindex functionality of DUNE.The subindex function takes the local node number, the element and the co-dimension ofthe entity as input and returns the global nodal number of that particular vertex.

The complete picture of our algorithm is shown in figure 9. The algorithm starts withan initial value of the ρi vector as the input. The initial guess of ρi is chosen suchthat, it resembles the final ρi the most, that is a gaussian distribution over the domain.In particular, ρi is chosen to be e−αr at the start of the algorithm where r is the radialdistance from the center of the domain. The algorithm is then taken through the conjugategradient optimization procedures for both the Poisson problem and the Thomas-Fermiproblem. With conjugate gradient, we obtain a configuration of ρi which is in thevicinity of the real solution. The output ρi from the CG method is used as the inputfor the Newton method which solves the Poisson problem and the Thomas-Fermi problemmore efficiently to reach the real minimum of the energy functional with respect to theρi. The final configuration of ρi is stored and the energies at that point gives us theground state energy of the system.

5.2.1. Conjugate Gradient Method. This method uses the gradients of the en-ergy functional to carry out optimizations. The Poisson problem requires the gradientswith respect to φi whereas the Thomas-Fermi problem requires gradients with respectto ui. The ui vector is initialized to a gaussian distribution over the domain. Thegradients are preconditioned to speed-up the conjugate gradient iterative procedure. Thepreconditioner used for the Poisson problem is the inverse of the hessian matrix corre-sponding to the Poisson problem with all the non-diagonal elements set to zero. Thepreconditioner used for the Thomas-Fermi problem is the inverse of the hessian matrixcorresponding to the Thomas-Fermi problem with all non-diagonal elements set to zero.The standard conjugate gradient method is operated on the preconditioned gradients toobtain updates of ui and φi.

The flowcharts in figure 10 and figure 11 depict the conjugate gradient implementa-tion order. The Poisson problem is solved first and then the Thomas-Fermi problem tillgradients for both these problems fall below a certain tolerance. The tolerance criteria isslightly loose for CG method unlike the Newton method. This is because, we employ theconjugate gradient method just to get closer to the real solution whereas in the Newtonmethod, we actually need to converge at the real solution.

Page 23: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 22

Figure 9: Complete algorithm

Page 24: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 23

Figure 10: CG minimization of −L with respect to φi

Page 25: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 24

Figure 11: CG minimization of L with respect to ui

Page 26: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 25

5.2.2. Root-Finding Newton Method. The crux of this method is in assemblingthe right hessian matrices and solving them. The hessian matrix for the Poisson problemand Thomas-Fermi problem are assembled first. To this end, sparcity patterns for boththe matrices are worked out. All codim-1 entities (intersection iterators in DUNE termi-nology, that is, the edges of an element) of the current element are traversed and all pairsof vertices are stored. The sparcity pattern of the assembler is set with the informationgained during the storage of the adjacency data. An index is added to the hessian matrixfor each non-zero element and later these indices are used while assembling the hessian.The hessian matrices are assembled in the standard procedure by iterating over the ele-ments, then over the quadrature rule and then over the shapefunctions. The boundaryconditions for these matrices are set such that diagonal elements are set to unity and therows corresponding to the boundary are set to zero.

The right-hand side vectors of the systems to be solved are also assembled and assignedthe appropriate values. Thereafter, the Ax = b systems are solved using DUNE solvers.To ease and hasten the solving process DUNE preconditioners are used before solving thesystems. For the Poisson Problem, SeqSOR preconditioner is used and BiCGSTABSolveris used for solving the system. For the Thomas-Fermi Problem, the preconditioner usedis SeqILUn and again we use the BiCGSTABSolver to solve the system.

The control of the Newton algorithm is reversed as compared to the conjugate gradientmethod, that is, the Thomas-Fermi problem is solved first and then the Poisson problem.This is because, for the Newton method, the initial solution should always be in thevicinity of the actual solution. When we switch from the CG method to the Newtonmethod, we have ρi from the CG which is in the vicinity of the real solution. Hence,we input that ρi into the Thomas-Fermi Newton algorithm unchanged. The figure 12provides an overall picture of the Newton method.

Page 27: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Implementation 26

Figure 12: Overall sketch of Newton algorithm

Page 28: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 27

6. Numerical Examples

In the previous chapter, two different methods of solving the saddle-point formulationof OFDFT have been discussed. The first method is basically a conjugate-gradient methodwhich treats the constraint in the optimization problem with a penalty parameter. In thesecond method, the constraint is handled by a lagrange multiplier. For convenience, inthe following sections the two methods have been denominated as the ‘conjugate-gradientmethod’ and the ‘Newton method’ respectively. A coupled approach which combines theconjugate gradient method and the Newton method is used to obtain the final saddle-pointconfiguration and the corresponding energy minimum. This is done by passing the finalui and φi configuration of the conjugate-gradient method into the Newton method.The Newton method requires the starting density, that is, the initial solution to be in thevicinity of the actual solution. The conjugate-gradient coupled Newton method achievesthe same, as the conjugate-gradient method brings down the gradients low enough to passon values to the Newton method which are close to the real minimum configuration. Thisapproach of solving the OFDFT problem is validated by the simulations presented in thenext sections.

6.1. Atoms

The test case is the Neon atom, which is the largest atom in our simulations. Weare going to do a comparative study of our results with previous OFDFT studies. Tothis purpose, we compare with the FE-OFDFT work by [21] who use λ = 2/9 as againstλ = 2/10 used by us for the Weizsaker term. We also compare our results with [61] whouse spline basis in their work. [61] use a slightly different functional than us as they donot have the correlation term in the energy functional. They employ though the same λvalue of 2/10 as we do for the Weizsacker term.

In the present study, we use λ = 2/9, which is the optimal value of the parameter λ[61]. The ground-state energies of various atoms computed in our simulations have beentabulated in Table 1. The energies are compared with OFDFT studies by [21] and [61]and Kohn-Sham-DFT values of NIST. We observe excellent agreement of the results ofour simulations with literature.

Table 1: Energies of atoms, in atomic units

Present Stich et al. [61] Gavini et al. [21] NISTHe -2.704 -2.818 -2.91 -2.834Li -7.218 -7.323 -7.36 -7.335C -37.967 -38.033 - -37.425N -54.881 -54.943 - -54.025O -74.637 -75.577 - -74.473Ne -128.700 -128.80 -123.02 -128.233

Figure 13 shows the electron density around the Neon atom in a 2-D mid-plane cut.Electron density is highest at the nucleus. This simulation of the Neon atom is run witha mesh with polygonal domain shape as shown in figure 14.

Figure 15 and figure 17 shows the convergence of our finite-element appoximation. Wecompare the convergence of the ground-state energy of the Neon atom with two different

Page 29: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 28

meshing schemes. The meshing schemes are shown in figure 14 and figure 16. Figure 14represents a polygonal mesh, where we start with a mesh of 277 DOFs and uniformly refineit three times to obtain the final mesh. The intermediate meshes used in the convergenceplot in figure 15 contain 277, 2025, 15729 and 124513 DOFs respectively. The secondmeshing scheme is shown in figure 16, which is a mesh with a cubical domain shape.In the second scheme, we start with a mesh of 183 DOFs and uniformly refine it threetimes to obtain the final mesh. The intermediate meshes used in the convergence plotin figure 17 contain 183, 1301, 9993 and 78737 DOFs respectively. It seems to us thatthe 3-D mesh with a polygonal domain shape is more suitable for our calculations as itconverges faster, although a strong inference cannot be drawn on this because it has moreelements for each uniform sub-division.

We have made a good observation in Table 2, where we compare the energy componentsof Neon in our Orbital-Free calculations and Kohn-Sham DFT calculations obtained fromNIST. The energy contributions are different to those of Kohn-Sham DFT, but sum up toa total energy that is similar again. The reason for this behavior is explained in chapter 3.OFDFT computations lead to a difference in the electron density due to the Orbital-Freenature of the theory. This is in contrast with the characteristic shell structure seen in theelectron densities computed by Orbital-Based methods such as Kohn-Sham-DFT.

Table 2: Comparison of orbital-free and orbital based methods, energy components ofNeon

Ne OF-DFT KS-DFTEtotal -128.700 -128.233Ekin +123.713 +127.738Exc -10.209 -11.710Ecoul +54.204 +65.726Eenuc -296.409 -309.988

At the end of this section, we would like to make a note that, we obtained the ground-state energy of Neon from our calculations as -128.80 Hartree, which is as accurate aspossible. That said, we also observed an extremum point at -127.414 Hartree. If weswitch from the conjugate-gradient method to the Newton method earlier than needed,we end up getting trapped in this extremum point. At this moment, we cannot reallycomment if this is a local minimum, a maximum or a saddle-point at an excited state.We have two methods in the present work, first a conjugate-gradient method, which isreally searching for a minimum in the functional and a ‘Newton method’, which findszeros of the gradient, which can therefore also end up in saddle points or (local) maximaof the functional. To be sure one would have to calculate the hessian and see whether it ispositive or not, something we have not investigated in the scope of the present work. Analternative is to run the conjugate-gradient method again after the Newton method, sothat we have a ‘conjugate-gradient coupled Newton coupled conjugate-gradient’ method.This method should find the minimum. We ran this simulation on the Neon atom andfound that the ground-state energy of -128.80 Hartree is really a minimum, neverthelesswe have not been able to identify if the extremum at -127.414 Hartree is a local minimum,maximum or a saddle-point. This makes the energy landscape of Neon quite interestingthough and calls for further analysis.

Page 30: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 29

Figure 13: Electron density around a neon atom calculated with 124513 DOFs with themesh in figure 14.

Figure 14: Mesh with a polygonal domain shape with 124513 DOFs.

Page 31: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 30

Figure 15: Convergence plot of Neon atom with a mesh with polygonal domain shape.

Figure 16: Mesh with a cubical domain Shape with 78737 DOFs.

Page 32: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 31

6.2. Molecules

The next application of our OFDFT implementation is to simulate binding in molecules.It should be mentioned here that, the Thomas-Fermi model is poor at predicting bind-ing, refer Teller non-binding theorem mentioned in earlier chapters [26]. It is the Weiz-sacker correction in the OFDFT functional which helps us predict binding of CO andN2 molecules in the present study. Figure 18 shows the mesh for a di-atomic molecule.Figure 19 and figure 20, show the electron density around CO and N2 molecules respec-tively and we can clearly visualize the binding between atoms. It’s important to pointout that the meshes for these molecules are so designed that the regions near the atomsand between the atoms are highly refined compared to the outer regions. This helps usto capture binding. Figure 21 shows the plot over line of a mid-plane section of the COcontour of electron density. This figure depicts the assymetry of the CO molecule, whereC is a smaller atom compared to O and hence the electron density at the center of C atomis lower compared to the electron density at the center of O atom.

Figure 22 shows the convergence of our meshing scheme for 2-atom molecules. Theconvergence of ground-state energies of CO at uniform subdivisions of the initial mesh isplotted in figure 22. The initial 2-atom mesh has 305 DOFs and it is uniformly refinedthree times to obtain the final mesh. The intermediate meshes used in the convergenceplot in figure 22 contain 305, 2217, 17201 and 136161 DOFs respectively.

In Table 3, we report the ground state energies of CO and N2 molecules. We find thatthe ground state energies of these molecules at sample interatomic distances are in goodagreement with ground state energies of the open source Kohn-Sham DFT code ORCA,applying the VWN-5 functional [48]. These calculations have been made with a mesh of136131 DOFs which is obtained by 3 uniform subdivisions of the initial mesh.

Table 3: Ground state energies of CO and N2 molecule [136131 DOFs]

Molecule Present [Eh] ORCA [Eh]CO[2.6 a.u.] -112.047 -112.391N2[2.4 a.u.] -106.542 -108.636

We then do a series of calculations of total energies of N2 at different interatomicdistances. This is done with a mesh of 17201 DOFs, which is obtained by 2 uniformsubdivisions of the initial mesh. As the mesh is not highly refined, we can expect thetotal energy values to be not so accurate. These values are tabulated in Table 4. Usingthese values, we compute the bond length of N2 as the interatomic distance where thetotal energy is minimum, see figure 23. We also observe strong repulsive energy at inter-atomic distance of 1.0 a.u. The minimum energy configuration corresponds to interatomicdistance 2.0 a.u., which is the most stable configuration of N2. The binding energy ofN2 is also calculated using the results of these computations which is tabulated in Table5. Binding energy is calculated as, binding energy = EAB - EA - EB, where EAB is theground-state energy of the molecule and EA and EB are the ground-state energies of thesingle atoms. The same mesh used for ground-state energy calculations of N2 molecule isused for energy calculations of single atom N. It’s assumed that the errors will cancel outdue to the low-refinement of the mesh [17201 DOFs] during binding energy calculations.The conversion of 1 Hartree = 27.2107 eV is used for calculation of binding energy. It’simportant to note that orbital-free kinetic energy functionals have strong limitations in

Page 33: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 32

Figure 17: Convergence plot of Neon atom with a mesh with a cubical domain shape.

Figure 18: Di-Atomic Mesh

Page 34: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 33

Figure 19: Electron density around a CO molecule

Figure 20: Electron density around a N2 molecule

Page 35: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 34

Figure 21: Plot over line for CO

Figure 22: Convergence plot of CO

Page 36: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 35

the presence of covalent bonds [48] and the orbital-free theory is not suitable for moleculeslike N2 and CO. It’s just a demonstration of our methodology which we have presentedhere.

Figure 23: Bond length of N2

Table 4: Ground state energies of N2 molecule [17201 DOFs]

Dist.[a.u.] Ground-state energy [Eh]1.0 -101.4921.2 -103.7331.4 -104.9221.6 -105.5291.8 -105.7782.0 -105.8332.2 -105.7352.4 -105.5242.6 -105.3032.8 -105.051

Table 5: Binding energy and bond length of N2 molecule [17201 DOFs]

Property Present Gavini. et al. [21] Experiments [21] HF [21] KS-LDABinding energy (eV) -6.6 -12.6 -11.2 -7.9 -9.6Bond length (a.u) 2.0 2.7 2.07 2.01 2.16

To conclude this section, we try to point out a few possible inadequacies of our method-ology which might lead to discrepancies and something one should always be careful about.

Page 37: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 36

Firstly, we have used a conjugate-gradient coupled Newton method in our calculations.It’s important to point out that the Newton method is not a minimum finding algorithmbut rather an extremum finding method. We cannot therefore guarantee that the ground-state energy values that we obtain are real minima. Rather, they can be excited statesaddle points. This eventuality can be ruled out by checking for the positive definitenessof the hessian matrix. Secondly, for the binding energy and bond length calculationsof molecules, we have done a series of computations with meshes specifically designedfor 2-atom molecules at different interatomic distances. This can get tricky, because inour solution procedure, we solve for the minimum of the OFDFT functional in the GFS(Grid Function Space). So, if the meshes generated for 2-atom molecules at differentinteratomic distances are not refined enough or are not similar enough, then there can bediscrepancies in the binding energy vs interatomic dist. curve and deviations from theoriginal nature of this curve. For us, it has not been easy to reproduce the exact bindingenergy vs interatomic dist. curve presented in [21]. We attribute these discrepancies tothe 2-atom meshes we have used.

6.3. Aluminium Clusters

We have applied our OFDFT implementation to simulate the electron density aroundsmall aluminium clusters. Figure 24 and figure 25 shows the mesh for a 2×2×2 aluminiumcluster and the electron density around a 2 × 2 × 2 aluminium cluster respectively. Themesh is highly refined near the atom positions. Similarly, figure 26 and figure 27 representsthe mesh for a 3×3×3 aluminium cluster and the corresponding electron density contourplot respectively.

Figure 24: Mesh for 2× 2× 2 Aluminium cluster

Similar to the binding energy calculations of molecules in the previous section, bindingenergy per atom of aluminium clusters can be computed from the ground-state energyvalues of these alumnium clusters. Binding energy can be calculated as, binding energy= (E(a) − aE0)/a where E(a) is the energy of the cluster per unit cell consisting of aatoms and E0 is the energy of a single atom. However, it’s pertinent to point out that,

Page 38: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 37

Figure 25: Electron density around a 2× 2× 2 Aluminium cluster

Figure 26: Mesh for 3× 3× 3 Aluminium cluster

Page 39: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 38

aluminium clusters have covalent bonds and OFDFT is not the best method for systemswith covalent bonds [48].

6.4. Computational Time

We now have a look at the computational time of our simulations using the Valgrindprogram. The code has been profiled and we have run a test simulation on the neon atomwith a mesh of 131 DOFs. We find that the conjugate gradient method is much slowerthan the Newton method for our test case. This is noted by running both the methodsseparately till convergence and measuring the time for each run. It’s also observed thatthe majority of the simulation time is taken by gradient calculations, see figure 28. It isinteresting to note that, solving the poisson problem is considerably less expensive thanthe Thomas-Fermi problem, figure 28. The gradient calculation by the conjugate gradientmethod takes up around 53% of the total time which is the most expensive function. Thisis because, for every iteration of the conjugate-gradient gradient calculation function,there is a line-search loop embedded in it. This line-search includes another gradientcalculation, thus making the outer function quite expensive. 35% of the time is takenby the gradient computation done by the Newton method. Also, computational timesignificantly depends on the size of the hessian matrix which is proportional to the numberof DOFs. Figure 29 and figure 30 shows the percentage break-up of the conjugate-gradientgradient calculation and the Newton gradient calculation functions respectively. It shouldbe observed that the pow functions (in the exchange-correlation terms) take the bulk ofthe time in these gradient calculations. It is important to note that the above observationsare specific only to our test case and cannot be generalized.

With our experience of these simulations, we have seen that the use of preconditionersin the penatly method has significantly reduced computational time. In our study, theNewton method seems to converge faster than the conjugate-gradient method, but wecannot draw a definite conclusion on this. If the initial guess is a good one, the methodwill achieve convergence faster. Also, for the conjugate-gradient method, we use thesimplest preconditioner now, which is the hessian matrix with non-diagonal elements setto zero. Moving to better preconditioners can reduce the computational time of theconjugate-gradient method. Additionally, parallelizing the code is strongly recommendedas a future work of this study.

Page 40: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 39

Figure 27: Electron density around a 3× 3× 3 Aluminium cluster

Figure 28: % break-up of the main function

Page 41: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Numerical Examples 40

Figure 29: % break-up of the conjugate-gradient gradL function

Figure 30: % break-up of the Newton gradL function

Page 42: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Conclusion and Future Directions 41

7. Conclusion and Future Directions

To sum up the present work, two different numerical methods of solving the OFDFTproblem have been implemented. Both methods have been compared and the results arefound to be matching. Excellent agreement with literature has been achieved for theenergies of single atoms. The ground-state energies of the molecules have been found tobe in reasonable agreement with other DFT codes. Additionally, good contour plots forelectron densities of atoms, molecules and small aluminium clusters have been obtained.Furthermore, the computational time of calculation by both the methods is studied fora particular test case. We also infer that the problem is highly mesh dependant becausethe optimization routines are performed on the Grid Function Spaces (GFS). We haveachieved significantly good results compared with past FE-OFDFT work [21], with farless number of finite elements and without parallelization.

To obtain more accuracy, use of higher order elements is recommended. Parallelizationof the code is required for simulating larger aluminium clusters with good accuracy. It isimportant to appreciate that, the finite element method is an approximate technique andto obtain good accuracies we need higher refinements of the meshes we have used andhence parallelization is important. Use of higher order elements is a solution to this end.

Page 43: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Required Derivatives 42

A. Required Derivatives

The terminology for different terms of the total energy functional is the same as de-nominated in the previous chapters. The total energy functional is given by

L(ρ,R, φ) := CF

Ω

u10/3(r) dr+λ

2

Ω

|∇u(r)|2 dr+

Ω

ǫxc(u2(r))u2(r) dr−

1

R3

|∇φ(r)|2 dr

+

R3

(u2(r) + b(r))φ(r) dr,

(A.1)

The kinetic energy is Ts, where,

Ts(ρ) = CF

Ω

ρ5/3(r) dr, (A.2)

such that CF = 310(3π2)2/3.

The exchange-correlation term is Exc, where,

Exc(ρ) =

Ω

ǫxc(ρ(r))ρ(r) dr, (A.3)

such that ǫxc = ǫx + ǫc is the exchange and correlation energy per electron given by

ǫx(ρ) = −3

4(3

π)1/3ρ1/3, (A.4)

ǫc(ρ) =

γ1+β1

√rs+β2rs

if rs ≥ 1,

A log rs +B + Crs log rs +Drs if rs < 1,

(A.5)

where rs = ( 34πρ

)(1/3).

The electrostatic term is ES, where,

ES := −1

R3

|∇φ(r)|2 dr

+

R3

(u2(r) + b(r))φ(r) dr.

(A.6)

The treatment of the constraint is either dealt by a penalty method or by introducinga lagrange multiplier. The penalty term is given by,

Penalty := µ(

Ω

u2(r) dr−N)2, (A.7)

where µ is the penalty parameter to treat the constraint,∫

Ωu2(r)dr−N = 0.

The lagrange term is given by

Lagrange := θ(∫

Ωu2(r)dr−N) (A.8)

where θ is the lagrange multiplier.

For our implementation of the two numerical methods, we need the first and secondpartial derivatives of the above terms with respect to ui and φi. These derivativeshave been computed below.

Page 44: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Required Derivatives 43

A.1. Derivatives with respect to ui

The first partial derivative of the kinetic energy term with respect to ui is,

∂Ts

∂ui= CF (

10

3)

Ω

u7/3(r)Ni(x) dr+ λ

Ω

∇u(r)∇Ni(x) dr. (A.9)

The second partial derivative of the kinetic energy term with respect to ui is,

∂Ts

∂ui∂uj= CF (

10

3)(7

3)

Ω

u4/3(r)Ni(x)Nj(x) dr+ λ

Ω

∇Ni(x)∇Nj(x) dr. (A.10)

The first partial derivative of the exchange-correlation term, with respect to ui is,

∂Exc

∂ui=

Ω

(∂ǫxc∂u

u2 + 2ǫxcu)Ni(x) dr. (A.11)

The second partial derivative of the exchange-correlation term, with respect to uiis,

∂Exc

∂ui∂uj

=

Ω

∂2ǫxc∂u2

u2Ni(x)Nj(x) dr+

Ω

∂ǫxc∂u

(4u)Ni(x)Nj(x) dr+

Ω

2ǫxcNi(x)Nj(x) dr.

(A.12)

Computing the second partial derivative of the exchange-correlation term requires thefollowing the derivatives,

∂2ǫxc∂u2

=∂2ǫx∂u2

+∂2ǫc∂u2

, (A.13)

where the exchange term is,

ǫx = −3

4(3

π)1/3u2/3. (A.14)

That implies,

∂ǫx∂u

= −1

2(3

π)1/3u−1/3, (A.15)

∂2ǫx∂u2

=1

6(3

π)1/3u−4/3. (A.16)

The correlation term is,

ǫc(ρ) =

γ1+β1

√rs+β2rs

,

A log rs +B + Crs log rs +Drs,

(A.17)

for rs ≥ 1 and rs < 1 respectively.

Page 45: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Required Derivatives 44

That implies,

∂ǫc∂u

=

−γ(1+β1

√rs+β2rs)2

( β1

2√rs+ β2)

∂rs∂u

,

( Ars+ C + C log rs +D)(∂rs

∂u),

(A.18)

for rs ≥ 1 and rs < 1 respectively, where rs = ( 34πu2 )

1/3 and ∂rs∂u

= ( 34π)1/3(−2

3)u−5/3.

∂2ǫc∂u2 is given by,

−γ(1+β1

√rs+β2rs)2

( β1

2√rs+ β2)

∂2rs∂u2 + −γ

(1+β1√rs+β2rs)2

( −β1

4r1.5s)(∂rs

∂u)2 + 2γ

(1+β1√rs+β2rs)3

( β1

2√rs+ β2)

2(∂rs∂u

)2,

( Ars+ C + C log rs +D)(∂

2rs∂u2 ) + (−A

r2s+ C

rs)(∂rs

∂u)2,

(A.19)

for rs ≥ 1 and rs < 1 respectively.

The first partial derivative of the electrostatic term with respect to ui is,

∂(ES)

∂ui= 2

R3

u(r)φ(r)Ni(x) dr. (A.20)

The second partial derivative of the electrostatic term with respect to ui is,

∂(ES)

∂ui∂uj

= 2

R3

φ(r)Ni(x)Nj(x) dr. (A.21)

The first partial derivative of the penalty term with respect to ui is,

∂(Penalty)

∂ui

= 4µ(

Ω

u2(r) dr−N)(

Ω

uNi(x) dr). (A.22)

The second partial derivative of the penalty term is not used in our implementation.

The first partial derivative of the term containing the lagrange multiplier, with respectto ui is,

∂(Lagrange)

∂ui= θ

Ω

2uNi(x) dr. (A.23)

The second partial derivative of the term containing the lagrange multiplier, withrespect to ui is,

∂(Lagrange)

∂ui∂uj

= θ

Ω

2Ni(x)Nj(x) dr. (A.24)

The second partial derivative of the term containing the lagrange multiplier, withrespect to ui and the lagrange multiplier θ is,

∂(Lagrange)

∂θ∂ui

=

Ω

2uNi(x) dr. (A.25)

The second partial derivative of the total energy functional, with respect to ui isthus,

∂L

∂ui∂uj|φi=const. =

∂Ts

∂ui∂uj+

∂Exc

∂ui∂uj+

∂(ES)

∂ui∂uj+

∂(Lagrange)

∂ui∂uj. (A.26)

Page 46: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

Required Derivatives 45

A.2. Derivatives with respect to φi

The partial derivatives of the kinetic energy term, the exchange-correlation term, thepenalty term and the lagrange term with respect to φi are zero. Only the partialderivative of the electrostatic term with respect to φi is non-zero.

The first partial derivative of electrostatic term, with respect toφi is,

∂(ES)

∂φi= −

1

Ω

∇φ(r)∇Ni(x) dr+

Ω

(u2(r) + b(r))Ni(x) dr. (A.27)

The second partial derivative of electrostatic term, with respect toφi is,

∂(ES)

∂φi∂φj=

−1

Ω

∇Ni(x)∇Nj(x) dr

︸ ︷︷ ︸

Stiffness−Matrix

. (A.28)

The second partial derivative of the total energy functional, with respect to φi isthus,

∂L

∂φi∂φj|ui=const. =

∂Ts

∂φi∂φj+

∂Exc

∂φi∂φj+

∂(ES)

∂φi∂φj+

∂(Lagrange)

∂φi∂φj, (A.29)

which reduces to

∂L

∂φi∂φj|ui=const. =

∂(ES)

∂φi∂φj, (A.30)

as only the electrostatic term contributes to a non-zero partial second derivative withrespect to φi.

Page 47: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

References 46

References

[1] Armero, F., Christian Linder [2008]: New finite elements with embedded strong

discontinuities in the finite deformation range. Computer Methods in Applied Me-chanics and Engineering, 197: 3138 – 3170.

[2] Armero, F., Christian Linder [2009]: Numerical simulation of dynamic fracture

using finite elements with embedded discontinuities. International Journal of Fracture,160: 119–141.

[3] Bastian, P, M Blatt, A Dedner, C Engwer, R Klofkorn, R Kornhu-

ber, M Ohlberger, O Sander [2008]: A Generic Grid Interface for Parallel and

Adaptive Scientific Computing. Part II: Implementation and Tests in DUNE. 82:121–138.

[4] Bastian, P, M Blatt, A Dedner, C Engwer, R Klofkorn, M Ohlberger,O Sander [2008]: A Generic Grid Interface for Parallel and Adaptive Scientific

Computing. Part I: Abstract Framework. 82: 103–119.

[5] Bastian, P, M Blatt, A Dedner, Ch. Engwer, J Fahlke, C Graser,R Klofkorn, M Nolte, M Ohlberger, O Sander: DUNE Web page.

[6] Blatt, Markus, Peter Bastian [2007]: The Iterative Solver Template Library.4699: 666–675.

[7] Blatt, Markus, Peter Bastian [2008]: On the Generic Parallelisation of Iter-

ative Solvers for the Finite Element Method. Int. J. Comput. Sci. Engrg., 4: 56–69.

[8] Chai, Jeng-Da [2005]: Orbital-Free Density Functional Theory of Atoms, Molecules

and Solids. Ph.D. Thesis, University of Maryland, College Park.

[9] Chai, Jeng-Da, Vincent L Ligneres, Gregory Ho, Emily A Carter,John D Weeks [2009]: Orbital-Free Density Functional Theory: Linear Scaling

Methods for Kinetic Potentials, and Applications to Solid Al and S. Chemical PhysicsLetters, 473: 263–267.

[10] Chai, Jeng-Da, John D Weeks [2007]: Orbital-Free Density Functional Theory:

Kinetic Potentials and Ab-Initio Local Pseudopotentials. Physical Review B, 75:1–14.

[11] Chen, Huajie, Aihui Zhou [2007]: Orbital-Free Density Functional Theory for

Molecular Structure Calculations. Numerical Mathematics: Theory, Methods andApplications, 1: 1–28.

[12] Choly, Nicholas, Efthimios Kaxiras [2001]: Kinetic energy density functionals

for non-periodic systems. Solid State Communications, 121: 12.

[13] Choly, Nicholas, Gang Lu, Weinan E, Efthimios Kaxiras [2005]: Multi-

scale simulations in simple metals:A density-functional-based methodology. PhysicalReview B, 71: 1–16.

[14] Dedner, A, R Klofkorn, M Nolte, M Ohlberger: DUNE-FEM Web page.

[15] Dedner, A, R Klofkorn, M Nolte, M Ohlberger [2010]: A Generic Inter-

face for Parallel and Adaptive Scientific Computing: Abstraction Principles and the

DUNE-FEM Module. 90: 165–196.

Page 48: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

References 47

[16] Fago, Matt, Robin Hayes, Emily Carter, Michael Ortiz [2004]: Density-

functional-theory-based local quasicontinuum method: Prediction of dislocation nu-

cleation. Physical Review B, 70: 1–4.

[17] Gavini, V, K Bhattacharya, M Ortiz [2007]: Quasi-continuum orbital-free

density-functional theory: A route to multi-million atom non-periodic DFT calcu-

lation. Journal of the Mechanics and Physics of Solids, 55: 697–718.

[18] Gavini, Vikram [2007]: Electronic Structure Calculations at Macroscopic Scales.Ph.D. Thesis, California Institute of Technology.

[19] Gavini, Vikram [2008]: Role of Macroscopic Deformations in Energetics of Vacan-

cies in Aluminum. Physical Review Letters, 101: 1–4.

[20] Gavini, Vikram, Kaushik Bhattacharya, Michael Ortiz [2007]: Vacancy

clustering and prismatic dislocation loop formation in aluminum. Physical ReviewB, 76: 1–4.

[21] Gavini, Vikram, Jaroslaw Knap [2007]: Non-periodic finite-element formulation

of orbital-free density functional theory. 55: 669–696.

[22] Hager, William W, Hongchao Zhang [2005]: A survey of nonlinear conjugate

gradient methods.

[23] Ho, Gregory S., Vincent L. Ligneres, Emily a. Carter [2008]: IntroducingPROFESS: A new program for orbital-free density functional theory calculations.Computer Physics Communications, 179: 839–854.

[24] Hohenberg, P, W Kohn [1964]: Inhomogeneous Electron Gas. Physical Review,136: B864–B871.

[25] Kohn, W, L J Sham [1965]: Self-Consistent Equations Including Exchange and

Correlation Effects. Physical Review, 140: A1133–A1138.

[26] Lieb, Elliott H. [1981]: Thomas-fermi and related theories of atoms and

molecules. Reviews of Modern Physics, 53.

[27] Lieb, Elliott H., Barry Simon [1977]: The Thomas-Fermi Theory of Atoms,

Molecules and Solids. Advances in Mathematics, 23: 22–116.

[28] Linder, Christian [2012]: An analysis of the exponential electric displacement

saturation model in fracturing piezoelectric ceramics. Technische Mechanik, 32: 53 –69.

[29] Linder, Christian [2013]: 3D finite elements to model electromechanical coupled

solids at failure. Proceedings in Applied Mathematics and Mechanics, 13: 81–82.

[30] Linder, Christian, F. Armero [2007]: Finite elements with embedded strong dis-

continuities for the modeling of failure in solids. International Journal for NumericalMethods in Engineering, 72: 1391–1433.

[31] Linder, Christian, F. Armero [2009]: Finite elements with embedded branching.Finite Elements in Analysis and Design, 45: 280 – 293.

[32] Linder, Christian, C. Miehe [2012]: Effect of electric displacement saturation on

the hysteretic behavior of ferroelectric ceramics and the initiation and propagation of

cracks in piezoelectric ceramics. Journal of the Mechanics and Physics of Solids, 60:882 – 903.

Page 49: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

References 48

[33] Linder, Christian, Arun Raina [2013]: A strong discontinuity approach on mul-

tiple levels to model solids at failure. Computer Methods in Applied Mechanics andEngineering, 253: 558 – 583.

[34] Linder, Christian, D. Rosato, C. Miehe [2011]: New finite elements with em-

bedded strong discontinuities for the modeling of failure in electromechanical coupled

solids. Computer Methods in Applied Mechanics and Engineering, 200: 141 – 161.

[35] Linder, Christian, Mykola Tkachuk, C. Miehe [2011]: A micromechanically

motivated diffusion-based transient network model and its incorporation into finite

rubber viscoelasticity. Journal of the Mechanics and Physics of Solids, 59: 2134 –2156.

[36] Linder, Christian, Xiaoxuan Zhang [2013]: A marching cubes based failure

surface propagation concept for three-dimensional finite elements with non-planar

embedded strong discontinuities of higher order kinematics. International Journal forNumerical Methods in Engineering, 96: 339–372.

[37] Li, Shaofan, Christian Linder, James W. Foulk III [2007]: On configura-

tional compatibility and multiscale energy momentum tensors. Journal of the Me-chanics and Physics of Solids, 55: 980 – 1000.

[38] Lu, Gang, E. Tadmor, Efthimios Kaxiras [2006]: From electrons to finite

elements: A concurrent multiscale approach for metals. Physical Review B, 73: 1–4.

[39] March, N H [1957]: The Thomas-Fermi approximation in quantum mechanics.Advances in Physics, 6.

[40] Motamarri, Phani, Mrinal Iyer, Jaroslaw Knap, Vikram Gavini [2011]:A numerical analysis of the finite-element discretization of orbital-free density func-

tional theory. Journal of Computional Physics, pages 6596–6621.

[41] Motamarri, Phani, Michael Nowak, Kenneth Leiter, Jaroslaw Knap,Vikram Gavini [2013]: Higher-order adaptive finite-element methods for Kohn-

Sham density functional theory. Journal of Computational Physics, 253: 308–343.

[42] Peng, Qing, Xu Zhang, Linda Hung, Emily Carter, Gang Lu [2008]: Quan-

tum simulation of materials at micron scales and beyond. Physical Review B, 78:1–14.

[43] Perdew, J. P., Alex Zunger [1981]: Self-interaction correction to density-

functional approximations for many-electron systems. Phys. Rev. B, 23: 5048–5079.

[44] Raina, Arun, Christian Linder [2010]: Modeling crack-microbranching using

finite elements with embedded strong discontinuities. Proceedings in Applied Mathe-matics and Mechanics, 10: 681–684.

[45] Raina, Arun, Christian Linder [2011]: A strong discontinuity based adaptive

refinement approach for the modeling of crack branching. Proceedings in AppliedMathematics and Mechanics, 11: 171–172.

[46] Raina, Arun, Christian Linder [2012]: Modeling quasi-static crack growth with

the embedded finite element method on multiple levels. Proceedings in Applied Math-ematics and Mechanics, 12: 135–136.

[47] Raina, Arun, Christian Linder [2013]: Modeling reorientation phenomena in

nonwoven materials with random fiber network microstructures. Proceedings in Ap-plied Mathematics and Mechanics, 13: 249–250.

Page 50: Finite Element Implementation of Orbital-Free Density ... · Finite Element Implementation of Orbital-Free Density Functional Theory for Electronic Structure Calculations Soumya Swayamjyoti

References 49

[48] R. Parr, W. Yang [1989]: Density-Functional Theory of Atoms and Molecules.Oxford University Press.

[49] Schauer, Volker [2013]: Finite Element based Electronic Structure Calculations.PhD Thesis, (University of Stuttgart).

[50] Schauer, Volker, Christian Linder [2011]: Finite element solution of the

Kohn-Sham equations. Proceedings in Applied Mathematics and Mechanics, 11:491–492.

[51] Schauer, Volker, Christian Linder [2012]: All-electron calculations with finite

elements. Proceedings in Applied Mathematics and Mechanics, 12: 353–354.

[52] Schauer, Volker, Christian Linder [2013]: All-electron Kohn-Sham density

functional theory on hierarchic finite element spaces. Journal of ComputationalPhysics, 250: 644–664.

[53] Shewchuk, Jonathan Richard [1994]: An Introduction to the Conjugate Gradi-

ent Method Without the Agonizing Pain.

[54] Smargiassi, E, Pa Madden [1994]: Orbital-free kinetic-energy functionals for first-

principles molecular dynamics. Physical review. B, Condensed matter, 49: 5220–5226.

[55] Tkachuk, Mykola, Christian Linder [2011]: Microstructural driven computa-

tional modeling of polymers. Proceedings in Applied Mathematics and Mechanics,11: 557–558.

[56] Tkachuk, Mykola, Christian Linder [2012]: Homogenization of random elas-

tic networks with non-affine kinematics. Proceedings in Applied Mathematics andMechanics, 12: 417–418.

[57] Tkachuk, Mykola, Christian Linder [2012]: The maximal advance path con-

straint for the homogenization of materials with random network microstructure.Philosophical Magazine, 92: 2779–2808.

[58] Wang, Lin-Wang, Michael P Teter [1992]: Kinetic-energy functional of the

electron density. Phys. Rev. B, 45: 13196–13220.

[59] Wang, Yan, Niranjan Govind, Emily Carter [1998]: Orbital-free kinetic-

energy functionals for the nearly free electron gas. Physical Review B, 58: 13465–13471.

[60] Weizsacker, C. F. von [1935]: Zur Theorie der Kernmassen. Z. Physik, 96:431–458.

[61] W. Stich, E.K.U. Gross, P. Malzacher, R.M. Dreizler [1982]: Accurate

Solution of the Thomas-Fermi-Dirac-Weizsacker Variational Equations for the Case

of Neutral Atoms and Positive Ions. Z. Phys. A - Atoms and Nuclei, 309: 5–11.

[62] Xia, Junchao, Emily A. Carter Chen Huang, Ilgyou Shin [2012]: Can

orbital-free density functional theory simulate molecules? Journal of ChemicalPhysics, 136.

[63] Zhang, Xiaoxuan, Christian Linder [2012]: New three-dimensional finite ele-

ments with embedded strong discontinuities to model solids at failure. Proceedings inApplied Mathematics and Mechanics, 12: 133–134.