by Jürgen Spitaler, Lorenzo Pardini, & Pasquale Pavone for exciting oxygen
Purpose: This tutorial gives a basic introduction into electronic-structure calculations. It explains how to set up and execute a simple exciting calculation, using elemental Ag as example. It is described how to prepare the input, how to run the calculation, and how to analyze the output. In addition, it is shown how basic properties like the density of states and the electronic band structure can be calculated.
0. General preparation
Define relevant environment variables
Read the following paragraph before starting with the rest of this tutorial!
Before starting, be sure that the relevant shell variables are defined as specified in How to set environment variables for tutorials scripts.
From now on the symbol $ will indicate the shell prompt.
Units in exciting
By default, all quantities in the exciting code are given in atomic units: Energies in Hartree, lengths in Bohr, etc. (see Input Reference). In case other units are desirable, they can be converted using templates as a post-processing to exciting's standard output.
1. Electronic structure of silver: Ground-state calculation
The first step of any density-functional calculation is the determination of the ground-state total energy and electron density.
The starting point of a ground-state calculation is the crystal structure, only. At the beginning of a ground-state calculation, an initial electron density is generated, which is obtained from a superposition of atomic densities. Thus, this initial electron density lacks the interaction between atoms and is normally a rather crude approximation of the density.
Then, the calculation iteratively goes through the following steps:
- Determine the potential from the electron density.
- Solve the Kohn-Sham (KS) equations to get the eigenfunctions and eigenvalues as well as the total energy.
- Calculate the electron density from the KS eigenfunctions.
- Create a new charge density, mixing the electron density from the current iteration with the ones of previous iteration (to ensure a good convergence behavior).
- Start again with (1).
Such a sequence of steps is usually called an iteration. The code will repeat such iterations, until the potential (or total energy, or charge density, …) obtained at the end of the last iteration is consistent with the one of the previous iterations. Thus, this kind of calculations is often called self-consistent field (SCF) calculation, and an iteration is often referred to as an SCF cycle.
To prepare your calculation, create a new, empty directory named Ag somewhere on your filesystem.
$ mkdir Ag
$ cd Ag
In this directory, save the following lines as input.xml.
<input> <title>Electronic structure of silver</title> <structure speciespath="$EXCITINGROOT/species"> <crystal scale="7.7201"> <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="Ag.xml" chemicalSymbol="Ag"> <atom coord="0.0 0.0 0.0" /> </species> </structure> <groundstate ngridk="8 8 8" outputlevel="normal" xctype="GGA_PBE_SOL"> </groundstate> </input>
N.B.: Do not forget to replace in the input.xml the string "$EXCITINGROOT" by the actual value of the environment variable $EXCITINGROOT using the command
$ SETUP-excitingroot.sh
If the visualization program XCrySDen is set up appropriately (find here how to do this: XCrySDen Setup for exciting), you can visualize the structure in the exciting input file by executing
$ xcrysden --exciting input.xml &
Executing xcrysden this way will write some (non relevant) output on the screen. If you want to skip this output use instead
$ xcrysden --exciting input.xml >/dev/null 2>&1 &
After this, start the ground-state calculation by executing the following command in the Ag directory:
$ time exciting_smp &
Using the optional time command, the elapsed time will be displayed on the screen at the end of the execution. If you wish, you can follow the progress by displaying the output to INFO.OUT with the command
$ tail -f INFO.OUT
which needs to be killed after exciting has stopped using Ctrl+C. The calculation should roughly take a few seconds. During the calculation, output files are created, which contain all kind of information on your material system and on the calculation. Some of the output files are already created at the beginning of the calculation and will not be changed anymore during the run. Output files created by exciting in a standard ground-state calculation are described in How to start an exciting calculation.
2. Electronic structure of silver: Density of states
After you have completed the ground-state run and have obtained the corresponding total energy, you can go for more properties of the system. One of the most fundamental ones is the density of states (DOS). The DOS gives you information on the energy levels in your system, or — more precisely — about how many electronic states there are at any given energy.
To calculate it, you need to do the following simple modifications in input.xml (for more details, see Input Reference):
- add the attribute do = "skip" to the element groundstate;
- add the element properties after the groundstate element;
- insert the subelement dos into the element properties.
- add some attributes to the element dos as shown below.
The corresponding part of the input.xml should now look like this:
... <groundstate do="skip" ngridk="8 8 8" outputlevel="normal" xctype="GGA_PBE_SOL"> </groundstate> <properties> <dos nsmdos="2" ngrdos="300" nwdos="1000" winddos="-0.3 0.3"> </dos> </properties> ...
Here, the attributes of the element dos have the following meaning (see here for more details):
- nsmdos indicates the type of smearing for the resulting DOS.
- ngrdos is the effective k-point mesh size to be used for Brillouin-zone integration.
- nwdos is number of energy points in the DOS.
- winddos indicates the energy window, given in Hartrees (Ha), for the DOS plot.
Then, execute exciting_smp again on the command line:
$ time exciting_smp &
This time, the program will produce the following files:
|
To visualize the DOS, execute
$ PLOT-dos.py
The script PLOT-dos.py is a useful general tool for plotting electronic and phonon density of states. It allows for a bunch of different arguments which are fully described in The python script "PLOT-dos.py". This script produces the PNG file PLOT.png. You can visualize this file with standard tools, the result should look like this:
Please note:
- Here, energies are relative to the Fermi energy, i.e., EF which corresponds to the energy zero.
- As a default, energies in this DOS plot are given in electronvolts (eV) as it is used in most of the literature.
- If you desire to plot energies in Hartrees, use the following command instead
$ PLOT-dos.py -eu Ha
Exercise
- We were using the attributes do = "skip" for the element groundstate for generating the DOS after the ground-state SCF run. Find out why, by searching for the element groundstate in Input Reference and proceeding to its attribute do.
3. Electronic structure of silver: Band structure
Now, we are ready for a more detailed view on the electronic structure: The band structure. In addition to the energy of each state, the band structure shows the dependence of the energy eigenvalues on the coordinates in k-space.
To calculate the band structure of silver, insert the subelement bandstructure in the element properties with the following specifications:
... <properties> <bandstructure> <plot1d> <path steps="100"> <point coord="1.0 0.0 0.0" label="Gamma"/> <point coord="0.625 0.375 0.0" label="K"/> <point coord="0.5 0.5 0.0" label="X"/> <point coord="0.0 0.0 0.0" label="Gamma"/> <point coord="0.5 0.0 0.0" label="L"/> </path> </plot1d> </bandstructure> </properties> ...
As you may have realized, we have removed the subelement dos now. The new element bandstructure allows for the calculation of energy eigenvalues as a function of k. Inside this element, the subelement plot1d creates a line plot where the abscissa is taken along a path consisting of straight lines joining the points defined by each element point. The coordinates of these points are given in terms of the basis vectors of the reciprocal lattice. The number of points along the full path, for which the ordinate(s) of the line plot (in this case the KS energies) are calculated, is established by the element path.
Here, we choose a simple path containing the directions in reciprocal space with the highest symmetry. Standard paths in reciprocal space for general crystals can be found in Setyawan & Curtarolo, Comp. Mat. Sci. 49, 299-312 (2010). For a face-centered cubic crystal, as in the example of this tutorial, the path is visualized in the following figure.In order to produce the electronic band-structure, execute now exciting_smp again on the command line:
$ time exciting_smp &
To visualize the band-structure (which is written inside the file BAND.OUT), you can use the script PLOT-band-structure.py.
$ PLOT-band-structure.py
The script PLOT-band-structure.py is a useful general tool for plotting electronic and phonon band-structures. It allows for a bunch of different arguments which are fully described in The python script "PLOT-band-structure.py". This script produces the PNG file PLOT.png. You can visualize this file with standard tools, the result should look like this:
By looking at the energy units in this plot, you can notice again that, as a default, electronvolts (eV) are used. We stick to this choice in all the tutorials.
If you wish more details on the energy region close to the Fermi Energy EF, you can add in the command line a minimum and maximum energy.
$ PLOT-band-structure.py -e -10 20
This obtains the following image.
Exercises
- Use the Bilbao Crystallographic Server -> Space-group symmetry -> KVEC to find out about the location of the special k-points within the Brillouin zone. The space group of Ag is 225, Fm-3m. Select Choose to choose the corresponding spacegroup, and then click Brillouin zone to see the Brillouin zone with the special k-points.
- Look at the dispersion of the bands for low energies and high energies:
- What trend do you see relating the band width to the energy?
- How can you explain this trend (think about how the "dispersion" of an isolated atom would look like…)?