The plbnds utility

plbnds is designed to generate data to make figures of energy bands along a specified symmetry lines. Questaal codes generate energy bands when the --band command-line argument is invoked, in the (default) symmetry line mode. Usually Questaal codes write bands to bnds.ext. This page contains files for symmetry lines for any crystal structure here

plbnds can make postscript files directly, but this tool is is mostly used to set up render bnds.ext into files with a simple, easy-to-read format. plbnds also makes a script for the fplot graphics tool that will make the postscript file. You can tailor the figure by editing the script file; alternatively the simple data format is suitable for use by any graphics package.

Preliminaries

Executables plbnds and fplot are required and are assumed to be in your path. You will also need a postscript viewer. This document assumes you are using the generic apple-style open command to view postscript files.

In a few places files in the repository are referred to. For purposes of this tutorial, it is assumed to reside in ~/lm.

1. Introduction

Energy bands provide a great deal of information, and the Questaal codes provide a fair amount of flexibility in generating them. Drawing bands with color weights is a particularly useful feature, as shown in Section 2.

Questaal lmf, lm, and tbe can generate energy bands along symmetry lines you specify. They share a common input and output format. You must choose the symmetry lines yourself, but prepackaged symmetry line files are available that greatly facilitate the selection and labelling of lines. Bands are written to file bnds.ext, or bbnds.ext if --band~bin is used. This file is not written in a friendly format; but it is often the case that you need only a subset of the bands or to provide extra information such as data for color weights.

plbnds may be used to make postscript files of bands directly, without other software. It is quick, but there is no easy way to modify the figure.

Alternatively plbnds can efficiently convert data in bnds.ext to a simpler format. In this mode (plbnds--fplot), data in bnds.ext is converted to a friendly format useful for a variety of circumstances. A separate file bndn.ext is created for each panel, one panel per symmetry line. bndn.ext is tailored to how many bands are in an energy window of interest, whether color weights are present, and so on. Together with these data files, a script plot.plbnds is automatically created designed for fplot. You can use fplot directly to make the figure, or use your favorite graphics package.

plbnds will provide a synopsis of its usage by typing

plbnds --h

Section 2 gives you an intuitive feel of how plbnds operates by working through an example (the energy bands of Co).

-fplot tells plbnds to generate data files for each of the five panels, and also a script for the fplot tool. The fplot script is written to a file, plot.plbnds. The five panels are written to files (bnd[1-5].dat) (see standard output). They take a standard Questaal format, which is easily read by other packages. The first column is a fractional distance along the symmetry line (0 for starting point, 1 for ending point). The remaining 26 columns comprise energy bands in the window (-10,8) eV.

-ef=0 tells plbnds to shift the bands by a constant so the Fermi energy falls at 0.Note: in an infinite periodic system the energy zero is ill defined; it can be chosen arbitrarily.

-scl=13.6 scales the energy bands by this factor, converting the raw bands (in Ry) to eV.

-nocol tells plbnds to ignore information about color weights.

The energy window is now -10,8 eV. The last two arguments from stdin (formerly 10,15) are not used in this mode since plbnds makes no figure.

Make and view a postscript file with

fplot -f plot.plbnds
open fplot.ps

This figure is much closer to publication quality. You can of course customize the figure by editing plot.plbnds. To interpret and customize the script, see the fplot manual.

Example 3 : Color weights

This example illustrates a very useful feature of the Questaal band plotting capabilities. It uses two color weights to distinguish spin-up and spin-down bands. The first color selects out the majority bands of d character, the second the minority d bands.

Consider orbital component i of band n. Its wave function has eigenvector element zin. The wave function is normalized, and so

The sum runs over all of the orbitals in the basis. By “decomposing the norm” of z, that is summing over a subset of orbitals i, the result is less than unity and is a measure of the contribution of that subset to the unit norm. Note: this decomposition is essentially a Mulliken analysis.

We will simply take bnds.co as given (it is generated from one of the validation scripts in the Questaal source directory).

