# LMF band plotting

This tutorial demonstrates how to plot bands. This is done for silicon starting from a self-consistent LDA density. An example of color plotting is provided as an additional exercise.

$blm si --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 / | 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 following lines to a file called 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


Run the following command to obtain a self-consistent density.

$blm si --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 in a file called syml.si. Create this file 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 $\Gamma$. In the first column, ‘41’ specifies the number of k points along the line segment. The ‘.5 .5 .5’ and ‘0 0 0’ parts are the xyz coordinates for the $L$ and $\Gamma$ points in units of $2\pi/a$, where $a$ is the lattice constant. The last line indicates the end of the file. To generate the bands (i.e. calculate the energy at each k-point), simply run the following command. Notes that writing lmf si is the same as writing lmf ctrl.si, see DFT tutorial for silicon for more. $ lmf si --rs=1,0 -vnit=1 --band~fn=syml                                #calculate bands


The ’--rs=1,0’ switch specifies that the restart file rst.si (containing the density) is to be read but not written to. The ‘-vnit=1’ switch changes the number of iterations in the ctrl file to 1. The --band switch tells lm to generate energy bands, contained in the bnds.si file, along the specified k-points. The start of your bnds file should look like this:

   36   0.18557     0
41
0.50000   0.50000   0.50000
-0.5225 -0.3299  0.0975  0.0975  0.2910  0.4280  0.4280  0.7503  0.9657  0.9657
1.0178  1.0372  1.0372  1.1434  1.6291  1.7021  1.8477  1.8478  1.8531  1.8531
2.2316  2.3082  2.3082  2.3746  2.3746  2.7147  2.7345  2.7345  2.8152  2.8152
3.0725  3.3734  3.7486  3.7488  3.8090  3.8092


The first line is header and specifies the maximum number of bands, the Fermi level (in Rydbergs) and a number to do with colored plotting (see additional exercises). The ‘41’ in the second line specifies the number of k points in the line segment. The third line lists the coordinates of the first k point and the following three lines are the energies for the 26 bands. The rest of the file is ordered in this way: number of k points in line, followed by alternating lines of coordinates and blocks of energies for each k point in the line segment.

Now plot the bands by running the following two commands:

$echo -6,6,10,15 | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si #set up plotting$ fplot -f plot.plbnds                                                      #plot


The first line uses the plbnds tool to do some data conversion and generates a script for the graphics package fplot. More details can be found in the plbnds documentation page and the fplot documentation page. The ‘echo -6,6,10,15 | plbnds’ part of the command specifies a y axis (energy window) from -6 ro 6 and that the overall figure width is 10 cm width and height is 15 cm. The ‘-fplot’ generates files for fplot, ‘-ef=0’ shifts the fermi energy to zero, ‘-scl=13.6’ scales the band energies by 13.6 (converts from Ry to eV) and the ‘-lbl’ supplies the high-symmetry point labels for the x axis. The second command plots the band structure, it uses fplot to create a postscript file fplot.ps. Open this file with a document viewer of your choice, for example do:

$gs fplot.ps  You can see that silicon has an indirect band gap slightly less than 0.5 eV. The valence band maximum falls at the $\Gamma$ point while the conduction band minimum lies between $\Gamma$ 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 $s$ and $p$ 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). To see how the orbitals are ordered, run the lmf program with high verbosity: $ lmf si --rs=1,0 -vnit=1 --quit=ham --pr60


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:18   1:1(s)   2:4(p)   5:9(d)   10:10(s) 11:13(p) 14:18(d)
2   Si   19:36   19:19(s) 20:22(p) 23:27(d) 28:28(s) 29:31(p) 32:36(d)


The ‘1:18’ specifies that the basis functions from the first silicon atom occupy columns 1:18 in the hamiltonian. The basis functions are then ordered by angular momentum ($s$, $p$, $d$ 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:18 ($s$, $p$ and $d$ for both). To highlight the $s$ and $p$ contributions from both atoms, run the lmf band plotting command with lists of the $s$ and $p$ orbitals:

$lmf si --rs=1,0 -vnit=1 --band~fn=syml~col=1,10,19,28~col2=2:4,11:13,20:22,29:31  Here, ‘col’ specifies the $s$ basis functions and ‘col2’ specifies the $p$. 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 $s$ and $p$ weights respectively.  36 0.18557 2 col= 1:28:9 col2= 2:4,11:13,20:22,29:31 41 0.50000 0.50000 0.50000 -0.5225 -0.3299 0.0975 0.0975 0.2910 0.4280 0.4280 0.7503 0.9657 0.9657 1.0178 1.0372 1.0372 1.1434 1.6291 1.7021 1.8477 1.8478 1.8531 1.8531 2.2316 2.3082 2.3082 2.3746 2.3746 2.7147 2.7345 2.7345 2.8152 2.8152 3.0725 3.3734 3.7486 3.7488 3.8090 3.8092 0.50000 0.50000 0.50000 1.0779 0.4380 0.0000 -0.0000 0.3374 -0.0000 -0.0000 -0.2314 -0.0000 -0.0000 0.6698 0.0000 0.0000 -0.0644 0.3592 0.7387 0.0000 -0.0000 -0.0000 -0.0000 -0.2352 -0.0000 -0.0000 -0.0000 -0.0000 -0.1133 0.0000 -0.0000 0.0000 -0.0000 0.7142 0.3091 0.0000 0.0000 -0.0000 0.0000 0.50000 0.50000 0.50000 0.0167 0.5633 0.8975 0.8975 0.3901 0.3461 0.3461 0.1060 0.0219 0.0219 -0.1855 0.4382 0.4382 0.8015 -0.1174 0.1862 -0.3524 -0.3524 0.1140 0.1140 0.7090 0.4691 0.4691 0.0692 0.0693 1.2897 0.3676 0.3676 1.2739 1.2739 0.1809 0.0597 0.5263 0.5265 -0.1717 -0.1715  Now plot the color-weighted bands by running the following commands: $ echo -6,6 / | 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 $s$ 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 the fplot.ps file and you will see the $s$ and $p$ character highlighted in red and blue.