Part 1: X-ray absorption spectrum of LiCl


1 Supercell core-hole calculation

At the end of this tutorial you will be able to:

  • Setup a supercell core-hole calculation
  • Know how to converge the calculation with respect to the supercell size
  • Understand the importance of excitonic effects in X-ray absorption spectroscopy

1.1 Task

Compute the K-edge X-ray absorption spectrum (XAS) of Li in LiCl using the supercell core-hole method.

X-ray adsorption spectroscopy (XAS) is a powerful technique for investigating the chemical properties of materials. An electron is excited from a core state to a conduction band by an x-ray. Since the wavelength of the x-rays is usually much larger than the characteristic momentum in solids, we start with with the transversal expression for the imaginary part of the dielectric function in the long wavelength ($\mathbf{q}=0$):

$$\tag{1} \begin{equation} \epsilon_{\alpha \beta}^{(2)} (\omega,\mathbf{q}=0) = \frac{4 \pi^{2} e^{2} \hbar^{2}}{\Omega \omega^{2} m_{e}^{2}} \sum\limits_{c,v,\mathbf{k}} 2w_{\mathbf{k}} \delta(\varepsilon_{c\mathbf{k}}-\varepsilon_{v\mathbf{k}}-\omega) \times M_{\alpha}^{v\rightarrow c} {M_{\beta}^{v\rightarrow c}}^{*} \end{equation}, $$

where $M$ and $\varepsilon$ denote momentum matrix elements and orbital energies, respectively. This is directly proportional to the absorption spectrum, which is possible because the wavelength of the electromagnetic waves in absorption spectroscopy is usually much larger than the characteristic momentum in solids. The matrix elements in the PAW formalism are written as

$$\tag{2} \begin{equation} M_{\alpha}^{v\rightarrow c} = \langle \psi_{c \mathbf{k}} |i \nabla_{\alpha} - \mathbf{k}_{\alpha}| \psi_{v\mathbf{k}} \rangle = \langle \tilde{\psi}_{c\mathbf{k}}| i \nabla_{\alpha}-\mathbf{k}_{\alpha}|\tilde{\psi}_{v\mathbf{k}} \rangle + \sum\limits_{ij} \langle \tilde{\psi}_{c\mathbf{k}} | \tilde{p}_{i} \rangle \langle \tilde{p}_{j} | \tilde{\psi}_{v\mathbf{k}} \rangle i \left(\langle \phi_{i}| \nabla_{\alpha}| \phi_{j} \rangle - \langle \tilde{\phi}_{i}| \nabla_{\alpha}| \tilde{\phi}_{j} \rangle \right) \end{equation}. $$

Here, $|\phi_{i}\rangle$, $|\tilde{\phi}_{i}\rangle$ and $|\tilde{p}_{i}\rangle$ are all-electron partial waves, pseudo partial waves, and the projectors, respectively. The indices $i$ and $j$ are shorthands for the atomic site, angular quantum numbers, magnetic quantum numbers, etc. In X-ray absorption spectroscopy, one only considers a core hole at a single site. We can from now on restrict the equations to a single site

$$\tag{3} \begin{equation} M^{\mathrm{core}\rightarrow c\mathbf{k}}_{\alpha}=\sum\limits_{i}\langle \tilde{\psi}_{c\mathbf{k}} | \tilde{p}_{i} \rangle \langle\phi_{i}| \nabla_{\alpha}| \phi_{\mathrm{core}}\rangle. \end{equation} $$

Here, we used the completeness relation, $\sum_{i} |\tilde{p}_{i}\rangle \langle \tilde{\phi}_{i}| = 1$, so that the first and third term in Eq. 2 are canceled out. Also the summation over bands in Eq. 1 can be limited to the conduction bands $c$ resulting in the following equation for the imaginary part of the dielectric matrix

$$\tag{4} \begin{equation} \epsilon_{\alpha \beta}^{(2)} (\omega) = \frac{4 \pi^{2} e^{2} \hbar^{2}}{\Omega \omega^{2} m_{e}^{2}} \sum\limits_{c,\mathbf{k}} 2w_{\mathbf{k}}\delta(\varepsilon_{c\mathbf{k}}-\varepsilon_{\mathrm{core}}-\omega) \times M^{\mathrm{core}\rightarrow c\mathbf{k}}_\alpha {M^{\mathrm{core}\rightarrow c\mathbf{k}}_\beta}^*. \end{equation} $$

1.2 Input

The input files to run this example are prepared at $TUTORIALS/XAS/e01_SCH.

VASP looks in the current directory for four main input files, i.e., POSCAR, INCAR, KPOINTS, and POTCAR. Check them out!

POSCAR.1x1x1 (primitive cell)


LiCl
5.106
0 0.5 0.5
0.5 0 0.5
0.5 0.5 0
Li Cl
1  1
Direct
0.0000000 0.0000000 0.0000000
0.5000000 0.5000000 0.5000000

POSCAR.2x2x2