bnds.co was generated with two color weights, as can be seen from the first line of the file

36 -0.02136 2 col= 5:9,14:18 col2= 23:27,32:36

All d orbitals in the Co majority spin channel are combined for the first weight, and the corresponding d orbitals in the Co minority channel the second. Thus, the first color weight is zero if there is no projection of the eigenfunction onto majority d channel, and 1 if the entire eigenfunction is of majority d character. The same applies for the second weight, but for the minority d channel.

-vmet=4 -vlmf=1 -vnk=8 -vnit=10assign algebraic variables which will modify ctrl.co when run through the preprocessor. They are of secondary interest here. -vso=t does the same, but it is important in this context because the input file contains the following:

--band~col=5:9,dup=9~col2=18+5:18+9,dup=9~fn=syml tells lmf to draw energy bands with two color weights (col=.. and col2=..) Orbitals 5-9 comprise the majority spin d orbitals of the first atom, 14-8 those of the second. (In this test, there is only one Hankel function per L per atom.) How the orbitals are ordered within the hamiltonian can be seen by running lmf with high verbosity, viz:

Co d orbitals then occupy positions 5:9 for the first atom, and 14:18 for the second. dup=9 replicates whateve list exists up to that point, adding 9 to each element in the list. Thus col=5:9,dup=9 pick up all the Co d orbitals of the first spin. The syntax for integer lists is explained here.

Spin orbit coupling is included, so the hamiltonian has twice the rank of a single spin: it is doubled into a 2×2 supermatrix with spin 1 orbitals occuring first and spin 2 orbitals following. To get the rank of the hamiltonian for one spin, look for Makidx in the standard output:

It says that there are 18 orbitals (this is also apparent from the table above: the last orbital is 18). Minority spin orbitals are ordered in the same way as the majority spin, but staggered by 18: col2=18+5:18+9,dup=9 then picks up all the Co d states of the second spin.

This is similar to Example 2 except -nocol is not used and line types are added. The line type specifes a solid line (-lt=1), the line thickness (bold=3); the default line color (col=0,0,0) which is the color when the first and second weights vanish; colors of the first weight (colw=.7,0,0) and second weight colw2=0,.7,0), respectively. The three numbers correspond to fractions of (red, green, blue). Thus, if a band has no d character it will be black; it will be red with 100% majority d character and green with 100% minority d character.

plbnds will generate a file bnd1.dat for the first panel, bnd2.dat for the second, and so on. Use your favorite graphics package to draw the figure, or use the fplot with the ready-made script plot.plbnds, which plbnds generates for fplot.

fplot -f plot.plbnds
open fplot.ps

Colors provide an extremely helpful guide to interpret the bands. It shows clearly which bands have majority and minority d character.

Note: If you do not supply the -lt flag, plbnds will still include color weights in bnd1.dat, bnd2.dat, … and the script plot.plbnds, but all the weights default to black so you won’t see any colors.

Your postscript file should look like the figure below.

Notes:

The highly dispersive band between Γ and A in the window (-2,0) eV, is black, indicating its sp character. The band continues on Γ-M line to positive energy. You can also see traces of it on the Γ-K line, starting at Γ near -0.5 eV, The bottom of the band starts occurs around -9 eV at Γ.

The majority and minority d bands are quite distinct. This means that sz is almost a good quantum number. In the absence of spin-orbit coupling it is a good quantum number. If spin-orbit coupling significantly admixes ↑ and ↓ character, red and green would bleed together, which would appear as yellow.

The majority and minority d bands are approximately the same shape, but split by about 1.6 eV. It is known that the spin part of potential is similar for all the d orbitals. The bands are spin split by an approximately constant value of I×M, where I and M are respectively the Stoner parameter and the magnetic moment. In 3d transition metals Cr, Mn, Fe, Co and Ni, I is close to 1 eV. Also for Co, M=1.6 μB.

Example 4 : Spin Texture

