# Including Augmented Plane Waves in the lmf Basis Set

### Preliminaries

This tutorial assumes you have cloned and built the lm repository (located here). For the purpose of demonstration, ~/lm will refer to the location of the cloned repository (source directory). In practice, this directory can be named differently.

All instances of commands assume the starting position is your build directory (this can be checked with the pwd command). In this tutorial it will be called ~/build/.

$cd ~/build/ with ~/build being the directory the lm repository was built in to. Note: the build directory should be different from the source directory. ### Tutorial Adding APWs to lmf is exemplified in these test cases$ fp/test/test.fp srtio3
\$ fp/test/test.fp cu

Should you want a more in depth look, or a practical example, these are good places to start. We will use these as a base and go through the steps required to add the APWs.

For APWs the important points are in the tokens used (tokens, of course, can be added either in the ctrl file or as part of the command line arguments, see here and here, for this tutorial we will use the command line argument method).

The tokens of importance are (these can be seen in detail here)

PWMODE=#
PWEMIN=#
PWEMAX=#
OVEPS=#

Specifically, PWMODE tells lmf how to add APWs to the basis. For our example we will use 11 (default=0), see the link above for a detailed description of the options. PWEMAX is the upper cutoff energy in Rydbergs, only G-vectors whose energy falls below this value will be included. Similarly, PWEMIN is the lower cutoff energy.

OVEPS, if its value is positive, tells lmf to diagonalise the overlap matrix and eliminate the subspace which has eigenvalues smaller than #. Necessary, as using many APWs can cause the overlap matrix to become nearly singular and thus unstable. A good value for OVEPS is 1E-7.

To continue our tutorial, we will focus on cu. First you must copy your ctrl.cu and syml.cu files to your working directory. Tutorials and documentation on these files can be found here and here respectively. Stock files can be found, in your lm repository, at:

fp/test/ctrl.cu
fp/test/syml.cu

To be used as references in building your more personally tailored files, or as a way to quickly jump in to the simulations. First, as with all lmf simulations, we must run lmfa to generate the free atom densities

lmfa --no-iactiv cu -vnk=8 -vbigbas=f

This runs lmfa, vnk=8 (which sets BZ_NKABC) telling it to use 8 divisions in the three directions (all 8) of the reciporcal lattice vectors. We then run our lmf command:

lmf  --no-iactiv cu -vnk=8 -vbigbas=t -vpwmode=11 -voveps=0d-7 --band:fn=syml

Breaking this command down: vnk=8 is as described above. -vpwmode=11, which sets HAM_PWMODE to 11, specifically tells lmf to use a LMTO basis only, and to fix the basis (read more here). -voveps=0d-7, being a positive value, works as described above. Finally, –band tells lmf to generate a bnds.cu file which is important for plotting our energy bands.

We now have our bnds.cu and the simulation is complete. You can plot this file with your preffered plotting software, although some data manipulaton may be required. Instructions for fplot are provided below:

cp bnds.cu bnds.lapw
echo -10 40 5 10 | plbnds -lbl=L,G,X,W,G,K -ef=0 -scl=13.6 -fplot -dat=apw bnds.lapw
cp bnds.cu bnds.lmto
echo -10 40 5 10 | plbnds -lbl=L,G,X,W,G,K -ef=0 -scl=13.6 -fplot -dat=lmto bnds.lmto
awk 'BEGIN {print "%char0 lta=2,bold=3,col=1,0,0"} {if ( = "-colsy") {print; sub("lmto","apw"); sub("ltb","lta");print} else {print}}' plot.plbnds > plot.plbnds~
fplot -disp -f plot.plbnds~
If this page has any errors, there is something you think is missing or unclear, or for any other issues, you can create a post here letting us know.