Click to reveal POSCAR.2x2x2!
LiCl
   5.10600000000000
    0.00000000   1.00000000   1.00000000
    1.00000000   0.00000000   1.00000000
    1.00000000   1.00000000   0.00000000
   Li Li   Cl
    1 7    8
Direct
   0.00000000   0.00000000   0.00000000
   0.50000000   0.00000000   0.00000000
   0.00000000   0.50000000   0.00000000
   0.50000000   0.50000000   0.00000000
   0.00000000   0.00000000   0.50000000
   0.50000000   0.00000000   0.50000000
   0.00000000   0.50000000   0.50000000
   0.50000000   0.50000000   0.50000000
   0.25000000   0.25000000   0.25000000
   0.75000000   0.25000000   0.25000000
   0.25000000   0.75000000   0.25000000
   0.75000000   0.75000000   0.25000000
   0.25000000   0.25000000   0.75000000
   0.75000000   0.25000000   0.75000000
   0.25000000   0.75000000   0.75000000
   0.75000000   0.75000000   0.75000000

POSCAR.3x3x3


Click to reveal POSCAR.3x3x3!
LiCl
   5.10600000000000
    0.00000000   1.50000000   1.50000000
    1.50000000   0.00000000   1.50000000
    1.50000000   1.50000000   0.00000000
  Li Li   Cl
  1 26   27
Direct
   0.00000000   0.00000000   0.00000000
   0.33333333   0.00000000   0.00000000
   0.66666667   0.00000000   0.00000000
   0.00000000   0.33333333   0.00000000
   0.33333333   0.33333333   0.00000000
   0.66666667   0.33333333   0.00000000
   0.00000000   0.66666667   0.00000000
   0.33333333   0.66666667   0.00000000
   0.66666667   0.66666667   0.00000000
   0.00000000   0.00000000   0.33333333
   0.33333333   0.00000000   0.33333333
   0.66666667   0.00000000   0.33333333
   0.00000000   0.33333333   0.33333333
   0.33333333   0.33333333   0.33333333
   0.66666667   0.33333333   0.33333333
   0.00000000   0.66666667   0.33333333
   0.33333333   0.66666667   0.33333333
   0.66666667   0.66666667   0.33333333
   0.00000000   0.00000000   0.66666667
   0.33333333   0.00000000   0.66666667
   0.66666667   0.00000000   0.66666667
   0.00000000   0.33333333   0.66666667
   0.33333333   0.33333333   0.66666667
   0.66666667   0.33333333   0.66666667
   0.00000000   0.66666667   0.66666667
   0.33333333   0.66666667   0.66666667
   0.66666667   0.66666667   0.66666667
   0.16666667   0.16666667   0.16666667
   0.50000000   0.16666667   0.16666667
   0.83333333   0.16666667   0.16666667
   0.16666667   0.50000000   0.16666667
   0.50000000   0.50000000   0.16666667
   0.83333333   0.50000000   0.16666667
   0.16666667   0.83333333   0.16666667
   0.50000000   0.83333333   0.16666667
   0.83333333   0.83333333   0.16666667
   0.16666667   0.16666667   0.50000000
   0.50000000   0.16666667   0.50000000
   0.83333333   0.16666667   0.50000000
   0.16666667   0.50000000   0.50000000
   0.50000000   0.50000000   0.50000000
   0.83333333   0.50000000   0.50000000
   0.16666667   0.83333333   0.50000000
   0.50000000   0.83333333   0.50000000
   0.83333333   0.83333333   0.50000000
   0.16666667   0.16666667   0.83333333
   0.50000000   0.16666667   0.83333333
   0.83333333   0.16666667   0.83333333
   0.16666667   0.50000000   0.83333333
   0.50000000   0.50000000   0.83333333
   0.83333333   0.50000000   0.83333333
   0.16666667   0.83333333   0.83333333
   0.50000000   0.83333333   0.83333333
   0.83333333   0.83333333   0.83333333

POSCAR.4x4x4


Click to reveal POSCAR.4x4x4!
LiCl
   5.10600000000000
    0.00000000   2.00000000   2.00000000
    2.00000000   0.00000000   2.00000000
    2.00000000   2.00000000   0.00000000
   Li Li   Cl
   1 63   64
