The total energy of a system is defined as the sum of the kinetic energyEkin, the electrostatic energyEes, the exchange-correlation contributionExc, and the external energyEext
Etot =Ekin +Ees+Exc+Eext. (3.32) The external energy is a consequence pf an applied external fieldVextσ (r)and, hence, its contribution to the total energy is given as
Eext =X
σ
Z
d3rnσ(r)Vextσ (r). (3.33)
The total kinetic energy Ekin can be evaluated directly from the auxiliary Kohn-Sham states
Ekin =X
nσk
fnσkhΨnσk|Tˆ|Ψnσki (3.34)
3.4. Total Energy 35 with the occupation numbersfnσkor indirectly via the eigenvalue sum and a dou-ble counting correction as
Ekin =X
nσk
fnσkǫnσk−X
σ
Z
d3rnσ(r)Veffσ(r). (3.35) The exchange-correlation energy in the local-density approximation reads
Exc = Z
d3rn(r)ǫxc[n](r) (3.36)
whereǫxc[n]is the exchange-correlation energy density of the homogeneous elec-tron gas at densityn. The electrostatic energy contributionEesis discussed in detail in the following section.
3.4.1. The Electrostatic Energy
The electrostatic contribution to the total energy consists of three terms,
Ees=EZZ+EeZ+Eee (3.37)
the core-core interaction, EZZ, the electron-core interaction, EeZ, and the electron-electron term,Eee, i.e. the electrostatic self-interaction of an electron densityn(r). The latter is given as
Eee = 1 where the electrostatic potential of a charge distributionρ(r)is given by
Ves[ρ](r) = Z
d3r′ ρ(r′)
|r−r′|. (3.40)
The evaluation of the electrostatic potential of a charge distribution that is not neutral in the spatial average is difficult. It involves either boundary values in the case of isolated systems or it requires the tuning for the convergence of an Ewald summation technique for periodic boundary conditions [71]. To overcome this dif-ficulty, we consider the electrostatics of the atomic cores. The attractive Coulomb potentials of the atomic nuclei at positionsRa create an external potential which is experienced by the electrons. The contribution to the electrostatic energy is thus given by where an additional Ewald summation over the atoms is required in the case of periodic boundary conditions. The charge distribution associated with the atomic nuclei is equivalent toZaδ(r−Ra). Zais the number of unit charges in the nucleus i.e. a negative integer. Finally, the core-core interaction is given by
EZZ= 1
Note that while each core does not interact electrostatically with itself it does inter-act with its periodic images, if applicable.
We can simplify the difficulties associated to Ewald summations of charged sys-tems by introducing a generalized charge density of electrons and protons. If the
3.4. Total Energy 37 total number of charges (electrons minus protons) vanishes, then the three con-tributions to the electrostatic energy can be written as electrostatic energy of the neutral charge densityρ(r)defined by
ρ(r) =n(r) +X
where the prime onρreminds us of the omission of the self-interaction of the cores.
3.4.2. Electrostatics and the Pseudocharge Construction
In analogy to the PAW transformed expectation values introduced above we split the electrostatic potentialVes[ρ]defined in Equation (3.40) and the electrostatic en-ergy yielding
The smooth contribution ˜Ves(r)can be represented with a reasonable number of basis functions, e.g. plane waves or grid points, that do not depend on the atomic positions. The two contributions Vesa, ˜Vesa are treated on a radial grid inside the augmentation spheresSaaround each atoma. The radial grids are limited by the radius of the augmentation spheresraaug.
The electrostatic potential of a charge distribution is found by solving the Poisson equation
∆rVes[ρ](r) = −4πρ(r) (3.47) with appropriate boundary conditions. In the case of finite systems, we align the electrostatic potential such that it assumes zero for large distances. Due to the treat-ment of neutral charge distributions the potential approaches zero as fast as∼ D·r
|r|3 , whereDis the total dipole moment, or even faster ifDvanishes. In the special case of three periodic boundaries, the value ofVes(r)may be shifted by an arbitrary con-stant. To fix this, we demand that the spatial average of the electrostatic potential vanishes,R
d3rVes(r) = 0.
The solution of Poisson’s Equation (3.47) can be found according to Jackson [72]
via the Green function
Ges(r,r′) = 1
|r−r′| (3.48)
since
∆r′Ges(r,r′) =∆r′ 1
|r−r′| = −4πδ(r−r′) (3.49) in Hartree atomic units.
The integration overr′shows that the electrostatic potential depends onρ(r′)in all space. For this reason simply replacingρ(r′) by a smooth quantity inside the spheres would result in a different electrostatic potential in the interstitial region and is thus not suitable. However, we can expand the Coulomb kernel|r−r′|−1in terms of multipoles such that
1
We then splitρ(r)into three parts, a smooth contribution ˜ρ(r)and two contribu-tionsρa(r), ˜ρa(r)treated on the radial grid, i.e.
ρ(r) =ρ(r) +˜ X
a
[ρa(r) −ρ˜a(r)]. (3.51) However, in this situation the non-locality of the electrostatic problem requires a special treatment. We demand that ˜ρ(r) reproduces the same electrostatic multi-pole moments asρ(r)inside each sphere. Hence, the atomic correctionρa(r)-˜ρa(r) must have only vanishing multipole moments. Since ˜ρ(r)coincides with ρ(r) in the interstitial region, we need to find the two identical charge distributions ˜ρ(r) and ˜ρa(r)that fulfill this requirement.
Again, ˜ρ(r)needs to be smooth enough to be accurately represented, so it can neither feature the rapid oscillations of the atomic core densities nor the nuclear chargesZaδ(|r−Ra|). At this point we introduce the concept of the pseudocharge construction. The compensator function ˆgaL(r−Ra)is strictly localized inside the sphereSa, centered atRaand has unity multipole moment
Z
d3rgˆL(r)|r|ℓ′YL′(rˆ) =δLL′. (3.52) Using compensator functions, we can identify ˜ρ(r)as
˜
3.4. Total Energy 39 such thatVes[ρ](˜ r)is the correct electrostatic potential outside of each sphere and shows the correct asymptotic behavior for |r| → ∞. The summation over ℓ is stopped at 2ℓmax, where ℓmax is the ℓ-cutoff of projectors and partial waves. The multipole moments∆qaL in the implementation are stored ina%qlm(1:).
3.4.3. Electrostatic Potential in the Spheres
For notational convenience, we assumeRa=0 in this section.
As we can see from Equation (3.50), the Coulomb kernel |r−r′|−1 is diagonal with respect to L in an ℓm-representation. Given that all densities are stored on radial grid asρ(r,L), the electrostatic problem reduces to the radial integrals
Ves[ρ(r2,L)](r1,L) = radiir2to findVes(r1,L). In a real calculation, the second integral is only executed up to the boundary of the sphereSa.
To find the correct electrostatic potentials and electrostatic energy contributions in the spheres, we start by generating a preliminary potential, ˜Vesa,pre[ρ˜a(r′,L)](r,L) andVesa,pre[ρa(r′,L)](r,L), in the sphere from the true densityρa and smooth den-sity ˜ρa, where we disregard the boundary conditions for both.
Also, due to the non-locality of the electrostatic problem, we cannot findVesa(r,L) fromna(r,L)and ˜Vesa(r,L)from ˜na(r,L)alone, respectively. Even if ˜na(r,L)matches (3.52)), such that we can multiply Equation (3.58) with the compensators ˆgaL and
integrate over space. Then where the first term is an integral of the compensators with the smooth electro-static potential on the grid (c.f. a%vlm(1:)) that contains information about exter-nal potential shifts, electrical fields and higher multipoles. In contrast to∆qaL (c.f.
a%qlm(1:)) which corrects the multipole moment for the far field, the shifts vaL carry information about the electrostatics outside the spheres into the sphere and generate the correct near field
V˜esa[ρ˜a(r′,L)](r,L) =V˜esa,pre[ρ˜a(r′,L)](r,L) +vaLrℓ, (3.60) Vesa[ρa(r′,L)](r,L) =Vesa,pre[ρa(r′,L)](r,L) +vaLrℓ. (3.61)
3.4.4. Electrostatic Energy in the Spheres
We can now compute the electrostatic energy in the spheres. At this point, the treatment of the smooth quantities and the true quantities differs slightly. The electrostatic energy of the smooth density in the sphere is a pure Hartree energy
E˜aes = 1 In return, the true electrostatic energyEaesin the sphere consists of a Hartree energy and the Coulomb energy of the electron density in the singular potential of the atomic nucleus. It cannot be evaluated byR
Vesa[ρa]ρawithρa=na+Zaδbecause that would involve a self-interaction of the nucleus. Instead
Eaes = 1
This way, the electrostatic interaction of a nucleus with itself is excluded.
3.4.5. Compensator Functions
The pseudocharge compensators need to be rather smooth and strictly localized.
We therefore adopt the polynomial construction as described by Weinertet al.[73]
as depicted in Figure 3.5.
ˆ
g[Nℓ W](r)∼ |r|ℓ 1− |r|2 R2aug
!(NW−ℓ)
Yℓm(ˆr) for |r|< Raug. (3.64)
3.4. Total Energy 41
Figure 3.5.:Strictly localized compensator functions of the Weinert type.
The exponentNWcontrols the smoothness of the functions. The main graph shows theℓ=0-compensator for different exponents, whereas the inlet shows the normalized radial functions for various values ofℓ.
3.4.6. Exchange-Correlation
A major advantage of the real-space representation is the ability to directly eval-uate the exchange-correlation energy densityǫxc[n](r)and the potentialVxc[n](r) in a local parametrization as LDA or GGA. However, the true densityndiffers in-side the spheres from the smooth density ˜n. The smooth density ˜n(r)is stored on the real-space grid, and the true densities inside the spheres are stored in(r,L) -representation. Therefore, the exchange-correlation energy has three contributions
Exc =
Since those exchange-correlation parametrizations known to work are non-linear, the evaluation ofǫxc and the matrix elements of partial waves withVxc has to be performed fully numerically at each step. The densities inside the spheres are
eas-ily represented in a radial representation and spherical harmonics for the angular part, i.e. ˜na(r,L), where r will be sampled from the origin to the sphere radius in a usually non-linear fashion. This allows us to capture the rapid oscillations in the all-electron densities with a reasonable number of radial support points. The advantages of an ℓm-representation (or L) are the simplicity of the cutoff param-eter ℓmax that controls the quality of this representation and the straightforward evaluation of electrostatics. However, the evaluation of the non-linear exchange-correlation potentialǫxcandVxccannot be executed in theℓm-basis. Here, we need to transform into representation that samples the full solid angleΩ. This transfor-mation is performed on a Legendre grid, where we sampleϕandϑin an equidis-tant fashion.
The number of points for this sampling is usually 2M2whereMis chosen>ℓmax. The transformation then reads
na(r,ϑj,ϕi) = X
L
na(r,L)YL(ϑj,ϕi), (3.69) and the reverse transformation applied to the potentialVxc(and alsoǫxc) reads
Vxca(r,L) =
2πZ
0
dϕ Zπ
0
dϑsinϑ Vxca(r,ϑ,ϕ)YL(ϑ,ϕ) (3.70)
≈ XM
j
wj 2M
X
i
Vxca(r,ϑj,ϕi)YL(ϑj,ϕi)
where the indicesiandjsampleϕandϑ, respectively. A Legendre grid forM=12 is depicted in Figure 3.6. The closer the points are to one of the poles (ϑ=0 orϑ=π), the denser is this grid. Therefore, the weightswjwith
wj =sin(ϑj) (3.71)
need to be included in the reverse transformation.