by Benjamin Aurich, Christian Vorwerk, & Caterina Cocchi for exciting nitrogen
Purpose: In this tutorial you will learn how to perform a basic BetheSalpeterequation (BSE) calculation. As an example, the optical spectrum of lithium fluoride (LiF) will be studied.
Table of Contents

1. Preliminary step: Groundstate calculation
Before starting, be sure that relevant environment variables are already defined as specified in How to set environment variables for tutorials scripts.
Important note: All input parameters are given in atomic units!
As a preliminary step to calculate excitedstate properties from BSE, a groundstate calculation has to be performed. In this tutorial we consider as an example LiF. Create a directory named LiFBSE and move into it.
$ mkdir LiFBSE
$ cd LiFBSE
Inside the directory LiFBSE we create a subdirectory GS where we perform the preliminary ground state calculation:
$ mkdir GS
$ cd GS
Inside the GS subdirectory we create the input file for LiF. In the structure element we include the lattice parameter and basis vectors of LiF, which has a rocksalt cubic lattice, as well as the positions of the Li and F atoms. In the groundstate element, we include a 10$\times$10$\times$10 kpoint mesh (ngridk) and a value of 14.0 for gmaxvr. This value, which is larger than the default, is needed in view of the excitedstate calculation.
The resulting input file is the following:
<input> <title>LiFBSE</title> <structure speciespath="$EXCITINGROOT/species/"> <crystal scale="7.608"> <basevect>0.5 0.5 0.0</basevect> <basevect>0.5 0.0 0.5</basevect> <basevect>0.0 0.5 0.5</basevect> </crystal> <species speciesfile="Li.xml"> <atom coord="0.0000 0.0000 0.0000" /> </species> <species speciesfile="F.xml"> <atom coord="0.5000 0.5000 0.5000" /> </species> </structure> <groundstate do="fromscratch" ngridk="10 10 10" xctype="GGA_PBE_SOL" gmaxvr="14.0"/> </input>
N. B.: Do not forget to replace in the input.xml the string "$EXCITINGROOT" by the actual value of the environment variable $EXCITINGROOT.
$ SETUPexcitingroot.sh
Start now the groundstate SCF calculation and check if it finishes gracefully.
$ time excitingser &
In case of a successful run the files STATE.OUT and EFERMI.OUT should be present in the directory. These two files are needed as a starting point for the BSE calculation.
2. Theoretical background: BetheSalpeter equation
Before starting with the calculation, we briefly review the theoretical background. Manybody perturbation theory (MBPT) offers a powerful tool such as the BetheSalpeter equation (BSE) formalism (see BSE1951) to compute optical absorption spectra of materials. In solidstate physics, the BSE formalism is used to describe the excitations of the system in terms of interacting electronhole pairs. In particular, the BSE formalism allows to resolve excitations below the band gap. These bound electronhole pairs are quasiparticles also called excitons, which can be created when the system absorbs a photon.
The BSE Hamiltonian
The BSE can be stated as an eigenvalue problem of an effective twoparticle Hamiltonian (see, e.g., SAD2009):
(1)where the effective Hamiltonian is defined as
(2)In this expression, three terms can be recognized, each carrying a specific physical meaning which will be clarified in the following. Moreover, the factors $\gamma_{\rm x}$ and $\gamma_{\rm c}$ allow one to choose different levels of approximation and to distinguish between spinsinglet (i.e., $\gamma_{\rm x} \equiv 1$ and $\gamma_{\rm c} \equiv 1$) and spintriplet channels (i.e., $\gamma_{\rm x} \equiv 0$ and $\gamma_{\rm c} \equiv 1$).
Since the BSE describes interacting electronhole pairs, it is natural to introduce a twoparticle basis (see, e.g., SAN2015) which reflects the excitation (resonant terms, labeled r) and the deexcitation (antiresonant terms, labeled a) of independent electronhole pairs:
(3)Here, $\psi_{n\mathbf{k}}\!(\mathbf{r})$ are quasiparticle states. The combined index $\alpha$ incorporates $v$, indicating valence states, $c$ indicating conduction states and $\mathbf{k}$ standing for the kpoints. The (crystal)momentum difference between electron and hole is denoted by $\mathbf{q}$, such that $\mathbf{k}^\pm = \mathbf{k} \pm \mathbf{q}/2$. In the case of optical excitations, no momentum transfer from photon to electron is considered ($\mathbf{q} = 0$). In the basis presented above, the Hamiltonian has a $2 \times 2$ block structure
(4)with the eigenvectors split into a resonant and an antiresonant part:
(5)We can formally write the eigenvector coefficients in the Dirac notation as
(6)In the BSE formalism it is common to adopt the TammDancoffapproximation (TDA) which neglects the coupling between the resonant and antiresonant components of the Hamiltonian. For $\mathbf{q} = 0$, this approximation entails that only the $H^\text{rr}$ part has to be considered. In this way, the necessary computational effort is significantly reduced. In the following, we focus only on the resonantresonant block of the BSE and discuss its terms.
The diagonal term of the Hamiltonian, $H^{\rm (diag)}$, accounts for the contribution of independent particle transitions energies
(7)where $\epsilon_{n\,\mathbf{k}}$ is the singleparticle energy of the $n$th band.
The exchange term, is defined as
(8)and describes the repulsive exchange interaction between the electronhole pairs $\alpha$ and $\beta$. The pair $\beta$ annihilates at $\mathbf{r}'$ and the pair $\alpha$ is created at $\mathbf{r}$. The interaction is mediated by the bare Coulomb potential $v(\mathbf{r,r'})$. For $\mathbf{q}=0$, only the shortrange part of this term is included (see, e.g., SAD2009, ONI2002).
Finally, the direct term $H^{\text{(c)}}$ reads
(9)It describes the scattering of the electronhole pair $\beta$ into the pair $\alpha$ due to the screened Coulomb potential $W(\mathbf{r,r'})$. It accounts for the attractive electronhole interaction including the screened potential of the form:
(10)where the screening of the Coulomb potential ${v}$ is given by the microscopic dielectric function $\varepsilon^{1}$, which is calculated here within the randomphase approximation (RPA).
In the limit of vanishing $\mathbf{q}$ (optical limit), one can obtain the macroscopic transverse dielectric tensor $\varepsilon^{ij}_{\text{M}}(\omega)$ from the BSE solutions. The imaginary part of this tensor yields the optical absorption spectrum, as expressed by
(11)Thus, considering a diagonal element, the spectrum is constructed from scaled positive (negative) Lorentizian function of width $\delta$ centered around the positive (negative) BSE eingenenergies. The scaling factors are determined by the transition coefficients $t_{\lambda, i}$ which are a sum of dipoletransition matrix elements weighted by the BSE eigenvectors:
(12)where, within the TDA, $Y^\lambda$ = 0.
In the actual computation, the dipole matrix elements are replaced by momentum matrix elements obtained by using the corresponding canonical commutator relation.
3. How to run a BSE calculation
i) Preparation of the input file and run
We start by performing a BSE calculation using the TDA and at $\mathbf{q}=0$. To do this, move to the parent directory LiFBSE and create a new folder which we name BSE. Then, we move into it:
$ cd ..
$ pwd
/home/tutorials/LiFBSE
$ mkdir BSE
$ cd BSE
As anticipated, we need the files STATE.OUT and EFERMI.OUT obtained from the ground state calculation to be inside the new directory. Copy these two files from the GS folder into the BSE one.
$ cp ../GS/{STATE.OUT,EFERMI.OUT,input.xml} ./
In this way we can skip the groundstate calculation by setting do = "skip" in the groundstate element of the input file, also copied from the GS folder.
To perform an excitedstate calculation we must include the xs element in the input file:
... <xs xstype="BSE" ngridk="4 4 4" vkloff="0.097 0.273 0.493" ngridq="4 4 4" nempty="30" gqmax="3.0" broad="0.007" scissor="0.20947" tappinfo="true" tevout="true"> <energywindow intv="0.0 1.0" points="1200"/> <screening screentype="full" nempty="100"/> <BSE bsetype="singlet" nstlbse="1 5 1 4" /> <qpointset> <qpoint>0.0 0.0 0.0</qpoint> </qpointset> </xs> ...
Several attributes appear in this section of the input file. We will go through all of them in order to clarify their meaning within the BSE calculation we are about to perform:
 The attribute xstype defines the type of excitedstate calculation: In this case it is set to BSE;
 The attribute ngridk is also set in the xs element and it is used in the (singleshot) SCF calculation which is necessary to obtain the singleparticle eigenstates and eigenenergies. Usually the same mesh as in the groundstate is taken or, as in this case, a coarser grid is considered to reduce the computational costs. If not defined, the kpoint mesh used in the groundstate calculation will be assumed;
 The attribute vkloff is used to shift the kmesh off symmetry by a small displacement, in order to break all symmetry relations among the kpoints of the mesh. In this way, all the kpoints in the mesh will be crystallographically inequivalent and there will be no redundant contribution to the spectrum;
 The attribute ngridq defines the qmesh for the calculation of the dynamical screening. It is a good practice to choose a qmesh equivalent to the kmesh;
 The attribute nempty determines the number of empty states available for the construction of the BSE Hamiltonian;
 The attribute gqmax is an energy threshold for the local field effects included in the calculation. The number of Gvectors employed in the calculation is written in the first line of the file GQPOINTS_QM001.OUT. Tuning gqmax may require to adjust the value of gmaxvr in the groundstate element;
 The attribute broad defines the Lorentzian broadening $\delta$ for the calculated spectra;
 When the attribute scissor is set different from zero, a scissors operator is applied to correct the band gap obtained from the ground state calculation in order to mimic the quasiparticle gap. This parameter should not appear when the electronic structure resulting from a GW calculation is taken as starting point for the BSE calculation;
 The attribute tappinfo allows to append the output printed in the log file INFOXS.OUT at each run, without overwriting the existing file.
 The attribute tevout sets the energy output in electronvolt (eV).
Additional subelements appear inside the xs element (refer to the Input Reference for further details):
 The element energywindow defines the energy window and the number of points for the calculation of the optical spectrum. The attribute intv indicates the lower and upper energy limits for the calculation of the spectrum, while points defines the number of points to be used.
 screening is a rather important element in a BSE calculation, as it defines the parameters used to compute the screened Coulomb potential. The attribute screeningtype sets the adopted approximation for the screening: in this case we include the full screening in the calculation. For other options refer to the Input Reference. The attribute nempty defines the number of empty states to be included in the calculation of the screening matrix. Note that this is a different attribute than the one within the xs element and must be always specified when performing a BSE calculation.
 In the BSE element the actual parameters for a BSE calculation are set. The attribute bsetype defines the level of approximation in the solution of the BSE Hamiltonian. Here we are calculating the singlet states, meaning that the full BSE Hamiltonian is diagonalized. Other options include the calculations of triplets, where the exchange term of the Hamiltonian is neglected, RPA, where the direct term is ignored, and the independentparticle (IP) approximation, where only the diagonal part of the Hamiltonian is considered. For further details see Input Reference. The attribute nstlbse defines the range of occupied and empty states included in the BSE calculation. The first two integers define the lowest and highest occupied bands, while the last two refer to the unoccupied bands. To define the band range we refer to the file EIGVAL.OUT obtained from the ground state calculation. Please notice that the occupied bands are numbered starting from the lowest occupied state, while unoccupied bands are numbered starting from the lowest unoccupied band. In this example, we include in the BSE calculation all the 5 occupied bands of LiF and only the first 4 empty ones.
 The element qpointset is related to the dependence of the response function upon the momentum transfer along different directions (see qdependent TDDFT). Here, the qpoint is set to "0.0 0.0 0.0" since we are neglecting momentum transfer in this calculation ($\mathbf{q}=0$).
We are now ready to run the BSE calculation:
$ time excitingser &
While the calculation is running, some strings will be printed on screen. A successfully completed BSE run will produce the following lines:
Calculating RPA Dielectric Function: 100.000
Calculating Screened Coulomb Potential: 100.000
Calculating Screened Coulomb Matrix Elements: 100.000
Calculating Planewave matrix elements: 100.000
Calculating Exchange Interaction Matrix Elements: 100.000
Solving BSE Eigenvalue Problem: 100.000
Additional information about the calculation workflow
ii) Analysis of the results
After running the calculation, we proceed with the analysis of the results. A number of files and folders are present in the working directory. Most of them contain technical information about the calculation that is not strictly related to the physical interpretation of the results. Since we are interested in plotting the optical absorption spectrum of LiF, given by the imaginary part of its macroscopic dielectric function, we consider the folder EPSILON and move into it. To do so and subsequently plot the spectrum, execute the following commands:
$ cd EPSILON
$ cp EPSILON_BSEsingletTDABAR_SCRfull_OC11.OUT.xml tmp.xml
$ xsltproc stringparam filename dielectricfunction $EXCITINGVISUAL/xmldielectricfunction2agr.xsl tmp.xml
Since we are dealing with a cubic system, all optical components are equivalent. For this reason, we consider only the first one along the xx direction (OC11). With the executions of the commands above, three xmgrace files are generated: dielectricfunction_Re.agr, dielectricfunction_Im.agr, and dielectricfunction_ReKK.agr, which contain the real part, the imaginary part, and the real part from a KramersKronig transform of the macroscopic dielectric function, respectively. This information is contained inside the EPSILON_BSEsingletTDABAR_SCRfull_OC11.OUT file in the second, third, and fourth column, respectively. To visualize the plot of the imaginary part with xmgrace (see also Xmgrace: A Quickstart), type:
$ xmgrace dielectricfunction_Im.agr >/dev/null 2>&1 &
For further analysis of the results we inspect also the output files contained in the folder EXCITON. This directory contains the solutions of the diagonalization of the BSE. Specifically, the files EXCITON_BSEsingletTDABAR_SCRfull_OCXX.OUT, where XX=11,22,33 include the relevant information about the excitation energies and intensities. Each file has six columns. After the progressive index referring to the excitation number, we find the excitation energies, exciton binding energies, oscillator strengths, and finally the real and the imaginary part of the transition coefficients from which the oscillator strengths are computed (see also SAD2009). A relevant quantity is the exciton binding energy, which is defined as the difference between the excitation energy and the band gap, which is printed at the top of the file and labeled as E_shift. Negative values of the exciton binding energies are associated with bound excitons.
Other folders that contain useful quantities for the physical interpretation of the results are SIGMA, including the optical conductivity, and LOSS with the loss functions. The latter will be discussed more in details in the tutorial on qdependent BSE.
iii) Scaling and convergence
BSE calculations are extremely demanding, even on stateoftheart computer infrastructure. The scaling with respect to the size of the kmesh is quadratic with respect to the setup of the Hamlitonian (direct term). Moreover, for a full diagonalization to the eigenvalue problem the scalability goes like the third power of the kmesh. An estimate for the scaling of the screened Coulomb interaction, which enters the direct term of the BSE Hamiltonian, and the full BSE eigenvalue problem is the following
(13)where $N$ stands for the "number of" and the subscripts denote the kpoints, qpoints, Gvectors, valence and conduction states.
The most important convergence parameters are listed here as a supplement to those explained in the tutorial Excited states from TDDFT.

