Generating and plotting energy bands with lmf
This tutorial demonstrates how to plot bands. This is done for silicon starting from a self-consistent LDA density. Plotting bands with color weights is given an additional exercise. There is a corresponding tutorial for ASA.
Spectral functions are the analog of energy bands for interacting hamiltonians such as generated by GW or Dynamical Mean Field Theory. See this tutorial to draw the spectral function for Fe from a GW calculation.
The following steps require init.si and syml.si.
blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc
lmf si --rs=1,0 -vnit=1 --band~fn=syml #calculate bands
echo -6,6,5,10 | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si #set up plotting
fplot -f plot.plbnds && gs fplot.ps #plot and view
Tutorial
The starting point is a self-consistent LDA calculation, you may want to review the DFT tutorial for silicon. Copy the contents of the box below to file init.si.
LATTICE ALAT=10.26 PLAT= 0.00000000 0.50000000 0.50000000 0.50000000 0.00000000 0.50000000 0.50000000 0.50000000 0.00000000 # pos means cartesian coordinates, units of alat SITE ATOM=Si POS= 0.00000000 0.00000000 0.00000000 ATOM=Si POS= 0.25000000 0.25000000 0.25000000
The following command constructs an input file and generates a self-consistent density in the LDA.
$ blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc
To plot the band structure you need to specify the symmetry lines. Create file syml.si with the following lines:
41 .5 .5 .5 0 0 0 L to G 41 0 0 0 1 0 0 G to X 21 1 0 0 1 .5 0 X to W 41 1 .5 0 0 0 0 W to G 0 0 0 0 0 0 0
Each line specifies a line segment in k-space. Consider the first line above, which is the line between the high-symmetry points L and . The first entry ( 41 ) specifies the number of k points along the line segment. .5 .5 .5 and 0 0 0 are xyz coordinates of the line segment connecting the L and points in units of , with the lattice constant. The last line indicates the end of the file.
To generate the bands run lmf with the --band switch. Note that lmf si
and lmf ctrl.si
do the same thing (see DFT tutorial for silicon for more).
$ lmf si --rs=1,0 -vnit=1 --band~fn=syml #calculate bands
The switches perform the following functions:
- --rs=1,0 specifies that the restart file rst.si (containing the density) is to be read but not written to.
- −vnit=1 sets preprocessor variable nit to 1, which controls the number of iterations in ctrl.si.
- --band tells lmf to generate energy bands, reading symmetry lines from syml.si.
lmf writes energy bands to file bnds.si. Its syntax is explained here. The first line (header) reads
26 0.18551 0
and specifies the number of bands, the Fermi level (in Rydbergs) and a number to do with plotting with color weights (see additional exercises). Generally the Fermi level should come out not too far from zero. This has to do with the choice of reference potential (a constant potential shift cannot change the electronic structure).
Now plot the bands by running the following two commands:
$ echo -6,6,5,10 | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si #set up plotting
$ fplot -f plot.plbnds #create fplot.ps
The first line uses the plbnds utility to do some data conversion and generate a script for the graphics package fplot. More details can be found in the plbnds documentation page and the fplot documentation page. Arguments to this line have the following meaning:
- echo -6,6,5,10 becomes standard input for plbnds. It reads the energy window for the bands from stdin.
- -fplot generates data files and a script for the fplot utility
- -ef=0 shifts the fermi energy to zero
- -scl=13.6 scales the band energies by 13.6, converts from Ry to eV
- -lbl supplies the symmetry point labels for the end points.
The fplot command plots the band structure, reading script plot.plbnds generated by plbnds. It generates a postscript file fplot.ps. Open this file with a document viewer of your choice, e.g.
$ gs fplot.ps
Click here to see the LDA band structure for Si.
You can see that silicon has an indirect band gap of around 0.60 eV. The valence band maximum falls at the point while the conduction band minimum lies between and X, at about 0.85 of the distance to X. The experimental gap is about 1.2 eV.
Other Resources
See Additional Exercises for an example of drawing bands with color weights. The band-edge tutorial demonstrates how to find extremal points based on gradients optimization and how to calculate effective masses.
Additional Exercises
1) Drawing bands with color weights
In the above tutorial, bands were calculated and the k points and energies were recorded in the bnds file. In addition, it is possible to generate orbital character weights (based on a Mulliken decomposition) which are also added to the bnds file. The weights can be used with a graphics package to draw bands with continuously varying color. To demonstrate the color weights feature, we will consider the and orbital character in silicon. More details can be found in the plbnds documentation page.
It is assumed that you already have a self-consistent LDA density (see above tutorial). Edit the ctrl file to change the number of iterations to 1 nit=1:
To see how the orbitals are ordered, run the lmf program with high verbosity:
$ lmf si --rs=1,0 --quit=ham --pr60
Switch –quit=ham tells lmf to stop after assembling the hamiltonian (we only want to print some information). Towards the end of the output, you will see the following section:
Orbital positions in hamiltonian, resolved by l:
Site Spec Total By l ...
1 Si 1:13 1:1(s) 2:4(p) 5:9(d) 10:10(s) 11:13(p)
2 Si 14:26 14:14(s) 15:17(p) 18:22(d) 23:23(s) 24:26(p)
The ‘1:13’ indicates that the basis functions from the first silicon atom occupy columns 1:13 in the hamiltonian. The basis functions are then ordered by angular momentum (, , etc). Here we are actually using a basis set with two sets of energies (double kappa), the first set is listed as 1:9 and the second as 10:13 (, and for first set but only and for the second). To highlight the and contributions from both atoms, run the lmf including the and orbitals like so:
$ lmf si --rs=1,0 -vnit=1 --band~fn=syml~col=1,10,14,23~col2=2:4,11:13,15:17,24:26
Here, ‘col’ specifies the basis functions and ‘col2’ specifies the . Take a look at the bnds file and you will see that color weights information has been added to the first header line. The k points are also now repeated three times, each followed by a block of values. The first block is the same as before, it has the energies for each of the bands (lines 4-7 in the text below). The other two blocks (lines 9-12 and 14-17) list the and weights respectively. The first line of bnds.si now reads
26 0.18551 2 col= 1,10,14,23 col2= 2:4,11:13,15:17,24:26
Note the extra information indicating that the file contains two color weights.
Plot the color-weighted bands by running the following commands:
$ echo -6,6,5,10 | plbnds -fplot -ef=0 -scl=13.6 -lt=1,bold=3,col=0,0,0,colw=1,0,0,colw2=0,0,1 -lbl=L,G,X,W,G bnds.si
$ fplot -f plot.plbnds
The color weights are specified in RGB notation after col, colw and colw2. The first color weight (for contribution) is red, indicated by ‘colw=1,0,0’ and the second is blue ‘colw2=0,0,1’. The ‘col=0,0,0’ specifies that the rest of the orbital character is black. Open fplot.ps and you will see the and character highlighted in red and blue.