Direct
   0.50000000   0.50000000   0.50000000
   0.00000000   0.00000000   0.00000000
   0.25000000   0.00000000   0.00000000
   0.50000000   0.00000000   0.00000000
   0.75000000   0.00000000   0.00000000
   0.00000000   0.25000000   0.00000000
   0.25000000   0.25000000   0.00000000
   0.50000000   0.25000000   0.00000000
   0.75000000   0.25000000   0.00000000
   0.00000000   0.50000000   0.00000000
   0.25000000   0.50000000   0.00000000
   0.50000000   0.50000000   0.00000000
   0.75000000   0.50000000   0.00000000
   0.00000000   0.75000000   0.00000000
   0.25000000   0.75000000   0.00000000
   0.50000000   0.75000000   0.00000000
   0.75000000   0.75000000   0.00000000
   0.00000000   0.00000000   0.25000000
   0.25000000   0.00000000   0.25000000
   0.50000000   0.00000000   0.25000000
   0.75000000   0.00000000   0.25000000
   0.00000000   0.25000000   0.25000000
   0.25000000   0.25000000   0.25000000
   0.50000000   0.25000000   0.25000000
   0.75000000   0.25000000   0.25000000
   0.00000000   0.50000000   0.25000000
   0.25000000   0.50000000   0.25000000
   0.50000000   0.50000000   0.25000000
   0.75000000   0.50000000   0.25000000
   0.00000000   0.75000000   0.25000000
   0.25000000   0.75000000   0.25000000
   0.50000000   0.75000000   0.25000000
   0.75000000   0.75000000   0.25000000
   0.00000000   0.00000000   0.50000000
   0.25000000   0.00000000   0.50000000
   0.50000000   0.00000000   0.50000000
   0.75000000   0.00000000   0.50000000
   0.00000000   0.25000000   0.50000000
   0.25000000   0.25000000   0.50000000
   0.50000000   0.25000000   0.50000000
   0.75000000   0.25000000   0.50000000
   0.00000000   0.50000000   0.50000000
   0.25000000   0.50000000   0.50000000
   0.75000000   0.50000000   0.50000000
   0.00000000   0.75000000   0.50000000
   0.25000000   0.75000000   0.50000000
   0.50000000   0.75000000   0.50000000
   0.75000000   0.75000000   0.50000000
   0.00000000   0.00000000   0.75000000
   0.25000000   0.00000000   0.75000000
   0.50000000   0.00000000   0.75000000
   0.75000000   0.00000000   0.75000000
   0.00000000   0.25000000   0.75000000
   0.25000000   0.25000000   0.75000000
   0.50000000   0.25000000   0.75000000
   0.75000000   0.25000000   0.75000000
   0.00000000   0.50000000   0.75000000
   0.25000000   0.50000000   0.75000000
   0.50000000   0.50000000   0.75000000
   0.75000000   0.50000000   0.75000000
   0.00000000   0.75000000   0.75000000
   0.25000000   0.75000000   0.75000000
   0.50000000   0.75000000   0.75000000
   0.75000000   0.75000000   0.75000000
   0.12500000   0.12500000   0.12500000
   0.37500000   0.12500000   0.12500000
   0.62500000   0.12500000   0.12500000
   0.87500000   0.12500000   0.12500000
   0.12500000   0.37500000   0.12500000
   0.37500000   0.37500000   0.12500000
   0.62500000   0.37500000   0.12500000
   0.87500000   0.37500000   0.12500000
   0.12500000   0.62500000   0.12500000
   0.37500000   0.62500000   0.12500000
   0.62500000   0.62500000   0.12500000
   0.87500000   0.62500000   0.12500000
   0.12500000   0.87500000   0.12500000
   0.37500000   0.87500000   0.12500000
   0.62500000   0.87500000   0.12500000
   0.87500000   0.87500000   0.12500000
   0.12500000   0.12500000   0.37500000
   0.37500000   0.12500000   0.37500000
   0.62500000   0.12500000   0.37500000
   0.87500000   0.12500000   0.37500000
   0.12500000   0.37500000   0.37500000
   0.37500000   0.37500000   0.37500000
   0.62500000   0.37500000   0.37500000
   0.87500000   0.37500000   0.37500000
   0.12500000   0.62500000   0.37500000
   0.37500000   0.62500000   0.37500000
   0.62500000   0.62500000   0.37500000
   0.87500000   0.62500000   0.37500000
   0.12500000   0.87500000   0.37500000
   0.37500000   0.87500000   0.37500000
   0.62500000   0.87500000   0.37500000
   0.87500000   0.87500000   0.37500000
   0.12500000   0.12500000   0.62500000
   0.37500000   0.12500000   0.62500000
   0.62500000   0.12500000   0.62500000
   0.87500000   0.12500000   0.62500000
   0.12500000   0.37500000   0.62500000
   0.37500000   0.37500000   0.62500000
   0.62500000   0.37500000   0.62500000
   0.87500000   0.37500000   0.62500000
   0.12500000   0.62500000   0.62500000
   0.37500000   0.62500000   0.62500000
   0.62500000   0.62500000   0.62500000
   0.87500000   0.62500000   0.62500000
   0.12500000   0.87500000   0.62500000
   0.37500000   0.87500000   0.62500000
   0.62500000   0.87500000   0.62500000
   0.87500000   0.87500000   0.62500000
   0.12500000   0.12500000   0.87500000
   0.37500000   0.12500000   0.87500000
   0.62500000   0.12500000   0.87500000
   0.87500000   0.12500000   0.87500000
   0.12500000   0.37500000   0.87500000
   0.37500000   0.37500000   0.87500000
   0.62500000   0.37500000   0.87500000
   0.87500000   0.37500000   0.87500000
   0.12500000   0.62500000   0.87500000
   0.37500000   0.62500000   0.87500000
   0.62500000   0.62500000   0.87500000
   0.87500000   0.62500000   0.87500000
   0.12500000   0.87500000   0.87500000
   0.37500000   0.87500000   0.87500000
   0.62500000   0.87500000   0.87500000
   0.87500000   0.87500000   0.87500000

