Electron-energy-loss spectrum: Difference between revisions

From VASP Wiki
No edit summary
 
Line 1: Line 1:
One of the many ways with which is possible to probe neutral excitations in a material is by injecting electrons into the sample. These are called electron-energy-loss spectroscopy experiments, where the incoming electron can create bound electron-hole pairs (i.e. excitons), plasmons, or even higher-order multi-pair excitations.  
One of the many ways in which it is possible to probe neutral excitations in a material is by injecting electrons into the sample. These are called electron-energy-loss spectroscopy experiments, where the incoming electron can create bound electron-hole pairs (i.e. excitons), plasmons, or even higher-order multi-pair excitations.  


The incoming electron acts as an external potential, <math>V_\mathrm{ext}(\mathbf r', t')</math>, which induces a charge density in the material, <math>\rho_\mathrm{ind}(\mathbf r, t)</math>. Within linear-response theory these two quantities can be related by the reducible polarisability function, <math>\chi</math>, via a Green-Kubo relation
The incoming electron acts as an external potential, <math>V_\mathrm{ext}(\mathbf r', t')</math>, which induces a charge density in the material, <math>\rho_\mathrm{ind}(\mathbf r, t)</math>. Within linear-response theory these two quantities can be related by the reducible polarisability function, <math>\chi</math>, via a Green-Kubo relation
Line 7: Line 7:
</math>
</math>


