by Caterina Cocchi for exciting carbon
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 that will appear will be 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 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. In order to compute the optical absorption spectra of materials, manybody perturbation theory (MBPT) offers a powerful tool such as the BetheSalpeter equation (BSE) formalism (see BSE1951). In solidstate physics, the BSE formalism is used to describe the electronhole pair (i.e., the exciton), which can be created when the system absorbs a photon. In this case an effective twoparticle Hamiltonian is introduced. In the following we use the notation of SAD2009.
In the BSE formalism, one solves the eigenvalue problem for the effective Hamiltonian $H ^{\rm (eff)}$,
(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$).
The diagonal term of the Hamiltonian, $H^{\rm (diag)}$, accounts for the contribution of singleparticle transitions,
(3)where $\epsilon_{n\,\mathbf{k}}$ is the singleparticle energy of the $n$th band. Here, the label $v$ ($c$) is used for valence (conduction) states.
The exchange term, which is caused by the repulsive interaction between the electron and the hole, is defined as
(4)where the $\varphi_{n\mathbf{k}}(\mathbf{r})$ are the singleparticle states and $\overline{v}(\mathbf{r,r'})$ is the bare (unscreened) Coulomb potential which is defined without the longrange term.
Finally, the correlation term (also known as direct term), $H^{\rm (c)}$, which reads
(5)contains the attractive electronhole correlation, due to the screened Coulomb potential $W(\mathbf{r,r'})$. This screened potential is expressed in reciprocal space as:
(6)where the screening of the Coulomb potential ${v}$ is given by the microscopic dielectric function $\varepsilon^{1}$.
The optical absorption, which is the main physical quantity obtained from a BSE calculation, is given by the imaginary part of the frequency dependent macroscopic dielectric function,
(7)where $t_{\lambda}$ is related to the momentum matrix elements as well as to the components $A^{\lambda}_{v\,c\,\mathbf{k}} = \langle v\,c\,\mathbf{k} A_\lambda\rangle$ of the BSE eigenvectors:
(8)Now, we calculate the macroscopic dielectric function of LiF applying the BSE formalism.
3. How to run a BSE calculation
i) Preparation of the input file and run
We now perform the BSE calculation. Move to the parent directory LiFBSE and create here 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 adding 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" 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 can be set also in the xs element. It is used in the SCF calculation necessary to obtain 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 to calculate the response function, as explained in more details in Excited states from TDDFT. In the BSE calculation the response function is needed to compute the screening;
 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 for the calculate spectra;
 When the attribute scissor is set different from zero, a scissor operator is applied to correct the band gap obtained from the ground state calculation (often understimated in LDA or GGA) in order to mimic the quasiparticle gap. This parameter should not appear when the electronic structure resulting from a GW calculation are taken as a starting point for a BSE calculation;
 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 see 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 the triplets, where the exchange term of the Hamiltonian is neglected, and RPA, where the correlation 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 numerated starting from the lowest occupied state, while unoccupied bands are numerated 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 four empty bands.
 The element qpointset is related to the dependence of the response 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.
We are now ready to run the BSE calculation:
$ time excitingser &
To display the progress you can use
$ tail f INFOXS.OUT
which can be killed with CtrlC when exciting has finished.
Additional information about the calculation workflow
ii) Analysis of the results
Once the calculation finishes (it will take a few minutes), a xmgrace plot can be generated as follows:
$ cp EPSILON_BSEsinglet_SCRfull_OC11.OUT.xml tmp.xml
$ xsltproc stringparam filename dielectricfunction $EXCITINGVISUAL/xmldielectricfunction2agr.xsl tmp.xml
Three xmgrace files are generated: dielectricfunction_Re.agr, dielectricfunction_Im.agr, and dielectricfunction_ReKK.agr, which contain, respectively, the real part, the imaginary part, and the real part from a KramersKronig transform of the dielectric function. The optical absorption spectrum is given by the imaginary part of the dielectric function. To visualize the plot with xmgrace (see also Xmgrace: A Quickstart), type:
$ xmgrace dielectricfunction_Im.agr >/dev/null 2>&1 &
For further analysis of the results we inspect some of the output files (YY being either of the three diagonal components 11, 22, and 33).
 The file EXCITON_BSEsinglet_SCRfull_OCYY.OUT, which contains the relevant information about the excitation energies and intensities. These files contain six columns. After the progressive index referring to the excitation number, we find the excitation energies, exciton binding energies, oscillator strengths, and finally real and imaginary part of the excitation amplitudes, from which the oscillator strengths themselves are computed as the absolute values (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 end of the file and labeled as E_gap. Negative values of the exciton binding energies are associated with bound excitons.
 Inside EXCITON_SORTED_BSEsinglet_SCRfull_OCYY.OUT, the list of excitations is sorted with respect to the corresponding oscillator strengths.
 In the files EPSILON_BSEsinglet_SCRfull_OCYY.OUT, the real and imaginary part of the macroscopic dielectric function are stored in the second and third columns, respectively. In the first column, energies are indicated. In the fourth column, one can find the real part of the macroscopic dielectric function computed from the imaginary part through the KramersKronig relations.
iii) Scaling and convergence
BSE calculations are extremely demanding, even on our stateoftheart computer infrastructure. The scaling with respect to the size of the kpoint mesh is very bad and enters quadratically the setup of the Hamlitonian (direct term), and, if a full diagonalization to the eigenvalue problem is applied, even with the third power. An estimate for the scaling of the screening, the direct term of the BSE Hamiltonian, and the BSE eigenvalue problem (which are the most timeconsuming parts of the calculation in general) is the following
(9)where $N$ stands for the "number of" and the subscripts denote the kpoints, qpoints, Gvectors, valence states, 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)?
 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.
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).