For the core-hole calculation, the atom containing the core hole needs to be a separate species with a single atom. To minimize the interaction between core holes in the neighboring cells, the supercell needs to be large enough. To get a feeling for that, we will carry out convergence tests with respect to the supercell size.

INCAR.2x2x2


# LiCl
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 88

# SCH calculation
ICORELEVEL = 2
CH_LSPEC = .TRUE.
CH_SIGMA = 0.3
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 8

INCAR.3x3x3


Click to see the reveal INCAR.3x3x3!
# LiCl
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 272

# SCH calculation
ICORELEVEL = 2
CH_LSPEC = .TRUE.
CH_SIGMA = 0.3
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 27

INCAR.4x4x4


Click to see the reveal INCAR.4x4x4!
# LiCl
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 648

# SCH calculation
ICORELEVEL = 2
CH_LSPEC = .TRUE.
CH_SIGMA = 0.3
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 64

INCAR.no_CH


Click to see the reveal INCAR.no_CH!
# LiCl
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 648

# SCH calculation
ICORELEVEL = 1
CH_LSPEC = .TRUE.
CH_SIGMA = 0.3
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 64

INCAR.step1_CH_PARCHG


Click to see the reveal INCAR.step1_CH_PARCHG!
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 648

# SCH calculation
ICORELEVEL = 2
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1

INCAR.step1_noCH_PARCHG


Click to see the reveal INCAR.step1_noCH_PARCHG!
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 648

# SCH calculation
ICORELEVEL = 1
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1

INCAR.step2_CH_PARCHG


Click to see the reveal INCAR.step2_CH_PARCHG!
ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 88

ICORELEVEL = 2
CH_LSPEC = .TRUE.
CH_SIGMA = 0.3
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 8

INCAR.step2_noCH_PARCHG


Click to see the reveal INCAR.step2_noCH_PARCHG!
LPARD = .TRUE.
LPARDH5 = .TRUE.
IBAND = 257

ISMEAR = 0
SIGMA = 0.05
LREAL = A
ENCUT = 300
NBANDS = 648

# SCH calculation
ICORELEVEL = 1
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1

We will use the final-state approximation (ICORELEVEL=2) [Phys. Rev. B 63 (2001) 205419]. CLNT selects the species for which the core hole will be calculated. In our calculations, we always choose one atom for that species, so that there is only one core hole in the supercell. CLN, CLL and CLZ select the main quantum number, angular quantum number and electron count of the excited core atom. CH_NEDOS selects the number of frequency (energy) grid points on the x-axis in the calculation of the dielectric function within core-hole calculations. CH_AMPLIFICATION is used to scale/amplify the spectrum. We will use the number of Li atoms in the supercell for CH_AMPLIFICATION. The number of bands NBANDS needs to be selected such that there are enough unoccupied bands present to excite into.

KPOINTS


K-Points
 0
Monkhorst Pack
 1 1 1
 0  0  0

For this example we use a single $\textbf{k}$-point, but the number of $\textbf{k}$-points is also a quantity that needs to be converged.


POTCAR_Li POTCAR_Cl


Pseudopotentials of Li and Cl.


1.3 Calculation

Open a terminal, navigate to this example's directory

cd $TUTORIALS/XAS/e01_SCH

and run the following commands

cat POTCAR_Li POTCAR_Li POTCAR_Cl > POTCAR
bash ./run_conv.sh

With the cat command, we first make a combined POTCAR for the separate species. In the supercell core hole calculations, the atom whose core is excited needs to be treated as a separate species, e.g., LiCl with 8 Li and 8 Cl will become 1 7 8 (Li Li Cl) for the K edge of Li. Hence, we also need a POTCAR for the third species.

Click to see run_conv.sh!
for i in "2x2x2" "3x3x3" "4x4x4"
do
   cp INCAR.$i INCAR
   cp POSCAR.$i POSCAR

   rm -f CHG*
   rm -f WAVECAR
   if [ ! -d ./SC$i ]; then
      mkdir SC"$i"
   fi

   mpirun -np 4 vasp_gam
   cp vaspout.h5 SC"$i"/
done

The run_conv.sh script is used to investigate the convergence of the spectra with respect to supercell size, the above script will run 3 calculations with increasing size of the supercell (2x2x2, 3x3x3, and 4x4x4, which correspond to 16, 54, and 128 atoms, respectively). The respective POSCAR and INCAR files have already been prepared. NBANDS is chosen for each cell such that it doubles the number of occupied bands. CH_AMPLIFICATION is chosen such that it scales the spectrum by the number of atoms in the cell. The amplification is not a mandatory step, but we use it to make the intensities of the spectra comparable because the spectrum is divided by the volume of the supercell, so the overall intensity would rapidly decrease without rescaling.