In the general noncollinear magnetic system, electron spins can point in arbitrary directions. The Mulliken decomposition described in Example 3 has a special mode for recording these directions (“spin texture”). In this mode four weights are generated: charge, and x-, y-, and z- components of the magnetization. The charge is merely the standard color weight (Example 3), and evaluates to 1 if all the orbitals are included (see Eq.(6) in the DOS tutorial). Designate the weights , , , .

This example presents several illustrations explaining how color weights can be used to represent spin texture.

a) xyz spin texture in Co

In this example the xyz spin projections in Co are shown as three colors (black=, red=, green=). The bands file bnds.co-st is generated by the test described at the beginning of the Examples section. Here we just take file generated by the test.

You should see the same Co bands as in Example 2, but now the bands are all black except for tiny regions of red where two bands of opposite spins coincide. This means that the band structure is nearly collinear.

A tiny red region can be seen in the band crossing Ef between A and L.

b) Sign of z component of spin in Co

Since the vector points essentially along a single direction, it is useful to know whether the spin is pointing up or down. The spin texture facility has a special mode that uses two color weights, the first represents positive values of projection onto a particular axis, the second for negative values of projection. In particular if z is the axis of projection, a projection between 0 and +1 on z would result in the band being weighted by the first color; a projection between 0 and −1 the band would be weighted by the second color. In addition, there is a choice of normalization: by default the magnetic moment is normalized to 1.

The figure has colors somewhat similar to Example 2: red and green indicate projections onto +z and −z spin components, respectively. Since almost every state is aligned along z, every band is distinctly green or red, in contrast to Example 2. This is because by default magnetization weights vector is normalized to unit length, and since the direction points almost entirely along z, bands are either red or green. The only exception is a small region for the lowest band near Γ, where the color becomes gray. At this point s and d character become completely decoupled. The s band has a negligible coupling to the exchange correlation field; it no longer needs to align with z.

If you leave unnormalized, then the colors will reflect not only the sign but the magnitude of the projection on that axis. Do this by using ~spintexture0 instead of ~spintexture :

Ten energy bands should be nearly green, except near the center point where they turn brown. This is because the spins point along +y for k to the right of the midpoint, and along −y for k to the left.

emin and emax comprise the lower and upper bounds of figure. Data is written only for bands that fall in this range.

Optional arguments w, h are used only in direct mode, as in Example 1. They determine the approximate width and height of the figure in cm. If you do not use w, h, substitute /.

To scale the figure in --fplot mode, use ~scl=w [,h].

Optional switches perform the following functions. A reference to expr indicates a real number or an algebraic expression.

−help | --help | --h prints out a help message and exits.

−lbl=a,b,c,d,…a,b,c,d,… are k point (symmetry) labels at the points where panels meet. (See Example 1) For now, labels must be one character each. You should supply n+1 labels, where n is the number of panels.Note: G is turned into the Greek character Γ.

−ef=expr shifts the energy bands so that the Fermi energy lies at expr. (See Example 2)

−wscl=w[,h] (applicable to fplot mode only) scales the default figure size by w. w is a real number or expression. If the second argument is present the width is scaled by w, the height by h. This switch is used in Example 4 and in this tutorial.

−wshft=x[,y] (applicable to fplot mode only) shifts the default figure to the right by x. x is a real number or expression. If the second argument is present the figure is shifted upwards by y.

−tl=title Adds a title to appear at the top of the figure.

−spin1 | −spin2 plots bands of first or second spin (bnds.ext must contain data for two spins).

−col3:bnds2,fnout merges the color weights in bnds.ext and bnds2 into file fnout (fnout and bnds2 refer to the full file name). The Questaal codes are equipped to generate energy bands with only one or two color weights; however plbnds and fplot has the capability to manage up to three color weights.−col3 enables you to merge back-to-back band calculations with respectively two and one color weights, into a single bnds file, suitable for processsing by plbnds and fplot.