Exercises
 For the given input file, decrease the local fields cutoff gqmax and check how the results change.
 Modify the attribute bsetype to calculate the independentparticle (IP), RPA (exchange only) and triplet absorption spectrum for LiF. How is the spectrum modified? What are the main differences between singlet and triplet spectra? What happens when the direct term of the BSE Hamiltonian is switched off (RPA and IP)? If you have already computed the singlet spectra, you only need to execute the last task of the BSE program flow, i.e., "bse", when switching the bsetype (see workflow).
 Modify the number of conduction bands considered in the BSE window by changing the third and forth indices in the attributes nstlbse. What is the effect on the spectrum?
4. BSE calculations on top of GW
The procedure to run BSE calculations in exciting illustrated above can be applied after computing the underlying electronic properties from a singleshot GW calculation. For details regarding bandstructure calculations using GW we refer to Electronic bandstructure from GW.
In order to use the quasiparticle energies computed from GW as starting point for the BSE calculation, it is sufficient to include in the input file the gw element. With this option the electronic eigenstates and eigenenergies are read from the GW output. The scissors operator specified by the attribute scissor is automatically ignored. Important: Make sure that the working directory of the BSE calculation contains the GW output file EVALQP.OUT.
5. BSE beyond the TDA
To go beyond the TammDancoff approximation we need to add coupling = "true" in the BSE element of the input file. Compared to the previous calculations on LiF performed within the TDA as described above, now also the resonantantiresonant coupling block of the screened Coulomb interaction needs to be recalculated, since the Fourier coefficients of this block are needed at different kpoints than those of the resonantresonant block. No additional action is instead required for the exchange interaction. To do this, add to the input file plan element with related attributes shown below:
... <BSE bsetype="singlet" coupling="true" nstlbse="1 5 1 4" /> ... <plan> <doonly task="screen"/> <doonly task="scrcoulint"/> <doonly task="bse"/> </plan> </xs> ...
To run this calculation, once again type
$ time excitingser &
After the calculation is finished (it will take a few minutes) new files will appear in the working directory as well as in the subfolders. Again, we are interested in analyzing the new spectra and the new excitation energies. Please note that the new files DO NOT contain the additional string TDABAR. To plot the imaginary part of the dielectric function, follow the same procedure illustrated above. To simply overlay the new spectrum on top of the TDA one produced before, you may simply plot the first and third column of the file EPSILON_BSEsinglet_SCRfull_OC11.OUT. The resulting graph will look like this:
It can be noticed that in the case of LiF there is no significant difference between the optical absorption spectrum computed within the TDA and by solving the full BSE.
Literature
 BSE1951: The BSE has been introduced for the first time in E.E. Salpeter and H.A. Bethe, Phys. Rev. 84, 1232 (1951).
 SAD2009: Details on implementation and application of the BSE formalism in exciting: Stephan Sagmeister and Claudia AmbroschDraxl, Timedependent density functional theory versus BetheSalpeter equation: An allelectron study, Phys. Chem. Chem. Phys. 11, 4451 (2009) (PDF).
 More details on the implementation of the BSE formalism within the LAPW method and applications to organic semiconductors: S. Sagmeister, PhD thesis, University of Graz, August 2009 (PDF).
 Additional information on the BSE implementation beyond the TDA and zero momentum transfer can be found in the excerpt from the Master's thesis of B. Aurich here.
 STR1988: "Application of the Greenâ€™s functions method to the study of the optical properties of semiconductors", G. Strinati, Riv. Nuovo Cim. (1988) (PDF).
 SAN2015: "Beyond the TammDancoff approximation for extended systems using exact diagonalization", T. Sander, et al (2015) (PDF).
 ONI2002: "Electronic excitations: densityfunctional versus manybody Green'sfunction approaches" G. Onida, et al (2015) (PDF).