To plot the spectra please run the following commands:

In [2]:
import py4vasp
import numpy as np

sc2 = py4vasp.Calculation.from_path( "./e01_SCH/SC2x2x2" )
sc3 = py4vasp.Calculation.from_path( "./e01_SCH/SC3x3x3" )
sc4 = py4vasp.Calculation.from_path( "./e01_SCH/SC4x4x4" )

(
sc2.dielectric_function.plot("Im(XAS)").label("2x2x2") + 
sc3.dielectric_function.plot("Im(XAS)").label("3x3x3") +
sc4.dielectric_function.plot("Im(XAS)").label("4x4x4") 
)

One can see that the splitting and the relative intensities of the peaks change with increasing cell size. Why are supercells important for core-hole calculations?

Click to see the answer!

Supercells are needed because the interaction of cores holes with its periodic images needs to be minimized.

Increasing the supercell size additionally improves the $\textbf{k}$-point representation of the Brillouin zone. However, this is not the primary reason to use the supercell, since one can also simply increase the number of $\textbf{k}$-points in the calculation. Once the interaction between neighboring core holes is minimized it is cheaper to increase the number of $\textbf{k}$-points for the chosen supercell size than to further increase the supercell size.

1.4 Visualization of core-hole effects

To get an idea how strong the excitonic effects can become in XAS, we will compare core-hole calculations in the final-state approximation (ICORELEVEL=2) to calculations in the initial-state approximation (ICORELEVEL=1). In contrast to the final-state approximation, in the initial-state approximation, the valence electrons are not relaxed with the core hole. Hence, no excitonic effects are incorporated in the calculation.

To run the calculation in the initial state approximation run the following:

bash ./run_noCH.sh

INCAR.noCH is similar to the previous INCAR files except that it set ICORELEVEL=1 instead of 2.

Click to see run_noCH.sh!
for i in "noCH"
do
   cp INCAR.$i INCAR
   cp POSCAR.4x4x4 POSCAR

   rm -f CHG*
   rm -f WAVECAR
   if [ ! -d ./SC$i ]; then
      mkdir SC"$i"
   fi

   mpirun -np 4 vasp_gam
   cp vaspout.h5 SC"$i"/
done

To visualize the spectra both in the final-state and initial-state approximation run the following script:

In [3]:
import py4vasp
import numpy as np

CH = py4vasp.Calculation.from_path( "./e01_SCH/SC4x4x4" )
noCH = py4vasp.Calculation.from_path( "./e01_SCH/SCnoCH" )

(
CH.dielectric_function.plot("Im(XAS)").label("CH") + 
noCH.dielectric_function.plot("Im(XAS)").label("noCH") 
)

We not only see a shift to lower energies but also a stronger localization of the states, especially visible in the first peak. All due to the electron-hole interactions (excitonic effects).

To further demonstrate the effects of the core hole we will look at the partial charge density of the lowest conduction band in the presence and absence of the core hole. For that run the following script:

bash ./run_parchg.sh
Click to see run_parchg.sh!
cp POSCAR.4x4x4 POSCAR
for i in "CH_PARCHG" "noCH_PARCHG"
do
   rm -f CHG*
   rm -f WAVECAR
   if [ ! -d ./SC$i ]; then
      mkdir SC"$i"
   fi

   cp INCAR.step1_$i INCAR
   mpirun -np 4 vasp_gam

   cp INCAR.step2_$i INCAR
   mpirun -np 4 vasp_gam

   cp vaspout.h5 SC"$i"/
done

To plot the 3d charge density of the first unoccupied state with a fully relaxed core hole execute the following:

In [4]:
import py4vasp

ch = py4vasp.Calculation.from_path( "./e01_SCH/SCCH_PARCHG")

view = ch.partial_density.to_ngl(isolevel=1)
c = view.trajectory_0
c.update_ball_and_stick(opacity=0.4)
view

We see that the charge density is localized around the atom holding the core hole at (0.5 0.5 0.5).

To plot the charge density without the core hole execute the following:

In [5]:
import py4vasp

noch = py4vasp.Calculation.from_path( "./e01_SCH/SCnoCH_PARCHG")

view = noch.partial_density.to_ngl(isolevel=1)
c = view.trajectory_0
c.update_ball_and_stick(opacity=0.4)
view

Here we see that the first unoccupied state is fully delocalized. By lowering the isolevel the delocalization can be visualized more prominently.

1.5 Questions

  1. Why can the interactions in XAS be restricted to a single site?
  2. Why do we need to increase NBANDS?
  3. Why do we need to use supercells in the calculation of spectra involving core holes?
  4. What are CLNT, CLN, CLL and CLZ in the INCAR file doing?
  5. Why are excitonic effects so important in XAS?

2 Full core-hole calculations

At the end of this tutorial you will be able to:

  • Perform full core-hole calculations.
  • Know how to present calculated spectra with respect to experiment

2.1 Task

Compute the XAS spectrum using the full core-hole method (FCH) and excited electron core-hole method.