bnds.ext should contain two color weights, bnds2 one color weight.

bnds.ext and bnds2 must contain identical bands generated at the same k points.

−dat=nam (same as −fplot~ext=nam) Substitute nam for .dat when writing data files. This is useful when merging two or more sets of bands into one figure.

−nocol | --nocol (may be used in conjunction with −fplot) Ignore information about color weights.

−merge=file2[,file3] | −mergep=file2[,file3] merges two bands file (one for each spin in the spin-pol case). Optional file3 causes plbnds to write the merged file to file3.-mergep pads a file containing fewer bands so that the number of bands in the merged file is fixed.

fplot mode

−fplot[~options] causes plbnds to create input for fplot or another graphics package (see Example 2.). It does the followng:

Optionally creates a postscript file by invoking fplot in a subshell. Options: the first character after −fplot (assumed to be ’~’ here) delimits the different switches.

~2sp : writes data for two spins

~sh : invoke fplot in a subshell to make fplot.ps.

~lt=string : specify fplot line type

~ext=nam : names the extension for data files (default is .dat)

~ib1=# : specify lowest band to include in plot

~ib2=# : specify highest band to include in plot

~scl=w[,h] : same as --wscl=w[,h]

~shft=x[,y] : same as --wshft=x[,y]

~spintexture : specifies that spin texture is used to define color weights.plbnds expects the bnds.ext to have four color weights, corresponding to charge, and ,, corresponding to components of the magnetization density.plbnds will generate three color weights: The components are normalized such that .

~spintexture0 : same as ~spintexture but is not normalized.

~spintextureq : same as ~spintexture but is normalized to .

For each of ~spintexture flags, append =x | =y | =z to use a single Cartesian component. Two color weights are assigned: first weight applies to projection >0, second to projection <0.Example 2 illustrates the --fplot switch; Example 4 illustrates the spin texture options.

You can create and view a postscript figure of the bands with

fplot -f plot.plbnds
open fplot.ps

Alternatively, make fplot.ps by using the ~sh option to --fplot.

To customize the figure, edit plot.plbnds. Refer to the fplot manual to learn about the capabilities and switches in the fplot tool. Or, generate energy bands with your favorite graphics tool. bnd1.dat, bnd2.dat, … are in Questaal’s standard form, an easily readable format.

creates a data file spf.ext that gnuplot reads to generate the figure.

creates a gnuplot script gnu.plt. Alternatively it writes spf.ext in a form that SpectralFunction.sh can read.

On exit, plbnds will print out a brief message giving you the instruction to make a postscript (or other) file. It draws the bands in the window given by the input spq.ext; however, you can edit the gnu.plt to adjust it.

Switches: the first character after −sp (assumed to be ’~’ here) delimits the different switches.~lst=list specifies which bands to include in the spectral function. See this page for the syntax of integer lists.~out=eps | out=svg | out=png | out=i Specify whether gnuplot is to generate a postscript file (.eps), a Portable Networks Graphics file (.png), or a Scalable Vector Graphics (.svg). i = 1, 2, or 3, corresponds to these three formats.~fs is a “Fermi Surface” mode which expects spq.ext to contain spectral functions at a single frequency on a uniform grid. It writes the sum of spectral functions to a file spf.ext in Standard Questaal format, for subsequent processing.~escl=val scales the frequency mesh by val.~window=#,# sets the energy window for the band plot. It defaults to energy window in spf.ext.~out=lmgf tells plbnds to format spf.ext for the SpectralFunction.sh script.Note: If you make spectral functions with lmfgws and the output is in eV, use escl=1/13.6. SpectralFunction.sh assumes the file is in Ry units.~ascal=val scales the spectral function by val. Only affects the scale in the colorbar.~atop=val sets the top of the colorbar scale to val.~abot=val zeros out any point less than val~writeqp causes plbnds to extract the QP part of the spectral function, and write a bnds file. When you use this switch, plbnds will not set up a plot for the spectral function.