If the external potential is taken as proportional to a plane-wave of momentum <math>\mathbf q</math>, then the electron energy-loss spectrum (EELS) can be taken from the imaginary part of the inverse dielectric function, <math>\epsilon^{-1}(\mathbf q,\omega)</math>, since <math>\epsilon^{-1} = 1 + v\chi</math>
If the external potential is taken as proportional to a plane-wave of momentum <math>\mathbf q</math>, then the electron energy-loss spectrum (EELS) can be taken from the imaginary part of the inverse [[:Category:Dielectric_properties#Dielectric_function|dielectric function]], <math>\epsilon^{-1}(\mathbf q,\omega)</math>, since <math>\epsilon^{-1} = 1 + v\chi</math>


::<math>
::<math>
Line 16: Line 16:


=Inclusion of local fields=
=Inclusion of local fields=
In general, the microscopic quantity <math>\epsilon^{-1}</math> is a function of two coordinates, i.e. <math>\epsilon^{-1} := \epsilon^{-1}(\mathbf r , \mathbf r', \omega)</math>. This has important consequences on inhomogeneous systems where a homogeneous, constant, external electric field can induce fluctuations at the interatomic scale, and thus create [[Dielectric properties#Microscopic and macroscopic quantities|microscopic fields]]. A direct consequence from the inhomogeneous character of the system is that in reciprocal space <math>\epsilon</math> has to be written as <math>\epsilon_{\mathbf G, \mathbf G'}(\mathbf q, \omega)</math>, where <math> \mathbf G</math> is a reciprocal lattice vector. The microscopic fields are then the <math>\mathbf G \neq 0</math> components of the tensor.
In general, the microscopic quantity <math>\epsilon^{-1}</math> is a function of two coordinates, i.e. <math>\epsilon^{-1} := \epsilon^{-1}(\mathbf r , \mathbf r', \omega)</math>. This has important consequences on inhomogeneous systems where a homogeneous, constant, external electric field can induce fluctuations at the interatomic scale, and thus create [[Dielectric properties#Microscopic and macroscopic quantities|microscopic fields]]. A direct consequence of the inhomogeneous character of the system is that in reciprocal space <math>\epsilon</math> has to be written as <math>\epsilon_{\mathbf G, \mathbf G'}(\mathbf q, \omega)</math>, where <math> \mathbf G</math> is a reciprocal lattice vector. The microscopic fields are then the <math>\mathbf G \neq 0</math> components of the tensor.


From <math>\epsilon^{-1} = 1 + v\chi</math> it is possible to see that a problem arises when <math>\mathbf q \to 0</math>, i.e. the optical limit. In reciprocal space this equation becomes
From <math>\epsilon^{-1} = 1 + v\chi</math> it is possible to see that a problem arises when <math>\mathbf q \to 0</math>, i.e. the optical limit. In reciprocal space, this equation becomes
::<math>
::<math>
\epsilon^{-1}_{\mathbf G, \mathbf G'}(\mathbf q, \omega) = \delta_{\mathbf G, \mathbf G'} + \frac{4\pi}{|\mathbf q + \mathbf G|^2}\chi_{\mathbf G, \mathbf G'}(\mathbf q, \omega)
\epsilon^{-1}_{\mathbf G, \mathbf G'}(\mathbf q, \omega) = \delta_{\mathbf G, \mathbf G'} + \frac{4\pi}{|\mathbf q + \mathbf G|^2}\chi_{\mathbf G, \mathbf G'}(\mathbf q, \omega)
Line 49: Line 49:


==EELS from density functional theory (DFT)==
==EELS from density functional theory (DFT)==
The simplest calculation that yields a the macroscopic dielectric function is a ground state calculation using DFT, with the tags {{TAG|NBANDS}} and {{TAG|LOPTICS}}. Using bulk silicon as an example with the following {{TAG|INCAR}}
The simplest calculation that yields a macroscopic dielectric function is a ground state calculation using DFT, with the tags {{TAG|NBANDS}} and {{TAG|LOPTICS}}. Using bulk silicon as an example with the following {{TAG|INCAR}}
  {{TAGBL|SYSTEM}} = Si
  {{TAGBL|SYSTEM}} = Si
  {{TAGBL|NBANDS}} = 48
  {{TAGBL|NBANDS}} = 48
Line 56: Line 56:
  {{TAGBL|LOPTICS}} = .TRUE.
  {{TAGBL|LOPTICS}} = .TRUE.
  {{TAGBL|CSHIFT}} = 0.4
  {{TAGBL|CSHIFT}} = 0.4
the macroscopic dielectric function can be extracted from the vasprun.xml file at the end of the calculation by first running the following script
the macroscopic dielectric function can be extracted from the vasprun.xml file at the end of the calculation by first running the following script


Line 66: Line 65:
</syntaxhighlight>
</syntaxhighlight>


which writes the trace of the tensor to a file called dielectric_function.DFT.dat. Plotting the EEL spectrum can be done with visualisation software like gnuplot, using the next command as an example.
which writes the trace of the tensor to a file called <code>dielectric_function.DFT.dat</code>. Plotting the EEL spectrum can be done with visualization software like Gnuplot, using the following command as an example:


<syntaxhighlight lang="bash" line>
<syntaxhighlight lang="bash" line>
Line 75: Line 74:
<div style="clear:both;"></div>
<div style="clear:both;"></div>


The results form this DFT calculation should be analysed with the following considerations in mind. Firstly, this calculation is performed only for <math>\mathbf q = 0</math>, with no local fields taken into account. Because of this, the dielectric function from DFT is often called the [[Dielectric properties#LOPTICS: Green-Kubo formula|independent particle random-phase approximation dielectric function]]. Also, there are no interactions between electrons and holes included in the evaluation of the dielectric function. To account for both local-field effects and the electron-hole interaction, approximations beyond DFT must be taken into account.
The results of this DFT calculation should be analyzed with the following considerations in mind. Firstly, this calculation is performed only for <math>\mathbf q = 0</math>, with no local fields considered. Because of this, the dielectric function from DFT is often called the [[Dielectric properties#LOPTICS: Green-Kubo formula|independent particle random-phase approximation dielectric function]]. Secondly, no interactions between electrons and holes are included in the evaluation of the dielectric function. To account for both local-field effects and the electron-hole interaction, approximations beyond DFT must be taken into account.


Before continuing, it is important to remark that plotting the EELS can also be done using {{py4vasp}} as python module. Taking the next script as an example, where the {{FILE|vaspout.h5}} had had its name changed to vaspout.DFT.h5 in order to preserve the information for latter plots, the EEL spectrum can be easily visualised taking advantage of {{py4vasp}} in-built tools and python modules.
Plotting the EELS can also be done using {{py4vasp}} as a Python module. Take the next script as an example, where the {{FILE|vaspout.h5}} had its name changed to <code>vaspout.DFT.h5</code>:


<syntaxhighlight lang="python" line>
<syntaxhighlight lang="python" line>
Line 101: Line 100:
<div style="clear:both;"></div>
<div style="clear:both;"></div>


It is important to note that for the case of bulk Silicon, since the material is centrosymmetric, only one component of the 3x3 tensor. For non-symmetric systems, it is better to take the trace of the dielectric function.
Note that for the case of bulk Silicon, since the material is centrosymmetric, it suffices to plot one component of the 3x3 tensor. For non-symmetric systems, it is better to take the trace of the dielectric function.


==EELS from time-dependent density functional theory (TDDFT)==
==EELS from time-dependent density functional theory (TDDFT)==
VASP can compute the macroscopic dielectric function form TDDFT calculations using different functionals. Such calculations not only account for the electron-hole interaction beyond the independent particle level, but also include local-fields and can be performed at points in the Brillouin zone other than <math>\Gamma</math>.  
VASP can compute the macroscopic dielectric function employing [[Time-dependent density-functional theory calculations|TDDFT calculations]] using different functionals. Such calculations not only account for the electron-hole interaction beyond the independent particle level but also include local fields and can be performed at points in the Brillouin zone other than <math>\Gamma</math>.  


The evaluation of <math>\epsilon_{\mathrm M}</math> is performed via Casida's equation, set with {{TAG|ALGO}}=TDHF in the {{TAG|INCAR}}. The following {{TAG|INCAR}} will be used as an example, where the electron-hole interaction is included using a [[Bethe-Salpeter-equations calculations#Model BSE (mBSE)|model dielectric function]]. The specific solver that details how <math>\epsilon_\mathrm{M}</math> is built is chosen with the tag {{TAG|IBSE}}. Other options are available, with more in formation to be found in the [[Bethe-Salpeter_equations|Bethe-Salpeter equations page]].
The evaluation of <math>\epsilon_{\mathrm M}</math> is performed via Casida's equation, set with {{TAG|ALGO}}=TDHF in the {{TAG|INCAR}}. The following {{TAG|INCAR}} will be used as an example, where the electron-hole interaction is included using a [[Bethe-Salpeter-equations calculations#Model BSE (mBSE)|model dielectric function]]. The specific solver that details how <math>\epsilon_\mathrm{M}</math> is built is chosen with the tag {{TAG|IBSE}}. Other options are available, with more information to be found on the [[Bethe-Salpeter_equations|Bethe-Salpeter equations page]].


  {{TAG|SYSTEM}}    = Si
  {{TAG|SYSTEM}}    = Si
Line 124: Line 123:
  {{TAG|HFSCREEN}}  = 1.22
  {{TAG|HFSCREEN}}  = 1.22


At the end of the calculation the dielectric function can be extracted from the vasprum.xml or {{FILE|vaspout.h5}} files. Results are shown at the end of the next subsection, in order to compare the difference between the TDDFT and the many-body perturbation theory approaches.
At the end of the calculation, the dielectric function can be extracted from the vasprum.xml or {{FILE|vaspout.h5}} files. Results are shown at the end of the next subsection in order to compare TDDFT and many-body perturbation theory approaches.


==EELS from many-body perturbation theory (MBPT)==
==EELS from many-body perturbation theory (MBPT)==
The addition of electron-hole interactions to the dielectric function can also be done at MBPT level, with {{TAG|ALGO}}=BSE. The caveat is that VASP requires a previous [[GW approximation of Hedin%27s equations|GW calculation]] in order to generate the [[WFULLxxxx.tmp|WFULLxxxx.tmp]] files, where the dielectric screening is stored.  
The addition of electron-hole interactions to the dielectric function can also be done performing [[Bethe-Salpeter-equations_calculations|calculations at the MBPT level]], with {{TAG|ALGO}}=BSE. The caveat is that VASP requires a previous [[GW approximation of Hedin%27s equations|GW calculation]] in order to generate the [[WFULLxxxx.tmp|WFULLxxxx.tmp]] files, where the dielectric screening is stored.  


Like in the TDDFT case, users can select which algorithm to use when evaluating <math>\epsilon_\mathrm{M}</math> via the tag {{TAG|IBSE}}. In the {{TAG|INCAR}} file used as an example below, the exact diagonalisation solver is employed
Like in the TDDFT case, users can select which algorithm to use when evaluating <math>\epsilon_\mathrm{M}</math> via the tag {{TAG|IBSE}}. In the {{TAG|INCAR}} file used as an example below, the exact diagonalization solver is employed


  {{TAG|SYSTEM}}    = Si
  {{TAG|SYSTEM}}    = Si
Line 143: Line 142:
  {{TAG|LADDER}}    = .TRUE.
  {{TAG|LADDER}}    = .TRUE.


and the same number of virtual and occupied states are used, but now no information is given about any parameters with which to model the electron-hole interaction.
and the same number of virtual and occupied states are used, but now, no information is given about any parameters to model the electron-hole interaction.


Extracting the data at the end of the calculation can be done for both MBPT and TDDFT using the following script, after editing it to use the right vasprun.xml file.
Extracting the data at the end of the calculation can be done for both MBPT and TDDFT using the following script. Edit it to use the right vasprun.xml file.
<syntaxhighlight lang="bash" line>
<syntaxhighlight lang="bash" line>
awk 'BEGIN{i=0} /<dielectricfunction>/,\
awk 'BEGIN{i=0} /<dielectricfunction>/,\
Line 152: Line 151:
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.BSE.xml > dielectric_function.BSE.dat
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.BSE.xml > dielectric_function.BSE.dat
</syntaxhighlight>
</syntaxhighlight>
{{NB|mind|If both TDDFT and MBPT calculations are run in the same directory, VASP will overwrite the vasprun.xml and {{FILE|vaspout.h5}} files, making it impossible to compare both calculations. Please be sure to either change the name of this file after the calculation is done, and before a new one begins, or perform both calculations in different directories.}}
{{NB|mind|If both TDDFT and MBPT calculations are run in the same directory, VASP will overwrite the vasprun.xml and {{FILE|vaspout.h5}} files, making it impossible to compare both calculations. Please be sure to either change the name of this file after each calculation or perform both calculations in different directories.}}


Plotting both results can be done in gnuplot using
Plotting both results can be done in gnuplot using
Line 162: Line 161:
<div style="clear:both;"></div>
<div style="clear:both;"></div>


Both spectra look very similar, the differences coming from the treatment of the electron-hole interaction in both TDDFT and BSE case. This is both a consequence of the appropriate choice of {{TAG|AEXX}} and {{TAG|HFSCREEN}} parameters, as well as the fact that bulk Silicon is a centrosymmetric material, so the model dielectric function works well here. However, while the use of a model (diagonal) dielectric function is well suited for bulk Silicon, for systems with lower symmetry the off-diagonal elements that are ignored here will be important, and can lead to larger discrepancies in the results from TDDFT and MBPT.
Both spectra look very similar, the differences is due to the treatment of the electron-hole interaction in both TDDFT and BSE case. This is both, a consequence of the appropriate choice of {{TAG|AEXX}} and {{TAG|HFSCREEN}} parameters, as well as the fact that bulk Silicon is a centrosymmetric material, so the model dielectric function works well here. However, while the use of a model (diagonal) dielectric function is well suited for bulk Silicon, for systems with lower symmetry, the off-diagonal elements that are ignored here will be important and can lead to larger discrepancies in the results from TDDFT and MBPT.


To plot the EEL spectrum with {{py4vasp}}, it should be noted that the type of calculation has to be specified when reading the dielectric function. It is simply a matter of editing the following script
To plot the EEL spectrum with {{py4vasp}}, it should be noted that the type of calculation has to be specified when reading the dielectric function. It is simply a matter of editing the following script
Line 189: Line 188:
plt.show()
plt.show()
</syntaxhighlight>
</syntaxhighlight>
which when used with the rest of the script will produce the following plot for EELS.
which will produce the following plot for EELS.


[[File:EELS bulk Si BSE TDHF Q1 py4vasp.png|thumbnail|400px|left|EELS plot using {{py4vasp}} for bulk Si from both BSE and TDHF at <math>\Gamma</math>-point.]]
[[File:EELS bulk Si BSE TDHF Q1 py4vasp.png|thumbnail|400px|left|EELS plot using {{py4vasp}} for bulk Si from both BSE and TDHF at <math>\Gamma</math>-point.]]
Line 195: Line 194:


=Calculations at finite momentum=
=Calculations at finite momentum=
{{NB|warning|With VASP, finite momentum calculations at TDDFT or BSE level, i.e. {{TAG|ALGO}}{{=}}TDHF or BSE, must always use {{TAG|ANTIRES}}{{=}}2 regardless of the solver, functional, or approximation used for the electron-hole interaction. Otherwise results will be unphysical!}}
{{NB|warning|With VASP, finite momentum calculations at TDDFT or BSE level, i.e. {{TAG|ALGO}}{{=}}TDHF or BSE, must always use {{TAG|ANTIRES}}{{=}}2 regardless of the solver, functional, or approximation used for the electron-hole interaction. Otherwise, the results will be unphysical!}}


The macroscopic dielectric function can be evaluated at other points in the Brillouin zone. First, it is important to check the point list in the {{TAG|OUTCAR}} or {{TAG|IBZKPT}} from the ground-state calculation. In the {{TAG|OUTCAR}} the points are listed  in this section
The macroscopic dielectric function can be evaluated at other points in the Brillouin zone. First, it is important to check the point list in the {{TAG|OUTCAR}} or {{TAG|IBZKPT}} from the ground-state calculation. In the {{TAG|OUTCAR}} the points are listed  in this section
Line 223: Line 222:
...
...
</syntaxhighlight>
</syntaxhighlight>
The point at which <math>\epsilon_M(\mathbf q,\omega)</math> is going go be computed is then selected in the {{TAG|INCAR}} file with the tag {{TAG|KPOINT_BSE}}. The syntax is
The point at which <math>\epsilon_M(\mathbf q,\omega)</math> is going to be computed is then selected in the {{TAG|INCAR}} file with the tag {{TAG|KPOINT_BSE}}. The syntax is


   KPOINT_BSE = index_of_k-point  n1 n2 n3
   KPOINT_BSE = index_of_k-point  n1 n2 n3
Line 247: Line 246:
  {{TAG|OMEGAMAX}} = 30
  {{TAG|OMEGAMAX}} = 30


Extracting the dielectric function from the vasprun.xml file is done in a similar way as <math>\Gamma</math>-point calculations, but with a small caveat that the dielectric function now only has one single component. Using the script
Extracting the dielectric function from the vasprun.xml file is done similarly as <math>\Gamma</math>-point calculations, but with a small caveat that the dielectric function now only has one single component. Use the following script
<syntaxhighlight lang="bash" line>
<syntaxhighlight lang="bash" line>
awk 'BEGIN{i=0} /<dielectricfunction>/,\
awk 'BEGIN{i=0} /<dielectricfunction>/,\
Line 254: Line 253:
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.xml > dielectric_function.TDHF.dat
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.xml > dielectric_function.TDHF.dat
</syntaxhighlight>
</syntaxhighlight>
and plotting the EELS result can also be done with gnuplot.  
to extract the data and plot the EELS result using Gnuplot.  


[[File:EELS bulk Si BSE TDHF Q2 result.png|thumbnail|400px|left|Imaginary part of the inverse macroscopic dielectric function for bulk Si from both BSE and TDHF for {{TAG|KPOINT_BSE}}=2. In this example it corresponds to the coordinates <math>(0.5,0.0,0.0)</math> in reciprocal space.]]
[[File:EELS bulk Si BSE TDHF Q2 result.png|thumbnail|400px|left|Imaginary part of the inverse macroscopic dielectric function for bulk Si from both BSE and TDHF for {{TAG|KPOINT_BSE}}=2. In this example it corresponds to the coordinates <math>(0.5,0.0,0.0)</math> in reciprocal space.]]


Much like calculations at <math>\Gamma</math>, results from model TDDFT are very close to those from MBPT. The reduction in intensity for spectra away from <math>\Gamma</math> is normal, due to the fact that matrix elements are now away from the dipole approximation.
Much like calculations at <math>\Gamma</math>, results from model TDDFT are very close to those from MBPT. The reduction in intensity for spectra away from <math>\Gamma</math> is normal. This is due to the fact that matrix elements are now away from the dipole approximation.
<div style="clear:both;"></div>
<div style="clear:both;"></div>
To plot the same results with {{py4vasp}}, the new shape of the dielectric function has to be taken into account, and so no indexing is added to the epslion array
To plot the same results with {{py4vasp}}, the new shape of the dielectric function has to be taken into account, and so no indexing is added to the epslion array
Line 288: Line 287:
</syntaxhighlight>
</syntaxhighlight>


which will generate the next plot.
which will generate the following plot.


[[File:EELS bulk Si BSE TDHF Q2 py4vasp.png|thumbnail|400px|left|EELS plot for {{TAG|KPOINT_BSE}}=2 using py4vasp.]]
[[File:EELS bulk Si BSE TDHF Q2 py4vasp.png|thumbnail|400px|left|EELS plot for {{TAG|KPOINT_BSE}}=2 using py4vasp.]]

Latest revision as of 08:45, 12 May 2025

One of the many ways in which it is possible to probe neutral excitations in a material is by injecting electrons into the sample. These are called electron-energy-loss spectroscopy experiments, where the incoming electron can create bound electron-hole pairs (i.e. excitons), plasmons, or even higher-order multi-pair excitations.

The incoming electron acts as an external potential, , which induces a charge density in the material, . Within linear-response theory these two quantities can be related by the reducible polarisability function, , via a Green-Kubo relation

If the external potential is taken as proportional to a plane-wave of momentum , then the electron energy-loss spectrum (EELS) can be taken from the imaginary part of the inverse dielectric function, , since

Inclusion of local fields

In general, the microscopic quantity is a function of two coordinates, i.e. . This has important consequences on inhomogeneous systems where a homogeneous, constant, external electric field can induce fluctuations at the interatomic scale, and thus create microscopic fields. A direct consequence of the inhomogeneous character of the system is that in reciprocal space has to be written as , where is a reciprocal lattice vector. The microscopic fields are then the components of the tensor.

From it is possible to see that a problem arises when , i.e. the optical limit. In reciprocal space, this equation becomes

where is the Coulomb potential. At , all components without microscopic fields are divergent. To circumvent this issue, the evaluation of is replaced the Coulomb potential with

leaving the component to be dealt with separately and then added at the end.

Micro-macro connection and relation to measured quantities

It is important to note that the actual measured quantity, , does not depend on the microscopic fields[1]. To connect both the microscopic and macroscopic quantities, an averaging procedure is taken out, so that

Since VASP computes the macroscopic function, EELS can be extracted from the final result via

Note that the inclusion of local fields and the connection to the macroscopic observable must be considered regardless of the level of approximation to the polarisability function, . Within VASP, this can be done at several levels of approximation, which are discussed in the next section.

Computing EELS with VASP

EELS from density functional theory (DFT)

The simplest calculation that yields a macroscopic dielectric function is a ground state calculation using DFT, with the tags NBANDS and LOPTICS. Using bulk silicon as an example with the following INCAR

SYSTEM = Si
NBANDS = 48
ISMEAR = 0 ; SIGMA = 0.1
ALGO = N
LOPTICS = .TRUE.
CSHIFT = 0.4

the macroscopic dielectric function can be extracted from the vasprun.xml file at the end of the calculation by first running the following script

awk 'BEGIN{i=0} /<dielectricfunction comment="density-density">/,\
                /<\/dielectricfunction>/ \
                 {if ($1=="<r>") {a[i]=$2 ; b[i]=($3+$4+$5)/3 ; c[i]=$4 ; d[i]=$5 ; i=i+1}} \
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.xml > dielectric_function.DFT.dat

which writes the trace of the tensor to a file called dielectric_function.DFT.dat. Plotting the EEL spectrum can be done with visualization software like Gnuplot, using the following command as an example:

p 'dielectric_function.DFT.dat' u 1:($2/($2**2+$3**2)) w l lc rgb 'black' t 'DFT'
Imaginary part of the inverse macroscopic dielectric function for bulk Si from DFT.

The results of this DFT calculation should be analyzed with the following considerations in mind. Firstly, this calculation is performed only for , with no local fields considered. Because of this, the dielectric function from DFT is often called the independent particle random-phase approximation dielectric function. Secondly, no interactions between electrons and holes are included in the evaluation of the dielectric function. To account for both local-field effects and the electron-hole interaction, approximations beyond DFT must be taken into account.

Plotting the EELS can also be done using py4vasp as a Python module. Take the next script as an example, where the vaspout.h5 had its name changed to vaspout.DFT.h5:

import py4vasp
import numpy as np
import matplotlib.pyplot as plt

calc = py4vasp.Calculation.from_file('vaspout.DFT.h5')

energies = calc.dielectric_function.read('')['energies']
# Only the xx-component of the dielectric function is read
epsilon  = calc.dielectric_function.read('')['dielectric_function'][1][1][:]

eels = -np.imag(1.0/epsilon)

plt.plot(energies, eels, label='DFT')
plt.ylabel(r'-Im[$\epsilon^{-1}_M$]')
plt.xlabel('Energy loss [eV]')
plt.legend()
plt.show()
EEL spectrum from DFT plotted with py4vasp.

Note that for the case of bulk Silicon, since the material is centrosymmetric, it suffices to plot one component of the 3x3 tensor. For non-symmetric systems, it is better to take the trace of the dielectric function.

EELS from time-dependent density functional theory (TDDFT)

VASP can compute the macroscopic dielectric function employing TDDFT calculations using different functionals. Such calculations not only account for the electron-hole interaction beyond the independent particle level but also include local fields and can be performed at points in the Brillouin zone other than .

The evaluation of is performed via Casida's equation, set with ALGO=TDHF in the INCAR. The following INCAR will be used as an example, where the electron-hole interaction is included using a model dielectric function. The specific solver that details how is built is chosen with the tag IBSE. Other options are available, with more information to be found on the Bethe-Salpeter equations page.

SYSTEM    = Si
ISMEAR    = 0 
SIGMA     = 0.1
NBANDS    = 48     
ALGO      = TDHF
CSHIFT    = 0.4
IBSE      = 0
NBANDSO   = 4       ! number of occupied bands
NBANDSV   = 8       ! number of unoccupied bands
LHARTREE  = .TRUE.
LADDER    = .TRUE.
LFXC      = .FALSE.
LMODELHF  = .TRUE. 
AEXX      = 0.083
HFSCREEN  = 1.22

At the end of the calculation, the dielectric function can be extracted from the vasprum.xml or vaspout.h5 files. Results are shown at the end of the next subsection in order to compare TDDFT and many-body perturbation theory approaches.

EELS from many-body perturbation theory (MBPT)

The addition of electron-hole interactions to the dielectric function can also be done performing calculations at the MBPT level, with ALGO=BSE. The caveat is that VASP requires a previous GW calculation in order to generate the WFULLxxxx.tmp files, where the dielectric screening is stored.

Like in the TDDFT case, users can select which algorithm to use when evaluating via the tag IBSE. In the INCAR file used as an example below, the exact diagonalization solver is employed

SYSTEM    = Si
ISMEAR    = 0 
SIGMA     = 0.1
NBANDS    = 48     
ALGO      = BSE
CSHIFT    = 0.4
IBSE      = 2
NBANDSO   = 4       ! number of occupied bands
NBANDSV   = 8       ! number of unoccupied bands
LHARTREE  = .TRUE.
LADDER    = .TRUE.

and the same number of virtual and occupied states are used, but now, no information is given about any parameters to model the electron-hole interaction.

Extracting the data at the end of the calculation can be done for both MBPT and TDDFT using the following script. Edit it to use the right vasprun.xml file.

awk 'BEGIN{i=0} /<dielectricfunction>/,\
                /<\/dielectricfunction>/ \
                 {if ($1=="<r>") {a[i]=$2 ; b[i]=($3+$4+$5)/3 ; c[i]=$4 ; d[i]=$5 ; i=i+1}} \
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.BSE.xml > dielectric_function.BSE.dat
Mind: If both TDDFT and MBPT calculations are run in the same directory, VASP will overwrite the vasprun.xml and vaspout.h5 files, making it impossible to compare both calculations. Please be sure to either change the name of this file after each calculation or perform both calculations in different directories.

Plotting both results can be done in gnuplot using

p 'dielectric_function.BSE.dat' u 1:($2/($2**2+$3**2)) w l lc rgb 'black' t 'BSE', \
'dielectric_function.TDHF.dat' u 1:($2/($2**2+$3**2)) w l lc rgb 'red' t 'TDHF'

which results in the following figure.

Imaginary part of the inverse macroscopic dielectric function for bulk Si from both BSE and TDHF at -point.

Both spectra look very similar, the differences is due to the treatment of the electron-hole interaction in both TDDFT and BSE case. This is both, a consequence of the appropriate choice of AEXX and HFSCREEN parameters, as well as the fact that bulk Silicon is a centrosymmetric material, so the model dielectric function works well here. However, while the use of a model (diagonal) dielectric function is well suited for bulk Silicon, for systems with lower symmetry, the off-diagonal elements that are ignored here will be important and can lead to larger discrepancies in the results from TDDFT and MBPT.

To plot the EEL spectrum with py4vasp, it should be noted that the type of calculation has to be specified when reading the dielectric function. It is simply a matter of editing the following script

import py4vasp
import numpy as np
import matplotlib.pyplot as plt

calc_bse  = py4vasp.Calculation.from_file('vaspout.BSE_Q1.h5')
calc_tdhf = py4vasp.Calculation.from_file('vaspout.TDHF_Q1.h5')

# The type of calculation must be specified, with the addition of the 'BSE' string
energies = calc_bse_q1.dielectric_function.read('BSE')['energies']
epsilon_bse  = calc_bse.dielectric_function.read('BSE')['dielectric_function'][1][1][:]
# The type of calculation must be specified, with the addition of the 'TDHF' string
epsilon_tdhf = calc_tdhf.dielectric_function.read('TDHF')['dielectric_function'][1][1][:]

eels_bse  = -np.imag(1.0/epsilon_bse)
eels_tdhf = -np.imag(1.0/epsilon_tdhf)

plt.plot(energies, eels_bse,  '', label='BSE')
plt.plot(energies, eels_tdhf, '', label='TDHF')
plt.ylabel(r'-Im[$\epsilon^{-1}_M$]')
plt.xlabel('Energy loss [eV]')
plt.legend()
plt.show()

which will produce the following plot for EELS.

EELS plot using py4vasp for bulk Si from both BSE and TDHF at -point.

Calculations at finite momentum

Warning: With VASP, finite momentum calculations at TDDFT or BSE level, i.e. ALGO=TDHF or BSE, must always use ANTIRES=2 regardless of the solver, functional, or approximation used for the electron-hole interaction. Otherwise, the results will be unphysical!

The macroscopic dielectric function can be evaluated at other points in the Brillouin zone. First, it is important to check the point list in the OUTCAR or IBZKPT from the ground-state calculation. In the OUTCAR the points are listed in this section

 Subroutine IBZKPT returns following result:
 ===========================================

 Found     16 irreducible k-points:

 Following reciprocal coordinates:
            Coordinates               Weight
  0.000000  0.000000  0.000000      1.000000
  0.166667  0.000000  0.000000      8.000000
  0.333333  0.000000  0.000000      8.000000
...

with the first three entries being the reduced coordinates, the fourth entry being the weight of the respective point. The same information is also repeated in the IBZKPT file, where the points are listed as

Automatically generated mesh
      16
Reciprocal lattice
    0.00000000000000    0.00000000000000    0.00000000000000             1
    0.16666666666667    0.00000000000000    0.00000000000000             8
    0.33333333333334    0.00000000000000    0.00000000000000             8
...

The point at which is going to be computed is then selected in the INCAR file with the tag KPOINT_BSE. The syntax is

 KPOINT_BSE = index_of_k-point  n1 n2 n3

where the first entry is the index of the point on the list found in the OUTCAR or IBZKPT files, and optional integer arguments. If present, these three indices can be used the evaluate the dielectric function at a k point outside of the first Brillouin zone corresponding to

Still using bulk silicon as an example, the following INCAR evaluates at the second k-point on the list

SYSTEM = Si
NBANDS = 48
NBANDSO = 4 ; NBANDSV = 8
ISMEAR = 0 ; SIGMA = 0.1
EDIFF = 1E-8
ALGO = BSE
LADDER = .TRUE.
LHARTREE = .TRUE.
ANTIRES = 2
CSHIFT = 0.4
IBSE = 2
KPOINT_BSE = 2
OMEGAMAX = 30

Extracting the dielectric function from the vasprun.xml file is done similarly as -point calculations, but with a small caveat that the dielectric function now only has one single component. Use the following script

awk 'BEGIN{i=0} /<dielectricfunction>/,\
                /<\/dielectricfunction>/ \
                 {if ($1=="<r>") {a[i]=$2 ; b[i]=$3 ; c[i]=$4 ; d[i]=$5 ; i=i+1}} \
     END{for (j=0;j<i/2;j++) print a[j],b[j],b[j+i/2]}' vasprun.xml > dielectric_function.TDHF.dat

to extract the data and plot the EELS result using Gnuplot.

Imaginary part of the inverse macroscopic dielectric function for bulk Si from both BSE and TDHF for KPOINT_BSE=2. In this example it corresponds to the coordinates in reciprocal space.

Much like calculations at , results from model TDDFT are very close to those from MBPT. The reduction in intensity for spectra away from is normal. This is due to the fact that matrix elements are now away from the dipole approximation.

To plot the same results with py4vasp, the new shape of the dielectric function has to be taken into account, and so no indexing is added to the epslion array

import py4vasp
import numpy as np
import matplotlib.pyplot as plt

calc_bse  = py4vasp.Calculation.from_file('vaspout.BSE.h5')
calc_tdhf = py4vasp.Calculation.from_file('vaspout.TDHF.h5')

energies = calc_bse.dielectric_function.read('BSE')['energies']

# Notice that the dielectric function no has a single component, so there is no need for indexing the 
# array
epsilon_bse  = calc_bse.dielectric_function.read('BSE')['dielectric_function']
epsilon_tdhf = calc_tdhf.dielectric_function.read('TDHF')['dielectric_function']

eels_bse  = -np.imag(1.0/epsilon_bse)
eels_tdhf = -np.imag(1.0/epsilon_tdhf)

plt.plot(energies, eels_bse,  '', label='BSE')
plt.plot(energies, eels_tdhf, '', label='TDHF')
plt.ylabel(r'Im[$\epsilon^{-1}_M$]')
plt.xlabel('Energy loss [eV]')
plt.legend()
plt.show()

which will generate the following plot.

EELS plot for KPOINT_BSE=2 using py4vasp.

Related Tags and Sections

ALGO, LOPTICS, LHFCALC, LADDER, LHARTREE, NBANDSV, NBANDSO, OMEGAMAX, LFXC, ANTIRES, BSE calculations, Time-dependent density-functional theory calculations

References