In the supercell core-hole method from the previous chapter, a single electron was removed from the core and added to the conduction bands. This is done automatically if one selects ICORELEVEL=2 and CLZ=1. This method is also referred to as the excited electron and core-hole (XCH) method [Phys. Rev. Lett. 96 (2006) 215502]. There is also the possibility to place the electron back into the background charge. This way, the excited electron distribution in the self-consistent calculations is omitted. This method is referred to as the full core-hole (FCH) method [J. Chem. Phys. 120 (2004) 8632]. In many cases, FCH gives better results than XCH compared to experiment. A detailed description of the reason for the superiority of FCH compared to XCH is given in part V of Unzog et. al [Phys. Rev. B 106 (2022) 155133].

2.2 Input

The input files to run this example are prepared at $TUTORIALS/XAS/e02_FCH.

VASP looks in the current directory for four main input files, i.e., POSCAR, INCAR, KPOINTS, and POTCAR. Check them out!

INCAR.FCH


# LiCl
ISMEAR = 0
SIGMA = 0.05
LREAL = A
NBANDS = 648
ENCUT = 300

# SCH calculation
ICORELEVEL = 2
CH_LSPEC = .TRUE.
CH_SIGMA = 0.1
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 64

NCORE = 2

NELECT = 512

INCAR.XCH


# LiCl
ISMEAR = 0
SIGMA = 0.05
LREAL = A
NBANDS = 648
ENCUT = 300

# SCH calculation
ICORELEVEL = 2
CH_LSPEC = .TRUE.
CH_SIGMA = 0.1
CLNT = 1
CLN = 1
CLL = 0
CLZ = 1
CH_NEDOS = 5000
CH_AMPLIFICATION = 64

NCORE = 2

POSCAR


Click to see the reveal the POSCAR!
LiCl
   5.10600000000000
    0.00000000   2.00000000   2.00000000
    2.00000000   0.00000000   2.00000000
    2.00000000   2.00000000   0.00000000
   Li Li   Cl
   1 63   64
