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 band structure can be calculated.
0. General preparation
Define relevant shell 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 Tutorial scripts and environment variables.
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: Groundstate calculation
The first step of any density-functional calculation is the determination of the groundstate total energy and electron density.
The starting point of a groundstate calculation is the crystal structure, only. At the beginning of a groundstate calculation, an initial electron density is generated, which is obtained from a superposition of atomic densities. Thus, this initial electron density lacks electron-electron and electron-ion interactions 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 iteration. 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. In this directory, save the following lines as input.xml.
<input> <title>Ag</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"></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
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 executing
$ xcrysden --exciting input.xml
After this, start the groundstate calculation by executing the following command in the Ag directory:
The calculation should roughly take 1 minute. 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. The most important among them are:
Other files are updated or extended in each iteration and contain information about the scf calculation. Here are the most important ones:
With the table above, find out the following properties of your calculation — to do so, find out first in which output files they are contained:
- How many iterations did the calculation go through?
- What is the total energy for the first iteration (which started from the superposition of atomic electron densities), and of the converged calculation (last iteration)?
- What was the change in total energy between the
- first two iterations?
- last two iterations?
- What is the Fermi energy of the system?
- How many occupied valence bands are there in the system?
- How much charge is there inside the muffin-tin sphere, and how much is found in the interstitial region?
2. Electronic structure of silver: Density of states
After you have completed the groundstate 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 xml-element groundstate;
- add the element properties after the groundstate element;
- insert the subelement dos into the element properties;
- add the attribute nsmdos="1" to the element dos.
The corresponding part of the input.xml should now look like this:
... <groundstate ngridk="8 8 8" do="skip"> </groundstate> <properties> <dos nsmdos="1"> </dos> </properties> ...
Then execute excitingser again on the command line:
This time, the program will produce the following files:
To visualize the DOS, execute
$ xsltproc $EXCITINGVISUAL/xmldos2grace.xsl dos.xml > Ag_dos.agr
This produces the file Ag_dos.agr for xmgrace. Open it with the command
$ xmgrace Ag_dos.agr
This will open the plotting tool xmgrace and display the total and partial densities of states. The units in this plot are
- Energy (Hartree) for the x axis
- DOS (states/unit cell/Hartree) for the y axis.
Please note: In the DOS plots, energies are relative to the Fermi energy, i.e., EF=0 Ha.
You can use xmgrace to change the plot appearance in any way you want, zoom in to see details of the DOS, or produce a figure in any format you like (ps, jpg, png, etc. …).
The DOS plot, by default, contains a partial DOS for any quantum number m and l, in this case up to l=4, i.e., up to the f states. Since the figure is crowded with this information, and in silver no f states are present, it is convenient to hide the latter.
- Do the following modifications inside xmgrace (see Xmgrace: A Quickstart for help …):
- In order to "tidy up" the plot, hide all curves for quantum numbers l>2.
- Change the x-region of the plot to -0.4 — 0.25.
- Autoscale the x axis.
- Add axes labels.
- Add a title.
- Increase the line-width of the DOS curve to 3.
- Change the colour of the DOS curve to red.
- Add a legend.
- Generate the file Ag_dos.png.
- We were using the attributes do="skip" for the element groundstate for generating the DOS after the groundstate SCF run. Find out why, by searching for the element groundstate in Input Reference and proceeding to its attribute do.
- Check out the electronic configuration of atomic silver. To do so, you can open the file $EXCITINGROOT/species/Ag.xml, and look there for the xml elements atomicState:
- Which is the occupied state with the highest n quantum number, and the highest l quantum number, respectively?
- What about the 4p and the 5p state, respectively—are they occupied in the atomic ground state?
- Considering the plot of total and partial densities of states, answer the following questions:
- What energy range do the occupied 4d states span in bulk silver? (Hint: Hide all other states except the d states to see this clearly.)
- What energy do the 4p states have in bulk Ag? In order to answer this question, you should first get an idea about where to look for them, by considering the corresponding atomic binding energy (see, e.g., the WebElements website -> Electron binding energies). Then you will need to change the attribute winddos of the element dos — check out Input Reference to see why and how this works.
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="0.750 0.500 0.250" label="W" ></point> <point coord="0.500 0.500 0.500" label="L" ></point> <point coord="0.000 0.000 0.000" label="GAMMA"></point> <point coord="0.500 0.500 0.000" label="X" ></point> <point coord="0.750 0.500 0.250" label="W" ></point> <point coord="0.750 0.375 0.375" label="K" ></point> </path> </plot1d> </bandstructure> </properties> ...
As you may have realized, we have removed the subelement dos now.
Now execute excitingser again on the command line:
This makes the code produce the band structure, which is written to bandstructure.xml. To visualize the band structure, execute the following command:
$ xsltproc $EXCITINGVISUAL/xmlband2agr.xsl bandstructure.xml
Now you have produced the xmgrace file Ag_bandstructure.agr, which you can open, visualize and manipulate with xmgrace:
$ xmgrace Ag_bandstructure.agr
- Use the Bilbao Crystallographic Server -> Space Groups Retrieval Tools -> KVEC to find out about the location of the special k-points within the Brillouin zone. The spacegroup 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.
- The band structure of our plot is plotted along the path W -> L -> Γ (Gamma) -> X -> W -> K. In which parts of this path do you find strong or weak dispersion, respectively? Try to explain why by using the Brillouin zone plot from above.
- In xmgrace: Use the autoscale button to see all bands. 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 …)?