Direct
   0.50000000   0.50000000   0.50000000
   0.00000000   0.00000000   0.00000000
   0.25000000   0.00000000   0.00000000
   0.50000000   0.00000000   0.00000000
   0.75000000   0.00000000   0.00000000
   0.00000000   0.25000000   0.00000000
   0.25000000   0.25000000   0.00000000
   0.50000000   0.25000000   0.00000000
   0.75000000   0.25000000   0.00000000
   0.00000000   0.50000000   0.00000000
   0.25000000   0.50000000   0.00000000
   0.50000000   0.50000000   0.00000000
   0.75000000   0.50000000   0.00000000
   0.00000000   0.75000000   0.00000000
   0.25000000   0.75000000   0.00000000
   0.50000000   0.75000000   0.00000000
   0.75000000   0.75000000   0.00000000
   0.00000000   0.00000000   0.25000000
   0.25000000   0.00000000   0.25000000
   0.50000000   0.00000000   0.25000000
   0.75000000   0.00000000   0.25000000
   0.00000000   0.25000000   0.25000000
   0.25000000   0.25000000   0.25000000
   0.50000000   0.25000000   0.25000000
   0.75000000   0.25000000   0.25000000
   0.00000000   0.50000000   0.25000000
   0.25000000   0.50000000   0.25000000
   0.50000000   0.50000000   0.25000000
   0.75000000   0.50000000   0.25000000
   0.00000000   0.75000000   0.25000000
   0.25000000   0.75000000   0.25000000
   0.50000000   0.75000000   0.25000000
   0.75000000   0.75000000   0.25000000
   0.00000000   0.00000000   0.50000000
   0.25000000   0.00000000   0.50000000
   0.50000000   0.00000000   0.50000000
   0.75000000   0.00000000   0.50000000
   0.00000000   0.25000000   0.50000000
   0.25000000   0.25000000   0.50000000
   0.50000000   0.25000000   0.50000000
   0.75000000   0.25000000   0.50000000
   0.00000000   0.50000000   0.50000000
   0.25000000   0.50000000   0.50000000
   0.75000000   0.50000000   0.50000000
   0.00000000   0.75000000   0.50000000
   0.25000000   0.75000000   0.50000000
   0.50000000   0.75000000   0.50000000
   0.75000000   0.75000000   0.50000000
   0.00000000   0.00000000   0.75000000
   0.25000000   0.00000000   0.75000000
   0.50000000   0.00000000   0.75000000
   0.75000000   0.00000000   0.75000000
   0.00000000   0.25000000   0.75000000
   0.25000000   0.25000000   0.75000000
   0.50000000   0.25000000   0.75000000
   0.75000000   0.25000000   0.75000000
   0.00000000   0.50000000   0.75000000
   0.25000000   0.50000000   0.75000000
   0.50000000   0.50000000   0.75000000
   0.75000000   0.50000000   0.75000000
   0.00000000   0.75000000   0.75000000
   0.25000000   0.75000000   0.75000000
   0.50000000   0.75000000   0.75000000
   0.75000000   0.75000000   0.75000000
   0.12500000   0.12500000   0.12500000
   0.37500000   0.12500000   0.12500000
   0.62500000   0.12500000   0.12500000
   0.87500000   0.12500000   0.12500000
   0.12500000   0.37500000   0.12500000
   0.37500000   0.37500000   0.12500000
   0.62500000   0.37500000   0.12500000
   0.87500000   0.37500000   0.12500000
   0.12500000   0.62500000   0.12500000
   0.37500000   0.62500000   0.12500000
   0.62500000   0.62500000   0.12500000
   0.87500000   0.62500000   0.12500000
   0.12500000   0.87500000   0.12500000
   0.37500000   0.87500000   0.12500000
   0.62500000   0.87500000   0.12500000
   0.87500000   0.87500000   0.12500000
   0.12500000   0.12500000   0.37500000
   0.37500000   0.12500000   0.37500000
   0.62500000   0.12500000   0.37500000
   0.87500000   0.12500000   0.37500000
   0.12500000   0.37500000   0.37500000
   0.37500000   0.37500000   0.37500000
   0.62500000   0.37500000   0.37500000
   0.87500000   0.37500000   0.37500000
   0.12500000   0.62500000   0.37500000
   0.37500000   0.62500000   0.37500000
   0.62500000   0.62500000   0.37500000
   0.87500000   0.62500000   0.37500000
   0.12500000   0.87500000   0.37500000
   0.37500000   0.87500000   0.37500000
   0.62500000   0.87500000   0.37500000
   0.87500000   0.87500000   0.37500000
   0.12500000   0.12500000   0.62500000
   0.37500000   0.12500000   0.62500000
   0.62500000   0.12500000   0.62500000
   0.87500000   0.12500000   0.62500000
   0.12500000   0.37500000   0.62500000
   0.37500000   0.37500000   0.62500000
   0.62500000   0.37500000   0.62500000
   0.87500000   0.37500000   0.62500000
   0.12500000   0.62500000   0.62500000
   0.37500000   0.62500000   0.62500000
   0.62500000   0.62500000   0.62500000
   0.87500000   0.62500000   0.62500000
   0.12500000   0.87500000   0.62500000
   0.37500000   0.87500000   0.62500000
   0.62500000   0.87500000   0.62500000
   0.87500000   0.87500000   0.62500000
   0.12500000   0.12500000   0.87500000
   0.37500000   0.12500000   0.87500000
   0.62500000   0.12500000   0.87500000
   0.87500000   0.12500000   0.87500000
   0.12500000   0.37500000   0.87500000
   0.37500000   0.37500000   0.87500000
   0.62500000   0.37500000   0.87500000
   0.87500000   0.37500000   0.87500000
   0.12500000   0.62500000   0.87500000
   0.37500000   0.62500000   0.87500000
   0.62500000   0.62500000   0.87500000
   0.87500000   0.62500000   0.87500000
   0.12500000   0.87500000   0.87500000
   0.37500000   0.87500000   0.87500000
   0.62500000   0.87500000   0.87500000
   0.87500000   0.87500000   0.87500000     

KPOINTS


k-mesh
 0
Gamma
 1 1 1
 0 0 0

POTCAR


Pseudopotentials of Li and Cl.


2.3 Calculation

Navigate to this example's directory:

cd $TUTORIALS/XAS/e02_FCH

For an FCH calculation, we need to treat the excited electron as a homogeneous background charge. Since VASP automatically compensates charged cells by the background charge, one just needs to lower the number of electrons by one using NELECT. For that, we first need to run VASP in the dry mode:

cp INCAR.XCH INCAR
mpirun -np 4 vasp_std --dry-run

Then look for the number of electrons in the OUTCAR:

grep NELECT OUTCAR

The output should show: NELECT = 513.0000 total number of electrons

Now add the followin line to INCAR.FCH:

NELECT = 512

After that run the job script:

bash ./run_job.sh

This script runs both an FCH and XCH job on a 4x4x4 supercell with a singe $\textbf{k}$-point.

Click to see the reveal the run_job.sh script!
for i in "FCH" "XCH"
do
   cp INCAR.$i INCAR

   rm -f CHG*
   rm -f WAVECAR
   if [ ! -d ./SC_$i ]; then
      mkdir SC_"$i"
   fi

   mpirun -np 4 vasp_gam
   cp * SC_"$i"/
done

We want to not only compare the two spectra with each other but also with experiment. The energies of the core electrons are always significantly off compared to experiment. Therefore, the spectra need to be shifted. It is also common to shift the first peak of the experiment to zero and to shift the calculated spectra to experiment such that the maxima of the first peaks overlap (this is arbitrary, one can also choose another peak to overlap).

Additionally, the intensities of the spectra are also very often reported as arbitrary units, since many parameters such as spectrometer broadening are not known in the calculations. For that, calculated spectra are usually scaled such that the peak maxima of the first peak (again arbitrarily chosen) of experiment and calculation have the same height.

Effectively, we look at fingerprints in the XAS spectrum and not absolute position and intensities.

Let's first save the directories for later:

cp -r SC_FCH/ SC_FCH_0.1
cp -r SC_XCH/ SC_XCH_0.1

Let's plot the spectra together with experiment:

In [6]:
import py4vasp
import numpy as np
import os

fch = py4vasp.Calculation.from_path( "./e02_FCH/SC_FCH_0.1" )
xch = py4vasp.Calculation.from_path( "./e02_FCH/SC_XCH_0.1" )

x_exp, y_exp = np.loadtxt(os.path.expanduser("./e02_FCH/expt.dat")).T

fchplot = fch.dielectric_function.plot("Im(XAS)").label("FCH")
xchplot = xch.dielectric_function.plot("Im(XAS)").label("XCH")


fig = (fchplot + xchplot).to_plotly()
fig.add_scatter(x=x_exp, y=y_exp, line_width=3, name="Expt.")
fig.show()

We see that the peaks of the calculated spectra are much more narrow than the experimental peaks. This is because we have chosen a quite small broadening of 0.1 eV. To make the calculation more easily comparable to experiment, the spectra are often presented with a peak broadening that matches experiment. Ideally, matching the broadening is done in a pure post-processing step. For the simplicity of this tutorial, we will do it by recalculating the dielectric function in VASP with a larger broadening. We do not want to redo the whole self-consistent-field cycle of the electronic minimization, instead, we can reuse the WAVECAR files that we have already calculated.

To rerun the FCH calculation with a larger broadening, do the following:

cd $TUTORIALS/XAS/e02_FCH/SC_FCH

Change the broadening CH_SIMGA in the INCAR file to:

CH_SIGMA = 0.5

Then run the calculation:

mpirun -np 4 vasp_gam

Repeat the same for the XCH calculations:

cd $TUTORIALS/XAS/e02_FCH/SC_XCH

Change the broadening CH_SIMGA in the INCAR file to:

CH_SIGMA = 0.5

Run the calcution:

mpirun -np 4 vasp_gam

Plot the spectra again:

In [7]:
import py4vasp
import numpy as np
import os

fch = py4vasp.Calculation.from_path( "./e02_FCH/SC_FCH" )
xch = py4vasp.Calculation.from_path( "./e02_FCH/SC_XCH" )

x_exp, y_exp = np.loadtxt(os.path.expanduser("./e02_FCH/expt.dat")).T

fchplot = fch.dielectric_function.plot("Im(XAS)").label("FCH")
xchplot = xch.dielectric_function.plot("Im(XAS)").label("XCH")


fig = (fchplot + xchplot).to_plotly()
fig.add_scatter(x=x_exp, y=y_exp, line_width=3, name="Expt.")
fig.show()

Now we see that the peaks are more easily comparable to experiment. It is very hard to quantitatively reproduce the correct broadening of experiment purely from theory since many factors, e.g., energy-dependent broadening coming from the spectrometer itself, contribute to the spectrum that are not explicitly simulated. Hence, the type of broadening (Gaussian, Lorentzian, constant, energy-dependent, etc.) can be freely chosen, with many different forms employed in literature.

Now let's go further along with the comparison of the calculated spectra. Let's shift the spectra to compare with experiment. We can rescale the spectra to make the first peaks align. We have done this by shifting and rescling the first peak with the following:

fchplot.series[0].x += -58.347
xchplot.series[0].x += -59.369
fchplot.series[0].y *= 0.276/0.166
xchplot.series[0].y *= 0.276/0.089
In [8]:
import py4vasp
import numpy as np
import os

fch = py4vasp.Calculation.from_path( "./e02_FCH/SC_FCH" )
xch = py4vasp.Calculation.from_path( "./e02_FCH/SC_XCH" )

x_exp, y_exp = np.loadtxt(os.path.expanduser("./e02_FCH/expt.dat")).T

fchplot = fch.dielectric_function.plot("Im(XAS)").label("FCH")
xchplot = xch.dielectric_function.plot("Im(XAS)").label("XCH")

fchplot.series[0].x += -58.347
xchplot.series[0].x += -59.369
fchplot.series[0].y *= 0.276/0.166
xchplot.series[0].y *= 0.276/0.089

fig = (fchplot + xchplot).to_plotly()
fig.add_scatter(x=x_exp, y=y_exp, line_width=3, name="Expt.")
fig.update_xaxes(range=[-3, 8])
fig.update_layout(height=600,width=600)
fig.show()

The calculations resemble the experiment, but both the relative peak positions and intensities can be significantly improved by using converged parameters in the calculations. Of course, these calculational parameters would require resources and calculation times that are outside the scope of this tutorial, and we refer the reader to Unzog et. al for the converged calculations [Phys. Rev. B 106 (2022) 155133].

2.4 Questions

  1. What is the difference between FCH and XCH?
  2. What do we need to do to compare calculated XAS spectra to experiment?

Good job! You have finished Part 1!