# Overview of Tutorials By Program

from a local dynamical self-energies generated by DFMT.\n\n

It has close similarities to generating spectral functions from dynamical self-energies generated by the GW\ncode; see for example this tutorial.\n\n

\n
\n\n\n\n

### Command summary

\n
\n

\n\n

For any of the sequences below, set up conditions with\n\n

\ntouch ctrl.lscoq\nrm -f *.lscoq\ncp ~/lm/dmft/test/lscoq/{{ctrl,basp,sigm,rst,syml,syml2,indmfl&125;.lscoq,sig.inp%125; .\n
\n\n

The following sequence generates “interacting energy bands” along symmetry lines as defined in syml.lscoq.\n\n

lmfdmft lscoq --rs=1,0 --ldadc=82.2 -job=1 --pade~nw=121~window=-4/13.606,4/13.606~icut=30,75\nlmchk lscoq | grep -A 3 Qlat | tail -3 | awk '{print $4,$5, $6}' > qlat\n~/lm/startup/symlinepoints -qlat=qlat -nk=101 syml.lscoq > syml2.lscoq\nlmfdmft lscoq -vnkabc=8 --ldadc=82.2 --job=1 --gprt~band,fn=syml2~rdsigr=sig2~mode=19 --pr45\nlmfgws lscoq '--sfuned~units eV~readsek@useef@irrmesh@minmax@ib=30:38~eps 0.02~se band@fn=syml2 nw=2 isp=1 range=-4,4'\nplbnds -sp~atop=10~window=-4,4 spq.lscoq ; gnuplot gnu.plt ; open spf.ps\n \n \n\n The following sequence generates the noninteracting DOS\nand the spectrum DOS (the k integrated spectral function)\n\n lmf lscoq -vnkabc=12 --dos@npts=721@ef0@rdm@window=-6/13.606,6/13.606 --quit=dos\nlmfdmft lscoq -vnkabc=8 --ldadc=82.2 --job=1 --gprt~rdsigr=sig2~mode=19\nlmfgws lscoq -vnkgw=8 '--sfuned~units eV~readsek@useef@ib=30:38~eps 0.02~dos isp=1 range=-4,4 getev=12 nw=4~savesea~q'\n \n \n\n Note: the main part of both sequences are done automatically\nby invoking ~/lm/dmft/test/test.dmft lscoq 2\n\n \n\n ### Preliminaries \n \n\n This tutorial works with paramagnetic La2CuO4. QSGW code has no CPA-like capability (in contrast to DMFT, which may be\nthought of as a dynamical generalization of the Coherent Potential Approximation). At the GW level the material \nmust be treated either as an ordered antiferromagnet, in which case it predicts La2CuO4 to be an insulator with a gap of ~4 eV, or\nnonmagnetically, in which case it predicts La2CuO4 to be a metal.\n\n Experimentally, La2CuO4 is an insulator with an optical gap slightly less than 2 eV.\nBoth LDA+DMFT and QSGW+DMFT yield an insulator in the paramagnetic state: the orbital (which in\nthe nonmagnetic case forms a continuous band that crosses the Fermi level) gets split off.\n\n This tutorial starts from a static nonlocal QSGW self-energy \nand a local, dynamical , projected onto the Cu d states, \ngenerated by DMFT for frequencies on the Matsubara axis.\nThe materials system is La2CuO4; files are taken from a validation test\ntaken from the Questaal installation.\n\n It tutorial assumes your build directory is ~/lm, and the executables are your path. The test itself can be\nrun by the script ~/lm/dmft/test/test.dmft. \nIt requires the following:\n \n • lmfdmft is used for Pade extrapolation of Σ to the real axis, and also to embed Σ into the QSGW bath.\n • lmchk is used to create file qlat, needed by symlinepoints\n • ~/lm/startup/symlinepointsmaps k-point lines in syml.lscoq to syml2.lscoq.\n • lmfgws Makes from the embedded .\nlmfgws uses the self-energy editor, described here\n • plbnds band plot utility, operating in the spectral function mode\n • gnuplot\n • open [use any utility that views postscript files]\n \n\n assumed to be in your path.\n\n ### Interacting Energy bands \n \n\n This section parallels the tutorial for the interacting band structure generated by GW.\nIn the GW case, is generated from QSGW on the real axis. Here is generated from a local\n generated by DMFT on the Matsubara axis.\n\n To generate physical observables, we need to analytically continue , given by DMFT for a set of discrete Matsubara frequencies, to the real axis.\nThis is an important difference between Questaal’s QSGW and DMFT implementations.\n\n In this tutorial we use lmfdmft’s built in Pade extrapolator to carry out the analytic continuation. \nNote: analytic continuation is a tricky business. Pade works reliably only when the polynomial order is not too large,\nwhich means in can operate reliably only over a small energy window. Also the self-energy should be reasonably smooth.\n\n Continue the local DMFT to the real axis in an energy window [−4,4] eV, using a Pade extrapolation:\n\n $ lmfdmft lscoq --rs=1,0 --ldadc=82.2 -job=1 --pade~nw=121~window=-4/13.606,4/13.606~icut=30,75\n
\n
\n\n

The switches to --pade are delimited by  ~  which is the first character following --pade:\n\n

\n
• ~nw=121
\nCreate an energy mesh of 121 points\n
• ~window=−4/13.606,4/13.606
\nUse an energy window of [−4,4] eV (specify in Ry units)\n
• ~icut=30,75
\nSpecifies which Matsubara points to use in the Pade approximant. Use the first 30\npoints; thereafter increment the spacing by 1,2,4 …\npoints.
Continue until the counter passes point 75. In this case\nthe Pade approximant includes Matsubara points 1:30,32,36,44,60\n
\n\n

Next, we need a list of q-points where the spectral function will be made (band plot). Here we use generic\nsymmetry lines from syml.lscoq, which contain high-symmetry points in units of the reciprocal lattice vectors. The\nsymlinepoints utility will convert these points to\nCartesian coordinates and at the same time specify a number of points on each line to make the spacing between points approximately uniform.\nDo the following:\n\n

$lmchk lscoq | grep -A 3 Qlat | tail -3 | awk '{print$4, $5,$6}' > qlat\n$~/lm/startup/symlinepoints -qlat=qlat -nk=101 syml.lscoq > syml2.lscoq\n \n \n\n symlinepoints writes points in Questaal’s symmetry line format\nto file syml2.lscoq.\n\n Next, we need to embed the local DMFT self-energy (now analytically continued to the real axis) \nin the bath defined by the one-particle QSGW hamiltonian. The next step will:\n\n \n 1. Determine the Fermi level, so the one-particle states can be referenced relative to it\n 2. \n Embed into , in the basis of QSGW eigenfunctions, for each of the k points supplied through syml2.lscoq.\n\n $ lmfdmft lscoq -vnkabc=8 --ldadc=82.2 --job=1 --gprt~band,fn=syml2~rdsigr=sig2~mode=19 --pr45\n
\n
\n \n
\n\n

−gprt tells lmfdmft to operate in a special purpose mode which creates and save some\nproperty of the Green’s function or self energy. Switches to –gprt are documented here.\n\n

lmfdmft first determines the chemical potential μ from on the Matsubara axis, avoiding errors in the Pade approximation.\nNext it makes another band pass for the points defined through syml2.lscoq. For each point it embeds\n (now continued to the real axis) to construct the crystal , for the set of bands defined\nby the DMFT hybridization function. It writes to se.lscoq.
\nNote: lmfdmft writes only the diagonal part of Σ to se.lscoq.\nIt is assumed that the off-diagonal elements do not significantly modify the spectral function.\n\n

We are now in a position to make spectral functions.\nIt is done by the dynamical self-energy editor lmfgws.\n constructed either by DMFT and GW can use this utility to analyze spectral functions.\nFor the GW case see this Fe tutorial.\n\n

$lmfgws lscoq --sfuned\n \n \n\n or it can be invoked in batch mode. We do the latter here. The following instruction will read\nse.lscoq, interpolate it to a finer frequency mesh, and write to file spq.lscoq.\n\n $ lmfgws  lscoq '--sfuned~units eV~readsek@useef@irrmesh@minmax@ib=30:38~eps 0.02~se band@fn=syml2 nw=2 isp=1 range=-4,4'\n
\n
\n\n

The editor’s instructions are delimited by the first character following --sfuned,\nwhich is  ~  in this case. They perform the following functions:\n\n

\n
• \n

units eV
\nSelect data is to be output in electron volt units\n \n

• \n

\nReads the self-energy from se.lscoq. Optional flags (separated by a delimiter) modify what is read.
\nNote: you cannot use  ~  for the flags delimiter because it was already used to\nseparate instructions to --sfuned (batch mode). The flags perform the following functions:\n

\n
• useef
\nTells the editor to use the chemical potential in se.lscoq.\nThe QSGW and DMFT Fermi levels are different, and this switch can have some effect if\n lmfgws is used to interpolate between k points.\nHowever, in this context it is not because lmfgws already has\nthe one-particle levels and self-energy relative to the Fermi level for every k point;\nthere is no interpolation (in contradistinction to the DOS calculation\n
• irrmesh
\nTells the editor that data is not being read on a regular mesh of points suitable for k integration.\nOperations that require k integration or k interpolation cannot be performed.\n
• minmax
\nInstructs the editor to print out the minimum and maximum values of QP levels among all the q points it reads.\nValues are printed for each band. This is for informational purposes only.\n
• ib=30:38
\nRestricts the bands entering into the spectral function to bands 30 through 38. These\nare the bands in the energy window [−4,4] eV, as the minmax printout will show.\n
\n \n
\n
\n
• \n

eps 0.02
\n add a constant 0.02 eV to Im Σ. this broaden spectral functions that have small imaginary parts near their peak,\n rendering a cleaner display.\n \n

• \n

se   band@fn=syml2   nw=2   range=−4,4
\nInstructs the editor to generate spectral functions at the list of k points you specify.\n

\n
• band@fn=syml2
\ngenerates a list of k points in lines defined through syml2.lscoq.\n @  is a delimiter separating flags to band (In general the band instruction can have multiple flags).\nBy default band operates in symmetry line mode, which read points symmetry lines from syml2.lscoq.\nHere we synchronize the k points with the same list for which lmfdmft made the self energy. That way will not need to be interpolated in q.\n
• nw=n
\nRefines the given energy mesh by interpolating Σ to an n multiple of the given energy mesh. n must be an integer.\n
• range=#1,#2
\nSpecifies the energy window [#1,#2] where the spectral function is to be generated.\n
\n \n
\n\n

Finally, invoke plbnds in spectral function mode\nto generate an “interacting energy bands” figure.\n\n

$plbnds -sp~atop=10~window=-4,4 spq.lscoq\n$ gnuplot gnu.plt\n$open spf.ps [choose your postscript file viewer]\n \n \n\n plbnds will generate a gnuplot script file gnu.plt\ntogether with a data file spf.lscoq. gnuplot makes a postscript file,\nspf.ps.\n\n The open merely displays spf.ps.\n\n ### Spectrum DOS \n\n The spectrum total DOS is a k-integrated version of the k resolved spectral function. Here we generate the noninteracting DOS\nfrom the QSGW hamiltonian, and compare it to the DMFT spectrum DOS.\n\n Making the QSGW noninteracting DOS using lmf in the usual manner, using the --dos switch\n\n $ lmf lscoq -vnkabc=12 --dos@npts=721@ef0@rdm@window=-6/13.606,6/13.606 --quit=dos\n
\n
\n\n

It creates file dos.lscoq. --quit=dos tells lmf to stop after the DOS has been written, and\nthe modifies to --dos have the following meanings:\n\n

\n
• npts=721  specifies number of energy points (the spacing between points is the same as for the spectrum dos)\n
• window=−6/13.606,6/13.606  energy window for DOS, in Ry. It is 3/2 wider than that generated for the spectrum DOS\n
• ef0     Energy window to be defined relative to Fermi level\n
• rdm    Write DOS in standard Questaal format for 2D arrays.\n
\n\n

To make the spectrum DOS, is needed on the real axis. The steps below are similar those used \nearlier in the tutorial for energy bands;\n\n

$lmfdmft lscoq --rs=1,0 --ldadc=82.2 -job=1 --pade~nw=121~window=-4/13.606,4/13.606~icut=30,75\n$ lmfdmft lscoq -vnkabc=8 --ldadc=82.2 --job=1 --gprt~rdsigr=sig2~mode=19\n$lmfgws lscoq -vnkgw=8 '--sfuned~units eV~readsek@useef@ib=30:38~eps 0.02~dos isp=1 range=-4,4 getev=12 nw=4~savesea~q'\n \n \n\n The main change to the lmfdfmt command is that --gprt has no band modifier, since we require the\nself-energy on a regular mesh to perform k-integration. lmfdfmt writes \n to se.lscoq.\n\n The main change to the lmfgws instruction is that dos is used instead of se\nin the self-energy editor. Note also the modifier getev=12.\nThis interpolates the QP band structure to a finer mesh (12×12×12 divisions), by recalculating the one-particle levels for the\nfiner mesh. The self-energy is linearly interpolated from the given 8×8×8 mesh to the 12×12×12 mesh.\nIt writes file sdos.lscoq.\n\n To compare the two DOS, you can use the fplot utility :\n\n $ fplot -vef0=.39 sdos.lscoq -ab '(x1-ef0)*13.6' -ord x2/13.6 -lt 2,col=1,0,0 dos.lscoq \n
\n
\n\n

The noninteracting DOS are written in Ry, on an absolute energy scale (i.e. not relative to the Fermi level).
\n-ab ‘(x1-ef0)*13.6’ shifts by ef0 and scales the abscissa from Ry to eV.\n-ord x2/13.6 scales the ordinate from Ry−1 to eV−1.\n\n

Note that we should use the Fermi level of the noninteracting DOS (0.264 Ry), but we used the Fermi level of the interacting one\n(0.392 Ry). The mostly noninteracting DOS near 4 eV line up properly that way.\n\n","dir":"/tutorial/qsgw_dmft/dmft-sf/","name":"dmft-sf.md","path":"pages/dmft-sf.md","url":"/tutorial/qsgw_dmft/dmft-sf/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Introduction to the QSGW+DMFT tutorials","permalink":"/tutorial/qsgw_dmft/dmft0/","auto":{"code":"QSGW+DMFT","physical":"","info":"The general framework of the QSGW+DMFT method (true also for LDA+DMFT) relies on a separation of the whole problem into a lattice and an impurity problem.","priority":9000},"header":false,"content":"\n

The general framework of the QSGW+DMFT method (true also for LDA+DMFT) relies on a separation of the whole problem into a lattice and an impurity problem. The solution of the joint problem is found by repeatedly hopping from one picture to the other, using the output of one calculation to improve the input of the successive at every iteration. Projection and embedding operations allow for transitions from one picture to the other.\n\n

The solution of each of the two pictures relies on a self-consistent procedure. For the lattice problem it is the QSGW loop (see dedicated tutorials), whereas for the impurity picture we speak about the DMFT loop. The two loops are closed in a larger loop (so called ‘density loop’) that allows for a fully self-consistent description. A schematic representation is depicted in the figure below.\n\n

\n\n

The following tutorials will guide you in the solution of the DMFT loop and the density loop.\nIt’s assumed that you understand how to perform a QSGW loop and what are the basic input/output of QSGW. If this is not the case, please rely on dedicated tutorials.\n\n

### Structure of this tutorial section

\n
\n
1. The first tutorial is about the manipulations to be done on the QSGW ouput to start the DMFT loop. Here you can also find input files that will be used throughout all tutorials.\n
2. The second tutorial is about how to perform a DMFT loop until convergence.\n
3. The third one is about possible errors and some indications and rules-of-thumb to set and adjust the input parameters of the DMFT loop.\n
4. The fourth tutorial is about how to close the density loop by means of the charge+static-magnetic approach.\n
5. The fifth tutorial is about how to close the density loop by updating the density with the dynamical approach (standard method).\n
6. The sixth tutorial focuses on the maximum entropy method, used to analytically continue the self-energy from the Matsubara’s frequency mesh to the real frequency axis.\n
7. The seventh tutorial is about how to close the external loop by updating the self-energy instead of the density. It also contains a section about how to construct the dynamical double-counting.\n
\n","dir":"/tutorial/qsgw_dmft/dmft0/","name":"dmft0.md","path":"pages/dmft0.md","url":"/tutorial/qsgw_dmft/dmft0/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"First tutorial on QSGW+DMFT","permalink":"/tutorial/qsgw_dmft/dmft1/","auto":{"code":"QSGW+DMFT","physical":"","info":"This tutorial will teach you how to set up the DMFT loop.","priority":8000},"header":false,"content":"

# Setting up the DMFT loop

\n\n

### The spin-polarized QSGW starting point

\n\n

This tutorial assumes you have terminated a spin-polarized QSGW calculation to be corrected with DMFT. Your QSGW calculation is supposed to be spin-polarized even for non-magnetic materials. For the purpose of this tutorial, we will refer to a QSGW calculation on ferromagnetic Nickel.\n\n

The file init.ni to start from scratch is:\n\n

LATTICE\n   SPCGRP=225\n   A=3.524 UNITS=A\nSITE\n   ATOM=Ni X=0 0 0\nSPEC\n   ATOM=Ni MMOM=0.0 0.0 0.6\n
\n
\n\n

To run a full QSGW calculation follow the commands below:\n\n

# the flag --mag for spin-polarized calculations\nblm ni --gw --wsitex --mag --nit=20 --nk=12 --nkgw=8 --gmax=8.7\nmv actrl.ni ctrl.ni\nlmfa ni                     # Starting guess is the atomic density\nmv basp0.ni basp.ni\nlmf ni                      # DFT calculation. At convergence mmom = 0.59\nlmfgwd ni  --jobgw=-1       # GWinput\nlmgwsc --wt --code2 --sym -maxit=20 --metal --getsigp --tol=2e-5 ni\n
\n
\n\n

The value of the parameters are a pretty low on purpose to run a QSGW loop in a reasonable time. We recommend to run the last step on a parallel machine (use the --openmp or the --mpi flag).\n\n

Note: Of course you can also do LDA+DMFT. The procedure is basically the same, but you can ignore all reference to any sigm file.\n\n

### Input folders, files and programs

\n\n

Once you have a converged spin-polarized QSGW calculation you still need some additional file to run lmfdmft and ctqmc. You can download them at this link.\n\n

Let qsgw the folder with the QSGW calculation and dmft-input the one where you extracted the content of the .tar.gz file linked above, then you dispatch relevant input files into two folders:\n\n

mkdir lmfinput qmcinput                     # input folders\ncp qsgw/{ctrl,basp,site,rst}.ni lmfinput    # copy relevant QSGW output files\ncp qsgw/sigm.ni lmfinput/sigm_old\ncp dmft-input/indmfl_input lmfinput/indmfl.ni\n# copy files and programs for CTQMC runs\ncp dmft-input/{atom_d.py,broad_sig.f90,Trans.dat,PARAMS} qmcinput/\n
\n
\n\n
##### Edit the ctrl file
\n

You need to add some tokens to ctrl.ni.\n\n

# add some tokens at the end of ctrl.ni\ncd lmfinput\necho 'DMFT    PROJ=2 NLOHI=1,8 BETA=50 NOMEGA=2000 KNORM=0' >> ctrl.ni\n
\n
\n\n

The token DMFT_NLOHI defines the projection window in band index, DMFT_BETA is the inverse temperature in eV and DMFT_NOMEGA is the number of Matsubara frequencies in the mesh. Some details of the projection procedure are controlled by DMFT_PROJ and DMFT_KNORM, but you are not meant to change their value.\n\n

Moreover we recommend to add % const bxc0=0 and BXC0={bxc0} in the HAM section of ctrl.ni file. Setting HAM_BXC0 to TRUE, tells lmf to construct from the spin-averaged charge density. The reason for this will be clarified in the fourth tutorial.\n\n

At the end, you can see how your ctrl.ni should look like the following.\n\n

# Autogenerated from init.ni using:\n# blm ni --gw --wsitex --mag --nit=20 --nk=12 --nkgw=8 --gmax=8.7\n\n# Variables entering into expressions parsed by input\n% const nit=20\n% const met=5\n% const nsp=2 so=0\n% const lxcf=2 lxcf1=0 lxcf2=0     # for PBE use: lxcf=0 lxcf1=101 lxcf2=130\n% const pwmode=0 pwemax=3          # Use pwmode=1 or 11 to add APWs\n% const sig=12 gwemax=2 gcutb=3.3 gcutx=2.7  # GW-specific\n% const nkabc=12 nkgw=8 gmax=8.7\n% const bxc0=0\n\nVERS  LM:7 FP:7 # ASA:7\nIO    SHOW=f HELP=f IACTIV=f VERBOS=35,35  OUTPUT=*\nEXPRESS\n# Lattice vectors and site positions\n  file=   site\n\n# Basis set\n  gmax=   {gmax}                   # PW cutoff for charge density\n  autobas[pnu=1 loc=1 lmto=5 mto=4 gw=1 pfloat=2]\n\n# Self-consistency\n  nit=    {nit}                    # Maximum number of iterations\n  mix=    B2,b=.3,k=7              # Charge density mixing parameters\n  conv=   1e-5                     # Convergence tolerance (energy)\n  convc=  3e-5                     # tolerance in RMS (output-input) density\n\n# Brillouin zone\n  nkabc=  {nkabc}   # 1 to 3 values.  Use n1<0 => |n1| ~ total number\n  metal=  {met}     # Management of k-point integration weights in metals\n\n# Potential\n  nspin=  {nsp}                    # 2 for spin polarized calculations\n  so=     {so}                     # 1 turns on spin-orbit coupling\n  xcfun=  {lxcf},{lxcf1},{lxcf2}   # set lxcf=0 for libxc functionals\n\n#SYMGRP i r4x r3d\nHAM\n      PWMODE={pwmode} PWEMIN=0 PWEMAX={pwemax}  # For APW addition to basis\n      FORCES={so==0} ELIND=-0.7\n      RDSIG={sig} SIGP[EMAX={gwemax}]  # Add self-energy to LDA\n      BXC0={bxc0}\nGW    NKABC={nkgw} GCUTB={gcutb} GCUTX={gcutx} DELRE=.01 .1\n      GSMEAR=0.003 PBTOL=1e-3\nSPEC\n  ATOM=Ni         Z= 28  R= 2.354453  LMX=3  LMXA=4  MMOM=0 0 0.6\nDMFT    PROJ=2 NLOHI=1,8 BETA=50 NOMEGA=2000 KNORM=0\n
\n
\n\n
##### Prepare spin-averaged self-energy
\n

Although you have done a spin-polarized calculation, the starting point of the DMFT loop has to be non-magnetic. To do that you have to produce a spin-averaged sigm.ni.\n\n

cp sigm_old  sigm.ni\n# read sigm, make spin-average, write it down, and quit\nlmf --rsig~spinav --wsig -vbxc0=1 ni > log\n# rename sigm2: you will work with this spin-averaged sigm\nmv sigm2.ni sigm.ni\ncd ..\n
\n
\n\n

Check that at among the last lines of the log you find\n\n

replace sigma with spin average ...\n
\n
\n\n

and\n\n

Exit 0 done writing sigma, file sigm2\n
\n
\n\n
\n

The statistical noise of Quantum Monte Carlo calculations can be source of instabilities. Because of this, you need to broad the output of the ctqmc software at the end of each iteration.\n\n

In the file dmft-input.tar.gz you should have downloaded, you will find broad_sig.f90 which has precisely this purpose.\nHowever you can use whatever method you prefer (but be careful in not spoiling the low- and the high-frequency limits).\n\n

cd qmcinput\ngfortran -o broad_sig.x broad_sig.f90\ncd ..\n
\n
\n\n

The tutorial will continue assuming you are using broad_sig.x to broaden the impurity self-energy.\n\n

### Prepare a vanishing impurity self-energy

\n

You start the loop from scratch by creating an empty impurity self-energy:\n\n

mkdir siginp0\ncd siginp0\ncp ../lmfinput/*  .\nlmfdmft ni --ldadc=71.85 -job=1 -vbxc0=1 > log\ncd ..\n
\n
\n\n

You can check that the line\n\n

Missing sigma file : create it and exit ...\n
\n
\n\n

is written at the end of the log.\n\n

The calculation has stopped just after reading the indmfl.ni. A text file called sig.inp has been created. It is formatted with the first column being the Matsubara frequencies (in eV) and then 0.0 repeated for a number of columns equal to twice the number of m channels (e.g. ten columns for d-type impurity grouped in real and imaginary parts).\n\n

Of course, if you want you can start from non-vanishing sig.inp files (e.g. from a previously converged DMFT loop).\n\n

\n\n

The list of relevant files in the two input directories is\n\n

$ls -l lmfinput\nbasp.ni # basis set used in the QSGW calculation\nctrl.ni # amended ctrl.ni file with DMFT category and HAM_BXC0={bxc0} token\nindmfl.ni # instructions for the correlated subsystem\nrst.ni # electronic density of the spin-polarized QSGW loop\nsigm.ni # spin-averaged sigm.ni from converged QSGW loop\nsite.ni\n\n$ ls -l qmcinput\natom_d.py         # initialise the atomic problem in a d-electron system\nbroad_sig.x       # broadens Sig.out at the end of each ctqmc run\nPARAMS            # main parameters for the ctqmc calculation\nTrans.dat         # translation table needed by atom_d.py\n
\n
\n\n

\n\n

# Running the DMFT loop

\n\n
\n\n

### Introduction

\n

As explained in the introduction to QSGW+DMFT, the fundamental step of DMFT is the self-consistent solution of the local Anderson impurity problem. This is connected to the electronic structure of the material (bath) through the hybridization function, the impurity level and the effective interactions and . The sequence of operations leading to the self-consistent impurity self-energy is called DMFT loop.\n\n

The DMFT loop is composed by the following steps:\n\n

\n
• The lattice Green’s function is projected onto the local correlated subsystem (), where are the fermionic Matsubara’s frequencies. This leads to the definition of the hybridization function () and the impurity levels ().\n
• These two quantities together with the effective interactions and are passed to the Continuous Time Quantum Monte Carlo (CTQMC) solver which computes the corresponding impurity self-energy and the impurity Green’s function ().\n
• The double-counting self-energy is subtracted from it and the result is embedded into an updated lattice Green’s function. After adjusting the chemical potential, the loop starts again from the starting point until the self-consistent relation is met.\n
\n\n

From a software perspective, these operations are accomplished in a four-step procedure. Each step relies on a specific program (lmfdmft, atom_d.py, ctqmc and broad_sig.x). The operations performed by each code and the input/output handling needed to cycle the loop are indicated schematically in the figure below.\n\n

\n\n

In this tutorial, we will go through all these steps and we will indicate what quantity to monitor to judge the convergence of the DMFT loop. We will assume that you followed all the steps of the previous tutorial.\n\n

### Running the loop

\n

The DMFT loop is composed by alternated runs of lmfdmft and ctqmc, the output of each run being the input for the successive. To do that, do the following steps:\n\n

##### (1) Prepare and launch the lmfdmft run
\n

First you have to copy the input files. If you are going to run the first iteration then\n\n

mkdir it1_lmfrun\ncp lmfinput/*.ni it1_lmfrun                 # copy standard input files\ncp siginp0/sig.inp it1_lmfrun/sig.inp       # copy vanishing sig.inp\n
\n
\n\n

Otherwise you are going to run iteration number X>1, then\n\n

mkdir itX_lmfrun                                    # X>1 number of the iteration\ncp lmfinput/*.ni itX_lmfrun                         # copy standard input files\ncp it(X-1)_qmcrun/Sig.out.brd  itX_lmfrun/sig.inp   # copy sigma from last CTQMC run\n
\n
\n\n

Let now U=10 eV and J=0.9 eV be the Hubbard on-site interaction and Hunds coupling respectively, and n=8 the nominal occupancy of the correlated subsystem (n=8 for Ni). Then launch lmfdmft with the command\n\n

cd it1_lmfrun\nlmfdmft ni --ldadc=71.85 -job=1 -vbxc0=1 > log\ncd ..\n
\n
\n\n

where 71.85 is the double-counting self-energy, computed according to the formula .\n\n

At the end of the run, the hybridization function is stored in delta.ni (first column are Matsubara’s energies and then five d-channels with real and imaginary parts).The impurity levels are recorded in eimp1.ni.\nThese two output files are essential to initialise the corresponding CTQMC run.\n\n

##### (2) Prepare and launch the ctqmc run
\n

At the Xth iteration you can launch the following commands\n\n

mkdir itX_qmcrun                                 # the running folder\ncp qmcinput/*   itX_qmcrun/                      # copy input files and relevant executables\ncp itX_lmfrun/delta.ni  itX_qmcrun/Delta.inp     # copy hybridization function output from lmfdmft\ncp itX_lmfrun/eimp1.ni  itX_qmcrun/Eimp.inp      # copy impurity levels from lmfdmft\ncp it(X-1)_qmcrun/status* itX_qmcrun/            # If X>1. See the third tutorial for details\n
\n
\n\n

Now there are some manual operations to do:\n\n

\n
• \n

Look for ‘????’ in the provided PARAMS. Assign the Ed variable the values reported in the forth line of Eimp.inp. Warning: be careful in erasing the ‘=’ sign before the brakets!. Then change mu accordingly as the first value of Ed with opposite sign. Finally add the correct values of U, J, beta and nf0 (equivalent of n: nominal occupation of correlated orbitals). Warning: Be careful in being consistent with the values in the ctrl.ni and the double counting used in the lmfdfmt run.\n\n

\n\n

At this point the PARAMS file should look like this\n\n

Ntau  1000\nOffDiagonal  real\nSig  Sig.out\nNaver  100000000\nSampleGtau  1000\nGf  Gf.out\nDelta  Delta.inp\ncix  actqmc.cix\nNmax  700         # Maximum perturbation order allowed\nnom  150          # Number of Matsubara frequency points sampled\nexe  ctqmc        # Name of the executable\ntsample  50       # How often to record measurements\nnomD  150         # Number of Matsubara frequency points sampled\nEd [ -71.710134, -71.710132, -71.796795, -71.710130, -71.796792, -71.732934, -71.732932, -71.820596, -71.732930, -71.820593 ]     # Impurity levels\nM  20000000.0     # Total number of Monte Carlo steps per core\nNcout  200000     # How often to print out info\nPChangeOrder  0.9         # Ratio between trial steps: add-remove-a-kink / move-a-kink\nCoulombF  'Ising'         # Ising Coulomb interaction\nmu   71.710134            # QMC chemical potential\nwarmup  500000            # Warmup number of QMC steps\nGlobalFlip  200000        # How often to try a global flip\nOCA_G  False      # No OCA diagrams being computed - for speed\nsderiv  0.02      # Maximum derivative mismatch accepted for tail concatenation\naom  3            # Number of frequency points used to determin the value of sigma at nom\nHB2  False        # Should we compute self-energy with the Bullas trick?\nU    10.0\nJ    0.9\nnf0  8.0\nbeta 50.0\n
\n
\n\n

\n \n
• \n

Run atom_d.py using the command\n\n

python atom_d.py J=0.9 l=2 cx=0.0 OCA_G=False qatom=0 \"CoulombF='Ising'\" HB2=False \"Eimp=[   0.000000,   0.000002,  -0.086661,   0.000004,  -0.086658,  -0.022800,  -0.022798,  -0.110462,  -0.022796,  -0.110459]\"\n
\n
\n\n

where the argument Eimp is a copy of the third line of Eimp.inp (to be changed at each iteration accordingly to the previous lmfdmft run) and the argument J is the Hund’s coupling. All other argument should not be changed.\nWarning: Pay attention to quotes and double quotes!\n\n

Running atom_d.py generates a file called actqmc.cix used by the ctqmc solver.\n \n

• \n

Run ctqmc using a submission script on, let’s say, 20 cores. Important parameters (that may need to be adjusted during the loop) are nom, Nmax and M. Their explanation is reported as a comment in the PARAMS file itself but further information is available in the next tutorial. For this tutorial, you can set them to nom 150, Nmax 700 and M 20000000 (as illustrated in one dropdown box above).\n\n

At the end of the run (it will take a while… e.g. on 20 cores around 30 minutes) a series of files have been produced. Among them we are especially interested in Sig.out, histogram.dat and the status files. To learn how to use them to judge on the quality of the QMC calculation we refer to the third tutorial.\n \n

• \n

Now you must broad Sig.out to smooth out the noise. If you use the program brad_sig.x you will run it with following commands\n\n

cd itX_qmcrun\ncp ../qmcinput/broad_sig.x .\necho 'Sig.out 150 l \"55  20  150\" k \"1 2 3 2 3\"'| ./broad_sig.x > broad.log\n
\n
\n\n

For a clearer explanation of how to use broad_sig.x, we refer to its commented header.\n \n

\n\n
##### (3) Cycling the loop
\n\n

At this point you have a new self-energy to be fed to lmfdmft. You can go back to the point (1) and repeat all the operations with a higher iteration number X.\n\n

As the required input/output handling is not being automatised yet, cycling the loop results pretty annoying.\nHowever, once you have familiarised with the procedure, you can write a script to do most of the work using this one as a basic template.\n\n

### Converging to the SC-solution

\n

The self-consistent condition holds when of iteration N is equal (within a certain tolerance) to of iteration N-1. You can add the flag --gprt when running lmfdmft to get printed on a file called gloc.ni. This can be compared with the file Gf.out produced by the previous CTQMC run. However in the comparison remember that the latter is not broadened, while the former is obtained by smoothened quantities.\n\n

An easier though accurate way is to look at the convergence of the chemical potential. This can be done by typing grep ‘ mu = ‘ it*_lmfrun/log.\n\n

A third method is of course to visualise the convergence of each separate channel of local quantities like Sig.out.brd or Gf.out.\n\n

In this tutorial, a reasonable convergence is achieved after around 10 iterations.\nHow to handle the converged DMFT result is the subject of the fourth and the fifth tutorials, while in the third one we will focus on possible source of errors, technical aspects to speed up the convergence and rule of thumbs to define the input parameters.\n","dir":"/tutorial/qsgw_dmft/dmft2/","name":"dmft2.md","path":"pages/dmft2.md","url":"/tutorial/qsgw_dmft/dmft2/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Third tutorial on QSGW+DMFT","auto":{"code":"QSGW+DMFT","physical":"","info":"Indications on how to set parameters for a DMFT calculation.","priority":6000},"permalink":"/tutorial/qsgw_dmft/dmft3/","header":false,"content":"

# Issues with input and parameters

\n

The aim of this tutorial is to give some indications on how to set the parameters of the DMFT calculation.\nWe will give some examples of how the output should look like and, more importantly, how it shouldn’t.\n\n

The basic input files for the CTQMC solver are the PARAMS file, the Trans.dat, the actqmc.cix file, the Delta.inp, the Eimp.inp and finally the status files.\nMoreover lmfdmft requires the indmfl file.\nDescriptions of how to set the relevant parameters of the PARAMS, and the indmfl files are given below. You are not supposed to edit the other files, so we don’t give an explanation of them here.\n\n

Among the output files, the most important ones are Sig.out and histogram.dat. We will refer to these two to judge the quality of our calculation.\n\n

### The indmfl file

\n\n

Note: It is planned to change the syntax of this file. It will soon become obsolete!\n\n

This file is used by lmfdmft to define which atomic species and orbitals are mapped to the impurity.\nAt the moment the file has a lot of redundant information, reminiscent of the formatting used in K. Haule’s DMFT package.\nAmong all the information reported, you are interested only in a couple of variables at lines three and four.\n\n

1                                   # number of correlated atoms\n1    1   0                           # iatom, nL, locrot\n
\n
\n\n

The first variables defines how many atoms are correlated.\nNote: At the moment we are testing the code for values higher than 1. So far it hasn’t been possible to treat more than one atom.\n\n

The first variable of the second line (iatom=1 in the example) is the index of the correlated atom in the basis chosen. In the example, Ni has only one atom so it’s index is 1. This value has to be consistent with the site.ext file\n\n

\n\n

If the site file is\n\n

  ATOM=La         POS=  0.5000000   0.5000000  -0.4807290\n  ATOM=La         POS= -0.5000000  -0.5000000   0.4807290\n  ATOM=Cu         POS=  0.0000000   0.0000000   0.0000000\n  ATOM=O          POS=  0.0000000   0.5000000   0.0000000\n  ATOM=O          POS=  0.0000000   0.0000000   0.6320273\n  ATOM=O          POS= -0.5000000   0.0000000   0.0000000\n  ATOM=O          POS=  0.0000000   0.0000000  -0.6320273\n
\n
\n\n

then iatom=3.\n\n

\n\n

All the other values of the file are either ignored or should not be changed.\n\n

### The PARAMS file

\n

This file is one of the input files read by the CTQMC sovler.\n\n

The variables contained in this file define the kind of calculation, allowing for a tuning of the Quantum Monte Carlo algorithm and details on how to treat the connection between the low-energy and the high-energy part of the self-energy.\nAn example of the PARAMS file is reported in a dropdown box of the second tutorial.\n\n

\n\n
##### Basic parameters (U, J, nf0 and beta)
\n

Among the possible parameters are U and J, defining respectively the Hubbard in-site interaction and the Hund’s coupling constant in eV.\nWarning: The same value of J has to be passed to atom_d.py as well.\n\n

The variable nf0 is the nominal occupancy of the correlated orbitals (e.g. nf0 9 for , nf0 8 for Ni).\n\n

Finally beta fixes the inverse temperature in eV.\n\n

Warning: Don’t forget to be consistent when you run atom_d.py (which wants J as an input) and lmfdmft (for which the flag --ldadc= has to be consistently defined as U(nf0-0.5)-J(nf0-1)*0.5).\n\n

##### Setting the number of sampled frequencies (nom and nomD)
\n

The CTQMC solver gives a very accurate description of the self-energy in the low frequency range (for Matsubara’s frequencies close to 0), but it becomes too noisy at high frequencies.\n\n

Let be the total number of Matsubara’s frequencies. This number has been defined through NOMEGA in the ctrl file during the lmfdmft run. Only the first nom frequencies are actually sampled by the CTQMC solver, while the other points are obtained analytically through the approximated Hubbard 1 solver (high-frequency tail).\n\n

Excessively low values of nom will miss important features of the self-energy (e.g. a convex point in ), while too high values will give excessively noisy results.\nAs a rule-of-thumb, a good initial guess is nom beta, but this value has usually to be adjusted during the DMFT loop.\nSome examples of how the looks like at different values of nom are given in the figures below.\n\n

\n\n

##### Setting the number of Monte Carlo steps (M and warmup)
\n

The higher is the number of Monte Carlo steps, the lower the noise in the QMC calculation.\nThe parameter M defines the number of MC steps per core.\nReliable calculations easily require at least 500 millions of steps in total.\nFor instance, if you’re running on 10 cores, you can set M 50000000.\nYou can judge the quality of your sampling by looking at the file histogram.dat. The closer it looks to a Gaussian distribution, the better is the sampling.\n\n

Warning: The variable M should be set keeping in mind that the higher it is, the longer the calculation. This is crucial when running on public clusters, where the elapsed time is computed per core. Too high values of M may consume your accounted hours very quickly!\nMoreover remember that you are supposed to broaden the output at each iteration, so you don’t actually need very clean Sig.out.\n\n

During the first warmup steps results are not accumulated, as it is normal on Monte Carlo procedures. This gives the ‘time’ to the algorithm to thermalise before the significative sampling.\nYou can set warmup=M/1000.\n\n

##### Setting the cutoff expansion order (Nmax)
\n

The variable Nmax defines the highest order accounted for in the hybrdization expansion.\nIf you have chosen an excessively low values of Nmax, the histogram.dat file will be cut and will look weird, as shown below.\n\n

You should chose Nmax high enough for the Gaussian distribution of histogram.dat to be comfortably displayed. However note that the higher Nmax the longer the calculation, so chose values just above the higher Guassian tail.\n\n

\n\n

\n\n

Warning: the value of beta affects the number Nmax, so calculations on the same material at different temperatures will require different Nmax. At low beta, the Gaussian distribution is sharper and centered on lower order terms, as shown below. Therefore lower beta require lower Nmax.\n\n

\n\n

##### Connecting the tail (sderiv and aom)
\n

The connection between the QMC part and the Hubbard 1 part is done with a straight line starting at frequency number nom+1 and running until it intersect the Hubbard 1 self-energy.\nYou can see it by comparing the Sig.out file with the s_hb1.dat (Hubbrad 1 only).\n\n

The two variables controlling the connection are sderiv, which is related to the angle of the straight line, and aom related to its starting point.\n\n

The straight line connecting the low- and the high-frequncy region can easily give rise to unwanted kinks.\nTo broaden Sig.out is necessary to smooth these kinks out as well.\n\n

##### Impurity levels (Ed and mu)
\n

The impurity levels reported at the fourth line of Eimp.inp enters in the PARAMS as the variable Ed.\nThe variable mu is set as the first entry of the Ed with opposite sign.\n\n

Warning: These two variables change at every iteration so you have to constantly update their value throughout the DMFT loop.\n\n

\n\n

### Phase transition boundaries

\n

It may happen that, despite the high number of QMC steps, the histogram.dat file displays a double peak distribution simiar to the sum of two Gaussians. This is the case when the material is close to a phase transition.\n\n

\n\n

In this case usually one or more channels of the self-energy are very noisy. One has to run for longer times, or use the status files to restart the calculation many times until only one peaks dominate and the histogram looks like a Gaussian.\nAn example is given in the boxes below.\n\n

\n\n

\n\n

\n\n

### Using status files

\n

During the calculation, each core generates a status file.\nThey contain some information about the sampling and should be used as restart files for other CTQMC calculations with similar parameters. They are read authomatically if they are in the folder where ctqmc is running.\n\n

\n\n

They can be used basically in two ways.\n\n

\n
• If you are performing iteration N, you should copy the status files from iteration N-1 to speed up the convergence of the calculation.\n
• If you realise that in one ctqmc run, you haven’t achieved a good sampling (e.g. M too low, or close to phase transition), than you can run again the calculation without losing the effort already done. When restarted, the ctqmc solver will automatically read the status files and retrive their information.\n
\n\n

Warning: Since there is one status file per core, you must pay attention to run on as many cores as status files you have. It should be safe (but not recommended) to run with a smaller number of cores, while running on more cores than status files gives wrong results.\n\n

Note: this page has not been carefully worked out, especially the description of the Stoner parameter may not be accurate.\n\n

You can add to the crystal potential an external magnetic field inside each augemetation sphere, in the ASA program lm and full-potential program lmf. Use token BFIELD to tell lm or lmf that a field is to be read. The calculation must be spin polarized, e.g.\n\n

HAM    NSPIN=2 BFIELD=2\n...\n
\n
\n\n

BFIELD=1 allows the field to point in any direction; BFIELD=2 restricts the field to the z axis. The former case generates a noncollinear hamiltonian; the latter is spin diagonal. (The hamiltonian may also be noncollinear for another reason, e.g. spin-orbit coupling is turned on.)\nCaution: lmf does not as yet generate noncollinear output densities. Self-consistent calculations with noncollinear B fields are not possible; also the total energy is not trustworthy if B is not along the z axis.\n\n

By selecting BFIELD nonzero, you are telling lm or lmf that a (site-dependent) Zeeman field is to be added. In this case you must also supply a site-dependent external field, which you do through the additional file bfield.ext. If this file is omitted, the program will not execute. bfield.ext contains one row for each site; each row contains three numbers corresponding to x,y,z components of B. (The file must always contain three components Bx. By Bz even if BFIELD=2.)\nThe GdN test case (part of the test suite) is an instructive example. In the top-level directory, run this test:\n\n

fp/test/test.fp gdn\n
\n
\n\n

This test combines the LDA+U hamiltonian with spin-orbit coupling. Bands are calculated for that case; then a magnetic field of 0.25 eV=0.037/2 Ry is added to the Gd site and the bands are recalculated. GdN has two atoms and file bfield.gdn reads:\n\n

0 0 .037/2\n0 0 0\n
\n
\n\n

The test generates files bnds.bfield.gdn and bnds.nobfield.gdn To analyze the bands you need to use a graphics package. If you have the FPLOT packaged installed, you can draw the picture shown below comparing the two cases, by invoking the following commands after running the test:\n\n

echo -8,8,5,10 | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G -dat=blue bnds.nobfield.gdn\necho -8,8,5,10 | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G -dat=dat  bnds.bfield.gdn\nmv plot.plbnds plot.plbnds~\necho \"% char0 colr=3,bold=4,clip=1,col=1,.2,.3\" >>plot.plbnds\necho \"% char0 colb=2,bold=2,clip=1,col=.2,.3,1\" >>plot.plbnds\nawk '{if ($1 == \"-colsy\") {sub(\"-qr\",\"-lt {colr} -qr\");print;sub(\"dat\",\"blue\");sub(\"colr\",\"colb\");print} else {print}}' plot.plbnds~ >>plot.plbnds\nfplot -disp -f plot.plbnds\n \n \n\n In the figure, blue bands are LDA+U results. Because spin-orbit coupling is included both minority and majority spin bands appear. You can see majority Gd f states near -6.5 eV, and minority f states near +5.5 eV. Gd d states are spin-split by the exchange-correlation field originating from spin splitting of the Gd f states; majority and minority d states are found near 2.5 eV and 3.5 eV, respectively, at the Γ point.\n\n Red bands use the same potential as the LDA+U case, except that a Bz field of magnitude 0.5 eV was added to the Gd site. Bz causes the the following shifts:\n\n \n • The majority f shifts down by ~0.22 eV, and the minority f states shift up by ~0.27 eV. States that are purely atomic like and are little affected by the kinetic energy will be shifted by the Zeeman field, ±B/2. This is the case for Gd f orbitals.\n • The majority d states at Γ shift down by ~0.16 eV; the minority d states shift up by ~0.20 eV.\n • The As p states, in the (-4,0) eV range, are only slightly shifted.\n \n\n ### Longitudinal susceptibility \n \n\n The magnetic susceptibility is the system’s magnetic response to an external magnetic field:\n\n\n\n or\n\n\n\n δM itself can be obtained from a derivative of the total energy:\n\n\n\n Thus\n\n\n\n and\n\n\n\n In linear response theory, can be written as a sum of a noninteracting part and an interacting part\n\n\n\n The kernel is often associated with the “Stoner parameter.” It is typically about 1 eV in 3d transition metals.\nThe noninteracting part is connected with the induced magnetization of the noninteracting system, i.e.\n\n\n\n where is the magnetization induced by without taking into account the internal potential shifts that cause. In the density-functional context, can be obtained from an initially self-consistent potential , which is generated in the absence of an external field. is then the change in for the potential . In practice this is obtained by evaluating the change in from the change in output density of a 1-shot calculation with potential .\n\n You can use lmf to apply a field and calculate E_LDA and δ_M as a function of B. By comparing self-consistent and 1-shot calculations you can in principle also obtain I. The example below does this in an approximate way for Fe, using input file fp/test/ctrl.felz. Note: a proper calculation of I would require a supercell large enough that the interactions between external B-fields would be sufficiently small. (I is a local function of r in density functional theory; thus I is a site-diagonal matrix.) Here we only consider a single atom cell. The interactions are not small, and I is underestimated.\nThe results below were generated by this command:\n\n lmf -vnk=16 --pr31 -vrel=1 -vnit=50 -vso=0 --rs=1 -vbeta=.3 -vbf=2 -vbz=$bz -vconv=1d-6 -vconvc=1d-6 felz\n
\n
\n\n

bz must be set as a shell variable.\n\n

Magnetization and total energy (relative to the B=0 case) were generated for several values of B, and ∂E/∂B was obtained from numerical differentiation of E.\n\n

As the top figure shows, the total energy E has a minimum near, but not exactly at B=0. This shows that there are some slight errors in the LDA calculation (in an exact self-consistent LDA calculation E should be minimum at exactly B=0).\nE is smooth in the interval (−0.01, 0.01) Ry, as the figure shows. The behavior is somewhat unsmooth near B=−0.01 Ry, and its discontinuity or near discontinuity is evident near B=0.01 Ry. That means numerical differentiation ∂E/∂B is a bit problematic, particularly outside the (−0.01,0.01) interval. Nevertheless we can perform it. In the bottom figure, MM(B=0) and ∂E/∂B are plotted respectively as a function of B as dashed lines+circles, and a solid line. The two curves track fairly well, though ∂E/∂B is noisy; nor is M(B) particularly smooth.\n\n

We can obtain χ from the slope ∂E/∂B. There is some uncertainty in the calculation since M is not particularly smooth (note in particular that (∂E/∂B)+ and (∂E/∂B) are a little different).\n\n

We can also obtain both χ0 by obtaining δM0 from a 1-shot calculation. The table below shows M0 and M for two values of B:\n\n

\n\n\n\n\n\n
B\nM0\nM\n \n \n
-0.005\n-2.363587\n-2.402973\n \n
0.005\n-2.234213\n-2.219662\n \n \n
\n\n

Thus we get:\n\n\n\n\n\n\n\n

As noted above, I calculated in this way only approximately corresponds to the Stoner I. A better calculation should produce I about 1 eV.\n","dir":"/tutorial/misc/extbfield/","name":"extbfield.md","path":"pages/extbfield.md","url":"/tutorial/misc/extbfield/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Making a Fermi Surface for spin polarized Fe","permalink":"/tutorial/application/fstut/","auto":{"code":"LM","physical":"Fermi Surface","info":"Outlines steps to generate a Fermi surface for Fe, using either the ASA or FP programs."},"header":false,"content":"

This tutorial outlines the steps needed to generate a Fermi surface for Fe, using either the ASA program lm\nor the FP programs lmf.
\nThe Fermi surface drawn on a 2D projection of the Brillouin zone, is a contour plot of the bands at the Fermi level.\n\n

This tutorial assumes ~/lm is the top-level directory for the Questaal repository, and that\nexecutables lm or lmf (and for plotting, the\nmcx calculator and\nfplot) are in your path.\n\n

### Setup: self-consistent calculation for Fe

\n\n
\n
With the FP program lmf:\n
If you don’t want to build an input file from scratch, use one\nfrom the Questaal repository and make the density self-consistent:\n\n
cp ~/lm/fp/test/ctrl.fe .\nlmfa fe -vnsp=2\nlmf fe --rs=0 -vnsp=2\n
\n
\n\n

Alternatively, repeat the steps for LDA self-consistency (or for the stout-hearted, QSGW self-consistency)\nin the Fe tutorial; steps are summarized in Command summary.\n \n

With the ASA program lm:\n
Use the following test to obtain an input file and self-consistent density:\n\n
~/lm/testing/test.lm --quiet fe\n
\n
\n \n
\n\n

### Bands on a regular 2D mesh

\n\n

Both lmf and lm can generate energy bands in a mesh\nmode for generating contour plots, i.e. bands on a regular mesh\nof q points in 2D.\n\n

Pick up a q-points file appropriate for Fe from the Questaal repository:\n\n

$cp ~/lm/fp/test/fs.fe .\n \n \n\n fs.fe has this structure (see here for syntax):\n\n \n\n\n\n\n # vx\nrange\nn\nvy\nrange\nn\nheight\nband\n \n \n .5 .5\n0 0 1\n35\n0 0 1\n0 1\n51\n0.00\n2:6\n \n \n \n\n Fe is magnetic and bands 2,3,4,5,6 cross the Fermi surface (either majority or minority), so bands 2..6 will be\ngenerated. This file is set up to generate mesh of points for bands 2..6 in the rectangle defined by Γ=(0,0,0) in\nthe lower left corner, H=(0,0,1)2π/a at the upper left corner, N=(1/2,1/2,0)2π/a at the lower right\ncorner, and N=(1/2,1/2,1)2π/a at the upper right corner.\n\n Do one of:\n\n $ lmf fe --band~con~fn=fs\n $lm fe --iactiv=no --band~con~fn=fs\n \n \n\n ### Drawing the Fermi surface \n\n To plot the Fermi surface you will need graphics software. This tutorial uses Questaal’s fplot utility, in the contour plotting mode.\n\n bnds.fe consists of 10 blocks of bands, each block on a \n2D grid of 35×51 points. Split this file into 10 separate files.\nName the first five (down spin) 2d, 3d, 4d, 5d, 6d, \nand the last five 2u, 3u, 4u, 5u, 6u,\n\n If you have the mcx calculator calculatoryour path, do this with the following command:\n\n  set rf = \"-r:open bnds.fe\" (tcsh)\n rf=\"-r:open bnds.fe\" (bash)\n mcx$rf -w 2d $rf -w 3d$rf -w 4d $rf -w 5d$rf -w 6d $rf -w 2u$rf -w 3u $rf -w 4u$rf -w 5u $rf -w 6u\n \n \n\n We will use the fplot utility to draw the Fermi surface\nCopy the box below into file plot.fs\n\n % var ef=-0.006678 # (or whatever the fermi level is output from your band calculation)\nfplot -frme 0,1/sqrt(2),0,1 -x 0,1/sqrt(2) -y 0,1 -tmx .1\n\n -lt 1,col=0,.1,1 -con {ef} 2u\n -lt 1,col=0,.3,1 -con {ef} 3u\n -lt 1,col=0,.5,1 -con {ef} 4u\n -lt 1,col=0,.7,1 -con {ef} 5u\n -lt 1,col=0,.9,1 -con {ef} 6u\n\n -lt 2,col=0,.1,1 -con {ef} 2d\n -lt 2,col=0,.3,1 -con {ef} 3d\n -lt 2,col=0,.5,1 -con {ef} 4d\n -lt 2,col=0,.7,1 -con {ef} 5d\n -lt 2,col=0,.9,1 -con {ef} 6d\n \n \n\n Generate a postscript file using\n\n fplot -f plot.fs\n \n \n\n The postscript file should look like the picture shown below. Compare, e.g. to this paper by Coleman et al:\nPhys. Rev. B23, 2491 (1981).\n\n Click here to see the image.\n","dir":"/tutorial/application/fstut/","name":"fstut.md","path":"pages/fstut.md","url":"/tutorial/application/fstut/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Introductory GW tutorial: LDA-based GW for Si","permalink":"/tutorial/gw/gw1shot/","auto":{"code":"gw","physical":"","info":"A basic tutorial on 1-shot GW calculations starting from the LDA.","priority":9900},"header":false,"content":" This tutorial begins with an LDA calculation for Si, starting from an init file. Following this is a demonstration of a 1-shot GW calculation. \nClick on the GW Theory dropdown menu below for a brief description of the 1-shot GW scheme. A complete summary of the commands used throughout \nis provided in the Commands summary dropdown menu. Theory for GW and QSGW, and its implementation in the Questaal suite, can be found \nin Phys. Rev. B76, 165106 (2007).\n\n ### Theory \n\n 1-shot GW calculations are perturbations to a DFT calculation (such as LDA). They are simpler than QSGW calculations, \nbecause only the diagonal part of is normally calculated (this is an approximation) and only one self-energy is \ncalculated (single iteration). On the other hand, 1-shot calculations are sensitive to the starting point and you do not have the\nluxury of interpolating between k points to get full bandstructures, as is the case in QSGW. As a result, it is only possible to \ncalculate 1-shot corrections for k points that lie on the k-point mesh used in the self-energy calculation.\n\n The self-energy enters the Hamiltonian as a perturbation and gives us access to quasi-particle (QP) energies. The QP energies are \nthe main output of a 1-shot GW calculation.\n\n The DFT executable is lmf. lmfgwd is similar\nto lmf, but it is a driver whose purpose is to set up inputs for the GW code.\n is made by a shell script lmgw1-shot.\n\n \n\n ### Command summary \n \n\n blm init.si --express --gmax=5 --nk=4 --nit=20 --gw #use blm tool to create actrl and site files\ncp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si #copy actrl to recognised ctrl prefix, run lmfa and copy basp\nlmf ctrl.si > out.lmfsc #make self-consistent\necho -1 | lmfgwd si #make GWinput file\nnano GWinput #edit k-point lines\nlmgw1-shot --ht si #1-shot GW calculation\n \n \n\n \n\n ### LDA calculation \n \n To carry out a self-consistent LDA calculation, we use the lmf code. The steps follow those from the lmf and QSGW tutorials; you should refer to these for \nadditional details. Copy the following lines to a file called init.si:\n\n LATTICE\n ALAT=10.26\n PLAT= 0.00000000 0.50000000 0.50000000\n 0.50000000 0.00000000 0.50000000\n 0.50000000 0.50000000 0.00000000\n# pos means cartesian coordinates, units of alat\nSITE\n ATOM=Si POS= 0.00000000 0.00000000 0.00000000\n ATOM=Si POS= 0.25000000 0.25000000 0.25000000\n \n \n\n Run the following commands to obtain a self-consistent density:\n\n blm init.si --express --gmax=5 --nk=4 --nit=20 --gw \ncp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si\nlmf ctrl.si > out.lmfsc\n \n \n\n Note that we have included an extra --gw switch, which tailors the ctrl file for a GW calculation. To see how it \naffects the ctrl file, try running blm without --gw. The switch modifies the basis set section (see the autobas line) \nto increase the size of the basis, which is necessary for GW calculations.\n\n After running these commands, we now have a self-consistent LDA density. Check the out.lmfsc file and you should find a \nconverged gap of around 0.58 eV. Now that we have the input eigenfunctions and eigenvalues, the next step is to carry out a GW calculation. For \nthis, we need an input file for the GW code.\n\n \n\n ### Making GWinput \n \n As in the QSGW case, a template GWinput file is made by running the following command:\n\n echo -1 | lmfgwd si #make GWinput file\n \n \n\n Take a look at GWinput, the k mesh is specified by n1n2n3 in the following line:\n\n n1n2n3 4 4 4 ! for GW BZ mesh\n \n \n\n In the QSGW tutorial we changed the mesh to 3x3x3 to speed things up. This time we will use the 4x4x4 mesh as the 3x3x3 mesh does not include \nthe X and L points that are of particular interest. You may want to review the QSGW tutorial for a discussion of \nk-point convergence. The number of states (bands) to consider is specified in the following section:\n\n *** no. states and list of band indices to make Sigma and QP energies\n 8\n 1 2 3 4 5 6 7 8\n \n \n\n Just below the no. of states is a section that specifies the k points to consider:\n\n *** q-points (must belong to mesh of points in BZ).\n 3\n 1 0.0000000000000000 0.0000000000000000 0.0000000000000000\n 2 -0.2500000000000000 0.2500000000000000 0.2500000000000000\n 3 -0.5000000000000000 0.5000000000000000 0.5000000000000000\n 4 0.0000000000000000 0.0000000000000000 0.5000000000000000\n 5 -0.2500000000000000 0.2500000000000000 0.7500000000000000\n 6 -0.5000000000000000 0.5000000000000000 1.0000000000000000\n 7 0.0000000000000000 0.0000000000000000 1.0000000000000000\n 8 0.0000000000000000 0.5000000000000000 1.0000000000000000\n \n \n\n These are the 8 irreducible k points of the 4x4x4 mesh, including X (0,0,1) and L (-1/2,1/2,1/2). You can calculate QP corrections for all of these points \nbut we will only calculate QP corrections at and X in this tutorial. The number 3 just below the q-points line tells the GW codes how many points \nto calculate QP corrections for. Use a text editor to change this number to 2 and move line 7 (which contains the X point) to appear second. The first few \nlines of your file should look like this:\n\n *** q-points (must belong to mesh of points in BZ).\n 2\n 1 0.0000000000000000 0.0000000000000000 0.0000000000000000\n 7 0.0000000000000000 0.0000000000000000 1.0000000000000000\n 3 -0.5000000000000000 0.5000000000000000 0.5000000000000000\n \n \n\n As specified above, the GW code will only calculate QP corrections for the first two lines (those containing and X).\n\n \n\n ### Running 1-shot GW \n \n\n We can now run the 1-shot GW calculation, this is done with the lmgw1-shot script:\n\n lmgw1-shot --ht si #1-shot GW calculation\n \n \n\n The insul switch tells the code where to find the valence band maximum (8 electrons and spin degenerate so the fourth band is the valence band). Take a look \nat the lmgw1-shot output:\n\n  lmgw 16:22:08 : invoking /users/ms4/bin/lmfgwd --jobgw=0 --gwcode=2 --no-iactive si >llmfgw00\n lmgw 16:22:08 : invoking /users/ms4/bin/code2/qg4gw --job=1 >lqg4gw\n lmgw 16:22:08 : invoking /users/ms4/bin/lmfgwd --jobgw=1 --gwcode=2 --no-iactive si >llmfgw01\n lmgw 16:22:09 : invoking /users/ms4/bin/lmf2gw_2 si >llmf2gw\n lmgw 16:22:09 : invoking /users/ms4/bin/code2/rdata4gw_v2 --job=0 >lrdata4gw\n lmgw 16:22:09 : invoking /users/ms4/bin/code2/heftet --job=1 >leftet\n lmgw 16:22:09 : invoking /users/ms4/bin/code2/hchknw --job=0 >lchknw\n lmgw 16:22:09 : invoking /users/ms4/bin/code2/hbasfp0 --job=3 >lbasC\n lmgw 16:22:09 : invoking /users/ms4/bin/code2/hvccfp0 --job=0 >lvccC\n lmgw 16:22:14 : invoking /users/ms4/bin/code2/hsfp0 --job=3 >lsxC\n lmgw 16:22:15 : invoking /users/ms4/bin/code2/hbasfp0 --job=0 >lbas\n lmgw 16:22:15 : invoking /users/ms4/bin/code2/hvccfp0 --job=0 >lvcc\n lmgw 16:22:20 : invoking /users/ms4/bin/code2/hsfp0 --job=11 >lsx\n lmgw 16:22:21 : invoking /users/ms4/bin/code2/hx0fp0 --job=11 >lx0\n lmgw 16:22:30 : invoking /users/ms4/bin/code2/hsfp0 --job=12 >lsc\n lmgw 16:22:38 : invoking /users/ms4/bin/code2/hqpe --job=0 >lqpe\n \n \n\n The first few lines are preparatory steps, the main GW calculation begins on the line containing the file name lbasC. The three lines \nwith lbasC, lvccC and lsxC are the steps that calculate the core contributions to the self-energy. The following lines up to the \none with lsc are for the valence contribution to the self-energy. The lsc step, calculating the correlation part of the self-energy, \nis usually the most expensive part. The lqpe line assembles components of the potential and makes the QPU file. Further information can be \nfound in the annotated GW output page.\n\n The resulting quasi-particle (QP) energies are reported in the QPU file. Your QPU file should look like this (note that the last two columns have been \nremoved in the output below):\n\n  q state SEx SExcore SEc vxc dSE dSEnoZ eLDA eQP eQPnoZ eHF Z \n 0.00000 0.00000 0.00000 1 -17.40 -1.81 6.70 -12.47 -0.02 -0.04 -12.27 -12.29 -12.31 -19.01 0.65 \n 0.00000 0.00000 0.00000 2 -12.92 -1.96 1.30 -13.62 0.02 0.03 -0.29 -0.27 -0.26 -1.56 0.78 \n 0.00000 0.00000 0.00000 3 -12.92 -1.96 1.30 -13.62 0.02 0.03 -0.29 -0.27 -0.26 -1.56 0.78 \n 0.00000 0.00000 0.00000 4 -12.92 -1.96 1.30 -13.62 0.02 0.03 -0.29 -0.27 -0.26 -1.56 0.78 \n 0.00000 0.00000 0.00000 5 -5.56 -1.42 -4.01 -11.82 0.63 0.82 2.22 2.85 3.04 7.05 0.77 \n 0.00000 0.00000 0.00000 6 -5.56 -1.42 -4.01 -11.82 0.63 0.82 2.22 2.85 3.04 7.05 0.77 \n 0.00000 0.00000 0.00000 7 -5.56 -1.42 -4.01 -11.82 0.63 0.82 2.22 2.85 3.04 7.05 0.77 \n 0.00000 0.00000 0.00000 8 -5.85 -3.72 -4.57 -15.20 0.80 1.06 2.94 3.75 4.00 8.58 0.76 \n\n 0.00000 0.00000 1.00000 1 -15.93 -2.11 4.80 -13.20 -0.03 -0.04 -8.13 -8.16 -8.17 -12.97 0.69 \n 0.00000 0.00000 1.00000 2 -15.93 -2.11 4.80 -13.20 -0.03 -0.04 -8.13 -8.16 -8.17 -12.97 0.69 \n 0.00000 0.00000 1.00000 3 -13.35 -1.69 2.30 -12.59 -0.12 -0.16 -3.16 -3.28 -3.32 -5.61 0.74 \n 0.00000 0.00000 1.00000 4 -13.35 -1.69 2.30 -12.59 -0.12 -0.16 -3.16 -3.28 -3.32 -5.61 0.74 \n 0.00000 0.00000 1.00000 5 -5.04 -0.92 -3.63 -10.25 0.52 0.66 0.29 0.81 0.95 4.58 0.79 \n 0.00000 0.00000 1.00000 6 -5.04 -0.92 -3.63 -10.25 0.52 0.66 0.29 0.81 0.95 4.58 0.79 \n 0.00000 0.00000 1.00000 7 -3.67 -2.35 -6.62 -13.50 0.63 0.86 9.73 10.35 10.59 17.20 0.73 \n 0.00000 0.00000 1.00000 8 -3.67 -2.35 -6.62 -13.50 0.63 0.86 9.73 10.35 10.59 17.20 0.73 \n \n \n\n In the GWinput file we specified that the QP energies are to be calculated at two k points ( and X) \nand for 8 states each. The first three columns above list the k point x, y and z components. There is a block of 8 points, a space \nand then a block of 8 X points.\n\n The SEx, SExcore and SEc columns contain the exchange and correlation terms, with the exchange divided into core and valence parts. These terms add to \ngive you the GW self-energy . In the first line above, the three values sum to give a self-energy of around -12.51 eV. vxc is the matrix element of \nthe LDA exchange-correlation potential for a given q-point and state, it is subtracted from the GW self-energy to get the QP shifts; you are adding (-vxc) \nto the LDA single-particle hamiltonian. Subtracting vxc from -12.51 gives you the -0.04 eV shift shown in the dSEnoZ column. This is the QP shift relative \nto LDA without a Z factor. The Z factor is a correction term that accounts for the fact that the self-energy is evaluated at the LDA eigenvalue (it should be \nevaluated at the QP eigenvalue but this is not known in advance). The dSE column is the QP shift relative to LDA including a z factor, it is obtained by \nmultiplying the dSEnoZ value by the Z factor found in the Z column.\n\n The column labelled eLDA contains the LDA eigenvalues. The conduction band energy (state 5) at the X point is 0.29 eV and the valence band energy at \n(state 4) is -0.29 eV. The difference between the two (0.58 eV) is the LDA -X bandgap. The quasi-particle energies including a Z factor are listed in \nthe next column eQP. The quasipartcle -X bandgap (1.08 eV) is given by the difference betwee state 5 in the X block of points and state 4 in the\n block of points. The eQPnoZ column contains the QP energies without a Z factor correction. Lastly, the eHF column contains \nthe Hartree-Fock eigenvalue energies which are obtained by subtracting the vxc value and adding the exchange terms SEx and SExcore.\n\n The 1-shot bandgap is an improvement over the LDA, but it still underestimates the experimental value of 1.32 eV (at 0 K). This tendency is a common feature \nof semiconductors. It was not recognized for a long time because pseudopotential calculations (nearly all calculations were pseudopotential based until about \n2005) tend to put levels too high, and somewhat remarkably, yielded fortutitously good agreement with experiment in many cases. On the other hand, \nthe -X gap from the QSGW tutorial is around 1.4 eV. The QSGW approximation is known to systematically overestimates band gaps for most semiconductors.\n\n \n\n ### Additional Exercises \n\n 1) GaAs\n\n Try a 1-shot GW calculation for GaAs. Note that the code automatically treats the Ga d state as valence (adds a local orbital). This requires a larger GMAX.\nYou also need to run lmfa a second time to generate a starting density that includes this local orbital. The lmfa line for GaAs should be:\n\n $ lmfa ctrl.gas; cp basp0.gas basp.gas; lmfa ctrl.gas \n
\n
\n\n

The init file is:\n\n

# init file for GaAs\nLATTICE\n#       SPCGRP=\n        ALAT=10.69\n        PLAT=    0.00000000    0.50000000    0.50000000\n                 0.50000000    0.00000000    0.50000000\n                 0.50000000    0.50000000    0.00000000\n# 2 atoms, 1 species\nSITE\n     ATOM=Ga   POS=    0.00000000    0.00000000    0.00000000\n     ATOM=As   POS=    0.25000000    0.25000000    0.25000000\n
\n

This tutorial will go through how the macroscopic dielectric function is calculated. The random-phase approximation (RPA) macroscopic dielectric function can be calculated in lmf using the OPTICS category in the ctrl file; see this page for a detailed description. Whilst the dielectric function in the form produced by lmf is useful for analysis there are two crucial effects missing. The first is the effect of local fields, and the second is excitonic (electron-hole interaction) effects. These effects can be included through use of the Bethe-Salpeter equation for the polarisation. See this page for a background to the theory.\n

\n\n
$mkdir lif\n$ cd lif\n$nano init.lif # paste in structural information (see below)\n$ blm --gw init.lif\n$cp actrl.lif ctrl.lif\n$ lmfa ctrl.lif\n$cp basp0.lif basp.lif\n$ nano ctrl.lif # change gmax, nit, nkabc, gcutb & gcutx (see below)\n$lmf ctrl.lif \n$ echo -1 | lmfgwd ctrl.lif\n$lmgwsc --code2 lif\n$ echo 6 | lmfgwd ctrl.lif\n$nano ctrl.lif # Edit OPTICS category\n$ lmf --opt:woptmc,rdqp ctrl.lif --rs=1,0 -vnit=1\n$cp optdatac.lif optdatabse\n$ nano GWinput # Include parameters for bethesalpeter (see below)\n$echo 0 | bethesalpeter\n \n \n\n ### Preliminaries \n \n\n blm, lmfa, lmf, lmfgwd, lmgwsc are all assumed to be in your path. The source code for all Questaal executables can be found here. \nYou should ensure that the executable bethesalpeter is also in your path.\n\n ### Tutorial \n\n Start by making a directory lif\n\n $ mkdir lif && cd lif\n
\n
\n\n

Structural information about the unit cell is then contained in the file init.lif. Create this file and paste the following\n\n

HEADER Li F (Lithium fluoride)\nLATTICE\n#       SPCGRP=225\n#       A=4.028  B=4.028  C=4.028   ALPHA=90  BETA=90  GAMMA=90\n% const a=4.028\n      ALAT={a}  UNITS=A\n      PLAT=    0.5000000    0.5000000    0.0000000\n               0.5000000    0.0000000    0.5000000\n               0.0000000    0.5000000    0.5000000\nSITE\n   ATOM=Li       X=     0.0000000    0.0000000    0.0000000\n   ATOM=F        X=     0.5000000    0.5000000    0.5000000\n
\n
\n\n

Now run blm to produce ctrl.lif.\n\n

$blm --gw init.lif\n$ cp actrl.lif ctrl.lif\n
\n
\n\n

The –gw switch adjusts certain parameters so that a GW calculation can be performed.\nNow run lmfa to calculate the free-atom density and copy this to basp.lif, as this is the file read by lmf:\n\n

$lmfa ctrl.lif\n$ cp basp0.lif basp.lif\n
\n
\n\n

Since no local orbitals were found we do not need to re-run lmfa. The next step then is to edit ctrl.lif and pick a suitable -mesh and add the value of GMAX suggested by the output of lmfa.\n\n

nit=30\nnkabc=5\ngmax=9.3\n
\n
\n\n

One important thing to note for this particular example are the parameters gcutb and gcutx, these are cut-offs used in the GW. Change these to\n\n

gcutb=3.7 gcutx=3.1\n
\n
\n\n

blm may choose negative values for these parameters, which are not compatible and must be changed. The values given were 3.6 and 3.0 respectively, however, these particular choices for this particular system may causes a segmentation fault when calculating the RPA polarisation needed to calculate the self-energy.\n\n

We are now ready to run our self consistent LDA calculation. Type the following\n\n

$lmf ctrl.lif\n \n \n\n This should produce a band gap of about 9.4 eV, which is small compared with experiment ~14.2 eV.\n\n #### QSGW calculation \n We now want to perform a QSGW calculation. To build the input files required by QSGW, type the following\n\n $ echo -1 | lmfgwd ctrl.lif\n
\n
\n\n

The main input is GWinput. This file, as it stands, is sufficient for this particular example. We can now perform a QSGW calculation on this system:\n\n

$lmgwsc --code2 lif \n \n \n\n Convergence should be reached after 5 iterations (iteration number 4, since counting starts at 0). The gap produced now should be about 16.4~16.5 eV. This is quite high, but can – however – be corrected slightly with a finer k-mesh.\n\n Before we run the bethesalpeter program we need to use lmf to produce the optical matrix elements, see this page for a description of how the optical matrix elements enter in to the expression for the macroscopic dielectric function. To do this we need to ensure the k-mesh used by bethesalpeter is consistent with that used by lmf. To do this run the following command\n\n $ echo 6 | lmfgwd ctrl.lif\n
\n
\n\n

We then need to include information in ctrl.lif about which pairs of states etc to calculate the optical matrix elements for. We do this through the OPTICS category, see this page\n\n

OPTICS\n  MODE=1\n  LTET=0\n  WINDOW=0.0 2.0\n  NPTS=1001\n  FILBND=1 4\n  EMPBND=5 50\n  MEFAC=0\n
\n
\n\n

MODE, LTET, WINDOW and NPTS do not affect the calculation of the matrix elements. FILBND and EMPBND include the upper and lower bounds on the valence and conduction bands for which we calculate the matrix elements and MEFAC determines how the contribution to these matrix elements from the non-local part of the potential is included. We do not include this correction here (it is handled in bethesalpeter, see below) hence MEFAC=0.\n\n

Next we run\n\n

$lmf --opt:woptmc,rdqp ctrl.lif --rs=1,0 -vnit=1\n$ cp optdatac.lif optdatabse\n
\n
\n\n

where we copy the file produced to that read in by bethesalpeter. Before we perform the Bethe-Salpeter calculation we need to include some parameters in GWinput.\n\n

$nano GWinput\n \n \n\n The parameters for the calculation are\n\n MaxOmega_BSE 2.0\nMinOmega_BSE 0.0\nnumOmega_BSE 8000\nNumValStates 4\nNumCondStates 4\nNLF_corr_BSE on\nQvec_bse 1 1 1 !q vector for BSE\nImagEner1 -0.083 !0.00160735\nImagEner2 0.107 !0.0138375\nRestartwithKernel off\nRestartwithDiagonal off\n \n \n\n which are (in order of appearance): the maximum (in Rydberg) for which the dielectric function is calculated; the minumum ; the number of frequencies; the number of valence states to include in the Bethe-Salpeter equation; the number of conduction states included; LDA energies ARE used to construct the optical matrix elements accounting for a non-local potential; the direction of the perturbing field; Lorentzian broadening (Rydberg) at ; broadening at (broadening can increase linearly); do not read the kernel from a previous calculation; and do not read the diagonalized 2-particle Hamiltonian from a previous calculation. Note that NumValStates and/or NumCondStates can be less than the number of states included in FILBND and EMPBND in ctrl.lif. The valence and conduction states used in the Bethe-Salpeter equation are those closest to the Fermi level. The rest of the states are included in , but included at RPA level. The reason for doing this is the computational expense of solving the Bethe-Salpeter equation.\n\n We are now ready to run a Bethe-Salpeter equation calculation to get the macroscopic dielectric function. To do this type\n\n $ echo 0 | bethesalpeter > out.bse\n$cp eps_BSE.out eps_BSE.outBSE\n \n \n\n eps_BSE.out contains parameters used, followed by three columns. The energy (for numOmegaBSE energies from MinOmega_BSE to MaxOmega_BSE) in eV are in column one followed by the real and imaginary parts of the macroscopic dielectric function. The imaginary part determines the absorption. We can vary the broadenings to match experiment. Ensure RestartwithKernel and RestartwithDiagonal are switched on to avoid having to calculate and diagonalize the matrix all over again.\n\n Finally, the reason we copied the output file is so that we can compare this with an RPA . To do this type\n\n $ echo -1 | bethesalpeter\n
\n
\n\n

The two outputs can be plotted in a plotting program such as gnuplot.\nThe output from the two calculations above are shown below in the image, along with the experimental spectrum.\n\n\n

This page explains the output from 1-shot GW and QSGW calculations. The lmgw1-shot script is used for the 1-shot GW calculation and the lmgwsc script is used for the QSGW calculation. The output from both lmgw1-shot and lmgwsc are similar. The main difference is the construction of a full self-energy (not just the diagonal terms). This is converted into an effective exchange-correlation potential in the lqpe step.\n\n

Consider the following output from lmgw1-shot broken down into individual lines:\n\n

$lmgw 16:22:08 : invoking /users/ms4/bin/lmfgwd --jobgw=0 --gwcode=2 --no-iactive si >llmfgw00\n \n \n\n The above line sets up a call to the GW package to extract the k-point list.\n\n $ lmgw  16:22:08 : invoking /users/ms4/bin/code2/qg4gw --job=1 >lqg4gw\n
\n
\n\n

Make k-point list\n\n

$lmgw 16:22:08 : invoking /users/ms4/bin/lmfgwd --jobgw=1 --gwcode=2 --no-iactive si >llmfgw01\n \n \n\n Generate input data for GW at given k-points (eigenvectors, projection of evecs…)\n\n $ lmgw  16:22:09 : invoking /users/ms4/bin/lmf2gw_2 si >llmf2gw\n
\n
\n\n

Translates output of lmfgwd into intermediate form.\n\n

$lmgw 16:22:09 : invoking /users/ms4/bin/code2/rdata4gw_v2 --job=0 >lrdata4gw\n \n \n\n Translates intermdiate form of lmfgwd output into form used by GW. Also makes information about matrix elements.\n\n $ lmgw  16:22:09 : invoking /users/ms4/bin/code2/heftet --job=1 >leftet\n
\n
\n\n

Finds Fermi level.\n\n

$lmgw 16:22:09 : invoking /users/ms4/bin/code2/hchknw --job=0 >lchknw\n \n \n\n Finds energy range.\n\n $ lmgw  16:22:09 : invoking /users/ms4/bin/code2/hbasfp0 --job=3 >lbasC\n
\n
\n\n

Product basis for core levels.\n\n

$lmgw 16:22:09 : invoking /users/ms4/bin/code2/hvccfp0 --job=0 >lvccC\n \n \n\n Hartree matrix elements for core\n\n $ lmgw  16:22:14 : invoking /users/ms4/bin/code2/hsfp0 --job=3 >lsxC\n
\n
\n\n

Exchange matrix elements for core\n\n

$lmgw 16:22:15 : invoking /users/ms4/bin/code2/hbasfp0 --job=0 >lbas\n \n \n\n Product basis for valence\n\n $ lmgw  16:22:15 : invoking /users/ms4/bin/code2/hvccfp0 --job=0 >lvcc\n
\n
\n\n

Hartree matrix elements for valence\n\n

$lmgw 16:22:20 : invoking /users/ms4/bin/code2/hsfp0 --job=11 >lsx\n \n \n\n Exchange matrix elements for valence\n\n $ lmgw  16:22:21 : invoking /users/ms4/bin/code2/hx0fp0 --job=11 >lx0\n
\n
\n\n

Dielectric function and screened Coulomb interaction\n\n

$lmgw 16:22:30 : invoking /users/ms4/bin/code2/hsfp0 --job=12 >lsc\n \n \n\n Self-energy\n\n $ lmgw  16:22:38 : invoking /users/ms4/bin/code2/hqpe --job=0 >lqpe\n
\n
\n\n

Assemble components of potential and make QPE file.\n\n","dir":"/docs/outputs/gw_output/","name":"gw_output.md","path":"pages/gw_output.md","url":"/docs/outputs/gw_output/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Making the dynamical GW self energy","permalink":"/tutorial/gw/gw_self_energy/","auto":{"code":"gw","physical":"Self Energy","info":"Make the dynamical self-energy in Fe, starting from a static QSGW self-energy.","priority":6000},"header":false,"content":"

An exact one-body description of the many-body Schrödinger equation requires a time-dependent, non-hermitian potential,\ncalled the self-energy . This is because independent-particle states that solve a one-body Schrödinger\nequation are no longer eigenstates in the many-body case. Nevertheless many-body descriptions are usually characterized\nin terms of a one-particle basis. The imaginary part of carries information about the inverse lifetime (the\ntime for decay of a state to another state).\n\n

is in general nonlocal in both space and time. Nonlocality in time implies that depends on two\ntime coordinates and ; however in equilibrium it depends only on the difference .\nConverting time to its Fourier (frequency) representation, depends only on a single frequency .\nNonlocality in space implies that depends on two coordinates and .\nTranslational invariance of a crystal implies that for translations between one unit cell and another, \ndepends only on one (lattice) translation vector . With a Fourier from to \nrepresentation, depends only on one vector. For points within a unit cell, depends\non two coordinates and confined to a unit cell. Thus in general is\nwritten as .\n\n

The GW approximation indeed makes a fully nonlocal , and\nthis tutorial described how to construct and analyze it. The main utility used to analyze is\nlmfgws.\nDynamical Mean Field Theory (DMFT) is a single-site approximation; it thus makes \nnonlocal in time but local in space. However its time-dependence is calculated to a higher level of theory than is done\nfor the GW approximation. The DMFT package generates in a different way but, once created, can also use\nlmfgws to analyze it.\n\n

The Coherent Potential Approximation, or CPA replaces a true\natom with some effective average atom (either alloys or atoms of one kind but different moment orientations) Even though\nit is a one-body approximation, the CPA construction implies that, like DMFT, is nonlocal in time but local\nin space. It operates as a stand-alone package.\n\n

\n
\n\n\n\n

### Preliminaries

\n
\n\n

This tutorial assumes you have completed a QSGW calculation for Fe, following this tutorial,\nwhich requires that the GW script lmgwsc is in your path, along with\nthe executables it requires.\nIn addition it requires spectral and lmfgws.\n\n

This tutorial assumes the your build directory is ~/lm, and the\nexecutables are in ~/bin and ~/bin/code2.\n\n

### Command summary

\n
\n\n

Repeat the steps for LDA self-consistency and QSGW self-consistency\nin the Fe tutorial; see Command summary.\n\n

If you have already done so without removing any files, you can skip those steps.\n\n

If on the other hand you have retained the QSGW self-energy (file sigm),\nmake sure your charge density is self-consistent.\n\n

lmf fe > out.lmf\n
\n
\n\n

If you also retained the density restart file rst.fe this step is not necessary.\nMake all the inputs (e.g. screened coulomb interaction) up to the self-energy step:\n\n

lmgwsc --wt --code2 --sym --metal --tol=1e-5 --getsigp --stop=sig fe\n
\n
\n\n

This will give you everything you need to make .\n\n

Make the spectral function files SEComg.UP (and SEComg.DN)\n\n

env OMP_NUM_THREADS=8 MKL_NUM_THREADS=8 ~/bin/code2/hsfp0_om --job=4 > out.hsfp0\n
\n
\n\n

Postprocessing step translating SEComg.{UP,DN} into lmfgws-readable form\n\n

spectral --ws --nw=1\nln -s se se.fe\n\n\n\n... to be finished\n
\n
\n\n

### Introduction

\n\n

This tutorial starts after a QSGW calculation for Fe has been completed, in this tutorial.\n\n

The QSGW static self-energy was made with the following command:\n\n

$lmgwsc --wt --code2 --sym --metal --tol=1e-5 --getsigp fe\n \n \n\n Note: until that tutorial is written, perform the setup as follows (where ~/lm is your Questaal source directory)\n\n ~/lm/gwd/test/test.gwd --mpi=#,# fe 4\n \n \n\n This tutorial will do the following:\n\n \n\n ### Theory \n\n\n #### Z factor renormalization \n\n\n Begin with a noninteracting Green’s function , defined through an hermitian, energy-independent exchange-correlation potential . refers to a particular QP state (pole of ). There is also an interacting Green’s function, .\n\n The contribution to from QP state is\n\n\n\n where is the pole of .\n\n Write the contribution to from QP state as\n\n\n\n Note that this equation is only true if is diagonal in the basis of noninteracting eigenstates. We will ignore the nondiagonal elements of . Note that if is constructed by QSGW, this is a very good approximation, since at . Approximate G by its coherent part:\n\n\n\n where\n\n\n\n defines the factor. The dependence of and on is suppressed.\n\n Define the QP peak as the value of where the real part of the denominator vanishes.\n\n\n\n and so\n\n\n\n Note that in the QSGW case, the second term on the r.h.s. vanishes by construction: the noninteracting QP peak\ncorresponds to the (broadened) pole of G.\n\n The group velocity is . For the interacting case it reads\n\n\n\n Use the ratio of noninteracting and interacting group velocities as a definition of the ratio of inverse masses. From the chain rule\n\n\n\n Ignore the dependence of on .\nWrite as , and use the definition of\n to get\n\n\n\n So\n\n\n\n In the QSGW case the quantity in parenthesis vanishes. Thus QSGW there is no “mass renormalization” from the ω-dependent self-energy, Σ(ω).\n\n #### Coherent part of the spectral function \n\n Write as\n\n\n\n Rewrite as\n\n\n\n Using the standard definition of the spectral function, e.g. Hedin 10.9:\n\n\n\n the approximate spectral function is\n\n which shows that the spectral weight of the coherent part is reduced by Z.\n\n\n\n #### Simulation of Photoemission \n\n (needs cleaning up)\n\n Energy conservation : requires (see Marder, p735, Eq. 23.58)\n\n\n\n where Eb is the binding energy and\n is the energy of the electron after being ejected.\n(Marder defines with the opposite sign, making it positive).\n\n Momentum conservation : The final wave vector kf of the\nejected electron must be equal to its initial wave vector, apart from shortening\nby a reciprocal lattice vector to keep kf in the first Brillouin zone.\n\n Let be the energy on exiting the crystal, the work function and and are called the\nelectron binding energy and “inner potential.”\n\n Then\n\n\n\n The total momentum inside the crystal, ,\nis linked to the kinetic energy measured outside the crystal through\nEq.(1). The kinetic energy is linked to the binding energy\nthrough the equation where\n is the work function of the analyzer. Usually\n. The Fermi level is defined such that\n. The inner potential is defined by scanning the range of photon\nenergy under the constraint of normal emission: then the -point can\nbe identified and by using Eq.(1), and the inner potential experimentally determined.\n\n The momentum of the particle in free space is\n\n\n\n Resolve into components parallel and perpendicular to the surface\n\n\n\n After passing through the surface, is modified to\n; this is what is actually measured.\n\n The conservation condition requires\n\n\n\n is conserved on passing through the surface;\nthus . is not conserved; therefore\n\n\n\n The wave number shift is then\n\n\n\n and the crystal momentum actually being probed by the experiment is\n\n\n\n ### Make the GW dynamical self-energy \n\n The 1-shot GW self-energy maker, hsfp0, has a mode (--job=4) make the dynamical Σ(k,ω).\nSome changes to GWinput are needed. lmfgwd will automatically make these\nchanges if you used switch --sigw in the QSGW tutorial.\n\n With your text editor, modify GWinput. Change these two lines:\n\n  --- Specify qp and band indices at which to evaluate Sigma\n\n \n \n\n into these four lines:\n\n ***** ---Specify the q and band indices for which we evaluate the omega dependence of self-energy ---\n 0.01 2 (Ry) ! dwplot omegamaxin(optional) : dwplot is mesh for plotting.\n : this omegamaxin is range of plotting -omegamaxin to omegamaxin.\n : If omegamaxin is too large or not exist, the omegarange of W by hx0fp0 is used.\n\n \n \n\n Also change these lines\n\n *** Sigma at all q -->1; to specify q -->0. Second arg : up only -->1, otherwise 0\n 0 0\n \n \n\n to\n\n *** Sigma at all q -->1; to specify q -->0. Second arg : up only -->1, otherwise 0\n 1 0\n \n \n\n If you have removed intermediate files, you must remake them up to the point where the self-energy is made. Do:\n\n $ lmgwsc --wt --code2 --sym --metal --tol=1e-5 --getsigp --stop=sig fe\n
\n
\n\n

This step is not necessary if you have completed the QSGW Fe tutorial without removing any files.\n\n

The next step will make Σ(kn,ω) on a uniform energy mesh −2 Ry < ω < 2 Ry, spaced by 0.01 Ry\nat irreducible points kn, for QP levels specified in GWinput. This is a\nfairly fine spacing so the calculation is somewhat expensive.\n\n

\n
• Run hsfp0 (or better hsfp0_om) in a special mode --job=4 to make the dynamical self-energy.\n
\n\n
export OMP_NUM_THREADS=8\nexport MPI_NUM_THREADS=8\n~/bin/code2/hsfp0_om --job=4 > out.hsfp0\n
\n
\n\n

This step should create SEComg.UP and SEComg.DN. These files contain\nΣ(k,ω), albeit in a not particularly readable format.\n\n

### spectral, the self-energy translator

\n\n

spectral is a postprocessor that reads SEComg.UP (and SEComg.DN in the spin polarized case).\n\n

Its main purpose is to translate these files into file se.ext which\nlmfgws can read.\n\n

SEComg.UP and SEComg.DN contain the diagonal matrix element\n for each QP level j, for each irreducible point kn in the Brillouin zone, on a\n uniform mesh of points ω as specified in the GWinput file of the last section. If the absence of\n interactions, so the spectral function would be proportional to\n δ(ωω*), where ω* is the QP level (see Theory section).\n\n

Interactions give an imaginary part which broadens out the level, and in general,\n shifts and renormalizes the quasiparticle weight by Z. As noted in the\nTheory section, there is no shift if is the QSGW self-energy\n; there\nremains, however, a reduction in the quasiparticle weight. This will be apparent when\ncomparing the interacting and noninteracting DOS.\n\n

#### 1. Setup for lmfgws

\n\n

Starting from SEComg.UP (and SEComg.DN in the magnetic case)\ngenerated by hsfp0, use\nspectral to generate the  se  file as described\nin the lmfgws tutorial below.\n\n

#### 2. Use spectral to directly generate spectral functions for q=0

\n\n

spectral also has a limited ability to directly generate spectral functions from raw output SEComg.{UP,DN}\nwhich this section demonstrates.\n\n

Do the following:\n\n

$spectral --eps=.005 --domg=0.003 '--cnst:iq==1&eqp>-10&eqp<30'\n \n \n\n Command-line arguments are described here. In this context they have the following meaning:\n\n \n • \n --eps=.005 : 0.005 eV is added to the imaginary part of the self-energy. This is needed because as ω→0, ImΣ→0. Peaks in\nA(k,ω) become infinitely sharp for QP levels near the Fermi level.\n \n • \n --domg=.003 : interpolates Σ(kn,ω) to a finer frequency mesh.\n ω is spaced by 0.003 eV. The finer mesh is necessary because Σ varies smoothly with ω, while A will be sharply\n peaked around QP levels.\n \n • \n --cnst:expr : acts as a constraint to exclude entries in SEComg.{UP,DN} for which expr is zero. \nexpr is an integer expression using standard Questaal syntax for algebraic expressions.\nIt can that can include the following variables:\n \n • ib (band index)\n • iq (k-point index)\n • qx,qy,qz,q (components of q, and amplitude)\n • eqp (quasiparticle energy, in eV)\n • spin (1 or 2)\n \n\n The expression in this example, iq==1&eqp>-10&eqp<30, does the following: \n generates spectral functions only for the first k point (the first k point is the Γ point) \n eliminates states below the bottom of the Fe s band (i.e. shallow core levels included in the valence through local orbital) \n eliminates states 30 eV or more above the Fermi level.\n \n \n\n spectral writes files\nsec_ibj_iqn.up and\nsec_ibj_iqn.dn\nwhich contain information about the G for band j and the k point kn.\nA sec files takes the following format:\n\n # ib= 5 iq= 1 Eqp= -0.797925 q= 0.000000 0.000000 0.000000\n# omega omega-Eqp Re sigm-vxc Im sigm-vxc int A(w) int A0(w) A(w) A0(w)\n -0.2721160D+02 -0.2641368D+02 -0.6629516D+01 0.1519810D+02 0.2350291D-04 0.6897219D-08 0.7774444D-02 0.2281456D-05\n -0.2720858D+02 -0.2641065D+02 -0.6629812D+01 0.1520157D+02 0.4701215D-04 0.1379602D-07 0.7776496D-02 0.2281979D-05\n ...\n \n \n\n spectral also makes the k-integrated DOS. However, the k mesh is rather coarse and a\nbetter DOS can be made with lmfgws.\nSee below.\n\n  spectral: read 29 qp from QIBZ\n Dimensions from file(s) SEComg.(UP,DN):\n nq=1 nband=9 nsp=2 omega interval (-27.2116,27.2116) eV with (-200,200) points\n Energy mesh spacing = 136.1 meV ... interpolate to target spacing 3 meV. Broadening = 5 meV\n Spectral functions starting from band 1, spin 1, for 9 QPs\n\n file Eqp int A(G) int A(G0) rat[G] rat[G0]\n sec_ib1_iq1.up -8.743948 0.8473 0.9999 T T\n sec_ib2_iq1.up -1.674888 0.8251 0.9999 T T\n sec_ib3_iq1.up -1.674819 0.8251 0.9999 T T\n sec_ib4_iq1.up -1.674753 0.8251 0.9999 T T\n sec_ib5_iq1.up -0.795683 0.8278 0.9999 T T\n sec_ib6_iq1.up -0.795556 0.8278 0.9999 T T\n sec_ib7_iq1.up 24.572881 0.7374 0.9994 T T\n sec_ib8_iq1.up 24.572882 0.7374 0.9994 T T\n sec_ib9_iq1.up 24.572884 0.7374 0.9994 T T\n\n writing q-integrated dos to file dos.up ...\n Spectral functions starting from band 1, spin 2, for 9 QPs\n\n file Eqp int A(G) int A(G0) rat[G] rat[G0]\n sec_ib1_iq1.dn -8.458229 0.8447 0.9998 T T\n sec_ib2_iq1.dn 0.015703 0.8718 0.9999 T T\n sec_ib3_iq1.dn 0.016072 0.8700 0.9999 T T\n sec_ib4_iq1.dn 0.016437 0.8688 0.9998 T T\n sec_ib5_iq1.dn 1.552938 0.8363 0.9998 T T\n sec_ib6_iq1.dn 1.553722 0.8364 0.9999 T T\n sec_ib7_iq1.dn 24.695801 0.7317 0.9994 T T\n sec_ib8_iq1.dn 24.695832 0.7317 0.9994 T T\n sec_ib9_iq1.dn 24.695865 0.7317 0.9994 T T\n\n writing q-integrated dos to file dos.dn ...\n \n \n\n ### Dynamical self-energy editor lmfgws \n\n lmfgws is the dynamical self-energy editor, which performs a variety of postprocessing of the GW or\nDMFT self-energy for different purposes. The collection of points\nkn are typically supplied for a regular mesh. This need not be the case, but when the points do not correspond to\na regular mesh the parts of the editor that require k interpolation are not allowed. You must tell the editor that you are not using a\nuniform mesh (see irrmesh in the instructions below).\n\n lmfgws requires the same files lmf needs\nto compute the QSGW band structure, e.g. ctrl.ext and sigm.ext.\nIn addition it requires the dynamical self-energy se.ext\nin special a format written by the spectral utility.\n\n #### Setting up lmfgws with the spectral utility \n\n For definiteness this section assumes that ext is fe.\nStarting from SEComg.UP (and SEComg.DN in the magnetic case)\ngenerated by hsfp0, use\nspectral to generate se.fe:\n\n $ spectral --ws --nw=1\n$ln -s se se.fe\n \n \n\n \n • --ws tells spectral to write the self-energy to file se for all k points, in a special format designed for lmfgws.\nIndividual files are not written.\nIt must be renamed to se.ext for use by lmfgws.\n • --nw=1 tells spectral to write the self-energy\non the frequency mesh it was generated; no interpolation takes place.\n \n\n Try starting the dynamical self-energy editor:\n\n $ lmfgws ctrl.fe cat switches-for-lm --sfuned\n
\n
\n\n

You should see:\n\n

 Welcome to the spectral function file editor.  Enter '?' to see options.\n\n Option :\n
\n
\n\n

The editor operates interactively. It reads a command from standard input, executes the command, and returns to the\n Option prompt waiting for another instruction. The editor will print a short summary of instructions if you type  ? <RET>.\n\n

#### Editor instructions

\n\n

This sections documents the instruction set of the dynamical self-energy editor.\nCodes that can generate the input for this editor are spectral\nand lmfdmft.\n\n

\n
\nreads the self-energy from an ASCII (or binary) file. In the absence fn, the file name defaults to the ASCII file se.ext\n(readsek), or the binary seb.ext (readsekb).
\nThe structure of the file is documented here.\nData is read in the basis of 1-particle eigenfunctions for whatever states are supplied in the file. Some points of note:\n
\n
1. Data is stored for a collection of k points; the list of points is written in the file.\nThese points may, or may not constitute a uniform mesh of points.\n
2. QP levels are stored relative to the chemical potential (which may, but need not, be written in the header).\n
3. Only the diagonal elements of the potentials are read. The full complement of static potentials consist of\nthe static QSGW self-energy , the Fock exchange , and .\n
4. The se file may, but need not, contain these potentials. For example, none are supplied by lmfdmft.\n
5. Optional flags are strung together and separated by a delimiter, taken is the first character, e.g.  @ .
\nNote: if you are operating the editor in batch mode, be sure to distinguish this delimiter from the batch mode delimiter.\n
\n
• @fn=nam   use nam for self-energy file name\n
• @useef    file chemical potential becomes Fermi level\n
• @irrmesh  points are not on a regular  k  mesh : no  k  interpolations allowed\n
• @ib=list    after reading data from file, pare bands read from file to those in list\n
• @minmax     print minimum and maximum QP levels for each band\n
• @dc=#     subtract double counting # from Re sigma(omega) after reading\n
• @makeqpse  Not documented yet\n
\n \n
\n \n
\n
\n
• \n

units Ry  |  units eV
\nSelect Rydberg units or electron volt units (default=Ry).
\nNote: the se file can store data in either eV or Ry units;\nlmfgws internally converts it to whatever units you select.\n \n

• \n

evsync
\nreplace quasiparticle levels read from se.ext by recalculating them\nwith the same algorithm lmf uses.\n \n

• \n

eps val
\n add a constant val to Im Σ, needed to broaden spectral functions so that integrations are tractable.\n \n

• \n

ef Ef  |  ef=Ef
\nUse Ef for the Fermi level, overriding the internally calculated value.
\nNote: the order in which you use this switch is important.\nIf you use the  ef  switch beforereadsek,\nQP levels are shifted by  μ−Ef  when they are subsequently read (provided the chemical\npotential μ is supplied in the se file).\nIf you use this switch afterreadsek, no shifts are added. In such a case you likely want to\nrealign the QP levels with evsync after  readsek.\nAlways enter Ef in Ry units.\n \n

\n
\n
• dos|jdos|imeps   [nq=#1,#2,#3]   ib=list   [getev[=#1,#2,#3]]   [nw=#|domg=#]   [range=#1,#2]   [isp=#]
\ndos  integrates the spectral function to make both the QP and spectrum DOS.
\njdos  integrates either the QP or interacting spectral function to make the joint DOS.
\nimeps  integrates either the QP or interacting spectral function to make Imε.
\nOptions are:\n
\n
• ib=lst       \n restrict contribution to spectra from QP states in list.\n
• nq=#1,#2,#3  \n Interpolate Σj(kn,ω)\n to a new uniform mesh of k points, defined by (#1,#2,#3) divisions.\n Use between 1 and 3 numbers.\n
• nw=n       \n Refine the given energy mesh by interpolating Σ to an n multiple of the given energy mesh.\n n must be an integer.\n
• range=#1,#2   \n Generate DOS in a specified energy window (#1,#2), in eV.\n
• kT        \n Temperature, units of omega (applies only to jdos and imeps).\n
• a0        \n Spectra for noninteracting spectral function (only for jdos and imeps).\n
• isp=#      \n Generate DOS for spin # (1 or 2). Default value is 1.\n
\n \n
\n
\n
• se   iq=n|q=#1,#2,#3|allq|band[~args]   ib=list|ibx=list   [getev[=#1,#2,#3]]   [nw=n|domg=#]   [isp=#]   [range=#1,#2]
\nMake Σ(ω) and A(ω) for given q and range of bands.
\n  Required arguments are:\n
\n
• iq=n       \n index to qn, from list in QIBZ. Alternatively specify q by:\n
• q=#1,#2,#3   \n q-point in units of 2π/alat. lmfgws will interpolate Σ(qn) to any q.\n
• allq       \n  Σ(ω) is made for all q in the irreducible BZ and written to disk\n
• band      \n A(ω), Σ(ω) are made for qp along symmetry lines and written to disk.
\n        \n Use this mode to draw interacting energy bands, in conjunction with plbnds −sp
\n        \n Optional ~args are parsed like options of the --band switch\n
• ib=list      \n Sum together Aj(ω) derived from QP states j in list.
\n        \n ibx=list is similar to ib=list, but Aj(ω)\n is resolved by band, writing each Aj(ω) in succession.
\nOptions are:\n
• getev         \n Do not interpolate energy but calculate it at q.\n
• getev=#1,#2,#3   Generate evals on independent mesh with #1,#2,#3 divisions of uniformly spaced points.\n
• nw=n         \n Refine the given energy mesh by interpolating Σ to an n multiple of the given energy mesh.\n n must be an integer.\n
• range=#1,#2     \n Generate spectral function in a specified energy window (#1,#2)\n
\n \n
\n
\n
• pe|peqp   iq=n|q=#1,#2,#3   ib=#   [getev[=#1,#2,#3]]   [nw=#|domg=#]   [nqf=#]   [ke0=#]   [isp=i]   [range=#1,#2]
\nModel ARPES for given q and band(s).
\npe uses the spectrum self-energy, while peqp uses just the quasiparticle hamiltonian.\nFinal-state effects are folded into both.\nOnly the latter works with SO coupling now.
\nRequired arguments are:\n
\n
• iq=n      \n index to qn, from list in QIBZ. Alternatively specify q by:\n
• q=#1,#2,#3          \n q-point in units of 2π/alat. lmfgws will interpolate Σ(qn) to any q.\n
• ib=list                      \n Sum together PE spectrum derived from QP states j in list.\n See here for the syntax of integer lists.
\nOptions are:\n
• getev                       \n Do not interpolate energy but calculate it at q.\n
• getev=#1,#2,#3 Generate evals on independent mesh with #1,#2,#3 divisions of uniformly spaced points.\n
• nw=n                        \n Refine the given energy mesh by interpolating Σ to an n multiple of the given energy mesh.\n n must be an integer.\n
• isp=i                         \n Generate spectra for spin i (1 or 2). Default value is 1.\n
• nqf=n                      \n number of mesh points for final state integration. Default is 200.\n
• ke0=#                      \n kinetic energy of emitted electron. KE+V0=ℏω−φs+V0\n
• range=#1,#2  \n Generate spectral function in a specified energy window (#1,#2)\n
\n \n
\n
\n
• \n

qpse
\nGenerates the Quasiparticle “self-energy” (in practice the QP levels relative to the Fermi level).\n \n

• \n

savesea [fn]
\nsaves spectrum DOS or self-energy + spectral function, in ASCII format. In the absence fn, the file name defaults to seia.ext\nor seia2.ext when writing band and k-resolved spectral functions (se or pe)\nand to sdos.ext or sdos2.ext when writing spectrum dos (dos).\n \n

• \n

savese [fn]
\nsaves q-interpolated self-energy + spectral function in binary format. In the absence fn, the file name defaults to seib.ext.\n \n

• q
\nquits the editor unless information has generated that has not been saved. Program terminates.\n
• a
\n(abort) unconditionally quits the editor. Program terminates.\n
\n\n

\n\n\n

You can also run the editor in batch mode by stringing instructions together separated by a delimiter:\n\n

$lmfgws ctrl.fe cat switches-for-lm '--sfuned~first command~second command~...'\n \n \n\n The delimiter ( ~ in this case), is the first character following --sfuned.\nlmfgws will parse through all the commands sequentially until\nit encounters “quit” instruction ( ~a or ~q ) which causes it to exit.\nIf no exit instructions are encountered, lmfgws returns to the\ninteractive mode and prompts you with Option : .\n\n ### Compare interacting and independent-particle density-of-states in Fe \n\n This section uses the self-energy editor, lmfgws,\nto interpolate Σ(kn,ω) to a fine k- and ω- mesh\nto obtain a reasonably well converged density-of-states.\n\n $ lmfgws fe cat switches-for-lm '--sfuned~units eV~readsek~eps .030~dos isp=1 range=-10,10 nq=32 nw=30~savesea~q'\n
\n
\n\n

This invocation runs lmfgws in batch mode, and writes the spectral and noninteracting DOS to file sdos.fe.\nThe editor’s instructions do the following (documented here):\n\n

\n
• units eV
\nSet units to eV; spectrum DOS will be written in eV.\n
• eps .030
\nAdd 30 meV smearing to Im Σ\n
• dos isp=1 range=-10,10 nq=32 nw=30
\nMake the DOS for spin 1, in the energy range (-10,10) eV, interpolating Σ to a k mesh 32×32×32 divisions, and refining the energy mesh by a factor of 30.\nThe as-given k mesh is 8×8×8 divisions.\n
• savesea
\nWrite the DOS.\n
• q
\nExit the editor.\n
\n\n

Notes:\n\n

\n
• The mesh is very fine, so the interpolation takes a little while (2 to 3 minutes). The frequency and k meshes are both pretty fine and the DOS is\nrather well converged, as the figure below demonstrates.\n
• The spectrum DOS is written to file sdos.fe.\nColumns 1,2,3 are ω, A(ω), and A0(ω), respectively.\n
• A0(ω) should compare directly to the DOS calculated as a byproduct of lmf.\n
\n\n

You can make the QP DOS yourself, but to speed things up just copy it from the build directory to your working directory.\n\n

cp ~/lm/gwd/test/fe/dosp.fe dosp.fe\n
\n
\n\n

The following script draws a figure comparing the DOS generated the three different ways,\nusing the fplot utility.\nCut and paste the contents of the box below into script file plot.dos.\n\n

% char0 ltdos=\"1,bold=3,col=0,0,0\"\n% var ymax=1.4 dy=0.4 dw=.00 ymax+=dy emin=-10 emax=5 ef=0\nfplot\n\n% var ymax-=dy+dw dy=0.4 dmin=0 dmax=3\n -frme 0,1,{ymax-dy},{ymax} -p0 -x {emin},{emax} -y {dmin},{dmax} -tmy 1 -1p\n -colsy 3 -lt 1,bold=3,col=.5,.5,.5 sdos.fe\n -colsy 2 -lt {ltdos} -ord y -qr dosp.fe\n -colsy 2 -lt 1,bold=3,col=1,0,0 sdos.fe\n -lt 2,bold=3,col=0,0,0,2,.5,.05,.5 -tp 2~{ef},{dmin},{ef},{dmax}\n
\n
\n\n

\n\n

$fplot -f plot.dos\n$ open fplot.ps   [choose your postscript file viewer]\n
\n
\n\n

Notes on the figure:\n\n

\n
• The black line (col=0,0,0) is the noninteracting DOS generated by lmf.\n
• The grey line (col=.5,.5,.5) is the noninteracting DOS A0(ω),\ngenerated by lmfgws\n
• The red line (col=1,0,0) is the interacting DOS A(ω), generated by lmfgws\n
• Grey and black lines nearly coincide, as they should if the DOS is well converged. Note that the black line was generated from energy bands with the tetrahedron method,\nthe other effectively by integrating G0(k,ω) by sampling with a smearing of 30 meV.\n
• The noninteracting DOS at the Fermi level is D(EF)≅1/eV (one spin). The Stoner criterion for the onset of\n ferromagnetism is I×D(EF)>1, where I is the Stoner parameter, which DFT predicts to be\n approximately 1 eV for 3d transition metals. Combining DOS for the two spins would indicate that the Stoner criterion is well satisfied.\n
• The interacting DOS is smoothed out, and is roughly half the amplitude of the noninteracting DOS. This is also expected: the Z factor for the d states is about 0.5.\n
\n\n

### Spectral Function of Fe near the H point

\n\n\n

This example computes the self-energy for a q point near the H point. It is calculated from band 2 for the majority spin and bands 2,3 for the minority spin.\nThese bands were chosen because of their proximity to the Fermi level.\n\n

$lmfgws fe cat switches-for-lm '--sfuned~units=eV~eps .01~readsek~evsync~se q=1.05,2.91,1.01 ib=2 nw=10 getev=12 isp=1~savesea~q'\n$ lmfgws fe cat switches-for-lm '--sfuned~units=eV~eps .01~readsek~evsync~se q=1.05,2.91,1.01 ib=2,3 nw=10 getev=12 isp=2~savesea~q'\n
\n
\n\n

The first command writes a file seia.fe, the second seia2.fe\n\n

The following makes a picture comparing A (solid lines) and A0 (dashed lines),\nmajority spin (black) and minority spin (red)\n\n

$fplot -x -9,5 -y 0,1 -colsy 2 -lt 1,col=0,0,0 seia.fe -colsy 3 -lt 2,col=0,0,0 seia.fe -colsy 2 -lt 1,col=1,0,0 seia2.fe -colsy 3 -lt 2,col=1,0,0 seia2.fe\n$ open fplot.ps   [choose your postscript file viewer]\n
\n
\n\n

\n\n

You should see a weak plasmon peak in the majority spin band near −8 eV.\n\n\n\n

### Interacting joint Density-of-States and Optics

\n\n

lmfgws can make the joint density-of-states (JDOS) and the macroscopic dielectric function.\nThe joint DOS is given by\n\n\n\n

Note that is a (weak) function of temperature since the Fermi function contains temperature.\n\n

In the limit of noninteracting particles and this expression reduces to the standard expression for joint density-of-states\n\n\n\n

The following computes joint DOS (noninteracting case) using the lmf optics package.\nIt renames the file for future comparison.\n\n

lmf -vnk=32 fe cat switches-for-lm -vlteto=0 -voptmod=-1 --quit=rho\ncp jdos.fe jdos-lmf.fe\n
\n
\n\n

The following computes joint DOS for both static and interacting QS_GW_ self-energies, using lmfgws.\n\n

lmfgws fe cat switches-for-lm '--sfuned~units eV~readsek~eps .040~jdos range=-10,10 nq=32 a0 nw=5~savesea~q'\nlmfgws fe cat switches-for-lm '--sfuned~units eV~readsek~eps .040~jdos range=-10,10 nq=32 nw=5~savesea~q'\n
\n
\n\n

The first command makes file jdosni.fe, the second jdos.fe.\n\n

fplot -ab 'x1*13.6' -colsy 2,3 -ord y/13.6 jdos-lmf.fe -lt 2,col=1,0,0 -colsy 2,3 jdosni.fe -lt 3,bold=5,col=0,1,0 -colsy 2,3 jdos.fe\n
\n
\n\n

In the absence of a vertex, is proportional to the joint DOS, decorated by the matrix elements of\nvelocity operator, . The latter is usually calculated in terms of the\nmomentum operator . In Ry units reads\n\n\n\n

The following makes using lmf with gaussian sampling\nintegration.\n\n

lmf -vnk=32 fe cat switches-for-lm -vlteto=0 -voptmod=1 --quit=rho\ncp opt.fe opt-lmf.fe\n
\n
\n\n

The following computes for both static and interacting QSGW self-energies, using lmfgws.\n\n

lmf -vnk=32 fe cat switches-for-lm -vlteto=0 -voptmod=1 -vmefac=0 --quit=rho --opt:woptmc\nlmfgws fe cat switches-for-lm '--sfuned~units eV~readsek~eps .040~imeps range=-10,10 nq=32 a0 nw=5~savesea~q'\nlmfgws fe cat switches-for-lm '--sfuned~units eV~readsek~eps .040~imeps range=-10,10 nq=32 nw=5~savesea~q'\n
\n
\n\n

The lmf instructions generates stores matrix elements of the velocity operator in file\noptdatac.fe for lmfgws. The latter commands generate optni.fe and opt.fe. They are calculated in the same way, but\nfor spectral functions from the static and interacting QSGW self-energies.\n\n

Draw a picture of the three independent calculations of :\n\n

fplot -frme 0,1,0,.7 -frmt th=3,1,1 -xl \"~{w} (eV)\" -x 0,10 -y 0,32 -ab 'x1*13.6' -colsy 2,5 opt-lmf.fe -lt 2,col=1,0,0 -colsy 2,5 optni.fe -lt 3,bold=5,col=0,1,0 -colsy 2,5 opt.fe\n
\n
\n\n

Note that lmf uses Ry units; we specified eV in the lmfgws\ninstruction. Thus when comparing , the abscissa from for opt-lmf.fe\nmust be scaled (alternatively tell lmfgws to use Ry units).\n\n

You should see something similar to the figure shown below (the figure shown is smoother because nq=64 divisions\nwere used for the k mesh). For all three data, contributions are resolved into majority and minority parts. The\nphysically relevant is the sum of the two.\n\n

\n\n

Black ( computed by lmf) and Red ( computed by\nlmfgws, noninteracting case) are very similar. Dotted green is the corresponding\n computed in the RPA with the dynamical self-energy. There is a strong reduction of order because of\nloss of quasiparticle weight in the coherent part of \n\n

### Interacting band structure

\n\n

This block uses lmfgws to generates the band structure of the interacting Green’s function, i.e. the k-resolved spectral function along symmetry lines similar to a band plot for a noninteracting . Peaks in the spectral function correspond to the band structure;\nthe plot can be compared directly to the bands of the noninteracting G0.\nUse syml.fe from that tutorial, or use file syml2.fe, which\ncontain the symmetry lines as appear in Figure 1 of this Phys. Rev. B paper.\nInvoke lmfgws in batch mode as follows:\n\n

$cp ~/lm/gwd/test/fe/syml2.fe .\n$ lmfgws fe cat switches-for-lm '--sfuned~units=eV~readsek~eps .01~evsync=6~se band:fn=syml2 ib=1:10 nw=10 getev=12 isp=1 range=-10,10'\n
\n
\n\n

The self-energy editor carries out the following\n\n

\n
• units eV
\nSet units to eV\n
• eps .01
\nAdd 10 meV smearing to Im Σ\n
• evsync
\nrefresh quasiparticle levels read from se.fe by recalculating them.\n
• se   band:fn=syml2   ib=1:10   nw=10   getev=12   isp=1   range=-10,10
\nGenerate the self-energy and spectral function along symmetry lines given in file syml2.fe.\nInclude bands 1-10, and generate on a frequency mesh 10× finer than the one in se.fe.\ngetev refines the k-mesh to a 12×12×12 mesh, and using that mesh to interpolate bands along symmetry lines in syml2.fe.\nGenearte bands in an energy window [−10,10] eV.\n
\n\n

lmfgws writes a file, spq.fe.\n\n

Invoke plbnds in “spectral function mode:”\n\n

$plbnds -sp~atop=10~window=-4,4 spq.fe\n \n \n\n It will generate a gnuplot script file gnu.plt\ntogether with a data file spf.fe.\n\n Run gnuplot\n $ gnuplot gnu.plt\n$open spf.ps [choose your postscript file viewer]\n \n \n to generate and view postscript file spf.ps.\n","dir":"/tutorial/gw/gw_self_energy/","name":"gw_self_energy.md","path":"pages/gw_self_energy.md","url":"/tutorial/gw/gw_self_energy/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Introductory QSGW Tutorial","permalink":"/tutorial/gw/qsgw_si/","auto":{"code":"gw","info":"An introduction to QSGW : calculation for Si.","priority":9000},"header":false,"content":" This tutorial begins with an LDA calculation for Si, starting from an init file. Following this is a demonstration of a quasi-particle\nself-consistent GW (QSGW) calculation. An example of the 1-shot GW code is provided in a separate tutorial. Click on the dropdown\nmenu below for a brief description of the QSGW scheme. A complete summary of the commands used throughout is provided in a separate dropdown\nmenu. Theory for GW and QSGW, and its implementation in the Questaal suite, can be found in\nPhys. Rev. B76, 165106 (2007).\n\n \n\n \n\n Each iteration of a QSGW calculation has two main parts: a section that uses effective one-body hamiltonians to make the density n (as in DFT), and\nthe GW code that makes the self-energy of an interacting hamiltonian. For quasiparticle self-consistency, the\nGW code makes a “quasiparticlized” self-energy , which is used to construct the effective one-body hamiltonian for the\nnext cycle. The process is iterated until the change in becomes small.\n\n The one-body executable is lmf. The script lmfgwd is similar\nto lmf, but it is a driver whose purpose is to set up inputs for the GW code.\n is made by a shell script lmgw. The entire cycle is managed\nby a shell script lmgwsc.\n\n Before any self-energy exists, it is assumed to be zero. Thus the one-body hamiltonian is usually the LDA, though it can be something else, \ne.g. LDA+U. \nNote: in some circumstances, e.g. to break time reversal symmetry inherent in the LDA, you need to start with LDA+U.\n\n Thus, there are two self-energies and two corresponding Green’s functions: the interacting and non-interacting\n. At self-consistency the poles of and coincide: this is a unique and very\nadvantageous feature of QSGW. It means that there is no “mass renormalization” of the bandwidth — at least at the GW level.\n\n Usually the interacting isn’t made explicitly, but you can do so, as explained in this tutorial.\n\n In short, a QSGW calculation consists of the following steps. The starting point is a self-consistent DFT calculation (usually LDA). The DFT\neigenfunctions and eigenvalues are used by the GW code to construct a self-energy . This is called the “0th iteration.”\nIf only the diagonal parts of are kept, the “0th” iteration corresponds to what is sometimes called 1-shot GW, or as\nGLDAWLDA.\n\n In the next iteration, is added to the LDA hamiltonian. The density is made\nself-consistent, and control is handed over to the GW part. (Note that for a fixed density cancels the exchange-correlation\npotential from the LDA hamiltonian.) This process is repeated until the RMS change in falls below a certain\ntolerance value. The final self-energy (QSGW potential) can be thought of as an effective exchange-correlation functional that is tailored to the system.\nThis is very convenient as it can now be used in an analogous way to standard DFT to calculate properties such as the band structure.\n\n \n\n ### Command summary \n\n $ nano init.si                                             #create init file using lines from box below\n$blm init.si --express --gmax=5 --nk=4 --nit=20 --gw #use blm tool to create actrl and site files\n$ cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si    #copy actrl to recognised ctrl prefix, run lmfa and copy basp\n$lmf si > out.lmfsc #make self-consistent\n$ echo -1 | lmfgwd si                                      #make GWinput file\n$vim GWinput #change GW k mesh to 3x3x3\n$ lmgwsc --wt --insul=4 --tol=2e-5 --maxit=5 si            #self-consistent GW calculation\n$vim ctrl.si #change number of iterations to 1\n$ lmf si --rs=1,0                                          #lmf with QSGW potential to get QSGW band gap\n$lmgwclear #clean up directory\n \n \n\n Alternatively, you can run the following two one-liners to get the same result. This assumes you have already created the init file.\n\n $ blm init.si --express=0 --gmax=5 --nk=4 --nit=20 --gw --nkgw=3 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\n$echo -1 | lmfgwd si && lmgwsc --wt --insul=4 --tol=2e-5 --maxit=5 si > out.gwsc && lmgwclear && lmf si --rs=1,0 -vnit=1 > out.lmf_gwsc\n \n \n\n \n\n \n\n ### LDA calculation \n \n\n The starting point is a self-consistent LDA density, you may want to review the DFT tutorial for silicon. Copy the following lines \nto a file called init.si:\n\n LATTICE\n ALAT=10.26\n PLAT= 0.00000000 0.50000000 0.50000000\n 0.50000000 0.00000000 0.50000000\n 0.50000000 0.50000000 0.00000000\n# pos means cartesian coordinates, units of alat\nSITE\n ATOM=Si POS= 0.00000000 0.00000000 0.00000000\n ATOM=Si POS= 0.25000000 0.25000000 0.25000000\n \n \n\n Run the following commands to obtain a self-consistent density:\n\n $ blm init.si --express --gmax=5 --nk=4 --nit=20 --gw\n$cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si\n$ lmf si > out.lmfsc\n
\n
\n\n

Note that we have included an extra --gw switch, which tailors the ctrl file for a GW calculation. To see how it affects \nthe ctrl file, try running blm without --gw. The switch modifies the basis set section (see the autobas line) to increase \nthe size of the basis, which is necessary for GW calculations.\n\n

Two new blocks of text, the HAM and GW categories, are also added towards the end of the ctrl file. The extra parameters \nin the HAM category handle the inclusion of a self-energy, actually a GW potential (see theory notes above), in a DFT calculation. The GW category provides \nsome default values for parameters that are required in the GW calculation. The GW code has its own input file and the DFT ctrl \nfile influences what defaults are set in it, we will come back to this later. One thing to note is the NKABC= token, which defines the GW k-point mesh. \nIt is specified in the same way as the lower case nkabc for the LDA calculation.\n\n

Now check the output file out.lmfsc. The self-consistent gap is reported to be around 0.58 eV as can be seen by searching for the last occurence of the word ‘gap’.\nNote that this result differs slightly to that from the LDA tutorial because the gw switch increases the size of the basis set.\n\n

Now that we have the input eigenfunctions and eigenvalues, the next step is to carry out a GW calculation. For this, we need an input file for the GW code.\n\n

\n\n

### Making GWinput

\n
\n

The GW package (both one-shot and QSGW) uses one main user-supplied input file, GWinput. The script lmfgwd can create a template\nGWinput file for you by running the following command:\n\n

$echo -1 | lmfgwd si #make GWinput file\n \n \n\n The lmfgwd script has multiple options and is designed to run interactively. Using ‘echo -1’ automatically passes it the ‘-1’ \noption that specifies making a template input file. You can try running it interactively by just using the command ‘lmfgwd si’ and then entering ‘-1’. \nTake a look at GWinput, it is a rather complicated input file but we will only consider the GW k-point mesh for now (further information \ncan be found on the GWinput page). The k mesh is specified by n1n2n3 in the GWinput file, look for the \nfollowing line:\n\n $ n1n2n3  4  4  4 ! for GW BZ mesh\n
\n
\n\n

When creating the GWinput file, lmfgwd checks the GW section of the ctrl file \nfor default values. The ‘NKABC= 4’ part of the DFT input file (ctrl.si) is read by lmfgwd and used \nfor n1n2n3 in the GW input file. Remember if only one number is supplied in NKABC then that number is used as the division in each direction of the \nreciprocal lattice vectors, so 4 alone means a 4 x 4 x 4 k mesh. To make things run a bit quicker, change the k mesh to 3 x 3 x 3 by editing \nthe GWinput file line:\n\n

$n1n2n3 3 3 3 ! for GW BZ mesh\n \n \n\n The k mesh of 3 x 3 x 3 divisions is rough, but it makes the calculation fast and for Si the results are reasonable. As is the case with the LDA, it is very \nimportant to control k convergence. However, a coarser mesh can often be used in GW because the self-energy generally varies much more smoothly with k than \ndoes the kinetic energy. This is fortunate because GW calculations are much more expensive. It is important to note that convergence tests will have to be \nperformed for any new system. These can be time consuming and unfortunately there are no shortcuts.\n\n \n\n ### Running QSGW \n \n We are now ready for a QSGW calculation, this is run using the shell script lmgwsc:\n\n $ lmgwsc --wt --insul=4 --tol=2e-5 --maxit=0 si        #zeroth iteration of QSGW calculation\n
\n
\n\n

The switch ‘–wt’ includes additional timing information in the printed output, insul refers to the number of occupied bands (normally spin degenerate so \nhalf the number of electrons), tol is the tolerance for the RMS change in the self-energy between iterations and maxit is the maximum number of QSGW \niterations. Note that maxit is zero, this specifies that a single iteration is to be carried out starting from DFT with no self-energy (zeroth iteration).\n\n

Take a look at the line containing the file name llmf:\n\n

    lmgw  15:26:47 : invoking         mpix -np=8 /h/ms4/bin/lmf-MPIK --no-iactive  cspi >llmf\n
\n
\n\n

Each QSGW iteration begins with a self-consistent DFT calculation by calling the program lmf and writing the output to the \nfile llmf. We are starting from a self-consitent LDA density (we already ran lmf above) so this \nstep is not actually necessary here. The next few lines are preparatory steps. The main GW calculation begins on the line containing the file name ‘lbasC’:\n\n

    lmgw  16:27:55 : invoking /h/ms4/bin/code2/hbasfp0 --job=3 >lbasC\n    lmgw  16:27:55 : invoking /h/ms4/bin/code2/hvccfp0 --job=0 >lvccC ... 0.0m (0.0h)\n    lmgw  16:27:58 : invoking /h/ms4/bin/code2/hsfp0_sc --job=3 >lsxC ... 0.0m (0.0h)\n    lmgw  16:27:59 : invoking /h/ms4/bin/code2/hbasfp0 --job=0 >lbas\n    lmgw  16:27:59 : invoking /h/ms4/bin/code2/hvccfp0 --job=0 >lvcc ... 0.0m (0.0h)\n    lmgw  16:28:02 : invoking /h/ms4/bin/code2/hsfp0_sc --job=1 >lsx ... 0.0m (0.0h)\n    lmgw  16:28:02 : invoking /h/ms4/bin/code2/hx0fp0_sc --job=11 >lx0 ... 0.1m (0.0h)\n    lmgw  16:28:07 : invoking /h/ms4/bin/code2/hsfp0_sc --job=2  >lsc ... 0.1m (0.0h)\n    lmgw  16:28:13 : invoking /h/ms4/bin/code2/hqpe_sc 4 >lqpe\n
\n
\n\n

The three lines with lbasC, lvccC and lsxC are the steps that calculate the core contributions to the self-energy and the following lines up \nto the one with lsc are for the valence contribution to the self-energy. The lsc step, calculating the correlation part of the self-energy, is \nusually the most expensive step. The self-energy is converted into an effective exchange-correlation potential in the lqpe step and the final few \nlines are to do with its handling. Further information can be found in the annotated GW output page.\n\n

Run the command again but this time set the number of iterations (maxit) to something like 5:\n\n

$lmgwsc --wt --insul=4 --tol=2e-5 --maxit=5 si #self-consistent GW calculation\n \n \n\n The iteration count starts from 1 since we are now starting with a self-energy from the zeroth iteration. Again, the iteration starts with a \nself-consistent DFT calculation but this the zeroth iteration GW potential is used. The following line in the llmf file \nspecifies that the GW potential is being used:\n RDSIGM: read file sigm and create COMPLEX sigma(R) by FT ...\n \n \n The GW potential is contained in the file sigm, lmgwsc also makes a soft link sigm.si \nso lmf can read it. The GW potential is automatically used if present, this is specified by the RDSIG variable in \nthe ctrl file. Take a look at the GW output again and you can see that the rest of the steps are the same as before. After 3 \niterations the RMS change in the self-energy is below the tolerance - the calculation is converged.\n\n lmgwsc : iter 3 of 5 RMS change in sigma = 1.19E-05 Tolerance = 2e-5\n \n \n\n Now that we have a converged self-energy (sigm) we can go back to using lmf to calculate additional properties. We only want to run \na single iteration so change the number of iterations (nit) to 1 in the ctrl file. Run the following command:\n\n $ lmf si --rs=1,0                              #lmf with QSGW potential to get QSGW band gap\n
\n
\n\n

Inspect the lmf output and you can find that the gap is now around 1.42 eV. The --rs option tells lmf to read from the restart file, \nwhich contains the density, but not to write to it (once we have a converged density we want to keep this fixed). More information on command line switches can be \nfound here.\n\n

Check your directory and you will see that a large number of files were created. The following command removes many redundant files:\n\n

$lmgwclear #clean up directory\n \n \n\n Further details can be found in the Additional exercises below.\n\n \n\n ### Additional Exercises \n\n 1) Correct gap\n\n This is actually the Γ-X gap; the true gap is around 1.30 eV as can be seen by running lmf with a fine k mesh.\n\n 2) Changing k-point mesh\n\n Test the convergence with respect to the GW k mesh by increasing to a 4 x 4 x 4 k mesh.\n\n 3) Plotting bands\n\n Plotting bands is the same as in the DFT case. Try repeating the same steps for your QSGW converged density.\n\n 4) GaAs\n\n Try a QSGW calculation for GaAs. Note that the code automatically treats the Ga d state as valence (adds a local orbital). This requires a larger GMAX.\nYou also need to run lmfa a second time to generate a starting density that includes this local orbital. The lmfa line for GaAs should be:\n\n $ lmfa ctrl.gas; cp basp0.gas basp.gas; lmfa ctrl.gas \n
\n
\n\n

The init file is:\n\n

# init file for GaAs\nLATTICE\n#       SPCGRP=\n        ALAT=10.69\n        PLAT=    0.00000000    0.50000000    0.50000000\n                 0.50000000    0.00000000    0.50000000\n                 0.50000000    0.50000000    0.00000000\n# 2 atoms, 1 species\nSITE\n     ATOM=Ga   POS=    0.00000000    0.00000000    0.00000000\n     ATOM=As   POS=    0.25000000    0.25000000    0.25000000\n
\n
\n\n","dir":"/tutorial/gw/qsgw_si/","name":"gwintrotut.md","path":"pages/gwintrotut.md","url":"/tutorial/gw/qsgw_si/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Generating Energy Bands","permalink":"/tutorial/asa/energybands/","auto":{"code":"lm","physical":"Drawing Energy Bands","info":"How to generate energy bands in Si using the ASA program lm.","priority":8000},"header":false,"content":"

\n
\n\n

You can make energy bands along symmetry lines you specify, using any code with band-generating capability (lmf,\n lm,  tbe, and  lumpy), \nusing the  --band switch, in symmetry lines\nmode. Some information to help you construct symmetry lines for any crystal lattice can be found\nhere.\n\n

This tutorial shows how to generate energy bands for silicon using the ASA code  lm; but\nthe  --band  switch applies equally to all codes that make crystal energy bands.\n\n

As a second step you must draw the bands. In this tutorial we create a postscript figure using the\nplbnds and fplot utilities.\n\n

Spectral functions are the analog of energy bands for interacting hamiltonians such as generated by GW or Dynamical Mean Field Theory.\nSee this tutorial to draw the spectral function for Fe from a GW calculation.\n\n

\n

### Preliminaries

\n

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

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/.\n\n

$cd ~/build/\n \n \n\n with ~/build being the directory the lm repository was built in to.\n\n Note: the build directory should be different from the source directory.\n\n \n ### Tutorial \n\n Energy bands are typically plotted along specified symmetry lines, which information you supply through a symmetry-line file. For the\npurpose of this tutorial, we will use one included in the repository, although generally you will want to create your own. You can obtain\nthe symmetry-line file for silicon, syml.si, by following these commands:\n\n $ cp ../lm/startup/syml.si .\n
\n
\n\n

which will copy the symmetry-line file to your current working directory. For drawing bands you want to use the --band switch\nin the symmetry line mode. The symmetry line mode is the default mode; the code will generate bands along symmetry lines you specify.\n\n

\n\n

syml.si has rows such as:\n\n

41    .5  .5  .5     0  0  0                L to Gamma   (Lambda)\n...\n0     0   0   0      0  0  0\n
\n
\n\n

Each line of text specifies a line segment in k-space. In the first line of this file the segment runs from to in units of . ‘41’ specifies the number of k points are generated in this segment. At present the remainder of the line is not used. The last line tells the line reader not to read any more lines.\n\n

\n\n

To generate the bands, simply run\n\n

$lm si --band:fn=syml\n \n \n\n The –band switch tells lm to generate energy bands, contained in the bands.si file, along the specified k-points (rather than the standard cycle of integration of states over the Brillouin zone)\n\n Once you have this file, it can be plotted with your preferred plotting package. Here, we will give an example using plbnds and fplot:\n\n echo -15 15 5 10 | plbnds -fplot -scl=13.6 -ef=0 si\n \n \n\n Which will generate a fplot command file, plot.plnds, which can be run with\n\n fplot -f plot.plbnds\n \n \n\n This will give you your desired postscript file fplot.ps.\n\n ##### Colouring Energy Bands \n It is also possible to colour your generated energy bands. The idea behind this is to assign a weight to each line, which is can be coloured by the graphics plotting package.\n\n To obtain this, run the –band command with the list of orbitals you want to highlight\n\n --band~col=orbital-list~...\n \n \n\n E.g. for Arsenic, using lmf (the commands are the same for lm):\n\n $ lmf --band~col=28:47~syml ...\n
\n
\n\n

This will read line data from the syml file, and weight orbitals 28 to 47. Of course, you will want to colour specific orbitals, e.g. only the p orbitals. To see how the orbitals are ordered, run the energy band program (lm or lmf) with rather high verbosity (>51) and look for the tables following Makidx. This will detail at what orbital number various bands are located.\n\n

\n\n
Makidx:  basis arranged in downfolding order:\n ib     low      intermed       high        .. offH ..\n  1  spdf (16)       (0)        g (9)       0    0    0\n k2    sd (6)        (0)      pfg (19)     16    0    9\n k3     d (5)        (0)          (0)      22    0   28\n  2  spdf (16)       (0)        g (9)      27    0   28\n k2     p (3)        (0)     sdfg (22)     43    0   37\n k3     s (1)        (0)          (0)      46    0   59\n  3   spd (9)        (0)       fg (16)     47    0   59\n k2       (0)        (0)    spdfg (25)     56    0   75\n  4   spd (9)        (0)       fg (16)     56    0  100\n k2       (0)        (0)    spdfg (25)     65    0  116\n\nMakidx:  hamiltonian dimensions Low, Int, High, Negl: 65 0 141 94\nkappa   Low   Int   High  L+I  L+I+H  Neglected\n  1      50     0    50    50   100       0\n  2       9     0    91     9   100       0\n  3       6     0     0     6     6      94\n all     65     0   141    65   206      94\n\nOrbital positions in hamiltonian, resolved by l:\nSite  Spec  Total   By l ...\n  1   Ga     1:27   1:1(s)   2:4(p)   5:9(d)   10:16(f) 17:17(s) 18:22(d) 23:27(d)\n  2   As    28:47   28:28(s) 29:31(p) 32:36(d) 37:43(f) 44:46(p) 47:47(s)\n  3   EA1   48:56   48:48(s) 49:51(p) 52:56(d)\n  4   EC1   57:65   57:57(s) 58:60(p) 61:65(d)\n
\n
\n\n

As you can see, the relevant area is the last table.\n\n

\n","dir":"/tutorial/asa/energybands/","name":"lm_energybands.md","path":"pages/lm_energybands.md","url":"/tutorial/asa/energybands/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Self-Consistency With Approximate Linear Response","permalink":"/tutorial/asa/linear_response/","auto":{"code":"lm","physical":"Dielectric Response and Optics","info":"How to accelerate convergence to self-consistency in the ASA by estimating the static dielectric function."},"header":false,"content":"

\n
\n\n
\n

### Tutorial

\n

First, you need to care the ASA bare response function , which will be defined as:\n\n\n\n

is the constant potential shift in the channel of sphere , and is the induced change in the 0th moment in channel L of sphere R, without taking into account interactions between electrons (noninteracting susceptibility). The static dielectric response function is:\n\n\n\n

where\n\n

+ (on-site term = something like the intraatomic U)\n\n

and\n\n

lm and lmgf can both generate , and store it on the disk. If you have generated , you can have the mxing precedure construct and then screen by . More exactly, it replaces the raw qout (generated by lm or lmgf) by:\n\n\n\n

and then it proceeds with self-consistency in the usual way, using quot* in place of the usual qout. It is not difficult to show that if is the exact inverse dielectric function, qout* is the RPA estimate of the self-consistent density. See, for example, Richard Martin’s book, Electronic Structure. Indeed, is sometimes called the “density-density response function”.\n\n

To tell the code to do this screening, set OPTIONS_SC=2. The program will crash if it can’t read from the disk ( is stored in the file psta.ext). You can create either with the band program lm or the Green’s function code lmgf. Since the metals treatment of is very primitive in the lm coce, it is better to use the lmgf to create for metals. lmgf can also make for the noncollinear case. To run lmgf, you need to add a couple of tokens to the ctrl file. For either program, set OPTIONS_SCR=1 to create .\n\n

The intraatomic U is esimated from the second derivative of the sphere total energy wrt to charge. You can update it every iteration by adding 10*k to the token SCR=… thus SCR=52 will update the U each iteration in the sphere program.\n\n

If you don’t want to make , you can let the codes make a model estimate for you. It saves you the trouble of making , but it is less good than when is calculated explicitly.\n\n

All of these functionalities can be enabled through the OPTIONS_SCR token:\n\n

OPTIONS_SCR       opt    i4       1,  1          default = 0\n    Use scr to accelerate convergence:\n    0 do nothing\n    1 Make ASA static response function (see documentation)\n    2 Use response to screen output q and ves\n    4 Use model response to screen output q\n    6 Use response to screen output ves only\n      Add 1 to combine mode 1 with another mode\n      Add 10*k to compute intra-site contribution to vbare each kth iteration\n      Add 100*k to compute response function on every kth iteration\n
\n
\n\n

This tutorial covers the basics for running a self-consistent LDA calculation in the Atomic Spheres Approximation (ASA), starting with the creation of an input file. \nThere are two main sections:\n\n

\n
1. Building a suitable input file for an ASA-LDA calculation\n
2. Running a self-consistent calculation\n
\n\n

A detailed theoretical description of the ASA and its uses can be found here.\n\n

\n\n
$blm --express=0 --asa --wsitex --findes init.pbte\n$ blm --h\n$cp actrl.pbte ctrl.pbte\n$ blm --express=0 --asa --wsitex --addes init.pbte\n$cp actrl.pbte ctrl.pbte\n\n... the following from section 2.2 are optional\n$ lmchk ctrl.pbte\n$lmchk --findes --wsitex ctrl.pbte\n\n$ lmstr ctrl.pbte\n$lm -vnit=0 ctrl.pbte\n$ lm -vnit=20 ctrl.pbte\n$lmctl ctrl.pbte\n$ cat log.pbte >> ctrl.pbte\n
\n
\n\n

\n\n
\n\n
##### 1. Building the input file
\n\n

Under normal atmospheric conditions PbTe crystallises in the rocksalt structure with lattice constant a=6.428 Å.\nTo build an input file, the first step is to construct file init.ext (ext is replaced by a name of your choosing, usually related to the material being studied, pbte in this case). init.pbte will contain the structural information needed for the calculations demonstrated here. For PbTe it will look similar to the following. Copy the content of the box below into init.pbte:\n\n

LATTICE\n    ALAT=6.427916  UNITS=A\n        PLAT=    0.0000000    0.5000000    0.5000000\n                 0.5000000    0.0000000    0.5000000\n                 0.5000000    0.5000000    0.0000000\nSITE\n    ATOM=Pb   X=     0.0000000    0.0000000    0.0000000\n    ATOM=Te   X=     0.5000000    0.5000000    0.5000000\n
\n
\n\n

File init.pbte shown above has two sections: LATTICE and SITE. The lattice section includes information regarding the lattice structure such as lattice constant (ALAT=) and its units (UNITS=, Å in this case) plus the primitive lattice translation vectors (PLAT=). The site section of the init file includes the basis information. In the case of PbTe there are two atoms, one Pb and one Te at the position indicated by “X=” (X= indicates positions as fractional multiples of the lattice vectors. Alternatively, you can supply the position with POS=, which specifies positions in Cartesian coordinates, in units of the lattice constant).\n\n

Now that init.pbte has been created, blm will create the ctrl file, which is the primary input file for the Questaal suite. Invoke it this way:\n\n

$blm --express=0 --asa --wsitex --findes init.pbte\n \n \n\n This command will generate three new files which are site.pbte, actrl.pbte, and log.pbte.\n(The log file keeps track of key information generated by each program and will not be considered here.) The site file contains structural information in a form the\nQuestaal package can read, and the ctrl file contains all other information needed to carry out a self-consistent calculation (LDA-ASA calculation in this case).\nThe switches blm used have the following meanings:\n\n --express=0 controls the brevity of the input file (smaller numbers make more verbose files with more information.\n It is worth experimenting with this switch to find which style of control file you are most confortable with.\n--asa tells blm that you are preparing to do an ASA calculation\n--wsitex causes blm to write site positions as fractional multiples of the lattice vectors.\n--findes causes blm to find empty spheres to fill the unit cell.\n \n \n\n The last switch is necessary when using ASA, because the sum of sphere volumes must equal the cell volume. The ASA only works well when sites are closely packed. Close packing of open systems can be artificially accomplished by adding “empty” sites with Z=0.\n\n blm has a number of other command-line switches; to see what they are, type:\n\n $ blm --h\n
\n
\n\n

Now the only thing left to do is to rename actrl.pbte to ctrl.pbte, which is the name of the main input file.\n\n

$cp actrl.pbte ctrl.pbte\n \n \n\n blm writes to actrl, rather than ctrl, to avoid overwriting a file you may wish to keep.\n\n Note\n\n \n • Lines which begin with # are comment lines and are ignored. (More generally, text following # in any line is ignored).\n • Lines beginning with % directives to the preprocessor. Directives can perform various functions similar to a normal programming language, such as assigning variables, evaluating expressions, conditionally readings some lines, and repeated loops over sections of input.\n \n\n ##### 2. Adding empty spheres manually \n\n If you used blm as above to find the empty spheres (ES) you can skip section 2.1 below. It is included here to explain how to add empty spheres to an already existing ctrl file.\n\n ###### 2.1 Empty Spheres \n Begin by running blm with a slightly different set of switches:\n\n $ blm --express=0 --asa --wsitex --addes init.pbte\n$cp actrl.pbte ctrl.pbte\n \n \n\n --addes differs from --findes in that in the former case, blm prepares the input file for adding empty spheres, without actually adding them, while in the latter case blm addes them automatically.\n\n To check ES and volume packing invoke:\n\n $ lmchk ctrl.pbte\n
\n
\n\n

The full output can be viewed by clicking here (waiting for file storing system), however the important informations regarding the volume packing and overlap are towards the end of the standard output (stdout) and in this particular case it can be seen (in the case of no ES) in one line\n\n

Cell volume= 448.07190   Sum of sphere volumes= 301.06511 (0.67191)\n
\n
\n\n

Here the cell volume, sum of all sphere volumes and their ratio are presented, the latter of which has to be equal to 1 for an ASA calculation. Another important value is the overlap percentage, which in this case is given by\n\n

  OVMIN, 38 pairs:  fovl = 4.24366e-7   <ovlp> = 8.7%   max ovlp = 8.7%\n
\n
\n\n

This line tells us about the average and maximum sphere overlaps. Generally, for ASA the overlaps should be kept below 16% where possible. For full potential calculations generally 5% and below is safe. For GW calculations it should be below 2%. As the sum of sphere volumes is less than the cell volume, we have to add artificial atoms with Z=0 (“empty spheres”) to meet this requirement.\n\n

The appropiate space filling spheres can be found using lmchk by invoking:\n\n

$lmchk --findes --wsitex ctrl.pbte\n \n \n\n We have added two command-line switches: the first is to invoke the procedure to find the empty spheres and the second is to write the information into a new site file called essite.pbte. At the end of the stdout generated by lmchk you will see the following snippet:\n\n  ... Final sphere sizes and packing fraction (2 new spheres)\n\n SCLWSR: mode = 30 vol = 448.072 a.u. Initial sphere packing = 81.3% scaled to 100%\n constr omax1= 16.0 18.0 20.0 % omax2= 40.0 100.0 100.0 %\n actual omax1= 8.7 12.1 0.0 % omax2= 16.0 24.6 0.0 %\n\n spec name old rmax new rmax ratio\n 1 Pb 3.300000 3.300000 1.000000\n 2 Te 3.300000 3.300000 1.000000\n 3 E 1.959808 2.598601 1.325947\n \n \n\n which indicates two new empty spheres have been found, and the new sphere packing is 100%. The control file has to be changed to reflect the new basis. First, change:\n\n  NBAS=2+{les?0:0} NL=4 NSPEC=2+{les?0:0}\n \n \n\n to\n\n  NBAS=2+{les?2:0} NL=4 NSPEC=2+{les?1:0}\n \n \n\n Quantities in brackets {…} are algebraic expressions. In particular, {les?2:0} uses C-like syntax consisting of three expressions separated by ‘?’ and ‘:’. The first (les in this case) is evaluated. If les is nonzero, the result of the entire bracket is the result of the second expression (2 in this case) and otherwise the result of the third (0). In the line above,\nthe contents of tag NBAS= can be interpreted as “if les>0 then NBAS=4 else NBAS=2”. Similarly the contents of NSPEC can be interpreted as “if les>0 NSPEC=3 else NSPEC=2”. “les” is a variable that is defined in the control file through the following line\n\n  % const nit=10 les=1\n \n \n\n Here we have also defined nit with value of 10. Finally, we have to pass the information about the empty sphere sites to the control file. We do this by commenting both instances of the line beginning FILE=site and uncommenting the line FILE=essite, as essite.pbte has the new appropiate information.\nNote: there are two instances of FILE=site : the first occurs in the STRUC category, where lattice information is read. The second occurs in the SITE category, where basis information is read. Be sure to comment/uncomment both instances.\n\n The last step is to copy the new species information from file poses.pbte file to the SPEC category within the ctrl file, including the new empty spheres.\n\n ###### 2.2 Self-consistency \n Before a self consistent calculation can be performed the real-space structure constants have to be generated. They are made once, for a given structure, with a separate tool\n\n $ lmstr ctrl.pbte\n
\n
\n\n

The penultimate step, is to generate a starting potential. In the ASA, the potential is determined through multipole moments , , . For this we first change the nkabc variable within the control file to (nkabc=4, this variable represents the k-mesh density). Use your text editor to change:\n\n

% const nkabc=0\n
\n
\n\n

to\n\n

% const nkabc=4\n
\n
\n\n

Invoke lm executable with zero number of iterations as:\n\n

$lm -vnit=0 ctrl.pbte\n \n \n\n This command takes , , and makes a trial potential from it. You supply , , ; if you do not will take some simple default guesses. blm does not supply these values.\n\n For a self consistent LDA-ASA calculation invoke lm with nit>0, e.g.\n\n $ lm -vnit=20 ctrl.pbte\n
\n
\n\n

You should see “Jolly good show” at the end of the standard output will indicate if self-consistency has been achieved, which in this case it has.\n\n

Note: -vnit=20 does not directly set the number of iterations. This number is determined by token NIT in this line:\n\n

ITER  MIX=B2,b=.3,k=7  NIT={nit}  CONVC=1e-5\n
\n
\n\n

The preprocessor sees the the curly brackets ({nit}), treats the contents as an expression (a trivial one in this case) and substitutes the result (20) for {nit}.\n\n

As a final step, you can collect the self-consistent moments generated by lm and add them to the ctrl file. Type\n\n

$lmctl ctrl.pbte\n \n \n\n lmctl clears the log file, log.pbte, and overwrites it with linearization parameters P and moments , , , in a form suitable for the ctrl file. Append log.pbte with, e.g.\n\n $ cat log.pbte >> ctrl.pbte\n
\n
\n\n

In this way the ctrl file retains the essential information for the self-consistent density.\n","dir":"/tutorial/asa/pbte_calculation/","name":"lm_pbte_calculation.md","path":"pages/lm_pbte_calculation.md","url":"/tutorial/asa/pbte_calculation/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"ASA Partial DOS","permalink":"/tutorial/asa/pdos/","auto":{"physical":"Partial DOS","code":"lm","info":"An introduction to generating partial DOS with lm."},"header":false,"content":"

\n
\n\n

### Preliminaries

\n
\n

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. In practice, this directory can be named differently.\n\n

All instances of commands assume the starting position is (this can be checked with the pwd command)\n\n

$~/your_build_directory/\n \n \n\n With your_build_directory being the directory the lm repository was built in to. Note: You will require files in the repository and those of the built suite, so it is advised to build in to the same directory as the repository itself.\n\n ### Tutorial \n \n For the purpose of the demonstration, we will use the Cr3Si6 input file generated in this tutorial, ctrl.cr3si6.\n\n Placing the ctrl.cr3si6 file in the same directory as the lm program, we can run the command\n\n $ lm cr3si6 -vnsph=1 -vnit=0 --pr30,31\n$lmdos cr3si6 -vnk=16 -vmet=1 --iactiv --pr30\n \n \n\n The latter command will prompt you, to which you should enter\n\n $ 1001 -1 .3\n
\n
\n\n

And then hit RETURN. This will create a dos.cr3si6 file.\n\n

This file can then be used with pldos and the plotting package fplot to plot the partial DOS. To do this, execute the command\n\n

$echo 8 7 / | pldos -fplot '-lst=1,2,3;4,5,6' dos.si\n \n \n\n Which creates dosp.dat and a plot.pldos file. The plot.pldos file holds the commands that fplot requires to plot. These can be used with\n\n $ fplot -disp -pr10 -f plot.dos\n
\n
\n\n

Generating a ps.dat file – your partial DOS plotting.\n","dir":"/tutorial/asa/pdos/","name":"lm_pdos.md","path":"pages/lm_pdos.md","url":"/tutorial/asa/pdos/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Including Augmented Plane Waves in the lmf Basis Set","permalink":"/tutorial/lmf/apw/","auto":{"code":"lmf","physical":"Augmented Plane Waves","info":"How to augment the lmf basis sset with Augmented Plane Waves (APWs).","priority":4300},"header":false,"content":"

\n
\n\n

### Preliminaries

\n
\n

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.\n\n

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/.\n\n

$cd ~/build/\n \n \n\n with ~/build being the directory the lm repository was built in to.\n\n Note: the build directory should be different from the source directory.\n\n ### Tutorial \n \n Adding APWs to lmf is exemplified in these test cases\n\n $ fp/test/test.fp srtio3\n$fp/test/test.fp cu\n \n \n\n 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.\n\n 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).\n\n The tokens of importance are (these can be seen in detail here)\n\n PWMODE=#\nPWEMIN=#\nPWEMAX=#\nOVEPS=#\n \n \n\n 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.\n\n 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.\n\n 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:\n\n fp/test/ctrl.cu\nfp/test/syml.cu\n \n \n\n 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\n\n lmfa --no-iactiv cu -vnk=8 -vbigbas=f\n \n \n\n 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:\n\n lmf --no-iactiv cu -vnk=8 -vbigbas=t -vpwmode=11 -voveps=0d-7 --band:fn=syml\n \n \n\n 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.\n\n 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:\n\n cp bnds.cu bnds.lapw\necho -10 40 5 10 | plbnds -lbl=L,G,X,W,G,K -ef=0 -scl=13.6 -fplot -dat=apw bnds.lapw\ncp bnds.cu bnds.lmto\necho -10 40 5 10 | plbnds -lbl=L,G,X,W,G,K -ef=0 -scl=13.6 -fplot -dat=lmto bnds.lmto\nawk '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~\nfplot -disp -f plot.plbnds~\n \n \n","dir":"/tutorial/lmf/apw/","name":"lmf_apw.md","path":"pages/lmf_apw.md","url":"/tutorial/lmf/apw/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Extremal points and effective mass","permalink":"/tutorial/lmf/bandedge/","auto":{"code":"lmf","physical":"","info":"Using the band-edge script to find extremal points in k-space and calculate effective masses.","priority":8200},"header":false,"content":" This tutorial demonstrates how to find extremal points (maxima/minima) in k-space and calculate effective masses using the band-edge program. This is done for silicon starting from a self-consistent LDA density. Silicon is a trivial example as its extremal points are found on high-symmetry lines. The band-edge program is particularly useful when looking for multiple extremal points that do not fall on high-symmetry lines.\n\n \n\n blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\nlmf si --rs=1,0 -vnit=1 --band~fn=syml #calculate bands\necho -6,6 / | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si #set up plotting\nfplot -f plot.plbnds && gs fplot.ps #plot and view\n\nband-edge -floatmn -maxit=20 -r=0.1 -band=5 -q0=0.1,0.2,0.3 si #float step\nband-edge -edge2=1 -maxit=20 -r=.04 -band=5 -gtol=.0001 -q0=-0.02,0.01,0.83 si #gradients step\nband-edge -mass -alat=10.26 -r=.0005,.001,.002,.003 -band=5 -q0=0,0,0.846 si #calculate mass\n \n \n\n \n\n ### Tutorial \n\n The starting point is a self-consistent LDA density, you may want to review the DFT tutorial for silicon. Copy the following lines to a file called init.si:\n\n LATTICE\n ALAT=10.26\n PLAT= 0.00000000 0.50000000 0.50000000\n 0.50000000 0.00000000 0.50000000\n 0.50000000 0.50000000 0.00000000\n# pos means cartesian coordinates, units of alat\nSITE\n ATOM=Si POS= 0.00000000 0.00000000 0.00000000\n ATOM=Si POS= 0.25000000 0.25000000 0.25000000\n \n \n\n Run the following command to obtain a self-consistent density:\n\n $ blm --express si --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\n
\n
\n\n

It will be helpful to have a band structure to refer to when finding the extremal points, you may want to review the\nsilicon band plotting tutorial. Create a symmetry file syml.si containing the following lines:\n\n

41  .5 .5 .5     0  0  0                L to G\n41   0  0  0     1  0  0                G to X\n21   1  0  0     1 .5  0                X to W\n41   1 .5  0     0  0  0                W to G\n0    0 0 0  0 0 0\n
\n
\n\n

Run the following command to generate the bands:\n\n

$lmf si --rs=1,0 -vnit=1 --band~fn=syml\n \n \n\n Now plot the bands by running the following two commands:\n\n $ echo -6,6,10,15 | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si    #set up plotting\n$fplot -f plot.plbnds && gs fplot.ps #plot and view\n \n \n\n Take a look at the band structure plot. The valence band maximum falls at the point while the conduction band minimum lies\nbetween and X, at about 0.85 of the distance to X.\n\n We will now use the band-edge tool to accurately locate the position of the conduction band minimum and to calculate the effective mass. This is done in three steps, you first do a rough search by ‘floating’ to a point near the minimum. From here, you do a more refined search by carrying out a minimization until the gradient is negligibly small. Lastly, you calculate the effective mass around this point.\n\n #### 1. Float to low-energy point \n The band-edge script has a ‘float’ option that is useful for doing a quick search to find a low-energy (or high-energy) region of k-space. You specify a starting point, then the script creates a cluster of points around it and checks what is the lowest-energy point. It then uses the lowest-energy point as the next central point, creates a new set of points around it and again moves to the lowest-energy one. This process is repeated until the central point is the lowest-energy point.\n\n Let’s pick a random point (0.1,0.2,0.3) and let band-edge float downhill. Run the following command:\n\n $ band-edge -floatmn -maxit=20 -r=0.1 -band=5 -q0=0.1,0.2,0.3 si\n
\n
\n\n

‘−floatmn’ tells band-edge to seek a minimum-energy point (see additional exercises for a maximum-energy point example). ‘−maxit’ switch sets the number of iterations (number of times a set of points is created), ‘−r=’ sets a range that defines how far from the centre the points are generated, ‘−band’ is for the band considered (here conduction band is 5 since 4 electrons and spin degenerate) and lastly −q0 is the starting k-point.\nTo see what switches band-edge has, invoke it without any arguments.\n\n

You should get an output similar to the following:\n\n

         check that \"lmf si\" reads input file without error ... ok\n         start iteration 1 of 20\n         lmf si --band~lst=5~box=0.1,n=12+o,q0=0.1,0.2,0.3 > out.lmf\nqnow     :     0.100000     0.200000     0.300000       0.3728323\ngradient :    -0.154879     0.182604    -0.061755       0.247276\nq*       :     0.160109     0.113958     0.240887\nuse      :     0.027639     0.147427     0.344721\n...\n         start iteration 8 of 20\n         lmf si --band~lst=5~box=0.1,n=12+o,q0=-0.017083,0.009789,0.834163 > out.lmf\nqnow     :    -0.017083     0.009789     0.834163       0.2202239\ngradient :    -0.045667     0.028215    -0.015231       0.055799\nq*       :    -0.004562     0.001050     0.845041\n         cluster center is extremal point ... exiting loop\n\nq @ minimum gradient :    -0.017083     0.009789     0.834163\nFinal estimate for q :    -0.017083     0.009789     0.834163\n
\n
\n\n

Take a look at the first line beginning with lmf. band-edge tells you what command it\nuses for the energy of each point in the cluster around your starting point. In each iteration qnow gives the current central k-point\nand its energy in Rydbergs. ‘use’ prints the lowest-energy k-point in the cluster of points around the middle point; this will then be\nused as the central point in the next iteration. The cluster of 13 k-points and their energies are printed to bnds.si. Take a look and you will see that (-0.017083,0.009789,0.834163) is indeed the lowest-energy point in the cluster.\n\n

As the iterations proceed, note that the energies at qnow are going down as we float to a low-energy region. After 8 iterations, the following \nis printed: ‘cluster center is extremal point … exiting loop’. The central k-point is the lowest-energy point and the float routine is finished.\n\n

\n

Starting from the low-energy point we floated to, the next step is to do a more refined search using a gradient minimization \napproach. band-edge creates a new cluster of points, does a quadratic fit and then traces the gradients \nto a minimum point. Run the following command:\n\n

$band-edge -edge2=1 -maxit=20 -r=.04 -band=5 -gtol=.0001 -q0=-0.02,0.01,0.83 si\n \n \n\n The ‘edge2’ part specifies what gradient minimization algorithm to use (run ‘band-edge –h’ for more information), the r is the excursion \nrange (step size in minimization), the ‘gtol’ is the tolerance in the gradient and the q0 is the starting point that we obtained from the float step.\n\n The output is similar to before but now we will pay attention to the gradient line which prints the x, y and z gradient components and the last column \ngives the magnitude. Note how the gradient magnitude is decreasing with each step until it falls below the specified tolerance (gtol). At this point, \nthe gradients minimization is converged and the following is printed ‘gradient converged to tolerance gtol = .0001’. It found the minimum gradient to \nbe (0,0,0.847).\n\n #### 3. Calculate effective mass \n Now that we have accurately determined the conduction band minimum, we can calculate the effective mass. This is done by fitting a quadratic form to a set \nof points around the conduction band minimum. Run the following command:\n\n $ band-edge -mass -alat=10.26 --bin -r=.0005,.001,.002,.003 -band=5 -q0=0,0,0.846 si\n
\n
\n\n

The mass tells band-edge to do effective mass calculation. alat is the lattice constant (found in various places \nsuch as the lmf output, init or site file). The lattice constant is needed to convert to atomic units since the code reports \nk-points in units of .  r gives the radii of the four clusters of points around the central point; each radius has 32 points (points \nand faces of an icosohedron). The extra points improve the accuracy of the quadratic fitting.\n\n

The last line of the output prints the three effective mass components in atomic units. So for silicon, the effective mass is anisotropic with lighter masses \nin two directions and a heavier effective mass in the third direction.\n\n

    0.918580    0.185604    0.185532\n
\n
\n\n

\n\n

1) Valence band maximum and effective mass\n\n

Although we know the valence band maximum for silicon is at the point, we will use it as an example for finding a maximum point. Try starting from the\npoint (0.1,0.1,0.1). In the float step, change the floatmn (for minimum) to floatmx (for maximum) and change the band number to 4 (for valence band). Notice the \nenergies are going up. Now do a gradient minimization from the point you floated to, remember to change the band number to 4. The valence band maximum is in a flatter \nregion so try using a smaller excursion radius, say 0.001. Then calculate the effective mass. Your values should be around (-0.34, -0.56, -0.88). The negative \nsigns indicate a maximum point, a saddle point would have at least one positive sign.\n\n","dir":"/tutorial/lmf/bandedge/","name":"lmf_bandedge.md","path":"pages/lmf_bandedge.md","url":"/tutorial/lmf/bandedge/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Generating and plotting energy bands","permalink":"/tutorial/lmf/bandplotting/","auto":{"code":"lmf","physical":"","info":"An introductory tutorial showing how to plot bands in Si.","priority":8500},"header":false,"content":"

This tutorial demonstrates how to plot bands. This is done for silicon starting from a self-consistent LDA density.\nPlotting bands with color weights is given an additional exercise.\n\n

\n\n

The following steps require init.si and syml.si.\n\n

blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\nlmf si --rs=1,0 -vnit=1 --band~fn=syml                                  #calculate bands\necho -6,6 / | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si      #set up plotting\nfplot -f plot.plbnds && gs fplot.ps                                     #plot and view\n
\n
\n\n

\n\n

### Tutorial

\n\n

The starting point is a self-consistent LDA calculation, you may want to review the DFT tutorial for silicon.\nCopy the contents of the box below to file init.si.\n\n

\nLATTICE\n        ALAT=10.26\n        PLAT=    0.00000000    0.50000000    0.50000000\n                 0.50000000    0.00000000    0.50000000\n                 0.50000000    0.50000000    0.00000000\n# pos means cartesian coordinates, units of alat\nSITE\n     ATOM=Si   POS=    0.00000000    0.00000000    0.00000000\n     ATOM=Si   POS=    0.25000000    0.25000000    0.25000000\n
\n\n

The following command constructs an input file and generates a self-consistent density in the LDA.\n\n

$blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\n \n \n\n To plot the band structure you need to specify the symmetry lines. Create file syml.si with the following lines:\n\n \n41 .5 .5 .5 0 0 0 L to G\n41 0 0 0 1 0 0 G to X\n21 1 0 0 1 .5 0 X to W\n41 1 .5 0 0 0 0 W to G\n0 0 0 0 0 0 0\n \n\n Each line specifies a line segment in k-space. Consider the first line above, which is the line between the high-symmetry points\nL and . The first entry ( 41 ) specifies the number of k points along the line segment. .5 .5 .5 and\n 0 0 0 are xyz coordinates of the line segment connecting\nthe L and points in units of , with the lattice constant. The last line\nindicates the end of the file.\n\n To generate the bands run lmf with the --band switch.\nNote that lmf si and lmf ctrl.si do the same thing (see DFT tutorial for silicon for more).\n\n $ lmf si --rs=1,0 -vnit=1 --band~fn=syml                                #calculate bands\n
\n
\n\n

The switches perform the following functions:\n

\n
• --rs=1,0 specifies that the restart file rst.si (containing the density) is to be read but not written to.\n
• −vnit=1sets preprocessor variable nit to 1, which controls the number of iterations in ctrl.si.\n
• --band tells lmf to generate energy bands, reading symmetry lines from syml.si.\n
\n\n

lmf writes energy bands to file bnds.si. Its syntax is explained here.\nThe first line (header) reads\n\n

   26   0.18551     0\n
\n
\n\n

and specifies the number of bands, the Fermi level (in Rydbergs) and a number to do with plotting with color weights\n(see additional exercises). Generally the Fermi level should come out not too far from zero. This has to do with the\nchoice of reference potential (a constant potential shift cannot change the electronic structure).\n\n

Now plot the bands by running the following two commands:\n\n

$echo -6,6 / | plbnds -fplot -ef=0 -scl=13.6 -lbl=L,G,X,W,G bnds.si #set up plotting\n$ fplot -f plot.plbnds                                                  #create fplot.ps\n
\n
\n\n

The first line uses the plbnds utility to do some data conversion and generate a script for the graphics package fplot.\nMore details can be found in the plbnds documentation page and the fplot documentation page.\nArguments to this line have the following meaning:\n

\n
• echo -6,6 /  becomes standard input for plbnds. It rads the energy window for the bands from stdin.\n
• -fplot  generates data files and a script for the fplot utility\n
• -ef=0  shifts the fermi energy to zero\n
• -scl=13.6  scales the band energies by 13.6, converts from Ry to eV\n
• -lbl supplies the symmetry point labels for the end points.\n
\n\n

The fplot command plots the band structure, reading script plot.plbnds generated by plbnds.\nIt generates a postscript file fplot.ps. Open this file with a document viewer of your choice, e.g.\n\n

$gs fplot.ps\n \n \n\n You can see that silicon has an indirect band gap of around 0.60 eV. The valence band maximum falls at the\n point while the conduction band minimum lies between and X, at about 0.85 of the distance to X.\nThe experimental gap is about 1.2 eV.\n\n \n\n ### Other Resources \n\n 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.\n\n \n\n ### Additional Exercises \n\n 1) Drawing bands with color weights\n\n 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.\n\n 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:\n\n To see how the orbitals are ordered, run the lmf program with high verbosity:\n\n $ lmf si --rs=1,0 --quit=ham --pr60\n
\n
\n\n

Switch  –quit=ham  tells lmf to stop after assembling the hamiltonian (we\nonly want to print some information). Towards the end of the output, you will see the following section:\n\n

Orbital positions in hamiltonian, resolved by l:\nSite  Spec  Total    By l ...\n  1   Si    1:13   1:1(s)   2:4(p)   5:9(d)   10:10(s) 11:13(p)\n  2   Si   14:26   14:14(s) 15:17(p) 18:22(d) 23:23(s) 24:26(p)\n
\n
\n\n

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\nordered by angular momentum (, , etc). Here we are actually using a basis set with two sets of energies (double kappa), the first set is listed\nas 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\nlmf including the and orbitals like so:\n\n

$lmf si --rs=1,0 -vnit=1 --band~fn=syml~col=1,10,14,23~col2=2:4,11:13,15:17,24:26\n \n \n\n Here, ‘col’ specifies the basis functions and ‘col2’ specifies the . Take a look at the bnds file and you will see that color weights\ninformation 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\nblock 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)\nlist the and weights respectively. The first line of bnds.si now reads\n\n  26 0.18551 2 col= 1,10,14,23 col2= 2:4,11:13,15:17,24:26\n \n \n\n Note the extra information indicating that the file contains two color weights.\n\n Plot the color-weighted bands by running the following commands:\n\n $ 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\n$fplot -f plot.plbnds\n \n \n\n The color weights are specified in RGB notation after col, colw and colw2. The first color weight (for contribution) is\nred, 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\ncharacter is black. Open fplot.ps and you will see the and character highlighted in red and blue.\n","dir":"/tutorial/lmf/bandplotting/","name":"lmf_bandplot.md","path":"pages/lmf_bandplot.md","url":"/tutorial/lmf/bandplotting/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Optimisation of the lmf basis set","permalink":"/tutorial/lmf/basis_optimisation/","auto":{"code":"lmf","info":"Demonstrates lmf's automatic basis optimization option.","priority":4400},"header":false,"content":" This tutorial shows how to optimize the basis set for SrTiO3.\nThe input file ctrl.srtio3 found in directory doc/fp/samples. (Output files are also in this directory.) It assumes you have read the FP documentation and the ASA documentation. This tutorial’s purpose is limited to demonstration of the automatic basis optimization option in lmf.\n\n To follow this tutorial, start in the top-level directory. Copy the file doc/FPsamples/ctrl.srtio3 to this directory. In addition to making each sphere self-consistent, program lmfa also finds parameters RSMH and EH for each occupied orbital of each free atom, by minimizing the free-atom total energy. While this is not in general an optimum basis for the solid, it provides a reasonable choice, and thus a reasonable starting guess. You may tell lmf to read parameters of a basis from a separate input file, overriding the parameters specified in the ctrl file. Do this using token –rdbasp[:fn=name]. The part in brackets is optional, and can be used to specify which file the parameters for the basis set are to be read from. If you don’t specify a name, lmf uses file basp (an extension is automatically appended to the name) In this case, we will use as starting values parameters generated by lmfa, which stores the data in file atm.srtio3. Note that the input file uses local orbitals for the Ti p and Sr p orbitals. (see input files, tokens PZ=0,4.9 for Sr and PZ=0,3.9 for Ti.\n\n We begin by invoking lmfa:\n\n lmfa srtio3\n \n \n\n which makes each sphere self-consistent, and stores the free-atom data in file atm.srtio3 along with the parameters RSMH and EH it determined for the free atom. The latter data is found at the end of file atm.srtio3 :\n\n  BASIS:\n Sr RSMH= 3.1 1.185 1.873 -1 EH= -0.114 -1.202 -0.1 0\n Ti RSMH= 2.335 0.815 1.137 -1 EH= -0.12 -2.057 -0.1 0\n O RSMH= 0.854 0.767 -1 EH= -1.289 -0.33 0\n \n \n\n Note that the starting values EH for the Sr and Ti p orbitals are very deep. This is because turning on local orbitals in these channels causes lmfa to treat these channels (Sr 4p and Ti 3p) as valence states. lmfa also restricts RSMH not to exceed the MT radius for any orbital; that is why RSMH for the Sr s orbital is 3.1.\n\n At this point we can carry out an optimization by minimizing the total energy using the Harris-Foulkes functional of the (non-self-consistent) density constructed out of a superposition of free-atom densities (Mattheis construction). Instead of doing that, let’s make the density self-consistent using the basis generated by lmfa. We use a very small number of k-divisions because we are only interested in a potential resembling the potential of the crystal, for purposes of finding an optimum basis. The Mattheis construction for oxides is a little too crude because of the large charge transfer effects.\n\n lmf -vnk=2 srtio3 --rdbasp:fn=atm\n \n \n\n The output can be found in FPsamples/out.srtio3.lmf0.\n\n Now we can optimize the basis using this (approximately self-consistent) density. Once again, there is little point in converging everything to a high precision. We use 2 k-divisions as before. To tell lmf to optimize the basis, use a command-line switch –optbas. When –optbas is invoked, lmf will not attempt to make the output density, but instead just computes the Harris-Foulkes total energy while varying basis parameters you specify until an optimum is reached. The optimizer is not sophisticated; it minimizes the energy varying one parameter at a time, running through all the parameters you specify. This means that the order of optimization matters somewhat, though in practice it doesn’t seem to matter much. The syntax for optimization is\n\n --optbas[:sort][:etol=#][:spec=spec-name[,rs][,e][,l=list]:spec=...]\n \n \n\n Some notes about the syntax of –optbas:\n\n \n 1. You tell lmf whether to optimize wrt to RSMH by using ,rs or EH by using ,e. You can specify both by e,g. for species O, use :spec=O,rs,e,…\n 2. If no species are specified, –optbas will optimize all RSMH for all species, leaving EH untouched.\n 3. You specify which l orbitals to optimize using ,l=list. Here “list” consists of a list of integers strung together. For example, to optimize the O RSM for both s and p orbitals, use :spec=O,rs,l=01.\n 4. Optional :sort tells lmf to choose for itself the order in which parameters are taken for optimization. It will pick smoothing radii first, because usually the total energy is more sensitive to RSMH than to EH. It orders the parameters from smallest (which correspond to more atomic-like states) to largest because the total energy is more sensitive to small-RSM orbitals.\n 5. Optional :etol=# tells lmf to keep the original value of the parameter unless the energy gain (by optimizing the parameter) exceeds #.\n \n\n If you are not interested in refinements, but just want to get on with it, try\n\n lmf -vnk=2 srtio3 --optbas:sort:etol=.001\n \n \n\n To show a more interesting case, let’s optimize wrt most of the orbitals we have. (With only 1 irreducible k-point, lmf runs pretty fast.) Note that we still need to read the basis from file atm.\n\n lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012 --rdbasp:fn=atm\n \n \n\n Early in the output you should see the following table:\n\n LMFOPB: optimizing energy wrt 16 parameters:\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n spec\nl\ntype\nstart\n \n \n 3:O\n1\nrsm\n0.767\n \n 2:Ti\n1\nrsm\n0.815\n \n 3:O\n0\nrsm\n0.854\n \n 2:Ti\n2\nrsm\n1.137\n \n 1:Sr\n1\nrsm\n1.185\n \n 1:Sr\n2\nrsm\n1.873\n \n 2:Ti\n0\nrsm\n2.335\n \n 1:Sr\n0\nrsm\n3.100\n \n 2:Ti\n1\neh\n-2.057\n \n 3:O\n0\neh\n-1.289\n \n 1:Sr\n1\neh\n-1.202\n \n 3:O\n1\neh\n-0.330\n \n 2:Ti\n0\neh\n-0.120\n \n 1:Sr\n0\neh\n-0.114\n \n 2:Ti\n2\neh\n-0.100\n \n 1:Sr\n2\neh\n-0.100\n \n \n \n\n lmf optimizes the total energy wrt each variable, in order shown. (lmf changed the order because of the :sort option). The output can be found in out.srtio3.lmfopt.\n\n The part of the output connected with basis optimization can be found in lines beginning with LMFOPB:, e.g.\n\n LMFOPB: continue optimization of var #2, species Ti val=0.888867\nMNBRAK: found=T x,f= 0.81500000 -2.65965498\nMNBRAK: found=T x,f= 1.01500000 -2.65785139\nMNBRAK: found=T x,f= 0.93860680 -2.65933813\nMNBRAK: found=T x,f= 0.86163389 -2.65967351\nBRENT: found=T x,f= 0.88886657 -2.65963089\n\n LMFOPB: var #2 converged in 5 iterations to 0.862: ehf=-2.659674 ... writing file basp\n \n \n\n After optimization is complete, lmf will (1) write the optimized basis to file basp.srtio3, (2) print out how much the energy changed on account of the optimization:\n\n LMFOPB: before optimization ehf=-2.5815\\. After optimization ehf=-2.7009\n \n \n\n and exit.\n\n You might repeat this optimization, since the optimization consisted of a series of independent optimizations one followed after another. In that case, don’t read the basis from the file atm but from file basp:\n\n lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012 --rdbasp\n \n \n\n After the second optimization, the energy changes to:\n\n LMFOPB: before optimization ehf=-2.7011. \n After optimization ehf=-2.7203\n \n \n\n Repeating the optimization still once more lowers the energy slightly:\n\n LMFOPB: before optimization ehf=-2.7211. \n After optimization ehf=-2.7267\n \n \n\n File basp contains a reasonably optimized basis:\n\n BASIS:\nSr RSMH= 3.1 1.345 2.013 EH= -0.02 -1.175 -0.518\nTi RSMH= 0.9 0.962 1.142 EH= -0.02 -2.597 -0.411\nO RSMH= 0.922 0.802 EH= -1.104 -0.02\n \n \n\n It is interesting to compare this basis to the initial one selected by lmfa.\n\n You can use your text editor to cut and paste this basis into your ctrl file. Alternatively you can carry around file basp.srtio3 and always remember to invoke lmf with –basp.\n\n The procedure just outlined has the advantage that it is completely automatic. However, there are a couple of pitfalls. There is a possibility that it will get stuck in local minima. Also, some orbitals, e.g. the Sr d orbital and the O p orbitals have no occupation in the free atom, so they were left out of the basis. They do, however, contribute in a non-negligible way to the energy. Optimizing the basis with these orbitals included generates the following\n\n BASIS:\nSr RSMH= 0.948 1 1.847 1 EH= -0.086 -1.046 -0.347 -0.1\nTi RSMH= 1 0.8 1.052 0 EH= -0.073 -2 -0.279 0\nO RSMH= 0.899 0.8 2.4 EH= -0.956 -0.065 -0.1\n \n \n\n This was obtained by using the basis supplied by the input file, and optimizing it:\n\n  lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012\n \n \n\n It produced\n\n  LMFOPB: before optimization ehf=-2.7507\\. After optimization ehf=-2.7607\n \n \n\n One could go further, choosing a still larger basis (one is supplied by the input file, which is used if you invoke lmf with -vbigbas=t)\n\n  lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012 -vbigbas=t\n \n \n\n which produced\n\n  LMFOPB: before optimization ehf=-2.7711\\. After optimization ehf=-2.7888\n \n \n\n This energy (-2.7888 Ry), is not so much larger than the minimal-basis energy (-2.7267) — it is deeper by 12 mRy/atom. Thus, the minimal basis is quite reasonable.\n","dir":"/tutorial/lmf/basis_optimisation/","name":"lmf_basis_optimisation.md","path":"pages/lmf_basis_optimisation.md","url":"/tutorial/lmf/basis_optimisation/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Properties of the lmf basis set","permalink":"/tutorial/lmf/basis_set/","auto":{"code":"lmf","info":"Explains the lmf basis set in the context of a self-consistent calculation for Bi2Te3.","priority":4500},"header":false,"content":" This tutorial describes the lmf basis set, and various kinds\nof cutoffs that affect convergence in the basis.\n\n ### Table of Contents \n\n\n \n\n nano init.bi2te3\nblm init.bi2te3 #makes template actrl.bi2te3 and site.bi2te3\nnano actrl.bi2te3 #change to autobas[pnu=1 loc=1 lmto=3 mto=1 gw=0]\ncp actrl.bi2te3 ctrl.bi2te3\n \n \n\n lmfa ctrl.bi2te3 #use lmfa to make basp file, atm file and to get gmax\nnano basp0.bi2te3 #remove PZ=.. from file\ncp basp0.bi2te3 basp.bi2te3 #copy basp0 to recognised basp prefix\n \n \n\n ... to be finished\n \n \n\n \n\n \n ### Preliminaries \n\n The input file structure is briefly described in this lmf tutorial for PbTe, which you may wish to go through first.\n\n Executables blm, lmchk, lmfa, and lmf are required and are assumed to be in your path.\n\n \n ### Definition of the basis set \n\n The lmf basis set consist of\nsmooth Hankel functions envelope functions\n, which get augmented by solutions of the radial\nwave equation in augmentation spheres (partial waves). An additional set of\nlocal orbitals may be added to make the basis more complete in the\naugmentation region.\n\n #### Envelope functions \n\n The lmf basis set begins with smooth\nenvelope functions. These functions are\nsmooth Hankel functions, centered on an\natom R. They are defined by smoothing radius and an\nenergy . Smooth Hankels have the Slater-Koster form,\n\n\n\n Here L is a compound index denoting the l and m angular momentum quantum numbers;\nthe are radial functions defined by Eqns. (6-8) on this page,\nand the are spherical harmonics.\n\n The are convolutions of ordinary Hankel functions of energy and Gaussian functions of\nsmoothing radius . These two parameters define the shape of the envelope: controls the\nasymptotic decay for large r (, ) and the smoothing\nradius demarcates the approximate point of transition from Gaussian-like shape at small r () to asymptotic behavior.\n\n Each site has its own family of . While it would be possible to have any number of on a particular\nsite, each with unique values of and , in practice the Questaal codes allow two types\n() of for a particular site R and angular momentum l. For the first envelope\n(), you define pair through\nparameters RSMH and EH: Each l gets its own RSMH and EH. You can\nelect to limit the basis to one envelope function for a particular l, or choose a second envelope. The second set\n() is optional: parameters are defined through RSMH2 and EH2.\nA single (“single kappa”) has the advantage of making for a small basis, but its accuracy is limited unless the\nsystem is fairly close-packed. At least for low l, i.e. for orbitals whose atomic levels are below or not far above\nthe Fermi level, it is recommended that the “double kappa” basis (two functions per l) be used.\n\n This flexibility in choosing is both a blessing and a curse. A blessing because the flexibility allows for more\nvariational freedom, keeping the basis at low rank while maintaining high accuracy. But it is a curse because of the\nadded burdens imposed on the user to determine the parameters. Usually you can allow the atom program lmfa to\nautomatically generate parameters for basis set.\n\n Thus we can identify the entire family of envelopes by , labeling whether the first or second\nenvelope, the site, and the L. Note that for each L, there are 2l+1 basis functions.\n\n #### Augmentation \n\n Each smooth envelope is “augmented” in a sphere around each nucleus by partial waves, which are numerical solution of\nthe Schrodinger equation in the sphere up to an augmentation radius (specified by tag R in the\nspecies category). For each l (and m for a given l) up to a\ncutoff lmxa, the is replaced\n(“augmented”) by a linear combination of partial waves and . These partial waves\nform the Hilbert space of essentially exact solutions to the Schrodinger equation, to\nlinear order in energy around some linearization energy .\nThis energy is normally allowed to float in the course\nof the self-consistency cycle, to minimize the linearization error.\nSee also the description of partial\nwaves on this page. Suitable linear combinations\nof and are taken in each sphere so as to make the augmented \ncontinuous and differentiable.\n\n #### Local orbitals \n\n It may be the linear method is not sufficient and that a third partial wave is required to make the basis complete over\na sufficiently wide energy window. A conventional local orbital is realized by integrating the Schrodinger equation at\nanother energy either far above or far below the energy used to make and , to obtain another\npartial wave . A suitable combination of and is subtracted to make the value and\nslope of the local orbital vanish at the augmentation radius. With such a construction it need not have an interstitial\npart. An “extended” local orbital (suitable for semicore states far below the Fermi level) is constructed by attaching\na single smooth Hankel function, whose energy and smoothing radius are varied to match value and slope of the partial\nwave. You specify the local orbital through tag PZ in the species category.\nlmfa can automatically find deep local\norbitals (one principal quantum number below the valence partial waves) that may be needed to make the basis reasonably\ncomplete. You may also select high-lying local orbitals (one principal quantum number above the valence partial waves).\nThese are usually less relevant in DFT; however, high-lying d local orbitals on transition metals were necessary to obtain\ngood agreement with other codes in the\nDeltaCodes validation exercise.\nNote that addition of local orbitals increases the rank of the Hamiltonian.\n\n #### Hilbert space and rank of the lmf Hamiltonian \n\n The Hilbert space of the lmf basis then consists of the following:\n\n \n 1. \n In the interstitial, smooth Hankel functions .\nThey can be expanded in plane waves to make matrix elements of the potential. \nNote: For a given set or you must include all l’s up to some basis cutoff,\ni.e. l=0,1,…lmxb. lmxb need not be the same for the set of envelopes as for the first.\n \n 2. \n In augmentation sphere R up to the augmentation l cutoff\nlmxa, the pair of partial waves (,\n). The dominant partial wave is ; mostly\nit attaches on to smoothed Hankels centered at R. mostly\nattaches on to the (tails) of smooth Hankels centered at other sites and makes\na smaller contribution. Finally there may possibly be local orbitals\n in some l channels. Local orbitals may be high-lying (far above the linearization energy)\nor deep, to include high-lying (semi)core levels in the valence. This extra set is specified through parameter\nPZ in the main input (ctrl file) file or the\nbasp file.\n \n 3. \n In augmentation sphere R above lmxa, the tails of smoothed Hankels\nat sites other than R. The special manner in which augmentation is done enables the lmf\nbasis set to converge very rapidly with lmxa — much faster than traditional all-electron basis sets.\nSee below.\n \n \n\n The total rank of the hamiltonian is then the number of you specify on all sites, plus any\nlocal orbitals specified. The size of the basis (number of first kappa, second kappa, and local orbitals) is printed\nin a table in lmf’s standard\noutput.\n\n \n ### Tutorial \n\n #### 1. Building the input file \n\n This step is essentially identical to the first step in the PbTe tutorial.\nAn abbreviated version is presented here.\n\n Cut and paste the following into init.bi2te3.\n\n # from http://cst-www.nrl.navy.mil/lattice/struk/c33.html\n# Bi2Te3 from Wyckoff\n% const a=4.3835 c=30.487 uTe=0.788 uBi=0.40\nLATTICE\n SPCGRP=R-3M\n UNITS=A\n A={a} C={c}\nSITE\n ATOM=Te C=0 0 0\n ATOM=Te C=0 0 {uTe}\n ATOM=Bi C=0 0 {uBi}\n \n \n\n This tutorial explains how the input files init.ext and ctrl.ext are structured.\n\n To create the skeleton input file invoke blm:\n\n $ blm init.bi2te3\n$cp actrl.bi2te3 ctrl.bi2te3\n \n \n\n There 2 Bi atoms and 3 Te atoms in the unit cell. Two of the Te atoms are symmetry equivalent.\n\n This template will not work as is; three essential pieces of information which blm does not supply are missing, to rectify this :\n\n \n • You must specify plane-wave cutoff GMAX; see the PbTe tutorial.\n • You must specify a valid k mesh for Brillouin zone integration; see the PbTe tutorial.\n • You must define a basis set which can be done manually or automatically, as described next.\n \n\n blm creates a family of tags belonging to AUTOBAS to enable other programs to automatically find a basis set for you. We will use this tag, which sets up a standard minimal basis:\n\n autobas[pnu=1 loc=1 lmto=3 mto=1 gw=0]\n \n \n\n This is an alias for the tag in the HAM category\n\n AUTOBAS[PNU=1 LOC=1 LMTO=3 MTO=1 GW=0]\n \n \n\n (Note that you must modify actrl.bi2te3 a little; the default gives [… LMTO=5 MTO=4], which makes a double kappa basis.\n\n lmfa calculates wave functions and atomic densities for free atoms. It also has a mode that automatically\ngenerates information for basis sets, using tokens in AUTOBAS to guide it. This information is written to a file basp0.ext. AUTOBAS specifies set of conditions that enable lmfa to automatically build the basis set for you,\nas described below. Parameters are generated, but you can modify them as you like.\n\n \n\n \n\n Tokens in AUTOBAS tell lmfa to do the following:\n\n \n PNU=1 Calculate the logarithmic derivative parameter Pl for the free atom.\n Calculated parameters are saved in file basp0.ext as P=…. Nothing about P is written if PNU=0.\n LOC=1 Look for shallow cores to be explicitly treated as valence electrons, as local orbitals.\n Shallow cores that meet specific criteria are identified and written to basp0.ext as PZ=….\nNo search is made if LOC=0\n LMTO=3 Pick a default choice about the size of basis. LMTO=3 is a standard minimal basis.\n Run lmfa --input and look for HAM_AUTOBAS_LMTO to see what other choices there are.\n\n lmfa will pick some defaults for the l-cutoff, e.g. spd or spdf depending on the value of LMTO.\n \n MTO=1 Choose 1-kappa basis set (single orbital per l channel).\n Small basis for fast calculations. For better quality calculations, it is recommended you use MTO=2 or MTO=4.\n GW=0 Create a setup for an LDA calculation.\n If GW=1, tailor basis for a GW calculation, selecting stricter criteria for including shallow cores as valence, and the size of basis.\n \n\n These tokens thus define some reasonable default basis for you. lmfa writes basp0.ext. This file is never read, but lmf will read basp.ext and use this information when assembling the basis set. The two files have the same structure and you can copy basp0.ext to basp.ext. What lmfa generates is not cast in concrete. You are free to adjust the parameters to your liking, e.g. add a local orbital or remove one from the basis.\n\n \n\n\n The AUTOBAS tokens tell lmf what to read from basp.ext. It uses tokens in a manner similar, but not identical, to the way lmfa uses them:\n\n \n PNU=1 Read parameters P for all species present in basp.ext.\n If PNU=0, these parameters will not be read.\n LOC=1 tells lmf to read local orbital parameters PZ.\n Since these parameters may also be specified by the input file, \nLOC=1 tells lmf to give precedence to parameters specified by ctrl file \nLOC=2 tells lmf to give precedence to parameters specified by basp.\n \n\n LMTO= is not used by lmf.\n\n \n MTO=1 controls what part of RSMH and EH is read from basp.bi2te3.\n LMTO=1 or 3 tells lmf to read 1-kappa parameters specified by basp \nLMTO=2 or 4 tells lmf to read 2-kappa parameters specified by basp \nLMTO=1 or 2 tells lmf that parameters in the ctrl file take precedence \nLMTO=2 or 4 tells lmf that parameters in the basp file take precedence\n GW=0 tunes the basis for an LDA calculation\n If GW=1, tune basis for a GW calculation. For example log derivative parameters P\nare floated a little differently in the self-consistency cycle.\nThey are weighted to better represent unoccupied states, at a slight cost\nto their representation of occupied states.\n \n\n \n\n See Table of Contents\n\n #### 2. Checking sphere overlaps \n\n Sphere overlaps can be checked using lmchk. To do this copy the template actrl.bi2te3 to the input file and run lmchk:\n\n $ lmchk bi2te3\n
\n
\n\n

You should see the site positions for all the atoms:\n\n

   Site    Class            Rmax        Hcr                 Position\n    1      1  Te          2.870279    2.009195    0.00000    0.00000    0.00000\n    2      3  Te2         2.870279    2.009195   -0.50000   -0.86603    1.46162\n    3      3  Te2         2.870279    2.009195    0.50000    0.86603   -1.46162\n    4      2  Bi          2.856141    1.999299    0.50000    0.86603    0.80309\n    5      2  Bi          2.856141    1.999299   -0.50000   -0.86603   -0.80309\n
\n
\n\n

and a table of overlaps\n\n

 ib jb  cl1     cl2        Pos(jb)-Pos(ib)      Dist  sumrs   Ovlp    %    summt   Ovlp   %\n  1  4  Te      Bi        2.391 -4.142  3.841  6.134  5.726  -0.41  -6.6   4.008  -2.13 -34.7\n  1  5  Te      Bi       -2.391 -4.142 -3.841  6.134  5.726  -0.41  -6.6   4.008  -2.13 -34.7\n  2  4  Te2     Bi       -2.391 -4.142 -3.149  5.726  5.726   0.00   0.0*  4.008  -1.72 -30.0\n  3  5  Te2     Bi        2.391 -4.142  3.149  5.726  5.726   0.00   0.0*  4.008  -1.72 -30.0\n
\n
\n\n

By default, blm makes the spheres as large as possible without overlapping. In this case the Bi and Te radii are nearly the same.\n\n

The packing fraction is printed\n\n

 Cell volume= 1141.20380   Sum of sphere volumes= 492.34441 (0.43143)\n
\n
\n\n

Generally larger packing fractions are better because the augmentation partial waves are quite accurate.\n0.43 is a fairly good packing fraction.\n\n

#### 3. The atomic density and basis set parameters

\n\n

If you did not do so already copy actrl.bi2te3 to ctrl.bi2te3 and change\n[… LMTO=4  MTO=4][… LMTO=3  MTO=1]).\n\n

Invoke lmfa:\n\n

$lmfa bi2te3\n \n \n\n The primary purpose of lmfa is to generate a free atom density. A secondary purpose is to supply additional information about the basis set in an automatic way. All of this information can be supplied manually in the input file, but the blm provides a minimum amount of information. lmfa generates basp0.bi2te3 which contains\n\n BASIS:\nTe RSMH= 1.615 1.681 1.914 1.914 EH= -0.888 -0.288 -0.1 -0.1 P= 5.901 5.853 5.419 4.187\nBi RSMH= 1.674 1.867 1.904 1.904 EH= -0.842 -0.21 -0.1 -0.1 P= 6.896 6.817 6.267 5.199 5.089 PZ= 0 0 15.936\n \n \n\n Every species gets one line. This file specifies a basis set consisting of spdf orbitals on Te sites, and spdf orbitals on Bi sites, and a local 5d orbital on Bi.\nSee the PbTe tutorial for further description of these parameters.\n\n Note: Remember that lmf reads from basp.ext, not basp0.ext.\n\n The partitioning between valence and core states is something that requires a judgement call. lmfa has made a\ndefault choice: from basp0.bi2te3 you can see that lmfa selected the\n6s, 6p, 6d, 5f states, populating them with charges 2, 3, 0, 0, making the total sphere charge Q=0. You can override the\ndefault, e.g. choose the 5d over the 6d with SPEC_ATOM_P; override the l channel charges with SPEC_ATOM_Q.\n\n lmfa does the following to find basis set parameters:\n\n \n • Automatically finds deep states to include as valence electrons.\n • Selects sphere boundary condition for partial waves\n • Finds envelope function parameters\n \n\n \n\n\n The process is essentially the same as described in the PbTe\ntutorial; it is described in some detail there and in the annotated\nlmfa output. The main difference is that in this case a\nsmaller, single-kappa basis was specified (LMTO=3); lmfa makes (RMSH,EH)\ninstead of the double kappa (RMSH,EH; RMSH2,EH2). Later we will improve on the basis by adding APW’s.\n\n With your text editor insert lines from basp0.bi2te3 in the SPEC category of the ctrl file, viz\n\n  ATOM=Te Z= 52 R= 2.870279 LMX=3 LMXA=3\n RSMH= 1.615 1.681 1.914 1.914 EH= -0.888 -0.288 -0.1 -0.1 P= 5.901 5.853 5.419 4.187\n ATOM=Bi Z= 83 R= 2.856141 LMX=3 LMXA=4\n RSMH= 1.674 1.867 1.904 1.904 EH= -0.842 -0.21 -0.1 -0.1 P= 6.896 6.817 6.267 5.199 5.089 PZ= 0 0 15.936\n \n \n\n Alternatively make lmf read these parameters from basp.bi2te3. Copy basp0.bi2te3 to basp.bi2te3, and modify it as you like. basp.ext\nis read after the main input file is read, if it exists. According to which of following tokens is present, their corresponding parameters\nwill be be read from the basp file, superseding prior values for these contents:\n\n \n\n\n\n\n\n  AUTOBAS\n lmfa writes, lmf reads\n \n MTO\n RSMH,EH (and RSMH2,EH2 if double kappa basis)\n \n P\n P\n \n LOC\n PZ\n \n \n \n\n If this information is supplied in both the ctrl file and the basp file, values of MTO and LOC\ntell lmf which to use. In this tutorial we will work just with the basp file.\n\n $ cp basp0.bi2te3 basp.bi2te3\n
\n
\n\n

The atm file was created by lmfa without prior knowledge that the 5d local orbital is to be included as a\nvalence state (via a local orbital). Thus it incorrectly partitioned the core and valence charge. You must do one of the following:\n\n

\n
1. \n

Remove PZ=0 0 15.936 from basp.bi2te3. It will no longer be treated as a valence state. Removing it means\nthe remaining envelope functions are much smoother, which allows you to get away with a coarser mesh density.\nWhether you need it or not depends on the context: with GW, for example, this state is a bit too shallow to be treated with Fock exchange\nonly (which is how cores are handled in GW).\n \n

2. \n

Copy basp0.bi2te3 to basp.bi2te3 and run lmfa over again:\n \n

\n\n
$cp basp0.bi2te3 basp.bi2te3\n$ lmfa bi2te3\n
\n
\n\n

With the latter choice lmfa operates a little differently from the first pass. Initially the Bi 5d was part of\nthe core (similar to the Pb 5d in the Pbte\ntutorial; now it is included in the valence.\n\n

#### 4. GMAX and NKABC

\n\n
##### 4.1 Setting GMAX
\n\n

blm makes no attempt to automatically assign a value to the plane wave cutoff for the interstitial density. This\nvalue determines the mesh spacing for the charge density. lmf reads this information through\nHAM_GMAX or EXPRESS_gmax, or HAM_FTMESH. It is a required input; but blm does not\nautomatically pick a value because its proper choice depends\non the smoothness of the basis. In general the mesh density must be fine as the most strongly peaked orbital in the basis.\n\n

lmfa makes RSMH and EH and can determine an appropriate value for HAM_GMAX based on them. In the\npresent instance, when the usual 6s, 6p, 6d, 5f states are included lmfa recommends GMAX=4.4 as can\nbe seen by inspecting the first lmfa run. If you keep the 5d in the valence and run lmfa second time you will see this output\n\n

 FREEAT:  estimate HAM_GMAX from RSMH:  GMAX=4.4 (valence)  8.1 (local orbitals)\n
\n
\n\n

The valence states still require only GMAX=4.4 but the 5d state is strongly peaked but GMAX=8.1 for the local orbitals. The 5d\nstate is strongly peaked at around the atom, and requires more plane waves to represent reasonably, even a smoothed version of it, than the\nother states. The difference between 8.1 and 4.4 is substantial, and it reflects the additional computational cost of including deep\ncore-like states in the valence. This is the all-electron analog of the “hardness” of the pseudopotential in pseudopotential schemes. If you\nwant high-accuracy calculations (especially in the GW context), you will need to include these states as valence. Including the Bi 5d is\na bit of overkill for LDA calculations however. If you eliminate the Bi 5d local orbital you can set GMAX=4.4 and significantly speed up the\nexecution time. It is what this tutorial does.\n\n

##### 4.2 Setting NKABC
\n\n

blm assigns the initial k-point mesh to zero. Note the following lines in ctrl.bi2te3:\n\n

% const nkabc=0 gmax=0\n...\n# Brillouin zone\n  nkabc=  {nkabc}                  # 1 to 3 values\n
\n
\n\n

Note: nkabc is simultaneously a variable and a tag here. This can be somewhat confusing. The expression\n {nkabc}  gets parsed by the preprocessor and is turned into the value of variable nkabc (see how nit gets turned into\n10 in the PbTe tutorial), so after preprocessing, the argument following tag is\na number.\n\n

EXPRESS_nkabc (alias BZ_NKABC) governs the mesh of k-points. An appropriate choice will depend\nstrongly on the context of the calculation and the sytem of interest; the density-of-states at the Fermi level; whether Fermi surface\nproperties are important; whether you want optical properties as well as total energies well described; the precision you need; the\nintegration method, and so on. Any automatic formula can be dangerous, so blm will not choose an operational\ndefault.\n\n

The most reliable way determine the appropriate mesh is to vary nkabc and monitor the convergence. We don’t need a self-consistent\ncalculation for that: the k-convergence will not depend strongly whether the potential is converged or assembled\nfrom free atoms.\n\n

Do the following (assuming no 5d local orbital)\n\n

lmf ctrl.bi2te3 -vgmax=4.4 --quit=band -vnkabc=2\nlmf ctrl.bi2te3 -vgmax=4.4 --quit=band -vnkabc=3\nlmf ctrl.bi2te3 -vgmax=4.4 --quit=band -vnkabc=4\nlmf ctrl.bi2te3 -vgmax=4.4 --quit=band -vnkabc=5\nlmf ctrl.bi2te3 -vgmax=4.4 --quit=band -vnkabc=6\n
\n
\n\n

The meaning of --quit=band is described here.\n\n

Total energies are written to the save file save.bi2te3.\nIt should read:\n\n

h gmax=4.4 nkabc=2 ehf=-126808.2361717 ehk=-126808.1583957\nh gmax=4.4 nkabc=3 ehf=-126808.3137885 ehk=-126808.2492178\nh gmax=4.4 nkabc=4 ehf=-126808.3168406 ehk=-126808.2505156\nh gmax=4.4 nkabc=5 ehf=-126808.3165536 ehk=-126808.2497121\nh gmax=4.4 nkabc=6 ehf=-126808.3164058 ehk=-126808.2494041\n
\n
\n\n

You can use the vextract tool to conveniently extract a table\nof the Harris-Foulkes total energy as a function of nkabc\n\n

cat save.bi2te3 | vextract h nkabc ehf | tee dat\n
\n
\n\n

You can plot the data, or just see by inspection that the energy is converged to less than a mRy with 4×4×4 k mesh and about\n0.1 mRy with a 5×5×5 k mesh. A detailed analysis of k point convergence is given\nhere.\n\n

#### 5. Self-consistent LDA calculation, small basis

\n\n

In the following we will use nkabc=3, though after convergence is reached we might consider increasing it a little. Before doing the\ncalculation you can use your text editor to set nkabc=3 and gmax=4.4, or continue to set assign values from the command line.\n\n

The density can be made self-consistent with\n\n

rm -f mixm.bi2te3 save.bi2te3\nlmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3\n
\n
\n\n
##### 5.1 Convergence in the charge density
\n\n

You should lmf reach self-consistency in 9 iterations.\n\n

The Harris-Foulkes and Kohn-Sham total energies are ehf=-126808.3137885 and ehk=-126808.2492178\nfrom the Mattheis construction. At self-consistency they come together: ehf=-126808.2950696 and ehk=-126808.2950608\n(the large integer part comes almost entirely from the core states.)\n\n

The self-consistent value is 18 mRy less binding than the Harris-Foulkes energy of the Mattheis construction,\nand 46 mRy more binding than the corresponding Kohn-Sham energy.\nThat the two initial functionals bracket the self-consistent result, and that the HF\nis generally closer to the final result than the HK functional, is typical behavior.\n(The HF functional is generally more stable.)\n\n

##### 5.2 Convergence in G cutoff
\n\n

The G cutoff, 4.4u Ry1/2\nyields precisions in plane-wave expansions of envelope functions as shown this table:\n\n

 sugcut:  make orbital-dependent reciprocal vector cutoffs for tol=1.0e-6\n spec      l    rsm    eh     gmax    last term   cutoff\n  Te       0    1.61  -0.89   4.603    3.31E-06    1635*\n  Te       1    1.68  -0.29   4.662    5.08E-06    1635*\n  Te       2*   1.91  -0.10   4.273    1.15E-06    1539\n  Te       3    1.91  -0.10   4.471    1.71E-06    1635*\n  Bi       0    1.67  -0.84   4.441    1.29E-06    1635*\n  Bi       1    1.87  -0.21   4.183    1.08E-06    1411\n  Bi       2*   1.90  -0.10   4.297    1.37E-06    1539\n  Bi       3    1.90  -0.10   4.497    2.06E-06    1635*\n
\n
\n\n

gmax=4.4 isn’t quite large enough to push the error below tolerance (1.0e-6), but it is pretty close.\nYou can check how well the total energy is converged by increasing gmax:\n\n

$lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --quit=band\n$ lmf ctrl.bi2te3 -vgmax=6 -vnkabc=3 --quit=band\n
\n
\n\n

and comparing ehf in the last two lines of save.bi2te3. You should find that the energy is converged to about 0.1 mRy.\n\n

##### 5.3 Convergence in the forces
\n\n

The exact forces are the change in total energy with respect to displacement of the nucleus. As they are calculated in the Questaal\npackage, some correction terms are added to accelerate convergence with respect to deviations ninn in the\nguessed density from the self-consistent one. See the annotation of lmf\noutput.\n\n

Note: The forces are not exact derivatives of the total energy. This is because the change in shape of the\naugmented partial waves and is not taken into account as a\nnucleus displaces. The effect is usually very small. Forces should be exactly consistent with the energy if the shape of the partial\nwaves is frozen, however, which you can do with HAM_FRZWF.\n\n

To what extent the basis set affects the forces is taken up in the Additional Exercises.\n\n

##### 5.4 Convergence in LMXA
\n\n

In an augmented wave method, envelope functions centered a different site is must be expanded around a local site, as one-center expansions\nin spherical harmonics Ylm. LMXA is a cutoff that truncates the one-center expansion to a finite l = LMXA.\nThe input file reads:\n\n

SPEC\n  ATOM=Te         Z= 52  R= 2.870279  LMX=3  LMXA=3\n  ATOM=Bi         Z= 83  R= 2.856141  LMX=3  LMXA=4\n
\n
\n\n

LMXA=3 and LMXA=4 are very low l cutoffs for an augmented wave method. They are about half of what is needed for a\nreasonably converged calculation with traditional augmentation. However, the Questaal suite has a unique augmentation procedure that\nconverges very rapidly with l. Indeed, it can be seen as a justification for pseudopotential methods that limit the pseudopotential to\nvery low l, e.g. l=2.\n\n

It is a useful exercise to see how well converged the total energy is using the default values LMXA=3 and LMXA=4.\nFirst, run lmf with the unaltered ctrl file:\n\n

lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --quit=band\n
\n
\n\n

Set both LMXA to 6: and run lmf again\n\n

$cp ctrl.bi2te3 ctrl.bak\n$ cat ctrl.bak | sed s/LMXA=./LMXA=6/ > ctrl.bi2te3\n$lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --quit=band\n \n \n\n When the restart file is read you should see\n\n  site 1, species Te : augmentation lmax changed from 3 to 6\n site 1, species Te : inflate local density from nlm= 16 to 49\n \n \n\n Compare the last two lines of save.bi2te3.\nYou should be able to confirm that the energy change is 0.25 mRy,\nBy playing around with the two LMXA you can confirm that increasing\nthe Te LMXA to 4, nearly all the error is eliminated.\n\n Before continuing, be sure to restore the original ctrl file\n\n cp ctrl.bak ctrl.bi2te3\n \n \n\n See Table of Contents\n\n ##### 5.5 Convergence in KMXA \n\n Ordinary Hankel functions can be expanded in Bessel functions around a remote site. This follows from the fact that both are solutions of\nthe same second order differential equation, one being regular at the origin and the other being regular at ∞. Smooth Hankel\nfunctions are more complicated: the one-center expansion has no such elementary function, but it can be written as a linear combination of\nLaguerre polynomials Pkl of half integer order; see Eq. (12.17) in this\nJ. Math. Phys. paper.\n\n The polynomials are cut off at a fixed order given by KMXA. blm doesn’t write KMXA to the template file;\ninstead a default value is used, which is written to this table\n\n  species data: augmentation density\n spec rmt rsma lmxa kmxa lmxl rg rsmv kmxv foca rfoca\n Te 2.870 1.148 3 3 3 0.718 1.435 15 1 1.148\n Bi 2.856 1.142 4 3 4 0.714 1.428 15 1 1.142\n \n \n\n You can check the convergence by in KMXA by supplying an input for it. First\nrun lmf with the unmodified file:\n\n $ lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --quit=band\n
\n
\n\n

Set KMXA to 5 and run lmf again:\n\n

$cp ctrl.bi2te3 ctrl.bak\n$ cat ctrl.bak | sed 's/LMXA=/KMXA=5 LMXA=/' > ctrl.bi2te3\n$lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --quit=band\n \n \n\n When the restart file is read you should see an indication that KMXA has been increased:\n\n  site 1, species Te : augmentation kmax changed from 3 to 5\n site 2, species Te : augmentation kmax changed from 3 to 5\n \n \n\n Compare the last two lines of save.bi2te3.\nYou should be able to confirm that the energy change is 0.15 mRy.\n\n Note: Before continuing, be sure to restore the original ctrl file.\n\n $ cp ctrl.bak ctrl.bi2te3\n
\n
\n\n

#### 6. Optimizing the basis set

\n\n
##### 6.1 Tuning the envelope function parameters
\n\n

The envelope function shape generated by lmfa is tailored to the atom. They are very good basis sets for that\ncase, but less so for the crystal.\n\n

Ideally a basis of the size could be constructed that yields energies converged almost as well as we accomlish for the free atom. This is\ndifficult to do in practice, though it is the aim of the Jigsaw Puzzle Orbitals basis.\n\n

The best we can with the existing lmf basis is to optimize the energy by tuning RSMH and EH.\nThis cannot be done analytically, but switch --optbas causes lmf to\nperform this optimization by brute-force minimization of the Harris-Foulkes energy.\n\n

\n\n

Starting from the self-consistent density generated previously do the following:\n\n

$lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --optbas > out\n \n \n\n This will loop through RSMH in each species, minimizing the total energy for each one by one.\nIt does not vary EH because the total energy is less sensitive to it. lmf will print out a table\nof the parameters it will optimize:\n\n  LMFOPB: optimizing energy wrt 8 parameters, etol=5e-4:\n spec l type start\n 1:Te 0 rsm 1.615\n 1:Te 1 rsm 1.681\n 1:Te 2 rsm 1.914\n 1:Te 3 rsm 1.914\n 2:Bi 0 rsm 1.674\n 2:Bi 1 rsm 1.867\n 2:Bi 2 rsm 1.904\n 2:Bi 3 rsm 1.904\n \n \n\n Each cycle carries out non self-consistent calculations to get the Harris-Foulkes total energy.\nAfter completing lmf prints out\n\n  LMFOPB: before optimization ehf=-126808.2951. After optimization ehf=-126808.3092\n Exit 0 Optimization complete. See file basp2\n \n \n\n By tuning the parameters the energy decreased by 0.0141 Ry. To see which orbitals contributed the most, do:\n\n $ grep LMFOPB out | grep optimized\n
\n
\n\n

You should see\n\n

 LMFOPB: var #1 optimized to 1.602 (7 iter):  ehf=-126808.295097, delta ehf=-2.38e-5\n LMFOPB: var #2 optimized to 1.617 (5 iter):  ehf=-126808.298989, delta ehf=-0.00392\n LMFOPB: var #3 optimized to 1.778 (6 iter):  ehf=-126808.299166, delta ehf=-1.77e-4\n LMFOPB: var #5 optimized to 1.605 (5 iter):  ehf=-126808.301, delta ehf=-9.12e-4\n LMFOPB: var #6 optimized to 1.658 (7 iter):  ehf=-126808.307945, delta ehf=-0.00695\n LMFOPB: var #7 optimized to 2.245 (5 iter):  ehf=-126808.308856, delta ehf=-9.11e-4\n LMFOPB: var #8 optimized to 1.679 (6 iter):  ehf=-126808.309198, delta ehf=-3.42e-4\n
\n
\n\n

The orbitals that mad the most difference were the Te 5p (1.6811.617) and Bi 5p (1.8671.658).\n\n

Optimized parameters where the total energy decreased by more than etol (5e-4)\nwere modified; the optimized parameters are written to basp2.bi2te3\n\n

You can copy basp2.bi2te3 to basp.bi2te3,\nbut there is little point in optimizing any but the Te 5p and Bi 6p. Instead we use a text editor and modify\nbasp.bi2te3 in those channels:\n\n

BASIS:\n Te RSMH= 1.615 1.617 1.914 1.914 EH= -0.888 -0.288 -0.1 -0.1 P= 5.901 5.853 5.419 4.187\n Bi RSMH= 1.674 1.658 1.904 1.904 EH= -0.842 -0.21 -0.1 -0.1 P= 6.896 6.817 6.267 5.199 5.089\n
\n
\n\n

Run lmf again\n\n

$lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3 --quit=band\n \n \n\n and confirm that ehf comes out close (-126808.3086945) to the optimized value (-126808.309198).\n\n You can at this point make the density self-consistent again.\n\n Note: Before continuing, be sure to restore the original basp file.\n\n \n\n In sum,\n\n \n • without optimizing the basis, you should achieve total energy ehf=-126808.2950696 at self-consistency.\n • With the --optbas switch it should become ehf=-126808.306962.\n \n\n See Table of Contents\n\n ##### 6.2 Increasing the number of envelope functions \n\n lmfa uses the lmto tags to make default choices for the size of basis.\nThe tutorial used a relative minimal basis, lmto=3.\n\n  autobas[pnu=1 loc=1 lmto=3 mto=1 gw=0]\n \n \n\n With your editor, modify this line to read\n\n  autobas[pnu=1 loc=1 lmto=4 mto=4 gw=0]\n \n \n\n This will increase the basis, most notably include two envelope functions per l channel (double-kappa)\n\n Run lmfa again and note how the basp file changed:\n\n $ lmfa bi2te3\n$diff basp0.bi2te3 basp.bi2te3\n \n \n\n Remove the PZ=… as before and copy basp0.bi2te3 to basp.bi2te3.\nSave the original file in a backup.\n\n $ nano basp0.bi2te3\n$cp basp.bi2te3 basp.bak\n$ cp basp0.bi2te3 basp.bi2te3\n
\n
\n\n

Run lmf to self-consistency\n\n

$rm -f mixm.bi2te3\n$ lmf ctrl.bi2te3 -vgmax=4.4 -vnkabc=3\n
\n
\n\n

Note that size of the basis has increased: With lmto=3 there are 80 orbitals\n\n

 Makidx:  hamiltonian dimensions Low, Int, High, Negl: 80 0 18 27\n suham :  98 augmentation channels, 98 local potential channels  Maximum lmxa=4\n
\n
\n\n

which increases to 125 orbitals with lmto=5:\n\n

 Makidx:  hamiltonian dimensions Low, Int, High, Negl: 125 0 71 54\n kappa   Low   Int   High  L+I  L+I+H  Neglected\n   1      80     0    18    80    98      27\n   2      45     0    53    45    98      27\n  all    125     0    71   125   196      54\n suham :  98 augmentation channels, 98 local potential channels  Maximum lmxa=4\n
\n
\n\n

At self-consistency you should find that the total energy converges to ehf=-126808.313403 Ry.\n\n

##### 6.3 Adding APWs : the PMT method
\n\n

You can also use augmented plane waves (APWs) to improve on the basis set. The combination of smooth Hankel functions with APW’s is called\nthe PMT basis set. Adding APW’s provides a systematic way of making the basis of envelope\nfunctions complete.\n\n

These tags in the HAM category control how many APWs are added:\n\n

  PWMODE={pwmode} PWEMIN=0 PWEMAX={pwemax}  # For APW addition to basis\n
\n
\n\n

To use APW’s some tolerances in the ctrl file should be tightened. If you invoke blm with --pmt these extra\ntolerances are included automatically. That is the easiest way to make the changes but here we just add include tolerances\nHAM_TOL and EWALD_TOL by hand. Insert two lines at the end of the\nHAM category:\n\n

HAM\n...\n      FORCES={so==0} ELIND=-0.7\n      TOL=1d-16\nEWALD TOL=1d-16\n
\n
\n\n

One problem with the PMT method is that the smoooth-Hankel and APW basis set span nearly the same hilbert space. If you add too many\nplane waves the overlap matrix does not remain positive definite. Tightening the tolerances above helps, and so does increasing the\nfineness of the density mesh, as these points are also used for the PW expansion of the basis.\n\n

Note: as a last resort, you can stabilize the overlap with the HAM_OVEPS switch,\nbut it is better to reduce the rank of the LMTO or APW basis sets.\n\n

PWMODE=11 adds APWs in a standard way: envelope functions of the form ei(k+G)·r are added to the\nsmooth Hankel basis. You must specify the PW cutoffs. Here you can specify both the lower and upper bounds since the smooth Hankels will\nefficiently cover most of the lower part of the space.\n\n

With these extra considerations, run lmf as follows\n\n

rm -f out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=0 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=1 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=2 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=3 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=4 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=5 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=6 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\nlmf ctrl.bi2te3 -vpwmode=11 -vpwemax=7 -vgmax=8 -vnkabc=3 --quit=band >> out.lmf\n
\n
\n\n

and observe how the total energy decreases with pwemax. Use the vextract tool:\n\n

cat save.bi2te3 | vextract i pwemax ehf ehk | tee etot.bi2te3\n
\n
\n\n

Draw a picture of the total energy relative to the double-kappa value. The fplot command\nshown in the box below will generate a postscript file; the figure actually shown has been elaborated a little. The red circle shows the\nself-consistent double-kappa result of Sec. 6.2. The light grey line follows the PMT procedure as above, but taking for the LMTO part\na smaller, optimized spd single kappa basis (see Additional exercises).\nNumbers in parenthesis are the number of LMTO’s. The red circle is the 2-kappa basis without APWs; the purple is the LAPW basis without LMTOs.\n\n

$fplot -frme 0,.8,0,.5 -frmt th=3,1,1 -tmy 2.5 -vehf=-126808.313403 -s circ -ord '(x2-ehf)*1000' etot.bi2te3\n \n \n\n \n\n The figure shows that the double-kappa basis (additional 45 orbitals) stabilizes the single-kappa spdf basis by about 18 mRy, and that the\nsame can be accomplished with APWs with a plane-wave cutoff of 2 Ry (additional 48-62 APWs). By further increasing the APW\ncutoff, another 5 mRy can be gained. For most purposes this extra gain is not important. Note that the APW basis with\nEmax=7 Ry is quite large: 343-370 APWs.\n\n Note that the APW basis is generally less efficient than the LMTO basis. To reach a precision comparable to the 2-kappa basis (125 orbitals)\nstarting from the 1-kappa spd basis, about 160 APWs are needed, or about 200 orbitals all told. The power of the PMT method can be\ncompared against a straight LAPW basis. About 300 APWs are needed to achieve the convergence of the double kappa basis. See purple line in the Figure.\n\n To see how many orbitals the APW basis adds, do:\n\n $ grep ndham out.lmf\n
\n
\n\n

#### Modifying the input file for GW

\n\n

GW calculations demand more of the basis set because unoccupied states are important. To set up a job in preparation for a GW calculation, invoke blm as :\n\n

\n
\n\n

\n\n
\n\n

\n\n\n
\n\n

### Preliminaries

\n\n

This tutorial assumes you have blm installed. \nAdditionally, poscar2init, lmchk, lmscell, poscar2site and cif2site may be required for some\nsections.\n\n

blm is an input file generator. Usually it reads an init.ext**{: style=”color: green”} to\n**build the input file (ctrl.ext).\n\n

You can build the (ctrl) file from scratch without blm, but most\npeople find going through blm to be easier and faster. You can customize the file once it’s\nbeen made.\n\n

blm saves the input file (ctrl_ext{: style=”color: green”}) file (_actrl.ext), \nunless you specify otherwise. (blm has many command line switches as detainedhere;\none of them lets you change (actrl) to some other name.)\n\n

Usually, but depending on the switches you use, blm separates out the structural information\nand writes it to a separate file (site.ext). Site files are very convenient because \nyou can change the structural information without touching the ctrl file.\n\n

The file structure is briefly described in the detailed lmf tutorial for Pbte,\nand some of the information given here is also explained there.\n\n

In either case, you need structural information to get started. In default mode blm reads structural data from a file\ninit.ext, and writes a ctrl file and a site file. It can read structural data from a site file.\n\n

### 1. Importing Crystal Structure

\n\n

#### 1.1 Supplying Crystal Structure by hand

\n\n

Classic books like Wyckoff’s Structure of Crystals\nhave information crystal structure contained in a compact form. Form that book we read that has a space group R3M.\nThat group has\n\n

# Bi2Te3 from Wyckoff

\n

% const a=4.3835 c=30.487 uTe=0.788 uBi=0.40\nLATTICE\n SPCGRP=R-3M\n UNITS=A\n A={a} C={c}\nSITE\n ATOM=Te C=0 0 0\n ATOM=Te C=0 0 {uTe}\n ATOM=Bi C=0 0 {uBi}\n\n

Typically you have structural information about your material, e.g. space group number (e.g. number 99 or name P4mm) and lattice parameters related to the space group (a and b in the P4mm case). This page will use Bi2Te3 as an example, which belongs to space group R3m with lattice constants a and c. You also need information about the chemical species and positions of the atoms in the basis. The minimum information for Bi2Te3 is:\n\n

ATOM=Te C=0     0    0\nATOM=Te C=0     0   .788\nATOM=Bi C=0     0   .4\n
\n
\n\n

Note: site positions are expressed as one of\n\n

\n
• positions in dimensionless Cartesian coordinates (they get scaled by ALAT), e.g.
\nATOM=Te POS= -0.500000 -0.866025 1.461620\n
• positions as multiples of the standard (actual) unit cell, e.g.
\nATOM=Te X= -0.212000 -0.212000 0.788000\n
• positions as multiples of the conventional unit cell, e.g.
\nATOM=Te C=0 0 .788\n
\n\n

In this exampbe (Bi2Te3) the init file is\n\n

LATTICE\n SPCGRP=R-3M\n UNITS=A\n A=4.3835 C=30.487\nSITE\n ATOM=Te C=0 0 0\n ATOM=Te C=0 0 .788\n ATOM=Bi C=0 0 .4\n\n

There are five atoms in the basis; the positions of the remaining two follow from the symmetry of the space group (R3m).\n\n

Symbols Te and Bi tell blm that the atoms are Tellurium and Bismuth, with atomic numbers 52 and 83. You can use any symbol for the species name, but if you don’t use a standard one you must specify the atomic number, e.g. write ATOM=A Z=52.\n\n

The three coordinates e.g. (0 0 0.788) correspond to fractions of the first, second, and third lattice vectors. This is a standard way of representing site coordinates. Alternatively, you can specify Cartesian coordinates; use POS= in place of X=. In the Bi2Te3 case, substituting the above 3 lines with\n\n

ATOM=Te POS= 0.0000000   0.0000000   0.0000000\nATOM=Te POS=-0.5000000  -0.8660254   1.4616199\nATOM=Bi POS= 0.5000000   0.8660254   0.8030878\n
\n
\n\n

creates the same input template.\n\n

#### 1.2 Importing a CIF file

\n\n

Crystallographic Information Files (CIF files for short) is a standard text file format for representing crystallographic information, whose standards are set by the International Union of Crystallography. If you have a CIF file, you can automatically make either an init.ext file, or a site.ext file. The tools in this package do not read CIF files directly, but parse the output of the cif2cell program (version 1.1.0). cif2cell is a very versatile tool, freely available on the web.\n\n

To import data from a CIF file you need cif2cell installed and cif2init in your path (cif2init should be automatically compiled with this package). The steps are:\n\n

1. Run cif2cell (without any special switches) and capture the output in a file, e.g. cif2cell.out .\n2. Run cif2init to generate an init file (called simply  init ‘).\n3. Rename init to init.ext and use the blm tool.\n\n

Example : create an init file for the orthorhombic form of BaTiO3:\n\n

$cp testing/cif2cell.batio3 .\n$ cif2init cif2cell.batio3\n
\n
\n\n

Note: cif2cell.batio3 was obtained by running cif2cell on the CIF file supplied with the cif2cell-1.1.0 distribution: cif2cell-1.1.0/cifs/BaTiO3_orthorhombic.cif.\n\n

The following init file should be generated:\n\n

HEADER Ba (Ti O3) (Barium titanate - nanocrystalline)\nLATTICE\n#       SPCGRP=38\n#       A=4.0094  B=5.6214  C=5.6386   ALPHA=90  BETA=90  GAMMA=90\n% const a=4.0094\n        ALAT={a}  UNITS=A\n        PLAT=    1.0000000    0.0000000    0.0000000\n                 0.0000000    0.7010276   -0.7031725\n                 0.0000000    0.7010276    0.7031725\nSITE\n     ATOM=Ba       X=     0.0000000    0.0000000    0.0000000\n     ATOM=Ti       X=     0.5000000    0.4900000    0.5100000\n     ATOM=O        X=     0.5000000    0.0100000    0.9900000\n     ATOM=O        X=     0.5000000    0.0129000    0.4921000\n     ATOM=O        X=     0.5000000    0.5079000    0.9871000\n
\n
\n\n

If you prefer to make your own input file but import structure information via a site file, use cif2site in place of cif2init. To summarize:\n\n

cif2init creates an init file from the output of cif2cell\ncif2site creates a site file from the output of cif2cell\n\n

#### 1.3 Importing a POSCAR file

\n\n

VASP is a very popular electronic structure program which can store structural information in the POSCAR files. If you want to import data from such a file in a form suitable for this program suite, use one of the following commands:\n\n

$poscar2init creates an init file from a VASP POSCAR file\n$ poscar2site     creates a  site file from a VASP POSCAR file\n
\n
\n\n

If you already have an input file, use poscar2site to translate structural data from a POSCAR file into site.ext. If you want an input file instead, use poscar2init; then run blm.\n\n

Example: create an input file for Zn3As2 from a POSCAR file:\n\n

$testing/test.blm 2\n \n \n\n The script has the following steps\n\n $ poscar2init > init.zn3as2\n$blm zn3as2 --fixpos:tol=1e-6 > out.zn3as2\n \n \n\n which creates an input file template (actrl.zn3as2) from a POSCAR file in two steps.\n\n Example: create a site file for the Kesterite Cu2ZnSnS4:\n\n $ testing/test.blm 3\n
\n
\n\n

It creates file site from file POSCAR.\n\n

### 2. Running blm

\n\n

blm will create a template file for the main input file of the Questaal package, ctrl.ext.\next_{: style=”color: green”} is a name you select; we will use bi2te3 corresponding to the material. blm actually generates actrl.ext, prepending the a so as not to overwrite any file named ctrl.ext.\n\n

Almost all programs in this package require the input file ctrl.ext. You can do an entire calculation starting only with this file; but often you supply other files. For example, symmetry line points for plotting energy bands are read from a separate file (e.g. syml.bi2te3).\nStructural data is typically split off into a separate file (site.bi2te3 in this tutorial); blm will create a site file by default.\n\n

#### 2.1 init file

\n\n

Create a file named init.bi2te3 containing the following lines:\n\n

    # from http://cst-www.nrl.navy.mil/lattice/struk/c33.html\n    # Bi2Te3 from Wyckoff\n    % const a=4.3835 c=30.487 uTe=0.788 uBi=0.40\n    LATTICE\n       SPCGRP=R-3M\n       UNITS=A\n       A={a} C={c}\n    SITE\n        ATOM=Te X=0     0    0\n        ATOM=Te X=0     0   {uTe}\n        ATOM=Bi X=0     0   {uBi}\n
\n
\n\n

Note\n\n

\n
• Lines which begin with ‘#’ are comment lines and are ignored. (More generally, text following a #’ in any line is ignored).\n
• Lines beginning with ‘%’ are directives to the preprocessor. Directives can perform various functions similar to a normal programming language, such as assigning variables, evaluating expressions, conditionally readings some lines, and repeated loops over sections of input.\n
• Quantities in brackets {…} are algebraic expressions parsed by the preprocessor, evaluated and the result the contents of brackets replaced by the result.\n
\n\n

init files and ctrl files are styled the same way: data is divided into categories (LATTICE and SITE) — tags which begin in the first column,\nand tokens (e.g. SPCGRP=, A=, X=) — tags belonging to a particular category.\n\n

This tutorial explains how the input files init.ext and ctrl.ext are structured, and the tags the various programs can read.\n\n

#### 2.2 ctrl file

\n\n

To create a template input file invoke blm:\n\n

$blm bi2te3\n \n \n\n Now take a look at the standard output.\nblm finds the lattice vectors from the crystal symmetry (if you had supplied the lattice vectors, it would have found the symmetry).\nIn this case, the symmetry is given; the corresponding point group has 12 symmetry operations, and two extra atoms had to be added to make the basis compatible with the group. The output snippet below indicates what blm found.\n\n \n\n  SGROUP: 12 symmetry operations from 3 generators\n ADDBAS: The basis was enlarged from 3 to 5 sites\n The additional sites are:\n\n ATOM=Te POS= 0.0000000 0.0000000 2.5538193\n ATOM=Bi POS= 0.0000000 0.0000000 -4.8185270\n \n \n\n \n\n blm automatically determined augmentation sphere radii, which it accomplishes by attempting to find spheres with equal potentials on each sphere surfaces (as well as it can). If you already have an input file, you can run lmchk with –getwsr to determine radii for you (it uses the same algorithm as blm). Particularly in polar compounds, this algorithm probably does a better job than you can do by hand, and it is recommended that you use the radii it finds, or some scaled version of them.\n\n **blm**{: style=\"color: blue\"} creates the file _actrl.bi2te3_{: style=\"color: green\"} with these contents:\n\n # Autogenerated from init.bi2te3\n VERS LM:7 FP:7\n IO SHOW=f HELP=f WKP=F IACTIV=f VERBOS=31\n % const pwmode=0 pwemax=3 # Use pwmode=1 or 11 to add APWs\n HAM AUTOBAS[PNU=1 LOC=1 LMTO=4 MTO=4 GW=0] GMAX= # set GMAX by hand\n # AUTOBAS[PNU=1 LOC=1 LMTO=3 MTO=3 GW=0] GMAX= # LMTO=3 for minimal basis\n PWMODE={pwmode} PWEMIN=0 PWEMAX={pwemax} OVEPS=0\n %const nsp=1 so=0 elind=-.7\n NSPIN={nsp} SO={so} FORCES={so==0} ELIND={elind}\n %const lxcf=2 lxcf2=-1 # PBE functional: lxcf=101 lxcf2=130\n %ifdef lxcf & lxcf2>0\n XCFUN=0,{lxcf},{lxcf2}\n %else\n XCFUN={lxcf}\n %endif\n % const nit=1\n ITER MIX=B2,b=.3 NIT={nit} CONVC=1e-5\n % const met=5 nk=0\n BZ NKABC={nk} METAL={met} # NKABC requires 1 to 3 positive numbers\n #SYMGRP i r3z my\n % const a=4.782549\n STRUC\n NSPEC=2 NBAS=5 NL=5\n ALAT={a}\n PLAT= 1 0 4.0154392 -0.5 0.8660254 4.0154392 -0.5 -0.8660254 4.0154392\n SPEC\n ATOM=Te Z= 52 R= 2.870279 LMX=3 LMXA=3\n ATOM=Bi Z= 83 R= 2.856141 LMX=3 LMXA=4\n SITE\n ATOM=Te POS= 0.0000000 0.0000000 0.0000000\n ATOM=Te POS= -0.5000000 -0.8660254 1.4616199\n ATOM=Te POS= 0.5000000 0.8660254 -1.4616199\n ATOM=Bi POS= 0.5000000 0.8660254 0.8030878\n ATOM=Bi POS= -0.5000000 -0.8660254 -0.8030878\n \n \n\n Note: The following applies to the FP code lmf. For ASA calculations, ignore the remainder of this section.\n\n This template will not work as is; three essential pieces of information which blm does not supply are missing, to rectify this :\n\n \n • You must specify plane-wave cutoff GMAX; see here.\n • You must specify a valid k mesh for Brillouin zone integration; see here.\n • You must define a basis set which can be done manually or automatically, as described next.\n \n\n blm creates a family of tags belonging to AUTOBAS to enbable other programs to automatically find a basis set for you. We will use this tag, which sets up a standard minimal basis:\n\n AUTOBAS[PNU=1 LOC=1 LMTO=3 MTO=3 GW=0]\n \n \n\n (Note that you must modify actrl.bi2te3 a little; the default gives [.. LMTO=4 MTO=4], which makes a double kappa basis.\n\n lmfa calculates wave functions and atomic densities for free atoms. It also has a mode that automatically generates information for basis sets, using tokens in AUTOBAS to guide it. This information is written to a file basp0.ext. AUTOBAS specifies set of conditions that enable lmfa to automatically build the basis set for you, including specification of envelope function parameters RSMH and EH. Alternatively you can define parameters such as EH and RSMH basis by hand, as described in this tutorial.\n\n Tokens in AUTOBAS tell lmfa to do the following:\n\n PNU=1 Calculate logarithmic derivative parameter for the free atom; save P parameters in file basp0._ext_ .\n Nothing about P is written if PNU=0 .\n\nLOC=1 Look for shallow cores to be explicitly treated as valence electrons, using [local orbitals](/docs/code/fpoverview/#local-orbitals).\n Shallow cores that meet specific criteria are identified and written to basp0._ext_ as PZ=.\n No search is made if LOC=0 .\n\nLMTO=3 Pick a default choice about the size of basis. LMTO=3 is a standard minimal basis.\n Run lmfa --input and look for HAM_AUTOBAS_LMTO to see what other choices there are.\n\n Note that **lmfa** will pick some defaults for the _l_-cutoff\n e.g. _spd_ or _spdf_ depending on the value of LMTO.\n\nMTO=1 Choose 1-kappa basis set (single orbital per _l_ channel).\n For better quality calculations, it is recommended you use MTO=2.\n\nGW=0 If GW=1, tailor basis for a GW calculation, e.g. changing the\n criteria for including shallow cores as valence, and the size of basis.\n \n \n\n These tokens thus define some reasonable default basis for you. lmfa writes basp0.ext. This file is never read, but lmf will read basp.ext and use this information when assembling the basis set. The two files have the same structure and you can copy basp0.ext to basp.ext. What lmfa generates is not cast in concrete. You are free to adjust the parameters to your liking, e.g. add a local orbital or remove one from the basis.\n\n The AUTOBAS tokens tell lmf what to read from basp.ext. It uses tokens in a manner similar, but not identical, to the way lmfa uses them:\n\n PNU=1 Read parameters P for all species present in basp._ext_\n\nLOC=1 LOC=1 or 2 tell **lmf** to read local orbital parameters PZ.\n Since these parameters may also be specified by the input file,\n LOC=1 tells lmf to give precedence to parameters specified by ctrl file\n LOC=2 tells lmf to give precedence to parameters specified by basp.\n\nLMTO= is not used by **lmf**.\n\nMTO=1 RSMH and EH may also be specified by the input file\n LMTO=1 or 3 tells lmf to read 1-kappa parameters specified by basp\n LMTO=2 or 4 tells lmf to read 2-kappa parameters specified by basp\n LMTO=1 or 2 tells lmf that parameters in the ctrl file take precedence\n LMTO=2 or 4 tells lmf that parameters in the basp file take precedence\n\nGW=0 If GW=1, tune basis for a GW calculation: log derivative parameters P\n are floated a little differently in the self-consistency cycle.\n They are weighted to better represent unoccupied states, at a slight cost\n to their representation of occupied states.\n \n \n\n ### 3. Checking sphere overlaps \n\n Sphere overlaps can be checked using lmchk. To do this copy the template actrl.bi2te3 to the input file and run lmchk:\n\n $ cp actrl.bi2te3 ctrl.bi2te3\n$lmchk bi2te3\n \n \n\n By default, blm makes the spheres as large as possible without overlapping, as the output shows. In this case the Bi and Te radii are nearly the same.\n\n ### 4. Making the atomic density \n\n Make the free atom density. If you did not do so already copy actrl.bi2te3 to the input file (changing [.. LMTO=4 MTO=4] to [.. LMTO=3 MTO=3]) and invoke lmfa:\n\n $ cp actrl.bi2te3 ctrl.bi2te3\n$lmfa bi2te3\n \n \n\n The primary purpose of lmfa is to generate a free atom density. A secondary purpose is to supply additional information about the basis set in an automatic way. All of this information can be supplied manually in the input file, but the autogenerated input file supplies a minimum amount of information. lmfa generates basp0.bi2te3 which contains\n\n BASIS:\nTe RSMH= 1.615 1.681 1.914 1.914 EH= -0.888 -0.288 -0.1 -0.1 P= 5.901 5.853 5.419 4.187\nBi RSMH= 1.674 1.867 1.904 1.904 EH= -0.842 -0.21 -0.1 -0.1 P= 6.896 6.817 6.267 5.199 5.089 PZ= 0 0 15.936\n \n \n\n Every species gets one line. This file specifies a basis set consisting of spdf orbitals on Te sites, and spdf orbitals on Bi sites, and a local 5d orbital on Bi. The contents of this file are explained above; see also RSMH and EH and PZ.\n\n Note: Remember that lmf reads from basp.ext, not basp0.ext.\n\n #### 3.1 Automatically finding deep states to include as valence electrons \n\n The partitioning between valence and core states is something that requires a judgement call. lmfa has made a default choice for you: the output shows that for Bi, lmfa selected the 6s, 6p, 6d, 5f states, populating them with charges 2, 3, 0, 0. Note that the total sphere charge is Q=0. You can override the default, e.g. choose the 5d over the 6d with SPEC_ATOM_P; override the l channel charges with SPEC_ATOM_Q.\n\n As was explained earlier, when HAM_AUTOBAS_QLOC is set lmfa will look for shallow core levels below 6s, 6p, 6d, 5f states, and as this table shows lmfa selected the 5d orbital which is normally a core state, to be included as a local orbital so that the usual 6d state and the 5d state are simultaneously included in the basis. Even though the 5d state is fairly deep (the output shows it lies at −2 Ry), the criterion of having a charge density outside the smoothing radius greater than 3×10−3 was met. (Use HAM_AUTOBAS_ELOC and HAM_AUTOBAS_QLOC to change these criteria.) lmfa supplies information about this to basp0.bi2te3, in the form PZ=0 0 15.936 (no local orbitals for s or p states). The 0.936 is significant: it tells lmf what boundary condition to use for the 5d radial function.\n\n #### 3.2 Automatically finding linearization energies \n\n Because HAM_AUTOBAS_P is set, lmfa save estimates for logarithmic derivative parameters P into basp0.ext. As is well known from elementary quantum mechanics there is a relation between the energy of a wave function and its logaritmic derivative at some radius. This information is supplied through the parameters P.\n\n lmfa calculates P for the free-atom potential. Since this potential is not so far removed from the crystal potential, these parameters can find the “band center” reasonably well for each partial wave l. In any case, these are only estimates; they normally get “floated” in the self-consistency cycle.\n\n #### 3.3 Automatically finding envelope function parameters \n\n Finally, the input file contains AUTOBAS[MTO=1]. This causes lmfa to envelope function parameters RSMH and EH (RSMH is the most important of the two) that fit the free atom wave functions well, and save the result in basp0.bi2te3. Unfortunately, what is optimum for the free atom is not optimum for the crystal, but the parameters are a reasonable starting point. These parameters are important, as they determine the quality of the basis. Later we discuss ways to optimize them, or improve the basis quality by adding APWs. blm cannot automatically determine every required input from the structural data. But for the following reasons: lmf will not run properly as the situation now stands\n\n \n 1. The basis set has to be specified. lmfa autogenerated parameters for a basis set, and saved the result to basp0.bi2te3. A decision must be made whether to use lmfa’s choices for RSMH, EH, P, and PZ, to supply your own, or to modify lmfa’s choice. In any case, you can do it in one of two ways:\n \n\n * With your text editor pick up the lines in _basp0.bi2te3_{: style=\"color: green\"} for Te and Bi, and paste them into _ctrl.bi2te3_{: style=\"color: green\"}, e.g.\n\n ATOM=Te Z= 52 R= 2.870279\n RSMH= 1.615 1.681 1.914 1.914 EH= -0.888 -0.288 -0.1 -0.1 P= 5.901 5.853 5.419 4.187\n ATOM=Bi Z= 83 R= 2.856141\n RSMH= 1.674 1.867 1.904 1.904 EH= -0.842 -0.21 -0.1 -0.1 P= 6.896 6.817 6.267 5.199 PZ= 0 0 15.936\n\n* Copy _basp0.bi2te3_{: style=\"color: green\"} to _basp.bi2te3_{: style=\"color: green\"}, and modify it as you like. File basp._ext_ is read after the main input file is read. If basp._ext_ exists, and one or more of the following tokens is present, their corresponding parameters _may_ be read from basp._ext_:\n* AUTOBAS[MTO]: read RSMH,EH (also possibly RSMH2,EH2)\n* AUTOBAS[P]: read P\n* AUTOBAS[PZ]: read PZ\n\nIf some this information is given in both the ctrl file and the basp file, the AUTOBAS settings tell **lmf**{: style=\"color: blue\"} which to use, as described [here](#basprules).\n \n \n\n \n 1. \n The atm file was created by lmfa without prior knowledge that the 5d local orbital is to be included as a valence state (via a local orbital). Thus it incorrectly partitioned the core and valence charge. You must do one of the following:\n\n \n • \n Remove PZ=0 0 15.936 from basp.bi2te3. It will no longer be treated as a valence state. Removing it means the remaining envelope functions are much smoother, which allows you to get away with a coarser mesh density, as described below. Whether you need it or not depends on the context.\n \n • \n Copy basp0.bi2te3 to basp.bi2te3 and run lmfa over again:\n\n $ cp basp0.bi2te3 basp.bi2te3\n$lmfa bi2te3\n \n \n \n \n\n With the latter choice lmfa operates a little differently from before as can be seen by comparing new output with the old. Initially the Bi 5d was part of the core; now is included as part of the valence.\n \n 2. \n blm does not by default assign any value to the plane wave cutoff for the interstitial density. lmf reads this information through HAM_GMAX. It is a required input; but blm does not pick a value because its proper choice depends on the smoothness of the basis. lmfa will determine a suggested value for HAM_GMAX for you. In the present instance, when the usual 6s, 6p, 6d, 5f states are included lmfa recommends GMAX=4.4 as can be seen by inspecting the first lmfa run. In the second run it recommends GMAX=4.1 from the valence states alone (as before), but because of the 5d state lmfa recommends that GMAX=8.1. The 5d state is strongly peaked at around the atom, and requires more plane waves to represent reasonably, even a smoothed version of it, than the other states. The difference between 8.1 and 4.4 is substantial, and it reflects the additional computational cost of including deep core-like states in the valence. This is the all-electron analog of the “hardness” of the pseudopotential in pseudopotential schemes. If you want high-accuracy calculations (especially in the GW context), you will need to include these states as valence. This particular choice of local orbital is rather overkill for LDA calculations however. If you eliminate the Bi 5d local orbital you can set GMAX=4.4 and significantly speed up the execution time.\n \n 3. \n blm assigns the initial k-point mesh to zero. Note the following lines in actrl.bi2te3:\n\n % const met=5 nk=0\nBZ NKABC={nk} METAL={met} # NKABC requires 1 to 3 positive numbers\n \n \n\n BZ_NKABC governs the mesh of k-points. An appropriate choice will depend strongly on the context of the calculation and the sytem of interest; the density-of-states at the Fermi level; whether Fermi surface properties are important; whether you want optical properties as well as total energies well described; the precision you need; the integration method, and so on. Any automatic formula can be dangerous, so blm will not choose a default for you. In this case, a 4×4×4 mesh works well. Use your text editor to change nk=0 to nk=4. Alternatively, supply –nk=.. to blm on the command line, as was done in this tutorial.\n\n Note that as generated, ctrl.bi2te3 will reflect METAL=5. Using METAL=5 with the tetrahedron integration is the recommended way to handle Fermi surface integration in metals. See this tutorial for some discussion.\n \n \n\n ### Input files for GW \n\n GW calculations demand more of the basis set because unuoccupied states are important. To set up a job in preparation for a GW calculation, invoke blm as :\n\n $ blm --gw bi2te3\n
\n
\n\n

Compare actrl.bi2te3 generated with the –gw switch to one without. One important difference will be that the default basis parameters are modified because AUTOBAS becomes:\n\n

AUTOBAS[PNU=1 LOC=1 LMTO=5 MTO=4 GW=1]\n
\n
\n\n

The basis is similar to LMTO=4 but EH has been set a little deeper. This helps the QS_GW_ implementation interpolate between k-points. The larger basis makes a minor difference to the valence bands; but the conduction bands change, especially the higher in energy you go.\n\n

Look also at this QS_GW_ demo for Silicon.\n\n

*Note The GW implementation allows you to use plane waves, but the QS_GW_ part of it does not, as yet.\n","dir":"/tutorial/lmf/buildingfpinput/","name":"lmf_buildingfpinput.md","path":"pages/lmf_buildingfpinput.md","url":"/tutorial/lmf/buildingfpinput/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Simplifying a complex ctrl file","permalink":"/tutorial/lmf/ctrlfile/","auto":{"code":"lmf","info":"How to construct a simplified ctrl file from a complex ctrl file","priority":1000},"header":false,"content":"

The input files ctrl.ext can be very complex and difficult to read.\nThis tutorial explains how to extract information from that file and make a simpler one.\nOf course, the simplified file need not generate the same results as the original.\n\n

This tutorial assumes you have cloned and built the lm repository (located here),\nand the executables (blm, lmfa, lmfa) reside in your path.\nThe repository is assumed to reside in ~/lm for the purpose of demonstration,\n\n

First, make sure there are no prior files for GaAs in your build directory (or where ever you are going to be working in). These come in the form of gas.* or *.gas, such as ctrl.gas (note: gas is not a typo of gaas).\n\n

$cp ../lm/fp/test/ctrl.gas .\n \n \n\n Now run the lmchk utility, which will generate site data (atom locations) from the ctrl.gas file:\n\n $ lmchk gas --wsitex=site\n
\n
\n\n

This generates a site file for gas; site.gas. lmf does not normally need empty spheres,\nedit site.gas and remove the lines starting wiWe then copy site.gas to sitein.gas:\n\n

$cp site.gas sitein.gas\n \n \n\n We can now run blm :\n\n $ blm --nk=5 --rdsite --wsitex --express gas\n
\n
\n\n

Which will create a actrl.gas file for us. Copy this to ctrl.gas\n\n

$cp actrl.gas ctrl.gas\n \n \n\n Technically this is the express ctrl.gas file created, however the file contents are not complete. Specifically, GMAX is not set as blm cannot determine it on its own. To find it, we can use the lmfa tool:\n\n $ lmfa gas\n
\n
\n\n

At the end of this output you will see a output such as\n\n

FREEAT:  estimate HAM_GMAX from RSMH:  GMAX=4.9\n
\n
\n\n

Specifically we care about the GMAX=* part. Although we are not done yet: copy the file lmfa generated, basp0.gas to basp.gas and run lmfa again:\n\n

$cp basp0.gas basp.gas\n$ lmfa gas\n
\n
\n\n

Finally, you will see another lmfa output looking like\n\n

FREEAT:  estimate HAM_GMAX from RSMH:  GMAX=4.9 (valence)  8.1 (local orbitals)\n
\n
\n\n

Now we have the value we want, namely the local orbital value (in this example: 8.1). We go back in to our ctrl.gas file and find the gmax= flag, which we should set to 8.1. The ctrl.gas is now complete!\n","dir":"/tutorial/lmf/ctrlfile/","name":"lmf_ctrl.md","path":"pages/lmf_ctrl.md","url":"/tutorial/lmf/ctrlfile/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Elastic Constants in Al","permalink":"/tutorial/lmf/elastic/","auto":{"code":"lmf","physical":"","info":"Two of the three independent elastic constants in Al are calculated.","priority":5000},"header":false,"content":"

### Command summary

\n\n

The tutorial starts under the heading “Tutorial”; you can see a synopsis of the commands by clicking on the box below.\n\n

\n\n
$mkdir si; cd si #create working directory and move into it\n$ cp lm/doc/demos/qsgw-si/init.si .             #copy init file     \n$blm init.si --express #use blm tool to create actrl and site files\n$ cp actrl.si ctrl.si                           #copy actrl to recognised ctrl prefix\n$lmfa ctrl.si #use lmfa to make basp file, atm file and to get gmax\n$ cp basp0.si basp.si                           #copy basp0 to recognised basp prefix   \n$vi ctrl.si #set iterations number nit, k mesh nkabc and gmax\n$ lmf ctrl.si > out.lmfsc                       #make self-consistent\n
\n
\n\n

\n\n

### Preliminaries

\n
\n\n

The input file uses some features of the preprocessor (mainly it uses\nsymbolic variables), so you may wish to go through the standard lmf\ntutorial,first.\n\n

This tutorial explains in more detail the input file, and the workings of the\n\n

lmf basis set.\n\n

Executables blm, lmfa, and lmf are required and are assumed to be in your path.\n\n

### Tutorial

\n
\n\n

This tutorial gives a brief outline as to the commands and procedures required to use the lmf program for users who may have experience with the program already. More detailed instructions can be found in each section should you require them.\n\n

Note: All instances of al in the command lines can be replaced with ctrl.al_, depending on what your input file has been named.\n\n

#### 1. Building The Input File

\n
\n\n

It is assumed for the tutorial that the specific categories in the input file are known. The sample input file for Al is provided here.\n\n

The input file and all of its categories are properly explained here.\n\n

#### 2. Getting Started: Analyzing The Results Of A Band Pass

\n
\n\n

Use lmchk to verify:\n\n

\n
• \n

lmchk al --showp\n
\n
\n\n

For example, the line containing RSMH= should have been turned into\n\n

RSMH=1.8,1.8,1.8    EH=-.1,-.1,-.1\n
\n
\n \n
• \n

Invoke:\n\n

lmchk al\n
\n
\n\n

And verify from the output that the sphere overlap is about 0.6% (a safe number) and that sum-of-sphere volumes equals about 75% of the total cell volume.\n \n

\n\n

Use lmfa to generate densitites for the free atom. Atomic densities will be overlapped to make a first trial density for the solid (Mattheis construction).\n\n

    lmfa al\n
\n
\n\n

Invoke lmf in a non self-consistent mode:\n\n

    lmf al -vhf=1\n
\n
\n\n

#### 3. Optimizing The Basis Set

\n
\n\n
\n
• \n

One can optimize RSMH efficiently with:\n\n

lmf al –optbas\n\n

You can take the result of the optimized calculation (saved in basp2.ext) and copy them to your input file. Or, you can have lmf automatically read these parameters from file basp; tokens in HAM_AUTOBAS control what lmf reads from this file, and what lmfa writes to it.\n \n

• \n

We might consider the effect of enlarging the basis, which as we noted we can do from the commmand line with -vbigbas=1. Do this:\n\n

lmf al -vbigbas=1 -vhf=1\n \n

\n\n

#### 4. Self-consistent LDA calculation

\n
\n\n

A fully self-consistent full-potential calculation can be preformed by invoking:\n\n

    lmf al > out\n
\n
\n\n

Now the output density is generated. With the output density, the HKS energy functional can be evaluated. Also the log derivative parameters P are floated to the band centers-of-gravity. How the P’s are floated is prescribed by tokens IDMOD.\n\n

A new density is constructed as follows:\n\n

\n
• \n

The output density is screened using the model Lindhard function, provided the Lindhard parameter ELIND is nonzero:\n\n \n \n

• \n

An estimate for the self-consistent density is made by mixing nin and nout* using some mixing scheme.\n \n

• \n

The resultant density is saved in rst.ext, unless you specify otherwise using –rs=.\n \n

• \n

At the end of the iteration, the total energies are printed and checks are made whether self-consistency is achieved to tolerances specified by ITER_CONV and ITER_CONVC. The RMS DQ generated at the mixing step is the measure compared against tolerance CONVC; the change in energy from one iteration to the next is tested against tolerance CONV. Both tolerances must be satisfied, unless you set CONV=0 or CONVC=0 (0 tolerance tells lmf not to test that parameter).\n \n

\n\n

#### 5. Shear constants

\n
\n\n

This section shows how to calculate two of the three independent shear constants in Al. We first calculate c11c12, which we will do by computing the total energy at different lattice distortions, and fitting the curvature of the total energy. The tetragonal distortion is conveniently generated using the line\n\n

    SHEAR=0 0 1 1+dist\n
\n
\n\n

which distorts the lattice in a way that conserves volume to all orders (this is useful because it tends to be less error-prone). The direction of distortion is set by the first three parameters; the lattice will be sheared along (001).\n\n

The first difficulty is that our specification of the FT mesh using token GMAX may cause the program to switch meshes for as parameter dist changes. This is a bad idea, since we want to resolve very small energy differences. So, the first step is to comment out the line with GMAX=gmax in the input and use instead:\n\n

    FTMESH=10 10 10\n
\n
\n\n

The second difficulty is that the shear constants in Al are difficult to converge, because they require many k-points. The following steps are written in ‘tcsh’ and compute the self-consistent total energy parameterically as a function of ‘dist’:\n\n

       rm -f out save.al\n       foreach x ( -0.04 -0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04)\n           rm -f mixm.al wkp.al\n           lmf al -vdist=$x -vnk=24 --pr20,20 >>out\n end\n \n \n\n Note that the mixing file eigenvalue weights file (mixm.al and wkp.al) are deleted for each new shear calculation. File save.al contains total energies ehf for 9 values of dist using 24 divisions of k-points. (To properly converge the calculation use nk=32 or even nk=40.)\n\n Extracting ehf and ehk parametrically as a function of dist is very easy with the vextract tool:\n\n  cat save.al | startup/vextract c dist ehf > dat\n \n \n\n The key ‘c’ tells vextract that you want lines beginning only with ‘c’: these lines correspond to band passes when self-consistency was reached. You can use any regular expression for the key. You can ask vextract to extract any quantity associated with a variable in the file.\n\n A trigonal shear will yield c44. To compute it, replace the SHEAR token with:\n\n  SHEAR=1 1 1 1+dist\n \n \n\n Both of these elastic constants depend on the fitting procedure with an uncertainty of about 5%. A careful calculation would use more points dist and increase nk. The final shear constant, the bulk modulus, you can calculate by varying the lattice constant. We do not do it here, but if you do this, you are advised to use token STRUC_DALAT, rather than change ALAT (see the following note).\n\n #### 6. Other things to read and do \n \n\n You can generate and plot the energy bands using lmf. It proceeds in the same way as in the ASA tutorial. Generate the band file this way:\n\n  cp startup/syml.fcc ./syml.al\n lmf al --band:fn=syml\n \n \n\n The generation of the core-level spectroscopy, Mulliken analysis or density-of-states is done first by invoking lmf with the appropriate command-line switch, followed by lmdos. The lmdos step is illustrated (including a way to plot results) in the ASA tutorial.\n\n To compute the density of states, see this tutorial. To compute core-level EELS spectra or Mulliken analysis in Fe, try running\n\n  fp/test/test.fp fe 2\n \n \n\n To compute total or partial DOS in hcp Co, try running\n\n  fp/test/test.fp co 2\n \n \n","dir":"/tutorial/lmf/elastic/","name":"lmf_elastic.md","path":"pages/lmf_elastic.md","url":"/tutorial/lmf/elastic/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Optics and resolved DOS in Fe","permalink":"/tutorial/gw/fe_optics/","auto":{"code":"lmf","physical":"Dielectric Response and Optics","info":"Shows various ways in which DOS can be decomposed.","priority":8300},"header":false,"content":" This tutorial is intended to show various ways in which DOS can be decomposed.\n\n \n\n LDA self-consistency (starting from init.fe)\n\n nano init.fe\nblm --nit=20 --nk=16 --gmax=7.9 --mag --nkgw=8 --gw fe\ncp actrl.fe ctrl.fe\nlmfa fe\ncat basp0.fe | sed -e 's/\$$Fe.*\$$/\\1 PZ=0 0 4.5'/ > basp.fe\nlmf fe > out.lmf\n \n \n\n Edit the ctrl file to add BZ and OPTICS tags.\n\n nano ctrl.fe\n \n \n\n Total DOS and integrated DOS\n\n lmf -vnkabc=16 fe --quit=band --dos:rdm\ncp dos.fe tdos.fe\nlmf -vnkabc=16 fe --quit=band --dos:rdm:idos\n \n \n\n Plot the total DOS and integrated DOS\n\n fplot -lt 1,col=1,0,0 -colsy 2 tdos.fe -lt 1,col=0,1,0 -colsy 3 tdos.fe\nopen fplot.ps\nfplot -frme:xor=-0.000599:yab=8 0,1,0,1 -lt 1,col=1,0,0 -ord x2+x3 dos.fe\nopen fplot.ps\n \n \n\n Identify the t2g and eg orbitals\n\n lmf fe --pr60 --quit=ham\n \n \n\n Make the Mulliken t2g and eg majority spin DOS\n\n lmf fe -vlteto=3 -voptmod=-5 -vnk=16 --quit=band --jdosw=5,6,8,21,22,24,26,27,29 --jdosw2=7,9,23,25,28,30\n \n \n\n Compare resolved to total DOS\n\n fplot -lt 1,col=0,0,0 jdos.fe -lt 1,col=.6,.6,.6 -ord x3+x4 jdos.fe -lt 2,col=1,0,0 -ord x3 jdos.fe -lt 2,col=0,1,0 -ord x4 jdos.fe\n \n \n\n Further resolve the DOS by k:\n\n lmf fe -vlteto=3 -voptmod=-5 -vnk=16 -vlpart=12 --quit=band --jdosw=5,6,8,21,22,24,26,27,29 --jdosw2=7,9,23,25,28,30\n \n \n\n \n\n ### Table of Contents \n\n \n\n ### Preliminaries \n \n\n You should first carry out the LDA self-consistency steps in the QSGW Tutorial for Fe.\nThis tutorial is written assuming you stopped at the LDA level (step 1). However the tutorial equally applies\nif you want the same results at the QSGW level (step 2).\n\n To view the postscript file, this document assumes you are using the apple-style open command.\n\n ### 1. Self-consistent LDA calculation for Fe \n\n Do step 1 of the QSGW Tutorial for Fe.\nTo follow this tutorial at the QSGW level, also complete step 2.\n\n ### 2. Setup for Optics \n\n This optics tutorial requires some additional tags to the input file.\nAppend the following lines to ctrl.fe.\n\n BZ NPTS=1001 DOS=-.7 .8 SAVDOS=T\n% const optmod=0 lteto=3 lpart=0\n% ifdef (optmod==-5|optmod==-6)\nOPTICS MODE={optmod} NPTS=1001 WINDOW=-.7 .8 LTET={lteto}\n% else\nOPTICS MODE={optmod} NPTS=301 WINDOW=0 1 LTET={lteto}\n%endif\n PART={lpart}\n \n \n\n The reasons for these extra tags will become clear in the tutorial.\n\n ### 3. Total Number and Density of States \n\n Total DOS are generated automatically when BZ_SAVDOS=T. With BZ added\nto the ctrl file, you can generate it immediately.\n\n The following generates the total DOS, saving it into file tdos.fe:\n\n $ lmf -vnkabc=16 fe --quit=band --dos:rdm\n$cp dos.fe tdos.fe\n \n \n\n and the following generates the number-of states (NOS), or integrated DOS:\n\n $ lmf -vnkabc=16 fe --quit=band --dos:rdm:idos\n
\n
\n\n

Notes:\n\n

\n
• the Fermi level should come out to -0.000599 Ry.\n
• At the Fermi level the total number of electrons should be 8.\n
• the :rdm tag is not necessary (DOS will be written wether the entire --dos switch is present),\nbut it causes lmf to write the file in\nan easy to read Questaal format for 2D arrays.\n
• The majority and minority DOS are roughly similar, but spin split by slightly\nless than 0.2 Ry, or about 2.2 eV, as noted in the\nQSGW tutorial.\n
\n\n

\n\n

The following uses the fplot utility to make postscript files.\n\n

For the DOS:\n\n

$fplot -lt 1,col=1,0,0 -colsy 2 tdos.fe -lt 1,col=0,1,0 -colsy 3 tdos.fe\n$ open fplot.ps\n
\n
\n\n

For the combined spin↑ + spin↓ NOS:\n\n

$fplot -frme:xor=-0.000599:yab=8 0,1,0,1 -lt 1,col=1,0,0 -ord x2+x3 dos.fe\n$ open fplot.ps\n
\n
\n\n

The figures should look like those shown below. In the left figure the vertical\naxis is aligned with the Fermi level, and the horizontal axis lies at 8 electrons.\nYou can confirm that the integrated DOS crosses 8 at EF.\n\n

In the right figure DOS are resolved by spin (red for majority spin, green for minority spin).\n\n

\n

\n\n

### 4. Resolve DOS into t2g and eg symmetry

\n\n

In Fe the d orbitals are of primary interest. Spherical\nharmonics for l=2 split under cubic symmetry into\nt2g and eg symmetry. In\nthis section we resolve the spin-1 DOS into those symmetries.\n\n

Optics MODE=-5\ngenerates the spin 1 DOS. Step 3 already supplied this information,\nbut the optics MODE=-5 works in concert with the\n--jdos switch which enables you to project the DOS into orbitals\nof your choosing, using a Mulliken analysis. --jdos offers a\nlot of flexibility, but a bit of extra work is needed to identify\nwhich orbitals in the LMTO basis set are associated with\nt2g and eg symmetry.\n\n

Run lmf with a high verbosity, stopping early:\n\n

lmf fe --pr60 --quit=ham\n
\n
\n\n

You should see this table:\n\n

 Orbital positions in hamiltonian, resolved by l:\n Site  Spec  Total    By l ...\n   1   Fe    1:30   1:1(s)   2:4(p)   5:9(d)   10:16(f) 17:17(s) 18:20(p) 21:25(d) 26:30(d)\n
\n
\n\n

It tells you that channels 5:9 (first kappa), 21:25 (second kappa) and 26:30 (local orbitals)\nare associated with the Fe d orbitals. In each group of 5 orbitals, three of them\nare of t2g character and two of eg character.\nThe t2g are the xy, xz, and yz, orbitals; the eg\nhave 3z2−1 and x2y2 character.\nAt the Γ point in the Brillouin zone, the Fe d states are three-fold and two-fold degenerate,\naccording to their character.\n\n

To know which of the 5 orbitals belong to each class, consult the\nspherical harmonics page. The\ntable indicates that the first, second, and fourth l=2 orbitals are\nt2g, and orbitals 3 and 5 are the\neg. Since the d orbitals appear three times in the basis,\nthere are 9 and 6 t2g and\neg orbitals, respectively.\n\n

Comparing to the table above, channels 5,6,8, 21,22,24, and 26,27,29 can be identified as\nt2g orbitals, and channels 7,9, 23,25, and 28,30 the\neg.\n\n

Run lmf as follows:\n\n

$lmf fe -vlteto=3 -voptmod=-5 -vnk=16 --quit=band --jdosw=5,6,8,21,22,24,26,27,29 --jdosw2=7,9,23,25,28,30\n \n \n\n Notes:\n\n \n • You can project onto one (--jdosw) or two (--jdosw and --jdosw2) combinations of orbitals,\nusing Mulliken projection.\n • This special Mulliken projected DOS MODE=-5 requires the enhanced tetrahedron integrator (LTET=3).\n • You can of course use more or fewer k points.\n • A file jdos.fe should be written to disk with total and the two Mulliken-projected DOS in the format\ndescribed here.\n • –quit=band avoids overwriting the density restart file.\n • \n lmf prints out messages like this:\n\n  optics: restrict transitions to : occ=(1,4) unocc=(2,6)\n \n \n\n This message is not relevant for the DOS.\n \n \n\n \n\n As a sanity check, the total DOS in jdos.fe should match tdos.fe\n\n $ fplot tdos.fe -lt 2,col=1,0,0  jdos.fe\n
\n
\n\n

The black and red dashed lines should lie on top of one another.\n\n

Make a Figure drawing:\n\n

\n
1. the total spin&uar; DOS;\n
2. the sum of t2g and eg DOS in light grey;\n
3. the t2g DOS in red;\n
4. \n

the eg DOS in green\n\n

$fplot -lt 1,col=0,0,0 jdos.fe -lt 1,col=.7,.7,.7 -ord x3+x4 jdos.fe -lt 2,col=1,0,0 -ord x3 jdos.fe -lt 2,col=0,1,0 -ord x4 jdos.fe\n \n \n\n the figure should look similar to this:\n\n \n \n\n In the interval (−0.35,0) Ry, the grey almost superimposes on the black. This shows that almost all the\nDOS in that interval is of Fe d character. Below −0.4 and above 0, a difference in the two appears: the d bandwidth has been exhausted and\nwhat remains is mostly of Fe s character. You can also see that the\nt2g is a somewhat wider than the eg.\n\n ### 5. Resolve DOS by k \n\n In the previous section the DOS were resolved into t2g and eg character.\nHere it is further resolved by k. To accomplish this use the OPTICS_PART tag.\nTo see its function, look at the web documentation\nor just do\n\n lmf --input | grep -A 10 OPTICS_PART\n \n \n\n Use OPTICS_PART=2 to resolve by k; we will use\nOPTICS_PART=12 to write the output to a binary file poptb.fe, since resolving DOS into 145 distinct k\nchannels and three kinds of DOS creates a large file. Column 1 is the energy.\nThe DOS channels are ordered as\n\n \n\n\n\n  \n total\n t2g\n eg\n \n columns\n 2:146\n 147:291\n 292:436\n \n \n \n\n Repeat the previous calculation adding a variable -vlpart=12:\n\n $ lmf fe -vlteto=3 -voptmod=-5 -vlpart=12 -vnk=16 --quit=band --jdosw=5,6,8,21,22,24,26,27,29 --jdosw2=7,9,23,25,28,30\n
\n
\n\n

This should create a binary file poptb.fe.\nTo confirm that the k resolved DOS sum to the total DOS, do:\n\n

mcx -br poptb.fe -split a 1,nr+1 1,2,'(nc-1)/3'+2,'(nc-1)/3*2'+2,'(nc-1)/3*3'+2 a11 a12 -csum -ccat jdos.fe -coll 1,2 -- -px:5\nmcx -br poptb.fe -split a 1,nr+1 1,2,'(nc-1)/3'+2,'(nc-1)/3*2'+2,'(nc-1)/3*3'+2 a11 a13 -csum -ccat jdos.fe -coll 1,3 -- -px:5\nmcx -br poptb.fe -split a 1,nr+1 1,2,'(nc-1)/3'+2,'(nc-1)/3*2'+2,'(nc-1)/3*3'+2 a11 a14 -csum -ccat jdos.fe -coll 1,4 -- -px:5\n
\n
\n\n

#### 5.1 DOS Heat Maps

\n\n

The k resolved DOS can be used to make a “heat map” of the Fermi surface, that is a tabulation of the\nDOS for all k points in the Brillouin Zone for a specific energy.\n\n

This is accomplished with optics editor, which you invoke with --–popted :\n\n

$lmf fe --rs=1,0 -vlteto=3 -voptmod=-5 -vlpart=12 -vnk=16 --popted\n \n \n\n You will be prompted for an instruction:\n\n  Option :\n \n \n\n Typing ? <enter> will give you a menu of options.\n\n As with many of the Questaal editors you can string a sequence of instructions on\nthe command line: the editor will treat them as though you entered them\ninteractively. Separate instructions are delimited by the character immediately following\n--popted. In the present case, try\n\n $ lmf fe --rs=1,0 -vlteto=3 -voptmod=-5 -vlpart=12 -vnk=16 '--popted:readb:npol 3:kshowe -0.01 1 sort ds,q3:kmape 0.05 1:saveka:q'\n
\n
\n\n

:  was used as the delimiter. These instructions do the following:\n\n

\n
• :npol 3  tells the editor that the file has three “polarizations.”\n In this case “polarizations” refer to total DOS, and first and second Mulliken DOS.\n
• :kshowe -0.01 1 sort ds,q3  causes the editor to :\n
\n
• print out the DOS at ω=−0.01 Ry\n
• print out the DOS for the first “polarization” (total DOS in this case).\n
• sort the list by increasing length, and for two vectors of the same length\nby the third component of k. Results are printed to standard output.\n
\n \n
• :kmape 0.05 1  causes the editor to :\n
\n
• Map DOS(ω=0.05 Ry) to each point in the full BZ\n
• Maps the first “polarization” (total DOS in this case)\n
• Results are kept in an internal array\n
\n \n
• :saveka  saves the internal array generated by kmape to an ASCII file, pka.ext.\n
• :q  quits the editor.\n
\n\n

\n\n\n","dir":"/tutorial/gw/fe_optics/","name":"lmf_fe_optics_tutorial.md","path":"pages/lmf_fe_optics_tutorial.md","url":"/tutorial/gw/fe_optics/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Generating a Fermi Surface with lmf","permalink":"/tutorial/lmf/fermisurface/","auto":{"physical":"Fermi Surface","code":"lmf","info":"Uses lmf and graphics tools to make and draw a Fermi surface.","priority":8100},"header":false,"content":"

This tutorial has been superseded; see here\n","dir":"/tutorial/lmf/fermisurface/","name":"lmf_fermi.md","path":"pages/lmf_fermi.md","url":"/tutorial/lmf/fermisurface/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Detailed lmf tutorial: self-consistent LDA calculation for PbTe","permalink":"/tutorial/lmf/pbte_calculation/","auto":{"code":"lmf","parent":"lmf","physical":"DFT","info":"Detailed lmf tutorial : A self-consistent density-functional calculation for PbTe","priority":9200},"header":false,"content":"

This tutorial carries out a self-consistent density-functional calculation for PbTe using the lmf code. It has a purpose similar to the basic tutorial on Si but provides much\nmore detail. See also the Fe tutorial, an LDA+QSGW calculation for a ferromagnetic metal.\n\n

It synchronizes with an ASA tutorial on the same system, enabling a comparison of the ASA and full potential methods, and forms a starting point for other tutorials, e.g. on optics.\n\n

\n\n
nano init.pbte\nblm init.pbte                                 #makes template actrl.pbte and site.pbte\ncp actrl.pbte ctrl.pbte\n
\n
\n\n
lmfa ctrl.pbte                                #use lmfa to make basp file, atm file and to get gmax\ncp basp0.pbte basp.pbte                       #copy basp0 to recognised basp prefix\nlmfa ctrl.pbte                                #remake atomic density with updated valence-core partitioning\n
\n
\n\n
lmf ctrl.pbte -vnkabc=6 -vgmax=7.8\n
\n
\n\n

\n\n

\n\n\n
\n\n

### Preliminaries

\n\n

Some of the basics are covered in the basic lmf tutorial for Si. It is easier to read but less detailed.\nSee also the the tutorial on building input files.\n\n

The standard outputs from running this tutorial are explained in the\nannotation of lmfa output and\nannotation of lmf output.\nMany details omitted here are given in the annotated outputs.\n\n

Executables blm, lmchk, lmfa, and lmf are required and are assumed to be in your path.\n\n

\n\n

### 1. Building the input file

\n\n

PbTe crystallizes in the rocksalt structure with lattice constant a = 6.428 Å. You need the structural information in the box below to construct the main input file,\nctrl.pbte. Start in a fresh working directory and cut and paste the box’s contents to init.pbte.\n\n

LATTICE\n        ALAT=6.427916  UNITS=A\n        PLAT=    0.0000000    0.5000000    0.5000000\n                 0.5000000    0.0000000    0.5000000\n                 0.5000000    0.5000000    0.0000000\nSITE\n        ATOM=Pb   X=     0.0000000    0.0000000    0.0000000\n        ATOM=Te   X=     0.5000000    0.5000000    0.5000000\n
\n
\n\n

The primitive lattice vectors are in row format (the first row contains the x, y and z components of the first lattice vector and so forth). In the SITE section, the atom type and coordinates are shown. X= specifies the site coordinates. They are specified in “direct” representation, i.e., as fractional multiples of lattice vectors PLAT. You can also use Cartesian coordinates; instead of X= you would use POS= (see additional exercises below). Positions in Cartesian coordinates are in units of ALAT, like the lattice vectors.\n\n

Note : You can also import structural data from other sources.\nSee this page for options.\n\n

Use the blm tool as in the box below to create the input file (ctrl.pbte) and the site file (site.pbte):\n\n

blm init.pbte\ncp actrl.pbte ctrl.pbte\n
\n
\n\n

Note : If you are preparing for a later QSGW calculation,\nuse blm --gw init.pbte. See this page for documentation of\nblm’s command-line switches.\n\n

### 2. How the input file is organized

\n\n

In this tutorial, blm is used in “standard” mode. (The basic tutorial\ncreates a simpler file with blm --express init.si).\nStandard mode makes limited use of the preprocessing capabilities of the Questaal input system :\nit uses algebraic variables which can be modified on the command line.\nThus lmf -vnit=10 ... sets variable nit to 10 before doing anything else. Generally:\n\n

\n
• Lines which begin with ‘#’ are comment lines and are ignored. (More generally, text following a #’ in any line is ignored).\n
• Lines beginning with ‘%’ are directives to the preprocessor.\n
\n\n

The beginning of the ctrl file generated by blm should look like the following:\n\n

# Variables entering into expressions parsed by input\n% const nit=10\n% const met=5\n% const so=0 nsp=so?2:1\n% const lxcf=2 lxcf1=0 lxcf2=0     # for PBE use: lxcf=0 lxcf1=101 lxcf2=130\n% const pwmode=0 pwemax=3          # Use pwmode=1 or 11 to add APWs\n% const nkabc=0 gmax=0\n
\n
\n\n

% const tells the preprocessor that it is declaring one or more variables. nit, met, etc, used in expressions later on.\nThe parser interprets the contents of brackets {…} as algebraic expressions:\nThe contents of {…} is evaluated and the numerical result is substituted for it.\nExpression substitution works for input lines proper, and also in the directives.\n\n

For example this line\n\n

metal=  {met}                    # Management of k-point integration weights in metals\n
\n
\n\n

becomes\n\n

metal=  5\n
\n
\n\n

because met is a numerical expression (admittedly a trivial one). It evaluates to 5 because met is declared as an algebraic variable and assigned value 5 near the top of the ctrl file. The advantage is that you can do algebra in the input file, and you can also re-assign values to variables from the command line, as we will see shortly.\n\n

Lines corresponding to actual input are divided into\ncategories and tokens within the\ncategories.\n\n

A category begins when a character (other than % or #) occurs in the\nfirst column. Each token belongs to a category; for example in box below IO contains three tokens,\nSHOWMEM, IACTIV and VERBOS :\n\n

IO    SHOWMEM=f\n      IACTIV=f VERBOS=35,35\n
\n
\n\n

(Internally, a complete identifier (aka tag) would be IO_IACTIV=, though it does not appears in that form in the ctrl file.)\n\n

This link explains the structure of the input file in more detail.\n\n

### 3. The EXPRESS category

\n\n

blm normally includes an EXPRESS category in ctrl.pbte.\n\n

EXPRESS\n# Lattice vectors and site positions\n  file=   site\n\n# Basis set\n  gmax=   {gmax}                   # PW cutoff for charge density\n  autobas[pnu=1 loc=1 lmto=5 mto=4 gw=0]\n
\n
\n\n

Tags in the EXPRESS category are effectively\naliases for tags in other categories, e.g. EXPRESS_gmax corresponds to\nthe same input as HAM_GMAX. If you put a tag into EXPRESS, it will\nbe read there and ignored in its usual location; thus in this instance adding GMAX\nto the HAM category would have no effect.\n\n

The purpose of EXPRESS is to simplify the input file,\ncollecting the most commonly used tags in one place.\n\n

### 4. Determining what input an executable seeks

\n\n\n

Executables accept input from two primary streams : tags in the ctrl file and additional information through command-line switches.\nEach executable reads its own particular set, though most executables share many tags in common.\n\n

Usually an input file contains only a small subset of the tags an executable will try to read; defaults are used for the vast majority of tags.\n\n

There are four special modes designed to facilitate managing input files. For definiteness consider the executable lmfa.\n\n

$lmfa --input\n$ lmfa --help\n$lmfa --showp\n$ lmfa --show | lmfa --show=2\n
\n
\n\n

--input puts lmfa in a special mode. It doesn’t attempt to read anything; instead, it prints out a (large) table of all the tags it would try to read, including a brief description of the tag, and then exits.
\nSee here for further description.\n\n

--help performs a similar function for the command line arguments: it prints out a brief summary of arguments effective in the executable you are using.
\nSee annotated lmfa output for further description.\n\n

--showp reads the input through the preprocessor, prints out the preprocessed file, and exits.
\nSee the annotated lmf output\nfor a comparison of the pre- and post-processed forms of the input file in this tutorial.\n\n

--show tells lmfa to print out tags as it reads them (or the defaults it uses).
\nIt is explained in the annotated lmf output.\n\n

### 5. Initial setup: free atomic density and parameters for basis

\n\n

\n\n\n

\n
The basp file\n
In order for lmf carry out a self-consistent calculation for the crystal,\nit requires information about the basis set, and an initial trial density.\n\n

lmfa computes densities for free atoms, which are overlapped to form an initial\ntrial density (called the Mattheis construction).\n\n

lmfa will also automatically generate a basis set, and save it in a file called basp.ext.\nWhat is stored in this file depends on the contents of HAM_AUTOBAS, but typically three\npieces of information are kept:\n

\n \n
\n\n

As will be described in more detail in the pages below, lmfa prepares the following.\n\n

\n
1. \n

Make a self-consistent atomic density for each species.\n \n

2. \n

Fit the density outside the augmentation radius.\nlmf needs this information to overlap atomic densities for an initial trial density.
\nInformation about the augmented and interstitial parts of the density are written to file atm.pbte.\n \n

3. \n

Provide a reasonable estimate for the\nGaussian smoothing radius rs and hankel energy ε)\nthat fix the shape of the smooth Hankel envelope functions\nfor l=0, 1,…. The l cutoff is determined internally, depending on the setting of  HAM_AUTOBAS_LMTO.
\nThese parameters are written to file basp0.pbte as  RSMH  and  EH.\n \n

4. \n

Provide a reasonable estimate for boundary conditions that fix linearization energies, parameterized by the\nlogarithmic derivative parameter Pl,\naka the “continuous principal quantum number.”
\nThese parameters are written to basp0.pbte as  P.\n \n

5. \n

Decide on which shallow cores should be included as local orbitals.
\nLocal orbitals are written basp0.pbte as nonzero values of  PZ.\n \n

6. \n

Supply an estimate for the interstitial density plane wave cutoff GMAX.\n \n

\n\n

lmfa will provide all of this information automatically. It will write atomic density information\nto atm.pbte and basis set information to template basp0.pbte. The Questaal suite reads\nfrom basp.pbte, but lmfa writes to basp0 to avoid overwriting a file you may want to\npreserve. You can edit basp.pbte and customize the basis set.\n\n

As a first step, do:\n\n

lmfa ctrl.pbte                                #use lmfa to make basp file, atm file and to get gmax\ncp basp0.pbte basp.pbte                       #copy basp0 to recognised basp prefix\n
\n
\n\n

The output is annotated in some detail here.\nIt begins with a header:\n\n

 LMFA:     nbas = 2  nspec = 2  vn 7.11.i  verb 35\n special\n pot:      XC:BH\n autogen:  mto basis(4), pz(1), pnu(1)   Autoread: pz(1)\n
\n
\n\n

The pot line says that lmfa the potential will be made from the Barth-Hedin functional.\nTo use a GGA, see here.\n\n

The autogen line says that lmfa will make the basis set information (points 3-5 outlined above).
\nThe next few sections amplify on these three points. Point 6 is discussed here.\n\n

#### 5.1 Local orbitals

\n\n

Part of lmfa’s function is to identify local orbitals that\nextend the linear method. Linear methods are reliable only over a limited energy\nwindow; certain elements may require an extension to the linear approximation for accurate calculations. This is accomplished with\nlocal orbitals. lmfa will automatically look for atomic\nlevels which, if certain criteria are satisfied it designates as a local orbital, and includes this information in the basp0 file.\nThe annotated lmfa output explains how lmfa analyzes core states for\nlocal orbitals.\n\n

Inspect basp.pbte. Note in particular this text connected with the Pb atom:\n\n

    PZ= 0 0 15.934\n
\n
\n\n

(The same information can be supplied in the input file,\nthrough SPEC_ATOM_PZ.)\n\n

lmfa is suggesting that the Pb 5d state is shallow enough that it be included in the valence. Since this state\nis far removed from the Fermi level, we would badly cover the Hilbert space spanned by Pb 6d state were we to use Pb 5d as the valence partial\nwave. (In a linear method you are allowed to choose a single energy to construct the partial wave; it is\nusually the “valence” state, which is near the Fermi level.)\n\n

This problem is resolved with local orbitals : these are partials wave at an energy far removed from the Fermi level.\nThe three numbers following PZ\ncorrespond to specifications for local orbitals in the s, p, and d channels. Zero indicates “no local orbital;”\nthere is only a d orbital here.\n\n

15.934 is actually a compound of 10 and the “continuous principal quantum number”\n5.934. The 10’s digit tells lmf\nto use an “enhanced” local orbital as opposed to the usual variety found in most\ndensity-functional codes. Enhanced orbitals append a tail so that the\ndensity from the orbital spills into the interstitial.\nYou can specify a “traditional” local orbital by omitting the 10, but this kind is more accurate, and there is no advantage to doing so.\n\n

The continuous principal quantum number (5.934) specifies the number of nodes and boundary\ncondition. The large fractional part\nof P is large for core states, typically\naround 0.93 for shallow cores. lmfa determines the proper value for the atomic potential. In the\nself-consistency cycle the potential will change and lmf will update this value.\n\n

lmfa automatically selects the valence-core partitioning; the information is given in basp.pbte.\nYou can set the partitioning manually by editing this file.\n\n

Note: high-lying states can also be included as local orbitals; they improve on the Hilbert\nspace far above the Fermi level. In the LDA they are rarely needed and lmfa will not add them\nto the basp.pbte. But they can sometimes be important in GW calculations, since in contrast to\nthe LDA, unoccupied states also contribute to the potential.\n\n

#### 5.2 Valence-core partitioning of the free atomic density

\n\n

After basp.pbte has been modified, you must run lmfa a second time:\n\n

lmfa ctrl.pbte\n
\n
\n\n

This is necessary whenever the valence-core partitioning changes through the addition or removal of a local orbital.\nEven though lmfa writes the atomic to atm.pbte, this file will change when\npartitioning between core and valence will change with the introduction of local orbitals, as described next.\nThis is because core and valence densities are kept separately.\n\n

##### Relativistic core levels
\n\n

Normally lmfa determines the core levels and core density from\nthe scalar Dirac equation. However there is an option to compute the core levels from the full Dirac equation.\n\n

Tag HAM_REL controls how the Questaal package manages different levels of relativistic treatment.\nRun lmfa --input and look for HAM_REL. You should see:\n\n

 HAM_REL                opt    i4       1,  1     default = 1\n   0 for nonrelativistic Schrödinger equation\n   1 for scalar relativistic Schrödinger equation\n   2 for Dirac equation (ASA only for now)\n   10s digit 1: compute core density with full Dirac equation\n   10s digit 2: Like 1, but neglect coupling (1,2) pairs in 4-vector\n
\n
\n\n

Set HAM_REL=11 to make lmfa calculate the core levels and core density with the full Dirac\nequation.\n\n

You might want to see the core level eigenvalues; they can shift significantly relative to the scalar Dirac solution.\nAlso, l is no longer a good quantum number so there can be multiple eigenvalues connected with\nthe scalar Dirac l. To see these levels, invoke lmfa\nwith a sufficiently high verbosity. In the present instance insert\nHAM REL=11 into ctrl.pbte and do\n\n

lmfa --pr41 ctrl.pbte\n
\n
\n\n

You should see the following table:\n\n

 Dirac core levels:\n nl  chg    <ecore(S)>     <ecore(D)>     <Tcore(S)>     <Tcore(D)>   nre\n 1s   2   -6461.412521   -6461.420614    9160.575645    9160.568216   439\n ec(mu)   -6461.420614   -6461.420614\n 2s   2   -1154.772794   -1154.777392    2201.484620    2201.485036   473\n ec(mu)   -1154.777392   -1154.777392\n 3s   2    -277.137428    -277.136313     700.148783     700.160432   501\n ec(mu)    -277.136313    -277.136313\n 4s   2     -62.683976     -62.678557     231.671152     231.686270   531\n ec(mu)     -62.678557     -62.678557\n 5s   2     -10.589828     -10.580503      60.826909      60.833608   567\n ec(mu)     -10.580503     -10.580503\n 2p   6    -990.094400   -1001.984462    1702.510726    1772.365432   475\n ec(mu)    -948.389636   -1109.174115    -948.389636   -1109.174115    -948.389636    -948.389636\n 3p   6    -229.993746    -232.623198     568.649082     585.156080   505\n ec(mu)    -220.667558    -256.534478    -220.667558    -256.534478    -220.667558    -220.667558\n 4p   6     -47.246014     -47.902771     184.751871     189.523363   537\n ec(mu)     -44.969950     -53.768412     -44.969950     -53.768412     -44.969950     -44.969950\n 5p   6      -6.300710      -6.422904      43.507054      44.670581   577\n ec(mu)      -5.869706      -7.529300      -5.869706      -7.529300      -5.869706      -5.869706\n 3d  10    -182.032939    -182.146340     501.452676     502.171493   509\n ec(mu)    -179.091564    -186.728504    -179.091564    -186.728504    -179.091564    -186.728504    -179.091564    -186.728504    -179.091564    -179.091564\n 4d  10     -29.432703     -29.453418     150.979227     151.198976   545\n ec(mu)     -28.796634     -30.438595     -28.796634     -30.438595     -28.796634     -30.438595     -28.796634     -30.438595     -28.796634     -28.796634\n 5d  10      -1.566638      -1.562069      23.907636      23.945913   605\n ec(mu)      -1.485638      -1.676716      -1.485638      -1.676716      -1.485638      -1.676716      -1.485638      -1.676716      -1.485638      -1.485638\n 4f  14      -9.755569      -9.751307     117.412788     117.457023   569\n ec(mu)      -9.592725      -9.962749      -9.592725      -9.962749      -9.592725      -9.962749      -9.592725      -9.962749      -9.592725      -9.962749      -9.592725      -9.962749      -9.592725      -9.592725\n\n qcore(SR) 78.000000  qcore(FR)  78.000000  rho(rmax)  0.00000\n sum ec :    -25841.9031 (SR)    -25934.9233 (FR) diff       -93.0203\n sum tc :     48113.1010 (SR)     48677.3220 (FR) diff       564.2210\n
\n
\n\n

The scalar Dirac Pb 5d eigenvalue (-1.566638 Ry) gets split into 6 levels with energy -1.485638 Ry and four with\n-1.676716 Ry. The mean (-1.56207 Ry) is close to the scalar Dirac value. In the absence of a magnetic field a\nparticular l will split into two distinct levels with degeneracies 2l and 2l+2, respectively.\n\n

The bottom part of the table shows how much the free atom’s total energy changes as a consequence of the fully\nrelativistic Dirac treatment.\n\n

#### 5.3 Automatic determination of basis set

\n\n

Some details of the basis set (envelope functions, augmentation, local orbitals)\nare explained in this tutorial.\n\n

lmfa loops over each species, generating a self-consistent density.\n\n

Given a density and corresponding potential, lmfa will construct some estimates for the basis set, namely the\ngeneration of envelope function parameters RSMH  and  EH (and possibly RSMH2  and  EH2, depending\non the setting of HAM_AUTOBAS_MTO), analyzing which cores should be promoted to local orbitals, and\nreasonable estimates for the boundary condition of the partial wave.\n\n

\n\n\n

\n
Envelope functions\n
The envelope functions (smoothed Hankel functions) are characterized by RSMH and EH. RSMH is the Gaussian “smoothing radius” and approximately demarcates the transition between short-range behavior, where the envelope varies as , and asymptotic behavior where it decays exponentially with decay length , where is one of the EH. lmfa finds an estimate for RSMH and EH by fitting them to the “interstitial” part of the atomic wave functions (the region outside the augmentation radius).\n
Fitting the smooth Hankel function to the numerically tabulated exact function is usually quite accurate. For Pb, the error in the energy (estimated from the single particle sum) is 0.00116 Ry — very small on the scale of other errors.\nThe fitting process is described in more detail in the annotated lmfa output.\n
lmf requires RSMH and EH. Those generated by lmfa are reasonable, but unfortunately not optimal choices for the crystal, as explained in the annotated lmfa output. You can change them by hand, or optimize them with lmf’s optimizing function, --opt. To make an accurate basis, a second envelope function is added through RSMH2 and EH2. (lmfa automatically does this, depending on the setting of HAM_AUTOBAS_MTO). Alternatively you can add APW’s to the basis. For a detailed discussion on how to select the basis set, see this tutorial.\n
\n\n
\n
• Note 1: The envelope functions [ for the\n(RSMH,EH) group, for the (RSMH2,EH2) group], are\naugmented by partial waves in augmentation spheres. Thus the lmf basis set consists of\naugmented smooth Hankel functions.\n
• Note: 2: The new Jigsaw Puzzle Orbital basis is expected significantly\nimprove on the accuracy of the existing Questaal basis. High quality envelope functions are automatically constructed\nthat continuously extrapolate the accurate augmented partial waves smoothly into the interstitial; the kinetic energy\nof the envelope functions are continuous across the augmentation boundary.\n
\n\n

\n\n\n

\n
Local orbitals\n
lmfa searches for core states which are shallow enough to be treated as local orbitals,\nusing the core energy and charge spill-out of the augmentation radius (rmt) as criteria; see annotated lmfa output.\n
When it was run for the first time, lmfa singled out the Pb 5d state, using\ninformation from the table below taken from lmfa’s standard output. Once local orbitals are specified lmfa is able to appropriately\npartition the valence and core densities. This is essential because the two densities are treated differently in the crystal code.\nRefer to the annotated lmfa output for more details.\n
\n\n
 Find local orbitals which satisfy E > -2 Ry  or  q(r>rmt) > 5e-3\n l=2  eval=-1.569  Q(r>rmt)=0.0078  PZ=5.934  Use: PZ=15.934\n l=3  eval=-9.796  Q(r>rmt)=3e-8  PZ=4.971  Use: PZ=0.000\n
\n
\n\n

\n\n\n

\n
Boundary conditions\n
The free atomic wave function satisfies the boundary condition that the wave function decay as r→∞.\nThus, the value and slope of this function at rmt are determined by the asymptotic boundary condition.\nThis boundary condition is needed for fixing the linearization energy\nof the partial waves in the crystal code.\nlmfa generates an estimate for this energy and encapsulates it into the\n“continuous principal quantum number”,\nsaved as P in basp0.pbte (normally P will updated in the\nself-consistency cycle).
\nRefer to the annotated lmfa output for more details.\n
\n\n

#### 5.4 Fitting the interstitial density

\n\n\n

lmfa fits valence and core densities to a linear combination of smooth Hankel functions.\nThis information will be used to overlap free-atomic densities to obtain a trial starting density.\nThis is explained in the annotated lmfa output.\n\n

#### 5.5 Estimate for GMAX

\n\n

After looping over all species lmfa writes basis information to\nbasp0.pbte, atomic charge density data to file\natm.pbte, and exits with the following printout:\n\n

 FREEAT:  estimate HAM_GMAX from RSMH:  GMAX=4.3 (valence)  7.8 (local orbitals)\n
\n
\n\n

This is the G cutoff EXPRESS_gmax or HAM_GMAX needed to\ndetermine the interstitial mesh spacing.\nTwo values are printed, one determined from the shape of valence envelope functions (4.3) and, if local orbitals are present the largest\nvalue found from their shape, as explained in the annotated lmfa output.\n\n

### 6. Remaining Inputs

\n\n

#### k mesh

\n\n

We are almost ready to carry out a self-consistent calculation.\nTry the following:\n\n

lmf ctrl.pbte\n
\n
\n\n

lmf stops with this message:\n\n

 Exit -1 bzmesh: illegal or missing k-mesh\n
\n
\n\n

We haven’t yet specified a k mesh. You must supply it yourself since there are too many contexts to supply a sensible default value. In this case a k-mesh of divisions is adequate. With your text editor change nkabc=0 in the ctrl file to nkabc=6, or alternatively assign variable nkabc on the command line using  -vnkabc=6 (which is what this tutorial will do).\n\n

#### Charge density mesh

\n\n

We also haven’t specified the G cutoff for the density mesh. blm does not determine this parameter automatically because it is sensitive to the selection of basis parameters, which local orbitals are included. lmfa conveniently supplies that information for us, based in the shape of envelope functions it found. In this case the valence G cutoff is quite small (4.3), but the Pb 5d local orbital is a much sharper function, and requires a larger cutoff (7.8). You must use the larger of the two.\n\n

Note: if you change the shape of the envelope functions you must take care that gmax is large enough. This is described in the lmf output below.\n\n

Change variable gmax=0 in the ctrl file, or alternatively add a variable to the command line (-vgmax=7.8), as we do in the next section.\nOr, you can run blm again, with command-line argument-gmax=7.8.\n\n

### 7. Self consistency

\n\n

Carry out a self-consistent calculation as follows:\n\n

lmf ctrl.pbte -vnkabc=6 -vgmax=7.8\n
\n
\n\n

lmf will iterate up to 10 iterations. The cycle is capped to 10 iterations because of the following lines in ctrl.pbte, which before and after preprocessing read:\n\n

   before preprocessing               after preprocessing\n% const nit=10                     |\n...                                |\nEXPRESS                           |  EXPRESS\n...                               |\n  nit=    {nit}                    |   nit=    10\n
\n
\n\n

#### Initialization steps

\n\n

lmf begins with some initialization steps. Each step is explained in more detail in the annotated lmf output.\n\n

\n\n

#### Self-consistent cycle

\n\n

Each iteration of the self-consistency cycle begins with\n\n

 --- BNDFP:  begin iteration 1 of 10 ---\n...\n --- BNDFP:  begin iteration 2 of 10 ---\n...\n
\n
\n\n

One iteration consists of the following steps. The standard output is annotated in some detail here.\n\n

\n
• Construct the potential and matrix elements.\n
\n
• Interstitial and local parts of the potential are made.\n
• Partial waves and are integrated from the\npotential subject to the boundary conditions.\n
• Matrix elements of the partial waves (kinetic energy, potential energy, overlap) are assembled for the Kohn-Sham hamiltonian.\n
• Matrix elements of the interstitial potential .\nfor envelope functions .\n
\n\n

This is sufficient to make the Kohn-Sham hamiltonian. Other matrix elements may be made depending on circumstances, matrix elements for optics or for spin-orbit coupling (HAM_SO=t).\n \n

\n
\n
• Makes an initial pass through the irreducible k points in the Brillouin zone to\nobtain the Fermi level and obtain integration weights for each band and k point into a binary file wkp.pbte. In general until the Fermi level is known, the weights assigned to each eigenfunction are not known, so the charge density cannot be assembled. How labor is divided between the first and second pass depends on BZ_METAL. See here for further discussion.\n
• Makes a second pass\nto accumulate the output mesh and local densities. For the latter essential information is retained as coefficients of the local density matrix (a compact form).\n
• Assembles the local densities from the density matrix.\n
• Symmetrizes the density.\n
• Finds new logarithmic derivative parameters pnu by floating them to the band center-of-gravity\n
• Computes the Harris-Foulkes and Kohn-Sham total energies and forces.\n
• \n

Mixes the input and output densities to form a new trial density.\nA segment of the output reads:\n\n

mixrho:  sought 2 iter from file mixm; read 0.  RMS DQ=2.17e-2\n
\n
\n\n

DQ=2.17e-2 is a measure of the root mean square deviation noutnin.\nAt self-consistency this number should be small.\n \n

• Checks for convergence.\n
\n\n

lmf should converge to self-consistency in 10 iterations.\n\n

At the end of the self-consistency cycle the density is written to rst.pbte\n\n

 iors  : write restart file (binary, mesh density)\n
\n
\n\n

and a check is made for convergence. No check is made in the first iteration because there is no prior iteration to compare the change in total energy. The second iteration reads:\n

\n              ↓         ↓\n diffe(q)=  0.004793 (0.018916)    tol= 0.000010 (0.000030)   more=T\ni nkabc=6 gmax=7.8 ehf=-55318.1657745 ehk=-55318.1568616\n
\n\n

Two checks are made: against the change (0.004793) in total energy and the RMS DQ (0.018916).\nWhen both checks fall below tolerances self-consistency is reached. In this case it occurs in iteration 10,\nwhere the convergence check reads:\n

\n              ↓         ↓\n diffe(q)=  0.000000 (0.000005)    tol= 0.000010 (0.000030)   more=F\nc nkabc=6 gmax=7.8 ehf=-55318.1620974 ehk=-55318.1620958\n
\n\n

The first line prints out the change in Harris-Foulkes energy relative to the prior iteration and some norm of RMS change in the\ncharge density noutnin (see arrows), followed by the tolerances required for self-consistency.\n\n

The last line prints out variables specified on the command line, and total\nenergies from the Harris-Foulkes and Kohn-Sham functionals. Theses are different\nfunctionals but they should approach the same value at self-consistency.\nThe c at the beginning of the line indicates that this iteration\nachieved self-consistency with the tolerances specified.\nSee the annotated output for more details.\n\n

### Other Resources

\n\n
\n
• \n

Click here to see annotated standard output from lmfa, and\nhere to see annotated standard output from lmf.\n \n

• \n

An input file’s structure, and features of the programming language capability, is explained in some detail\nhere. The full syntax of categories and tokens can be found in the input file manual.\n \n

• \n

This tutorial more fully describes some important tags the lmf reads,\nand this one presents alternative ways to build input files from various sources such as the VASP POSCAR file.\n \n

• \n

This tutorial more fully explains the lmf basis set.\nThere is a corresponding tutorial on the basics of a self-consistent ASA calculation for PbTe.\nA tutorial on optics can be gone through after you have finished the present one.\n \n

• \n

This document gives an overview of some of lmf’s unique features and capabilities.\n \n

• \n

The theoretical formalism behind the lmf is described in detail in this book chapter:\nM. Methfessel, M. van Schilfgaarde, and R. A. Casali, A full-potential LMTO method based\non smooth Hankel functions,’’ in Electronic Structure and Physical Properties of\nSolids: The Uses of the LMTO Method, Lecture Notes in Physics,\n535, 114-147. H. Dreysse, ed. (Springer-Verlag, Berlin) 2000.\n \n

\n\n

### FAQ

\n\n
\n
1. \n

How does lmf iterate to self-consistency?\n\n

It mixes the input density nin with output density nout generated by lmf,\nto construct a new input density nin. This process is repeated until nout=nin\n(within a specified tolerance). The actual mixing algorithm can be quite involved; see this page.\n \n

2. \n

The gap is small and Pb is a heavy element. Doesn’t spin-orbit coupling affect the band structure?\n\n

Yes, it does. The bandgap will change significantly when spin-orbit coupling is added.\n \n

3. \n

The LDA is supposed to underestimate bandgaps. But the PbTe bandgap looks pretty good. Why is that?\n\n

This turns out to be largely an accident. If spin orbit coupling is included, the bandgap appears to be pretty good, but in fact levels\nL6+ and L6 that form the valence and conduction band edges are inverted in the LDA.\nSee Table I of this paper.\nAs the paper notes, they are well described in QSGW.\n \n

4. \n

How do you know where the band edges are?\n\n

PbTe is has a quite simple band structure with high symmetry. It’s a good bet that the\nband edges are on high-symmetry lines. But in general the position of band edges can be\nquite complex. A slightly more complicated case is Si. See this tutorial.\n \n

5. \n

Is there an easy way to calculate effective masses?\n\n

Yes, once you know where the band edge is. See this tutorial.\n \n

6. \n

The augmentation l cutoff in the ctrl file is 4 for Pb and 3 for Te. LAPW methods typically require much higher l cutoffs (6 or 8) to be well converged.\nWhy is this? Is it a worry?\n\n

Questaal uses a different kind of augmentation.\nIt a difference in the basis set (smoothed Hankels vs LAPWs; Questaal in fact has an LAPW basis that \nmay be combined with the augmented smooth Hankels), but because of the different way augmentation is carried out.\nBoth kinds of augmentation converge to the same answer in the limit of large l, but Questaal’s augmentation is much more rapidly convergent.\nIt can be incorporated into APW basis sets as well.\nSee this tutorial.\n \n

\n\n

\n\n
\n
1. \n

Try self-consistent calculations with the Pb 5d in the valence as a local orbital. Repeat the calculation but remove the PZ part from basp.pbte.\n \n

2. \n

Specify symops manually.\n \n

3. \n

Turn on spin orbit coupling and observe how the band structure changes.\n \n

4. \n

Try rotations\n \n

5. \n

k-convergence. Try BZ_BZJOB\n//: {::comment}\n \n

\n\n

\n\n

This tutorial covers the basics for running a self-consistent DFT calculation for silicon. The goal is to introduce you to the different file types and the basics of running the code.\n\n

\n\n
$mkdir si && cd si #create working directory and move into it\n$ nano init.si                                  #create init file using lines from box below\n$blm init.si --express #use blm tool to create actrl and site files\n$ cp actrl.si ctrl.si                           #copy actrl to recognised ctrl prefix\n$lmfa ctrl.si #get basp file, atm file and gmax estimate\n$ cp basp0.si basp.si                           #copy basp0 to recognised basp prefix\n$nano ctrl.si #set k-point mesh and real space mesh\n$ lmf ctrl.si > out.lmfsc                       #make self-consistent\n
\n
\n\n

Alternatively, you can run the following one-liner to get the same result. This assumes you have already created the init file. See Additional Exercises for more details.\n\n

$blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\n \n \n\n \n\n \n ### Preliminaries \n\n Executables blm, lmfa, and lmf are required and are assumed to be in your path. The source code for all Questaal executables can be found here.\n\n \n ### Tutorial \n\n To begin with, create a new working directory and move into it. Here we will call it “si”.\n\n $ mkdir si && cd si\n
\n
\n\n

We will start by creating a file called init.si that contains structural\ninformation in a format that is recognised by the code (analogous to the POSCAR file in VASP). Create\na file called init.si and copy the following lines to it:\n\n

LATTICE\n        ALAT=10.26\n        PLAT=    0.00000000    0.50000000    0.50000000\n                 0.50000000    0.00000000    0.50000000\n                 0.50000000    0.50000000    0.00000000\n# pos means cartesian coordinates, units of alat\nSITE\n     ATOM=Si   POS=    0.00000000    0.00000000    0.00000000\n     ATOM=Si   POS=    0.25000000    0.25000000    0.25000000\n
\n
\n\n

ALAT specifices the lattice constant, which is in atomic units by default (Questaal code uses Atomic Rydberg Units). The primitive lattice vectors are listed after PLAT and are in row format (i.e. the first row contains the x, y and z components of the first lattice vector and so forth). The SITE section specficies the atom types and their positions in cartesian coordinates (indicated by POS) in units of the lattice constant. More information can be found in the Additional Exercises.\n\n

In order to run the DFT program lmf, you need an input file along with structural information. The blm tool reads the init file as input and creates a template input file actrl.si and structure file site.si. The Questaal package recognises certain names as file types (such as “ctrl” for input file and “site” for structure file). blm writes\nactrl.si rather than ctrl.si to prevent overwriting of an existing ctrl file. Extension “si” labels the material; it is something you choose. Most files read or generated by Questaal programs will append this extension.\n\n

Run blm as shown below and then copy the template file actrl.si to ctrl.si, which is the name of the main input file recognised by most codes in the Questaal package. The --express switch tells blm to make a particularly simple input file; we will see more complicated examples in later tutorials.\n\n

$blm init.si --express\n$ cp actrl.si ctrl.si\n
\n
\n\n

The start of the blm output shows some structural and symmetry information. Further down, the “makrm0:” part gives information about creating the augmentation spheres, both silicon atoms were assigned spheres of radii 2.22 Bohr. Now open up the site file and you can see it contains the lattice constant and lattice vectors in the first line. The other terms in the first line are just standard settings and a full explanation can be found in the online page for the site file. The second line is a comment line and the subsequent lines contain the atomic species labels and coordinates. Note that running blm produces a new actrl.si and site.si file each time.\n\n

Next take a look at the input file ctrl.si.\n\n

$nano ctrl.si\n \n \n\n The first few lines are just header information, then you have a number of basic parameters for a calculation. We won’t talk about these values now but a full description is provided on the ctrl file page. Defaults are provided by blm for most of the variables except gmax and nkabc, which are left as “NULL”. nkabc specifies the k mesh and there is no sensible way for blm to select a default value, as it depends on the bandgap or details of the Fermi surface, and also the precision needed for the physical property you need. gmax specifies how fine a real space mesh is used for the interstitial charge density and this depends on the basis set as described below. Take a look at the last line, it contains information about the different atoms in the system (here we only have silicon) and their associated augmentation spheres.\n\n We now need a basis set and based on this we can get an estimate for gmax. This can done automatically by using the lmfa tool. lmfa also calculates free atom wavefunctions and densities. The latter will be used later to make a trial density for the crystal calculation; the free atom wavefunctions are used to fit the basis set parameters. Note that in the all-electron approach, space is partitioned into two kinds of regions: an augmentation sphere part (around each atom) and an interstitial part (region between spheres). In the augmentation spheres, the basis set is composed of local atomic functions, tabulated numerically. In the interstitial regions, the basis consists of analytic, smooth-Hankel functions, characterised by their smoothing radius (RSMH) and Hankel energies (EH). The number of interstitial functions and their parameters (RSMH and EH) are defined in the basp file (the size of which is determined by parameters in the ctrl file). There are a few more subtleties to the code’s basis set but we will leave further details to the theory pages and the input file pages. Run the following command:\n\n $ lmfa ctrl.si\n
\n
\n\n

Again the output shows some structural information and then details about finding the free atom density, basis set fitting and, at the end an estimate of gmax is printed out. Note that the Barth-Hedin exchange-correlation functional is used, as indicated by “XC:BH”, this was specified by “xcfun=2” in the ctrl file (the default). We won’t go into more detail now, but a full description can be found on the lmfa page. One thing to note is a recommended value for gmax given towards the end: “GMAX=5.0”. Now that we have a gmax value, open up the ctrl file and change the default NULL value to 5.0.\n\n

$nano ctrl.si\n \n \n\n Check the contents of your working directory and you will find two new files atm.si and basp0.si . The file atm.si contains the free atom densities calculated by lmfa. File basp0.si is the template basis set file; the standard basis set name is basp and the extra 0 is appended to avoid overwriting. Take a look at basp0.si and you will see that it contains basis set parameters that define silicon’s smooth Hankel functions. Changing these values would change their functional form, but lmfa does a reasonable job (also later on parameters can be automatically optimized, if desired) so we will leave them as they are. Copy basp0.si to basp.si, which is the name lmf recognises for the basis set file.\n\n $ cp basp0.si basp.si\n
\n
\n\n

The second unknown parameter is the k-mesh. A $4\\times4\\times4$ k mesh is sufficient for Si. Set this value with your text editor by simply changing “nkabc=NULL” to “nkabc=4” (4 is automatically used for each mesh dimension, you could equivlaently use “nkabc=4 4 4”).\n\n

$nano ctrl.si\n \n \n\n #### Self-consistency \n\n We now have everything we need to run an all-electron, full-potential DFT calculation. This is done using the lmf program. Double check that you have specified the k mesh (nkabc) and a gmax value and then run the following command. A lot of text is produced so it will be easier to redirect the output to a file, here we call it out.lmfsc (appending sc to indicate a self-consistent cycle).\n\n $ lmf ctrl.si > out.lmfsc\n
\n
\n\n

The first part of the output is similar to what we’ve seen from the other programs. Look for the following lines:\n\n

lmfp  : no rst file ... try to overlap atomic densities\nrdovfa: read and overlap free-atom densities (mesh density) ...\n
\n
\n\n

The first line above tells us about what input density is used. lmf first looks for a restart file rst.si and if it’s not found it then looks for the free atom density file atm.si. lmf then overlaps the free atom densities to form a trial density (Mattheis construction) and this is used as the input density. Next lmf begins the first iteration of a self-consistent cycle: calculate the potential from the input density, use this potential to solve the Kohn-Sham equations and then perform Brillouin zone integration to get the output density. Towards the end of the output, the Kohn-Sham total energy is reported along with the Harris-Foulkes total energy. These two energies will be the same (or very close) at self-consistency.\n\n

Now move to the end of the file. The ‘c’ in front of the Harris Foulkes ehf and Kohn-Sham ehk energies indicates that convergence was reached (note how similar the ehf and ehk energies are). A few lines up you can see that it took 7 iterations to converge: look for “it 7 of 20”. At the end of each iteration the ehf and ehk total energies are printed and a check is made for self-consistency. The two parameters conv and convc in the ctrl file specify, respectively, are the self-consistency tolerances for the total energy and root mean square (RMS) change in the density. Note that by default both tolerances have to be met. To use a single tolerance you simply set the one that you don’t want to zero.\n\n

Further down the Fermi energy and band gap values, and other key bits of information are reported in the Brillouin zone integration section. You should find something similar to the output snippet below.\n\n

 BZWTS : --- Tetrahedron Integration ---\n ... only filled or empty bands encountered:  ev=0.185509  ec=0.229539\n VBmax = 0.185509  CBmin = 0.229539  gap = 0.044029 Ry = 0.59880 eV\n BZINTS: Fermi energy:      0.185518;   8.000000 electrons;  D(Ef):    0.000\n         Sum occ. bands:   -1.4864297  incl. Bloechl correction:    0.000000\n
\n
\n\n

To see how the density and energy changes between iterations, try grepping for “DQ” and “ehk=-”. The RMS DQ measures the RMS change in the density between iterations; ehk is the Hohenberg-Kohn Sham total energy (also just called Kohn-Sham).\n\n

$grep 'DQ' out.lmfsc\n$ grep 'ehk=-' out.lmfsc\n
\n
\n\n

You can also check how the bandgap changes as iterations proceed to self-consistency by grepping out.lmfsc for “gap”.\n\n

And that’s it! You now have a self-consistent density and have calculated some basic properties such as the band gap and total energy.\nOther tutorials to look at are those to generate energy band structures, and density-of-states, or calculate a mechanical property such as the optical mode frequency.\n\n

\n

### Other Resources

\n\n

This tutorial on PbTe also covers the basic self-consistency cycle, in a bit more detail. It has a companion tutorial for the ASA, allowing you to compare the FP and ASA methods.\nThere is a more detailed tutorial\nwith some description of important tags the lmf reads, and of the lmf basis set.\n\n

For a tutorial showing a self-consistent calculation of ferromagnetic metal, see this tutorial. This tutorial shows how to calculate optical properties for PbTe. See this tutorial for the calculation of the optical mode frequency in Si. This document gives an overview of the lmf implementation; the formalism behind the method is described in this book chapter.\n\n

\n

### FAQ

\n\n\n

Below is a list of frequently asked questions. Please get in contact if you have other questions.\n\n

1) How does blm determine the augmentation sphere radii?\n\n

Overlaps free atom densities and adjusts the radii to make the potential as similar as possible on teh surface of each sphere.\n\n

2) What is the log file?\n\n

The log file log.si keeps a compact record of key outputs in the current directory. In successive runs, data is appended to the log file.\n\n

3) What is the Harris-Foulkes energy?\n\n

It is a functional of the input density, rather than the output density. At self-consistency it should be the same as the standard Kohn-Sham functional. The Harris-Foulkes functional tends to be more stable, and like the Kohn-Sham functional, it is stationary at the self-consistent density. But it is not necessarily a minimum there. See this paper by M. Foulkes and R. Haydock.\n\n

\n\n

\n\n

1) Short version of tutorial with one-liner command\n\n

The entire tutorial can be run with the following one-liner:\n\n

$blm si --express --nk=4 --gmax=5 && cp actrl.si ctrl.si && lmfa si && cp basp0.si basp.si && lmf si > out.lmfsc\n \n \n\n Create a new directory and try running the above command, starting from the init file. N.B. You should\nbe careful about running calculations in the same directory as certain files (such as the\nrst, mix and moms files) will be read and used. First of all, notice that here we use ‘blm si’ instead\nof ‘blm ctrl.si’. The two are equivalent, blm accepts either the full init file name or just the extension.\nNotice that the above command left out the –express switch, compare this new ctrl file to the previous one\nand you will see that it provides more options. Note also that the nkabc and gmax values were supplied as\noptions or ‘switches’ to blm, this removes the need to edit the ctrl file by hand.\n\n 2) Accurate bandgap\n\n The bandgap printed out by the code is not the actual LDA gap, but the smallest separation between the highest occupied and lowest unoccupied state it found on a discrete$4\\times4\\times4$k mesh. The actual minimum occurs near k=(1,0,0), commonly referred to as the X point. The X point is on the$4\\times4\\times4$k-mesh, but the conduction band minimum itself is not quite at X. Rerun the calculation with a very fine k mesh (not self-consistently this time) and observe that the bandgap is slightly smaller. Use your text editor to set nkabc to 12 or 16 and do:\n\n $ lmf ctrl.si --quit=rho\n
\n
\n\n

You should find that the gap gets smaller by about 0.13 eV, which is close to the experimentally observed splitting between the conduction minimum and the conduction band at X.\nInstead of running a very fine k-point mesh, you can also do a gradients minimization as described in the Extremal points and effective mass tutorial.\n\n

3) Structural data in other formats (POSCAR or CIF)\n\n

If you have structural data in another format, you can simply convert to an init file and repeat the same steps. The cif2init and poscar2init\ntools convert CIF and POSCAR files, respectively, to init files. For example, create a new directory and copy the following lines to a file called POSCAR:\n\n

system Si\n5.430\n0.0 0.5 0.5\n0.5 0.0 0.5\n0.5 0.5 0.0\nSi\n2\ndirect\n0.00 0.00 0.00\n0.25 0.25 0.25\n
\n
\n\n

Convert to an init file with the following command:\n\n

$poscar2init POSCAR > init.si\n \n \n\n The output has been redirected to the file init.si (it is sent to standard output by default). Take a look at the converted init file. The UNITS=A on the third line specifies that the lattice constant is in units of Angstroms, which is the default for the POSCAR format. The Questaal code accepts other units in the init file but will convert to atomic units. Check this by running blm and you will see that the lattice constant in the site file has been converted to Bohr. Last thing to note is the ‘X=’ after the atom species. The init file from the tutorial has ‘POS=’, indicating cartesian coordinates but here the ‘X=’ indicates direct or fractional coordinates (see the following additional exercises for more). The poscar2init tool only accepts POSCAR files with coordinates specified in direct format. Also note that the POSCAR file must specify the atom types and number of atoms per atomic species (lines 6 and 7 in the POSCAR example above). More information, including an example of cif conversion, can be found in the detailed input file tutorial.\n\n 4) Converting between fractional and Cartesian coordinates\n\n For example, try running the command blm init.si --express --wsitex and you will see that xpos has been added to the first line of site.si; this indicates that the coordinates are now in fractional form. Note that in this example for silicon the Cartesian and fractional coordinates happen to be the same.\n\n 5) Specifying the structure based on the space group (init file)\n\n Run blm again but this time use the following init file:\n\n # Init file for Silicon\nLATTICE\n SPCGRP=227\n A=5.43 UNITS=A\nSITE\n ATOM=Si X=0 0 0\n \n \n\n Si forms in the diamond cubic structure, space group 227 as you can readily determine from, e.g. this web page. Space group 227 is Fd-3m which has an underlying fcc Bravais lattice. The init file equally allows you to supply the space group as SPCGRP=Fd-3m, or supply the lattice vectors directly, with a token PLAT, viz\n\n  PLAT= 0.0 0.5 0.5\n 0.5 0.0 0.5\n 0.5 0.5 0.0\n \n \n\n \n\n\n UNITS=A tells blm that A is in Å;. If you do not specify the units, A is given in atomic units. (Questaal uses Atomic Rydberg units.)\n\n Lattice vectors, lattice constant and the position of the basis vectors place in SITE is all that is needed to fix the structural information. Atomic numbers for each atom is inferred from the symbol (Si). Token X= specifies that the coordinates are in “direct” representation, that is, as fractional multiples of lattice vectors.\nIt doesn’t matter in this case, but you can use Cartesian coordinates : use POS= instead of X (see additional exercise 4). In such a case positions are given in Cartesian coordinates in units of ALAT. So are the lattice vectors, if you supply them instead of the space group number.\n\n Relation between Cartesian coordinates and fractions of lattice vectors\n\n The connection between positions expressed in Cartesian coordinates and as (fractional) lattice vector multiples is:\n \nPOSi = X1Pi,1 + X2 Pi,2 + X3 Pi,3, where Pi,j is Cartesian component i of lattice vector j.\n \n \n\n","dir":"/tutorial/lmf/si_calculation/","name":"lmf_lda_si.md","path":"pages/lmf_lda_si.md","url":"/tutorial/lmf/si_calculation/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Annotated standard output, program lmf","permalink":"/docs/outputs/lmf_output/","auto":{"code":"lmf","info":"The standard output from the PbTe tutorial is annotated.","priority":9150},"header":false,"content":" ### Table of Contents \n \n\n\n ### Preliminaries \n \n\n The output documented here is mostly taken from the lmf tutorial for PbTe. Some portions are adapted from other calculations, as will be indicated.\n\n The standard output is organized by blocks. The sections below annotate each block approximately in the order they are made.\n\n ### Preprocessor’s transformation of the input file \n\n The input file is run through the preprocessor, which modifies the ctrl file before it is parsed for tags. Normally it does this silently. To see the effects of the preprocessor use lmf --showp ...\n\n \n\n Append --showp to the lmf command in the PbTe tutorial\n\n $ lmf ctrl.pbte -vnkabc=6 -vgmax=7.8 --showp\n
\n
\n

The box below compares side by side the original ctrl.pbte and its transformation by the preprocessor (the original file was edited slightly)\n\n

% const nit=10\n% const met=5\n% const so=0 nsp=so?2:1\n% const lxcf=2 lxcf1=0 lxcf2=0\n% const pwmode=0 pwemax=3\n% const nkabc=0 gmax=0\n\nVERS  LM:7 FP:7 # ASA:7                          |  VERS  LM:7 FP:7\nIO    SHOW=f HELP=f IACTIV=f VERBOS=35,35        |  IO    SHOW=f HELP=f IACTIV=f VERBOS=35,35\nEXPRESS                                          |  EXPRESS\n# Lattice vectors and site positions             |\n  file=   site                                   |    file=   site\n                                                 |\n# Basis set                                      |\n  gmax=   {gmax}                                 |    gmax=   7.8\n  autobas[pnu=1 loc=1 lmto=5 mto=4 gw=0]         |    autobas[pnu=1 loc=1 lmto=5 mto=4 gw=0]\n                                                 |\n# Self-consistency                               |\n  nit=    {nit}                                  |    nit=    10\n  mix=    B2,b=.3,k=7                            |    mix=    B2,b=.3,k=7\n  conv=   1e-5                                   |    conv=   1e-5\n  convc=  3e-5                                   |    convc=  3e-5\n                                                 |\n# Brillouin zone                                 |\n  nkabc=  {nkabc}                                |    nkabc=  6\n  metal=  {met}                                  |    metal=  5\n                                                 |\n# Potential                                      |\n  nspin=  {nsp}                                  |    nspin=  1\n  so=     {so}                                   |    so=     0\n  xcfun=  {lxcf},{lxcf1},{lxcf2}                 |    xcfun=  2,0,0\n                                                 |\n#SYMGRP i*r3(1,1,-1) r4x                         |\nHAM                                              |  HAM\n    PWMODE={pwmode} PWEMIN=0 PWEMAX={pwemax}     |      PWMODE=0 PWEMIN=0 PWEMAX=3\n    FORCES={so==0} ELIND=-0.7                    |      FORCES=1 ELIND=-0.7\nSPEC                                             |  SPEC\n  ATOM=Pb  Z= 82  R= 3.044814  LMX=3  LMXA=4     |    ATOM=Pb  Z= 82  R= 3.044814  LMX=3  LMXA=4\n  ATOM=Te  Z= 52  R= 3.028689  LMX=3  LMXA=3     |    ATOM=Te  Z= 52  R= 3.028689  LMX=3  LMXA=3\n
\n
\n\n

\n\n

### Display tags parsed in the input file

\n\n\n

After transformation by the preprocessor, lmf parses for tags and substitutes default values for tags it does not find. To see the value of tags lmf, whether parsed or defaults, use lmf --show or lmf --show=2. The latter causes lmf to stop after displaying tags, and is useful if you want to see whether lmf is doing what you expect. Using --show is useful if you want to record the input conditions in the output (be advised that the output is verbose).\n\n

\n\n

Add --show=2 to the lmf command from the PbTe tutorial:\n\n

$lmf ctrl.pbte -vnkabc=6 -vgmax=7.8 --show=2\n \n \n The output is quite verbose so only a snippet from the SPEC category is shown\n\n  Tag Input cast (size,min,read,def) result\n\n...\n --- Parameters for species data ---\n SPEC_SCLWSR opt r8 1, 1, *, 1 0\n SPEC_OMAX1 opt r8v 3, 1, *, 3 0 0 0\n SPEC_HFAC opt chr 1, 0, *\n SPEC_HFAC_V opt lg 1, 1, *, 1 F\n ... Species 1\n SPEC_ATOM reqd chr 1, 0, 1 Pb\n SPEC_ATOM_Z reqd r8 1, 1, 1, -- 82\n SPEC_ATOM_R reqd* r8 1, 1, 1, -- 3.04481\n SPEC_ATOM_A opt r8 1, 1, *, 1 0.025\n SPEC_ATOM_NR opt i4 1, 1, *, 1 497\n SPEC_ATOM_RSMH opt r8v 4, 4, *, 4 0 0 0 0\n SPEC_ATOM_EH opt r8v 4, 4, *, --\n...\n \n \n\n \n • Tags are optional except for SPEC_ATOM, SPEC_ATOM_Z, and SPEC_ATOM_R;\nthe latter could have been supplied with equivalent information through a different tag\n(SPEC_ATOM_R/W or **SPEC_ATOM_R/A) in this case.\n • Variables are read as scalars or vectors; integers, floating-point numbers, or strings.\nIf strings have spaces you must enclose them in quotes or backets.\n • Default values were substituted for the optional tags. In this case, the input\nfile contained none of the optional tags: all values are taken from defaults,\nexcept for EH which was not assigned any value.\nlmf requires EH; but it will be read independently\nfrom the basp file.\n \n\n \n\n There are two other special modes to help with managing the input.\n\n $ lmf --input doesn’t attempt to read anything; instead, it prints out a (large) table of all the tags it would try to read, including a brief description of the tag, and then exits. See here for further description.\n\n

$lmf --help performs a similar function for the command line arguments: it prints out a brief summary of arguments effective in the executable you are using. See the tutorial for further description.\n\n See Table of Contents\n\n ### Reading basis information from the basp file \n\n After parsing the ctrl file, lmf may attempt to read basis set information from the basp file. \nThe basp file is automatically generated by lmfa. Tokens in EXPRESS_autobas or HAM_AUTOBAS control what is read from the basp file.\n\n \n\n\n\n basp.pbte supplies basis information (parameters EH and RSMH defining the shape of the envelope functions,\ncontinuous principal quantum numbers P\nand information about local orbitals). The structure of the basp file is described on this page.\nWhen lmf reads from this file, it will print to standard output what it read :\n\n  rdctrl: reading basis parameters from file basp\n ioorbp: read species Pb RSMH,EH RSMH2,EH2 P PZ\n ioorbp: read species Te RSMH,EH RSMH2,EH2 P\n reset nkaph from 1 to 3\n \n \n\n You can also supply this information in the ctrl file. If data is present in both the ctrl and basp files, lmf decides on which to use depending on settings in EXPRESS_autobas or HAM_AUTOBAS.\n\n To see a synopsis of tokens in AUTOBAS, invoke lmf --input and search for autobas. Tokens in AUTOBAS are documented here.\n\n \n\n ### Header information \n\n The header information presents a condensed synopsis of some key settings that are used in the calculation.\n\n  LMF: nbas = 2 nspec = 2 vn 7.11.i verb 35\n special: forces\n pot: XC:BH\n float: float P LDA-style\n autoread: mto basis(4), pz(1), pnu(1)\n bz: metal(5), tetra, invit\n \n \n\n It tells you, for example that you are using the Barth-Hedin functional\n\n ### Lattice information \n\n This block prints informations about the lattice vectors and settings used in Ewald summations:\n\n  Plat Qlat\n 0.000000 0.500000 0.500000 -1.000000 1.000000 1.000000\n 0.500000 0.000000 0.500000 1.000000 -1.000000 1.000000\n 0.500000 0.500000 0.000000 1.000000 1.000000 -1.000000\n alat = 12.147006 Cell vol = 448.071898\n\n LATTC: as= 2.000 tol=1.00E-08 alat=12.14701 awald= 0.261\n r1= 1.807 nkd= 87 q1= 5.403 nkg= 169\n \n \n\n Note: When long, thin cells are used, or when APW’s are added to the basis set, some attention needs to be paid to the Ewald tolerance, input through EWALD_TOL.\n\n ### Symmetry and k mesh \n\n The block below shows symmetry operations it finds in the crystal, and the irreducible k mesh it obtains from the point group it is given:\n\n  SGROUP: 1 symmetry operations from 0 generators\n SYMLAT: Bravais system is cubic with 48 symmetry operations.\n SYMCRY: crystal invariant under 48 symmetry operations for tol=1e-5\n GROUPG: the following are sufficient to generate the space group:\n i*r3(1,1,-1) r4x\n i*r3(1,1,-1) r4x\n MKSYM: found 48 space group operations ... includes inversion\n BZMESH: 16 irreducible QP from 216 ( 6 6 6 ) shift= F F F\n TETIRR: sorting 1296 tetrahedra ... 35 inequivalent ones found\n \n \n\n Notes: (see also Additional Exercises).\n\n \n • \n The group operations were determined automatically from the given lattice. PbTe is cubic, with 48 group operations. \nFirst the crystal system is determined; then the symmetry operations inconsistent with the basis are discarded. \nFinally the 48 operations are distilled into a minimum set of generators (i*r3(1,1,-1) r4x) that generate\nthe entire space group.\n\n Generators comprise a minimum set of group operators. All possible products of them form a closed set of operations,\nwhich forms a group.\n\n In this case there are no translations; all the group operators are pure point group operations.\nThis is not true in general. For example, hcp Co has 24 space group operations. The generators\ndefining its space group can be written as:\n\n i*r3z::(1/3,-1/3,-1/2) r2z::(1/3,-1/3,1/2) r2x\n \n \n \n • You can also specify symmetry operations manually via the SYMGRP category. This is particularly useful when magnetic symmetry must be considered.\n • The k mesh is specifed through the number of divisions along each of the three reciprocal lattice vectors, tag EXPRESS_nabc or\nBZ_NABC. In this case the 216 k points generated by a 6×6×6 mesh\ngets reduced by symmetry to 16 inequivalent points. \nYou can also specify whether the k-mesh should pass through the origin or straddle it\n(see BZ_BZJOB).\n • Bloechl’s generalized tetrahedron method is used to perform Brillouin zone integrations.\nYou can also use the generalized Methfessel-Paxton sampling integration scheme or a\nsampling with a Fermi function, using BZ_N=-1.\n \n\n See Table of Contents\n\n ### Augmentation parameters \n\n The table below contains a synopsis of key parameters associated with augmentation spheres.\n\n  species data: augmentation density\n spec rmt rsma lmxa kmxa lmxl rg rsmv kmxv foca rfoca\n Pb 3.045 1.218 4 3 4 0.761 1.522 15 1 1.218\n Te 3.029 1.211 3 3 3 0.757 1.514 15 1 1.211\n \n \n\n \n • rmt: the augmentation radius\n • rsma and kmxa: smoothing radius and\npolynomial order used to expand envelope functions around other sites.\n • lmxa: the l-cutoff for the augmentation of the smoothed Hankel envelope functions\nby partial waves.\nBecause of the unique way augmentation is done in this method, properties converge much faster\nwith lmxa than in standard augmented wave methods.\n • lmxl: analogous to lmxa, but it controls the l-cutoff of the charge density. lmxl defaults to\nlmxa; you can often make it smaller with minimal loss of accuracy. There is little efficiency gain, however, so\nin practice this feature is rarely used.\n • rg: is concerned with adding local gaussian pseudocharges to manage the Hartree potential.\n • rsmv, kmxv: concerned projections of mesh density onto local densities.\n • foca, rfoca: allow for differing treatments of the core.\n \n\n ### Interstitial mesh \n\n The following block is concerned with the mesh used to represent the charge density, and to evaluate matrix elements of the (unaugmented) envelope functions. The spacing of the mesh is controlled by the G cutoff (7.8 for PbTe).\n\n  MSHSIZ: mesh has 18 x 18 x 18 divisions; length 0.477, 0.477, 0.477\n generated from gmax = 7.8 a.u. : 3647 vectors of 5832 (62%)\n\n GVLIST: gmax = 7.8 a.u. created 3647 vectors of 5832 (62%)\n mesh has 18 x 18 x 18 divisions; length 0.477, 0.477, 0.477\n SGVSYM: 126 symmetry stars found for 3647 reciprocal lattice vectors\n \n \n\n Information about whether this mesh is sufficiently accurate is given in the table beginning with sugcut below.\n\n ### Counting the size of the basis \n\n How the basis is defined is described on this page.\n\n In the table below, the size of the basis is presented. lmf doesn’t have downfolding capability, so the important numbers are those in the “low” column. Rows 1,2,3 indicate how many orbitals are connected respectively with the first Hankel envelope (EH), the second envelope (EH2), and local orbitals. The total basis (and hamiltonian rank) consists of 55 orbitals.\n\n  Makidx: hamiltonian dimensions Low, Int, High, Negl: 55 0 32 63\n kappa Low Int High L+I L+I+H Neglected\n 1 32 0 9 32 41 9\n 2 18 0 23 18 41 9\n 3 5 0 0 5 5 45\n all 55 0 32 55 87 63\n suham : s 41 augmentation channels, 41 local potential channels Maximum lmxa=4\n \n \n\n The last line refers to augmentation channels. An envelope of a particular l must be expanded around remote sites. The l-cutoff for expanding tails of envelope functions centered elsewhere is lmxa, input though tag opeSPEC_ATOM_LMXA. For lmf, lmxa is usually reasonably converged if it is 3 for sp systems, 4 for d atoms and 6 for f shell elements.\n\n ### Envelope function parameters and their G cutoffs \n\n In the table envelope function parameters for each species is given, which defines their shape. Also shown is :\n\n \n • gmax : the G cutoff that represents that envelope to the\ngiven tolerance\n • last term : an estimate for the precision of the plane-wave repesentation\n • cutoff : the number of plane waves with G<gmax.\n \n\n  sugcut: make orbital-dependent reciprocal vector cutoffs for tol=1.0e-6\n spec l rsm eh gmax last term cutoff\n Pb 0 1.80 -0.10 4.123 2.68E-06 531\n Pb 1 2.02 -0.10 3.848 2.42E-06 411\n Pb 2* 2.03 -0.10 4.013 1.37E-06 531\n Pb 3 2.03 -0.10 4.193 1.54E-06 537\n Pb 0 1.80 -0.90 4.123 2.68E-06 531\n Pb 1 2.02 -0.90 3.848 2.42E-06 411\n Pb 2 2.03 -0.90 4.013 1.37E-06 531\n Te 0 1.63 -0.10 4.572 1.45E-06 725\n Te 1 1.71 -0.10 4.575 1.52E-06 725\n Te 2* 2.02 -0.10 4.037 1.63E-06 531\n Te 3 2.02 -0.10 4.218 1.87E-06 537\n Te 0 1.63 -0.90 4.572 1.45E-06 725\n Te 1 1.71 -0.90 4.575 1.52E-06 725\n Te 2 2.02 -0.90 4.037 1.63E-06 531\n \n \n\n Each envelope function must be expanded in plane waves in order to\n\n \n • assemble matrix elements of the interstitial potential\n • assemble the output charge density.\n \n\n Both are assembled in reciprocal space. The number of plane waves needed for a particular orbital depends on how sharply peaked the function is, so the cutoff is orbital-dependent to allow for faster execution. gmax of any one orbital may safely be less than the global G cutoff (7.8 for PbTe); if it can, lmf will find a gmax for each orbital that meets a preset tolerance (10−6 in this case).\n\n Otherwise it uses all the G vectors available to it, and appends a ‘*’ to the number indicating not enough orbitals are available to meet the specified tolerance. This is flagged by an asterisk appended to the cutoff, e.g.\n\n  Te 0 1.63 -0.10 4.572 1.74E-06 701*\n \n \n\n If ‘last term’ is too high you can expect errors in the hamiltonian and you should increase gmax.\n\n The tolerance defaults to 10−6, but you can control it with tag HAM_TOL. 10−5 or smaller is usually safe.\n\n Note: With APW’s also in the basis, it the overlap matrix becomes nearly singular. To stabilize the overlap matrix, you can set HAM_TOL to something close to machine precision, e.g. 10−16.\n\n At this stage the potential independent setup is complete.\n\n See Table of Contents\n\n ### Obtain an input density \n\n In Kohn-Sham theory, the potential is a functional of the density. lmf tries to read the density from the density restart file, rst.pbte.\n\n Initially the density is not known and rst.pbte does not exist.\n\n  lmfp : no rst file ... try to overlap atomic densities\n \n \n\n When lmf cannot read the density, it constructs a trial density by overlapping free atom densities. The true density is obtained itertively through the self-consistency cycle.\n\n lmf reads atomic densities from atm.pbte and overlaps them (Mattheis construction). This makes a reasonable guess for the density: the atomic potential is very deep, and the crystal potential is a relatively modest perturbation to it. Thus the true density is typically not so far from a superposition of atomic densities.\n\n \n\n \n\n This table indicates what lmf is doing, and checks that atm.pbte is consistent the input file.\n\n  lmfp : no rst file ... try to overlap atomic densities\n rdovfa: read and overlap free-atom densities (mesh density) ...\n rdovfa: expected Pb, read Pb with rmt= 3.0448 mesh 497 0.025\n rdovfa: expected Te, read Te with rmt= 3.0287 mesh 461 0.025\n \n \n\n Next follows a table with some useful information about the overlapping process\n\n  ovlpfa: overlap smooth part of FA densities\n site 1 spec 1 pos 0.0000 0.0000 0.0000 Qsmooth 7.659845\n site 2 spec 2 pos 0.0000 0.0000 0.5000 Qsmooth 7.820498\n total smooth Q = 15.480342\n\n Free atom and overlapped crystal site charges:\n ib true(FA) smooth(FA) true(OV) smooth(OV) local\n 1 12.535727 6.195571 12.881552 6.541397 6.340155\n 2 4.566605 6.387103 4.926059 6.746557 -1.820498\n\n Smooth charge on mesh: 15.480342\n Sum of local charges: 4.519657\n Total valence charge: 20.000000\n Sum of core charges: 114.000000\n Sum of nuclear charges: -134.000000\n Homogeneous background: 0.000000\n Deviation from neutrality: -0.000000\n \n \n\n It is important that the system is charge neutral (last line).\n\n \n\n If, on the other hand, the charge density has been saved in a restart file from a prior iteration lmf reads it. Usually restart files are saved in a binary form in a file rst.ext.\n\n When lmf reads from a restart file it prints out a message similar to this:\n\n  iors : read restart file (binary, mesh density)\n use from restart file: ef window, positions, pnu\n ignore in restart file: *\n \n \n\n The restart file contains:\n\n \n 1. valence and core densities inside augmentation spheres for each nucleus.\n 2. mesh density\n 3. lattice vectors and site positions\n 4. Information about the Fermi level and (in the sampling case) parameters controlling the Brillouin zone integration\n 5. logarithmic derivative parameters pnu — boundary conditions for partial waves\n \n\n ##### Controlling what is read from the restart file \n\n By default, parameters 3-5 will be read from rst.pbte and supersede pre-existing values. In this tutorial lattice vectors and site positions are read from site.pbte, Brillouin zone integration parameters from category BZ in ctrl.pbte, pnu from basp.pbte.\n\n Through command-line switch --rs you can control what lmf reads from rst.pbte and what it keeps from input files. --rs has five arguments: --rs=#1,#2,#3,#4,#5; you can supply one to five numbers and default values are taken for the rest.\n\n \n\n #1 and #2 mark whether and how to read and write the restart file. Use the remaining switches to suppress reading from the restart file: \n#3=1 keep original site positions. This is necessary if you shift the atoms but retain this rst.ext \n#4=1 keep original sampling parameters. \n#5=1 keep original pnu.\n\n Notes:\n\n \n 1. If you use #5=1, a self-consistent density will no longer be fully self-consistent because the augmentation part of the basis set has changed. lmf automatically floats pnu to the band center of gravity, to make the basis set more accurate.\n 2. The mesh density has a lump centered at each atom. If the site positions change, the lump will be centered in the wrong place, and the density very poor. lmf can partially compensate for this by adding an atomic density centered at the new position, and subtracting it at the file position. It will do this if you use #1=11. But if the shifts are large, it is better to discard the restart file and overlap atomic densities again.\n 3. If the lattice has been rotated or sheared, the reader will detect this and will rotate or shear the mesh density accordingly. But the site densities are left unaltered, unless you tell the reader to rotate them. To do this use #1=101.\n 4. If you are doing sampling integration and want to change sampling parameters, you must use #4=1.\n \n\n \n\n See Table of Contents\n\n ### Potential and Matrix Elements \n\n Routine (fp/mkpot.f) makes the potential and relevant matrix elements.\n\n #### LDA functionals \n\n It was indicated in the header that you are using the LDA with the Barth-Hedin functional. This is controlled by EXPRESS_xcfun, which is an alias for HAM_XCFUN..\nTo perform a GGA calculation with Kieron Burke’s PBE functional, remove this line in ctrl.pbte\n\n  xcfun= {lxcf},{lxcf1},{lxcf2} # set lxcf=0 for libxc functionals\n \n \n\n and add this to the HAM category:\n\n  XCFUN=3 GGA=3\n \n \n\n When you run lmfa or lmf the header should now read\n\n  pot: XC:PW91+PBE(gga)\n \n \n\n Note: you should start the calculation from the beginning with this change, since the atomic densities are made from a Barth-Hedin functional. The core densities made by lmfa are frozen and will carry over into the lmf calculation.\n\n The smooth part of the potential is made first. This is necessary to determine the electrostatic potential on the augmentation sphere boundaries. It serves as a boundary condition for the solving Poisson’s equation inside each sphere. The output reads\n\n  Average es pot at rmt = 0.473380 avg sphere pot = 0.516004 vconst = -0.473380\n smooth rhoves 41.429795 charge 15.480342\n smooth rhoeps = -11.301007 rhomu = -14.720287 avg vxc = -0.680712\n \n \n\n These few lines conceal a somewhat involved process. For the mesh density to yield the correct potential in the interstial, lumps of charge must be added to the mesh density. Provided the additional charge has multipole moments matching those obtained by the difference in the two local densities , multipoles of the (modified) mesh density will match those of the true density, and the electrostatic potential generated by it will be correct at each augmentation radius.\n\n \n\n Run lmf with a high verbosity (--pr50 --quit=pot) and the following appears:\n\n  rhomom: ib ilm qmom Qval Qc Z\n 1 1 1.954651 6.929056 68.00 82.00\n 1 21 0.018533\n 1 25 0.015663\n 2 1 -0.307248 -1.089167 46.00 52.00\n\n Smooth charges: Qmesh = 14.160111 Qgauss = 5.839889 core-nuc = -20 tot = 0\n \n \n\n lmf has found the multipole moments from the local densities ( is the charge, the l=0 multipole moment is ). It adds localized gaussian charges with smoothing radius rg. (Notice that rg is quite small, to ensure that the gaussian does not spill out of the augmentation sphere.)\n\n Now the electrostatic potential at the augmentation radius can be constructed\n\n  site class ilm vval ves(rmax)\n 1 1 1 1.623863 0.458083\n 21 -0.059347\n 25 -0.050158\n 2 2 1 1.767044 0.498474\n \n \n\n lmf shifts the total mesh potential by a constant so that the average potential on augmentation boundaries is close to zero:\n\n  Average es pot at rmt = 0.478171 avg sphere pot = 0.518433 vconst = -0.478171\n Average es pot at MT boundaries after vconst shift\n Site ves Site ves\n 1 -0.020088 | 2 0.020302 |\n \n \n\n It is done order to put the Fermi level close to zero. This shift can be chosen differently; if you use --oldvc the cell-averaged potential is set to zero instead.\n\n \n\n From the local densities and electrostatic boundary conditions, the local (site) potentials can be constructed along with matrix elements of partial waves. Some limited output is shown in this table:\n\n  locpot:\n\n site 1 z= 82.0 rmt= 3.04481 nr=497 a=0.025 nlml=25 rg=0.761 Vfloat=T\n sm core charge = 0.029706 (sphere) + 0.000318 (spillout) = 0.030024\n potential shift to crystal energy zero: 0.000065\n\n site 2 z= 52.0 rmt= 3.02869 nr=461 a=0.025 nlml=16 rg=0.757 Vfloat=T\n sm core charge = 0.32823 (sphere) + 0.005658 (spillout) = 0.333888\n potential shift to crystal energy zero: 0.000023\n \n \n\n Note the printout Vfloat=T. This indicates that the potential used integrate the partial waves is being updated to the current local potential. The potential used to make partial waves and is kept independently of the potential generated by the density. Initially this potential is taken from of the free atom; and normally it is overwritten (Vfloat=T). If you tell lmf to freeze it (HAM_FRZWF=t globally or SPEC_ATOM_FRZWF=f for one species) the basis set will not adapt to the potential.\n\n Once again, many steps are concealed behind this limited output. You can get more information, e.g. matrix elements, using a higher print verbosity: the higher the verbosity, the more is output.\n\n \n\n Run lmf with (--pr70 --quit=pot)\nand a great deal of information is printed out. A table of classical LMTO potential parameters is made. Particularly useful are the indicating the band center (c) and bandwith (srdel2), and linearization energy enu:\n\n  l enu v c srdel qpar ppar\n 0 -0.685722 -1.220936 -0.974210 0.311410 2.5442 2.037524\n 1 -0.345247 -0.961024 0.034414 0.322661 9.5614 3.768891\n 2 0.215079 -0.351057 1.877979 0.404577 13.6181 3.646179\n 2(sc) -1.355835 -1.700376 -1.373127 0.018377 60.8790 0.594481\n 3 -0.367178 -0.903272 2.382595 0.347763 27.1688 7.102666\n 4 -0.261796 -0.813619 4.861503 0.414942 32.9588 13.704206\n \n \n\n The following table presents (hamiltonian, potential, overlap) matrix elements of special linear combinations val and slo of and that have the property that value or slope vanishes at the MT boundary:\n\n  l val-val val-slo slo-val slo-slo\n 0 s 10.363095 -7.303401 -7.303401 7.075456\n h -11.973814 -0.299694 8.971198 -0.531008\n v -67.315135 84.761799 84.761799 -111.419064\n 1 s 8.042350 -4.234108 -4.234108 3.159956\n ...\n \n \n\n A number of other quantities are made, depending on print verbosity and computational conditions.\n\n For verbosities above 50, electric field gradients are printed:\n\n  Electric Field Gradient:\n Site Tensor axes esu/cm^2 V/m^2 eta line splitting\n x10^13 x10^19 (mm/s)\n 1 0.292-0.936 0.198 0.00 0.00 0.000 0.00000\n 0.771 0.109-0.627 0.00 0.00\n 0.565 0.336 0.754 0.00 0.00\n\n 2 0.292-0.936 0.198 0.00 0.00 0.000 0.00000\n 0.771 0.109-0.627 0.00 0.00\n 0.565 0.336 0.754 0.00 0.00\n \n \n\n These are directly measurable quantities. At least in , the electric field gradient on the site (measured to be ), is not well predicted by LDA, or LDA+U. QSGW, however, does quite well. See Fig.13 of this paper.\n\n If spin-orbit coupling is set (HAM_SO=t). matrix elements of are generated. Working from the Fe tutorial, invoke\n\n $ lmf ctrl.fe -vso=1 --iactiv  --quit=pot --pr55\n
\n
\n\n

These matrix elements of are printed out:\n\n

 soprm:  matrix elements for perturbation from spin-orbit coupling\n             l    <phi || phi>  <dot || phi>  <dot || dot>\n up   up     1     0.01903736    0.00053774    0.00001694\n down down   1     0.01947919    0.00036545    0.00000870\n up   down   1     0.01925699    0.00036153    0.00001201\n down up     1     0.01925699    0.00054370    0.00001201\n\n up   up     2     0.00559381    0.00229625    0.00097759\n...\n
\n
\n\n

\n\n

After completing the loop over sites a table is written for terms involving the total energy\n\n

 Energy terms:             smooth           local            total\n   rhoval*vef            -36.158050      -282.028989      -318.187039\n...\n   valence chg            14.160111         5.839889        20.000000\n   core charge           114.000000         0.000000       114.000000\n
\n
\n\n

and the following lines are written:\n\n

 Charges:  valence    20.00000   cores   114.00000   nucleii  -134.00000\n    hom background     0.00000   deviation from neutrality:      0.00000\n
\n
\n\n

Is is important that the system be neutral.\n\n

\n\n

If you have performed a QSGW calculation and read a self-energy from file sigm.ext (or sigmrs.ext), will be added to the LDA potential.
\nNote: sigm.ext contains the difference, , so it is added directly to the Kohn-Sham potential .\n\n

\n\n

You will see an indication is read from the following standard output. It was taken from the Fe tutorial.\n\n

 RDSIGM: read file sigm and create COMPLEX sigma(R) by FT ...\n         Sigm will be approximated by:  diagonal Sigma for high and low states\n         Approximate sigma for energies E(lda)>2\n         For high states read constant sigii from sigm file\n         sigm file has 29 irreducible QP: nk = ( 8 8 8 )  shift= F F F\n         average SE read from sigm file:   0.122871 0.138308\n hft2rs: make neighbor table for r.s. hamiltonian using range = 5 * alat\n
\n
\n\n

Notes:\n\n

\n
• How lmf reads Σ0 and carries\nout an inverse Bloch sum is described in some detail in Section IIG of this Physical Review B paper.\n
• The cutoff E(lda)>2 is controlled by HAM_SIGP_EMAX.\nIt affects the partitioning between calculated matrix elements of Σ0 and\nand the fixed ones above emax, as explained at the top of p165107 in the PRB paper\n(EMAX corresponds to Exccut2).\n
• The average self-energies (0.122871 spin-up and 0.138308 spin-down) above 2 Ry.\nWhen SIGP_MODE=4 (recommended), these numbers are used for Σii0 for energies E > EF+EMAX.\nIn this mode the code prints out the line containing read constant sigii from sigm file.\n
• Range 5 for inverse Bloch-summed Σ0, in units of alat.\nIf this number is not sufficiently large, the inverse Bloch transform is incomplete, and the program may stop with an\nerror message.\n
\n\n

This table:\n\n

 Irr. qp for which sigma is calculated ...\n BZMESH:  29 irreducible QP from 512 ( 8 8 8 )  shift= F F F\n
\n
\n\n

indicates the Brillouin zone mesh for Σ0.\n\n

This table:\n\n

 hft2rs created hrs:  ndhrs=30  max Re(hrs) = 0.556  max Im(hrs) = 3.93e-10\n ...\n check FT s(R) against s(q) ... maximum error = 2.3e-15 < tol (5e-6)\n ...\n check FT s(R) against s(q) ... maximum error = 7.8e-15\n ...\n
\n
\n\n

indicates the precision in the construction of the inverse Bloch sum. It:\n\n

\n
• checks the forward Bloch sum of the inverse Bloch summed Σ0 (2.3e-15) to ensure that the error is less than HAM_RSSTOL.\nThe combined inverse/forward sum should recover the original Σ0 to machine precision unless the inverse Bloch transform is inexact, as described above.\n
• Shows deviation (7.8e-15) from original Σ0 after symmetrization by the\ngroup operations.\n
\n\n

\n\n

### Parameters for local orbitals

\n\n

Extended local orbitals must attach a smooth Hankel tail. A single smooth hankel function that fits both value and slope is found. The result displayed in a table:\n\n

 Fit local orbitals to sm hankels, species Pb, rmt=3.044814\n  l  type    Pnu      Eval        K.E.       Rsm       Eh      Q(r>rmt)    Fit K.E.\n  2  low    5.934   -1.568604   -0.810887   1.05495  -1.12869   0.02566   -0.810887\n
\n
\n\n

### Brillouin zone integration

\n\n

The charge density and Fermi level must be found by integration over the Brillouin zone. The code makes two passes over the irreducible k points. The first is needed to obtain the Fermi level. EF and k-point weights are saved into a binary file wkp.pbte.\n\n

 Start first of two band passes ...\n bndfp:  kpt 1 of 16, k=  0.00000  0.00000  0.00000\n -1.3108 -1.3108 -1.3076 -1.3076 -1.3076 -1.0419 -0.5426 -0.2498 -0.2498\n -0.2498  0.1728  0.1728  0.1728  0.2942  0.2942  0.2942\n bndfp:  kpt 11 of 16, k=  -0.16667  0.16667  0.83333\n -1.3161 -1.3103 -1.3081 -1.3058 -1.3056 -0.9310 -0.6887 -0.4314 -0.3314\n -0.3190  0.1376  0.1914  0.2171  0.2802  0.5842  0.6122\n\n BZWTS : --- Tetrahedron Integration ---\n ... only filled or empty bands encountered:  ev=-0.138629  ec=-0.080593\n VBmax = -0.138629  CBmin = -0.080593  gap = 0.058036 Ry = 0.78930 eV\n BZINTS: Fermi energy:     -0.138629;  20.000000 electrons;  D(Ef):    0.000\n         Sum occ. bands:  -18.1376921  incl. Bloechl correction:    0.000000\n\n Saved qp weights ...\n
\n
\n\n

PbTe is an insulator, both in real life and in the LDA. lmf automatically detects\nwhat appears to be an insulating state, in which case it prints out the highest occupied state and lowest unoccupied state it encountered and the “bandgap.”
\nNote 1: the “bandgap” is only the actual bandgap if the actual band edges coincide with one of the mesh of discrete k points used for integration. It is true in PbTe (both band edges fall at L) but not other cases, e.g. Si. See this tutorial.
\nNote 2: the band code may incorrectly determine that the system is an insulator. This can happen when band gaps are small and the k mesh is too coarse.\n\n

In a metal the situation is more complicated. The following table was extracted from the Fe tutorial (self-consistent LDA level)\n\n

 BZWTS : --- Tetrahedron Integration ---\n ...\n BZINTS: Fermi energy:     -0.000601;   8.000000 electrons;  D(Ef):   14.389\n         Sum occ. bands:   -1.3036417  incl. Bloechl correction:   -0.001188\n         Mag. moment:       2.200354\n
\n
\n\n

The BZINTS table contains significant information, including the Fermi level (-0.000601 Ry) and density-of-states there (14.389/Ry), and the single-particle sum -1.3036417 Ry entering into the LDA total energy. The LDA magnetic moment/cell (2.200354μB) is close to the experimental value. The Bloechl correction (-0.001001 Ry) indicates how much the band sum changes when Bloechl weights are used in lieu of weights from the standard tetrahedron method. This is a measure of the convergence of the k mesh.\n\n

#### Integration weights and the METAL switch

\n\n

Numerical quadrature is used to accumulate the output density or any property integrated over the Brillouin zone.\n\n

In insulators, each point in the full Brillouin zone gets equal weight; each point in the irreducible zone is weighted by the number of points in the full zone mapped to it. You can see these weights by running lmf at a high verbosity.\n\n

In metals, how the weights are made depends on the quadrature. See this page for a detailed discussion of the tetrahedron and sampling methods.\n\n

\n\n

Add --pr50 --quit=ham to your invocation of lmf. You should see this table:\n\n

 BZMESH:  16 irreducible QP from 216 ( 6 6 6 )  shift= F F F\n              Qx          Qy          Qz      Multiplicity    Weight\n    1      0.000000    0.000000    0.000000         1        0.009259\n    2     -0.166667    0.166667    0.166667         8        0.074074\n    3     -0.333333    0.333333    0.333333         8        0.074074\n  ...\n   16      0.000000    0.333333    1.000000        12        0.111111\n
\n
\n\n

The weight of the first point (0.009259) is 2/216. The factor of 2 is for spin. In spin polarized calculations this factor gets reduced to 1.\n\n

If you know that the system is an insulator in advance, you can tell lmf to assume an insulator: in the input file replace % const met=5 with % const met=0. This will set tag EXPRESS_metal (an alias for\nBZ_METAL) to zero. In this mode it can accumulate the density on the first pass as well.\n\n

In metals, the weights depend on the Fermi level , which must be determined from the eigenvalues. Quadratures are of two types:\n\n

\n\n

Questaal has several strategies to solve this chicken-and-egg problem, which you control through the BZ_METAL tag.\nThe numbers below correspond to the values of BZ_METAL.\n\n

\n
1. System assumed to be an insulator; weights determined a priori. Only one pass is required.\n
2. Eigenvectors are written to disk, in which case the\nintegration for the charge density can be deferred until all the bands are obtained. (Note: This option is available only for the ASA. When\naccumulating just the spherical part of the charge, eigenvector data can be contracted over m, reducing memory demands.)\n
3. Integration weights are read from file wkp.ext, which will have been generated in a prior band pass, e.g. from\na prior cycle in the self-consistent iteration.\nIf wkp.ext is unavailable, the program will temporarily switch to METAL=3.\n
4. Two band passes are made;\nthe first generates only eigenvalues to determine EF. It is slower than METAL=2, but it is more stable which can be\nimportant in difficult cases.\n
5. Three distinct Fermi levels are assumed and weights generated for each. After EF is\ndetermined, the actual weights are calculated by quadratic interpolation through the three points. The three Fermi levels are gradually\nnarrowed to a small window around the true EF in the course of the self-consistency cycle. This scheme works for sampling\nintegration where the k-point weights depend on EF only and not eigenvalues at neighboring k. You can also\nuse this scheme in a mixed tetrahedron/sampling method: Weights for the band sum are determined by tetrahedron, but the charge density is\nintegrated by sampling. It works better than straight sampling because the total energy is variational in the density.\n
6. Like METAL=3 in that two passes are made but eigenvectors are kept in memory so there is no additional overhead in making the first pass.\nThis is the recommended mode for lmf unless you are working with a large system and need to conserve memory.\n
\n\n

The ASA implements METAL=0,1,2; the FP codes METAL=0,2,3,4,5. See Additional Exercises in the Fe tutorial.\n\n

Tetrahedron and sampling methods are explained and compared in some detail here.\n\n

\n\n

### Output density and update of augmentation sphere boundary conditions

\n\n

A second pass over the irreducible k-points is made with output similar to the first pass.\nAfter completion the output density is made and symmetrized. This table tells you\nhow many electrons are inside each augmentation sphere:\n\n

 mkrout:  Qtrue      sm,loc       local\n   1   12.610810    6.902591    5.708219\n   2    5.275210    6.408075   -1.132866\n
\n
\n\n

\n\n\n

Then the\nlogarithmic derivative parameters\npnu are updated. Whether they are frozen or allowed to float depends on SPEC_ATOM_IDMOD.\nIn this tutorial they are all allowed to float.\n\n

 Make new boundary conditions for phi,phidot..\n\n site    1   species   1:Pb\n l  idmod     ql         ebar        pold        ptry        pfree        pnew\n 0     0    1.700379   -0.652781    6.895000    6.901582    6.500000    6.901582\n 1     0    0.846967   -0.353483    6.809000    6.620518    6.250000    6.620518\n 2     0    0.121211   -0.338472    6.250000    6.143261    6.147584    6.250000\n 2     0    sc         -1.306275    5.934000    5.938843    5.147584   15.938843\n 3     0    0.032691   -0.376447    5.183000    5.125635    5.102416    5.125635\n...\n
\n
\n\n

The fractional parts of P is of order 0.9 for the 6s and 5d states, because they are deep. The 6d state is far above\nEF, so its P is close to the free electron value. (For numerical stability, P is frozen for any l for which\nthere is a corresponding deep local orbital. Thus for that state pnew is not updated to ptry.) The 6p state is near the Fermi\nlevel, and forms the predominant contribution to the bonding and band structure. See\nthis page for an interpretation.\n\n

### Total energy

\n\n

The Harris-Foulkes energy is a functional of the input density and single-particle sum. Information is printed out in the table below.\n\n

 Harris energy:\n ...\n rhoeps=   -1094.806758     utot= -116742.136483    ehar=  -55318.170567\n
\n
\n\n

The Kohn-Sham total energy is also calculated:\n\n

 Kohn-Sham energy:\n sumtv=      299.045855  sumtc=     62219.476115   ekin=    62518.521970\n rhoep=    -1094.805096   utot=   -116741.865633   ehks=   -55318.148758\n
\n
\n\n

This energy is a functional of nout and\nVin. It is a different functional than the HF\nfunctional, but the two should come together at the self-consistent\ndensity.\n\n

### Forces

\n\n

In the same time total energies are calculated, forces are made. Since PbTe is cubic forces vanish by symmetry; this section\nrefers to the output generated in the Bi2Te3 tutorial.\n\n

The force evaluation has two parts. First a correction term to the forces is made. In contrast to the total energy, which is variational deviations of the input density relative to the self-consistent density, ninn, thus δE ~ (ninn)2, the forces are not. If it were known how the density shifts with the nucleus (which requires knowledge of the dielectric function), the forces could be made variational as well.\n\n

We can do almost as well by making an ansatz for how the density shifts. The simplest ansatz is to assume that there is a cloud of charge that shifts rigidly with nucleus. Assuming that this charge is the free-atomic density, a correction term can be devised which dramatically improves on the convergence of the forces with respect to deviations ninn. In many cases the error becomes almost variational, i.e. the error in the force to linear order in ninn becomes much smaller. At self-consistency the correction term vanishes.\n\n

In the Bi2Te3 tutorial the correction calculated from the starting density (Mattheis construction) reads:\n\n

 Harris correction to forces: shift in free-atom density\n  ib         delta-n dVes             delta-n dVxc               total\n   1    0.00    0.00    0.00     0.00    0.00    0.00     0.00    0.00    0.00\n   2    0.00    0.00 -605.58     0.00    0.00  -23.90     0.00    0.00  629.48\n   3    0.00    0.00  605.58     0.00    0.00   23.90     0.00    0.00 -629.48\n   4    0.00    0.00  292.27     0.00    0.00    9.54     0.00    0.00 -301.81\n   5    0.00    0.00 -292.27     0.00    0.00   -9.54     0.00    0.00  301.81\n shift forces to make zero average correction:            0.00    0.00    0.00\n
\n
\n\n

The forces are printed, including the correction mentioned above:\n\n

 Forces, with eigenvalue correction\n  ib           estatic                  eigval                    total\n   1    0.00    0.00    0.00     0.00    0.00    0.00     0.00    0.00    0.00\n   2    0.00    0.00   79.59     0.00    0.00  -66.61     0.00    0.00   12.98\n   3    0.00    0.00  -79.59     0.00    0.00   66.61     0.00    0.00  -12.98\n   4    0.00    0.00   -6.78     0.00    0.00   19.25     0.00    0.00   12.46\n   5    0.00    0.00    6.78     0.00    0.00  -19.25     0.00    0.00  -12.46\n Maximum Harris force = 13 mRy/au (site 3)  Max eval correction = 629.5\n
\n
\n\n

In the last iteration when self-consistency has been approximately achieved these tables become\n\n

 Harris correction to forces: shift in free-atom density\n  ib         delta-n dVes             delta-n dVxc               total\n   1    0.00    0.00    0.00     0.00    0.00    0.00     0.00    0.00    0.00\n   2    0.00    0.00    0.39     0.00    0.00    0.00     0.00    0.00   -0.39\n   3    0.00    0.00   -0.39     0.00    0.00    0.00     0.00    0.00    0.39\n   4    0.00    0.00   -0.77     0.00    0.00    0.19     0.00    0.00    0.58\n   5    0.00    0.00    0.77     0.00    0.00   -0.19     0.00    0.00   -0.58\n shift forces to make zero average correction:            0.00    0.00    0.00\n...\n Forces, with eigenvalue correction\n  ib           estatic                  eigval                    total\n   1    0.00    0.00    0.00     0.00    0.00    0.00     0.00    0.00    0.00\n   2    0.00    0.00  638.27     0.00    0.00 -627.55     0.00    0.00   10.71\n   3    0.00    0.00 -638.27     0.00    0.00  627.55     0.00    0.00  -10.71\n   4    0.00    0.00 -278.13     0.00    0.00  262.20     0.00    0.00  -15.93\n   5    0.00    0.00  278.13     0.00    0.00 -262.20     0.00    0.00   15.93\n Maximum Harris force = 15.9 mRy/au (site 5)  Max eval correction = 0.6\n
\n
\n\n

At self-consistency, the force on Te is 10.71 mRy/a.u.. With the correction term, the force from the initial guessed density is 12.98 mRy/a.u.. The error is thus of order 5 mRy/a.u., vastly smaller than it would be without the correction term (629.48 mRy/a.u). This term vanishes at self-consistency, as it should.\n\n

The final forces give a measure of the error in the LDA predicting structure since site positions were taken from experiment. 10 mRy/a.u. is a fairly small force, implying that LDA lattice positions will be close to experimental ones.\n\n

To what extent the basis set affects the forces is taken up in Additional Exercises in the Bi2Te3 tutorial.\n\n

Forces are used in molecular statics, and also to compute phonons.\n\n

### New density

\n\n

Questaal’s general strategy for guessing the self-consistent density based on (nin,nout) pairs, is described here.\n\n

It takes some linear combination of nin and nout from the current, and possibly prior iterations, based on settings in ITER_MIX.\n\n

lmf’s printout of this mixing looks like the following\n\n

 mixing: mode=B  nmix=2  beta=.3  elind=.531  kill=7\n mixrho:  sought 2 iter from file mixm; read 0.  RMS DQ=2.17e-2\n charges:       old           new         screened      rms diff       lin mix\n smooth      15.480342     15.424647     15.424647      0.011907     15.463634\n site    1    6.340155      5.708219      5.708219      0.022361      6.150574\n site    2   -1.820498     -1.132866     -1.132866      0.013213     -1.614208\n AMIX: nmix=0 mmix=8  nelts=6302  beta=0.3  tm=5  rmsdel=2.17e-2\n unscreened rms difference:  smooth  0.011613   local  0.022361\n   screened rms difference:  smooth  0.011907   local  0.022361   tot  0.021660\n
\n
\n\n

Notes:\n\n

\n
• mode=B indicates that the Broyden method will be used when mixing\nprior iterations (in the first pass there are no prior iterations to mix)\n
• elind is the Fermi level entering into the model Lindhard function used to screen noutnin (see\n Eq. (1)).\n
• beta=.3 is the mixing parameter, governing how much nout is added to nin, as\nexplained in Eq. (4).\n
• RMS DQ=2.17e-2 is a measure of the collective RMS change in\nnoutnin.\nThis number is used to check convergence to self-consistency.\nIt is broken down into individual contributions in the table.\n
\n\n

### End of self-consistency loop

\n\n

At the end of the self-consistency cycle the density is written to rst.pbte and a check is made for convergence. Checks in the first and second iterations read\n\n

 iors  : write restart file (binary, mesh density)\n\n   it  1  of 10    ehf=  -55318.170567   ehk=  -55318.148758\nh nkabc=6 gmax=7.8 ehf=-55318.1705672 ehk=-55318.1487582\n\n  ...\n --- BNDFP:  begin iteration 2 of 10 ---\n  ...\n\n   it  2  of 10    ehf=  -55318.165774   ehk=  -55318.156862\n From last iter    ehf=  -55318.170567   ehk=  -55318.148758\n diffe(q)=  0.004793 (0.018916)    tol= 0.000010 (0.000030)   more=T\ni nkabc=6 gmax=7.8 ehf=-55318.1657745 ehk=-55318.1568616\n
\n
\n\n

No check is made in the first iteration because there is no prior iteration to compare the change in total energy.\n\n

In subsequent iterations two checks are made: the change (0.004793) in total energy from the prior iteration and the RMS DQ (0.018916). Self-consistency is reached when both checks fall below tolerances.. You can set tolerances with EXPRESS_conv and EXPRESS_convc, aliases for ITER_CONV and ITER_CONVC.\n\n

In the PbTe case convergence is reached in iteration 10, where the convergence checks read:\n\n

 diffe(q)=  0.000000 (0.000005)    tol= 0.000010 (0.000030)   more=F\nc nkabc=6 gmax=7.8 ehf=-55318.1620974 ehk=-55318.1620958\n
\n
\n\n

The last line prints out variables assigned on the command line (and variables in the ctrl file kept by the % save directive), total magnetic moment in magnetic calculations, and total energies from the Harris-Foulkes and Kohn-Sham functionals. These functionals are different but they should approach the same value at self-consistency.\n\n

This line is also written to file save.pbte; see here for further documentation.\n\n

### Other Resources

\n\n

This output was mostly taken from the basic lmf tutorial on a self-consistent calculation for PbTe\n","dir":"/docs/outputs/lmf_output/","name":"lmf_output.md","path":"pages/lmf_output.md","url":"/docs/outputs/lmf_output/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Annotated standard output, program lmfa","permalink":"/docs/outputs/lmfa_output/","header":false,"auto":{"code":"lmf","info":"The standard output from lmfa for the PbTe tutorial is annotated","priority":9100},"content":"

\n\n\n

The output documented here is mostly taken from the lmf\ntutorial for PbTe.\nSome portions are adapted from other calculations, as will be indicated.\n\n

The standard output is organised by blocks. The sections below\nannotate each block approximately in the order they are made.\nSome parts are similar to the lmf output; in places where they are similar a cursory\ntreatment is given here; the reader is referred to that page.\n\n

Note: This document is annotated for an output vebosity of 35 (medium verbosity)\nRaising the verbosity causes lmfa to print additional information.\nVerbosity 31 is a little terse; 41 is a little verbose while 55 is quite verbose. 80 can give you a headache.\n\n

### 1. Preprocessor’s transformation of the input file

\n\n\n

The input file is run through the preprocessor, which modifies the ctrl file before it is parsed for tags.\nNormally it does this silently. To see the effects of the preprocessor use lmfa --showp ...\nThe result is very similar to lmf --showp ..., which is documented\nhere.\n\n

### 2. How lmf and lmfa read input

\n\n\n

To see what tags lmfa will look for, use lmfa --input.\nThis web page explains the function of --input.\n\n

The result is similar to lmf produces.\nHowever lmfa parses fewer tags; moreoever, some tags they both parse\nhave different meanings.\n\n

\n\n

Add --input to the lmfa and lmf commands\n\n

$lmfa ctrl.pbte --input > out.lmfa\n$ lmf  ctrl.pbte --input > out.lmf\n
\n
\n

The output is quite verbose so only some differences are highlighted.\n\n

This appears in the lmf output\n\n

 --- Parameters for hamiltonian ---\n gmax                   reqd*  r8       1,  1\n   (alias for HAM_GMAX)\n   Energy cutoff for plane-wave mesh (Ry)\n - If preceding token is not parsed, attempt to read the following:\n
\n
\n\n

lmfa does not read EXPRESS_gmax (alias for HAM_GMAX).\nFor this reason you don’t need to specify it when running lmfa,\nbut do need to when running lmf. Similarly, lmfa does not read\nBZ_NKABC (another tag lmf requires), and many other tags that are optional in lmf,\ne.g. HAM_SO.\n\n

lmfa looks for this tag, but lmf does not:\n\n

 autobas_lmto           opt    i4       1,  1     default = 0\n   (alias for HAM_AUTOBAS_LMTO)\n   Controls lmfa's autogeneration of LMTO basis parameters (RSMH,EH,RSMH2,EH2)\n
\n
\n\n

Two others lmfa looks for but lmf does not are  SPEC_ATOM_Q  and  SPEC_ATOM_MMOM.\nThese affect the construction of the atomic charge density.\n\n

The following tag is read by both codes, but the meaning differs. From the output of lmfa:\n\n

 autobas_mto            opt    i4       1,  1     default = 0\n   (alias for HAM_AUTOBAS_MTO)\n   Controls lmfa's autogeneration of LMTO basis parameters (RSMH,EH,RSMH2,EH2)\n   0 do not autogenerate basis parameters\n   1 or 3 1-kappa parameters with Z-dependent LMX\n   2 or 4 2-kappa parameters with Z-dependent LMX\n   ...\n
\n
\n\n

From the output of lmf:\n\n

 autobas_mto            opt    i4       1,  1     default = 0\n   (alias for HAM_AUTOBAS_MTO)\n   Autoset basis:  controls what part of MTO basis is read from basis file basp\n   0       No parameters are read from basp\n   ...\n
\n
\n\n

In the first case the token affects how the basis parameters are generated;\nin the second how the basis parameters are read.\nThe same applies to HAM_AUTOBAS_PNU and HAM_AUTOBAS_LOC;\nalso HAM_AUTOBAS_PFLOAT have different meanings.\n\n

\n\n

\n\n\n

--help performs a function similar to --input but for the command line arguments: it prints out a brief summary of arguments effective in the executable you are using.\n\n

\n\n

Consider the output of lmfa --help.\n\n

First appears a list of command line options available in most Questaal codes, a portion of which is shown below. They are described in\nmore detail here.\n\n

 --help         Print this message, and quit\n --input        List categories, tokens, and data program expects, and quit\n --show         Print control file after parsing by preprocessor,\n                and echo input data as read from the control file\n --showp        Same as --show, but quit after input parsed\n --pr#1[,#2...] Set the verbosity (stack) to values #1,#2, ...\n...\n -vnam=expr     Define numerical variable \"nam\"; set to result of 'expr'\n -cnam=strn     Define character variable \"nam\"; set to 'strn'\n...\n
\n
\n\n

Then follow a synopsis of lmfa-specific options:\n\n

 --noopt        Suppress optimization of s.m. Hankel basis\n --norscnst     In optimization of s.m. Hankel basis, do not constrain rsm < rmt\n --plotwf       Writes atomic radial wave functions to disk files\n --dumprho      Writes out the density for each atom to out.ext\n --basp         Turns on autofind EH,RSMH (better to use HAM_AUTOBAS)\n --getallloc    Look for local orbitals (better to use HAM_AUTOBAS)\n
\n
\n\n

\n\n

After transformation by the preprocessor, lmfa parses for tags and substitutes default values for tags it does not\nfind. To see the value of tags lmfa, whether parsed or defaults, use lmfa --show or lmfa --show=2. The latter causes lmfa to stop after displaying tags, and is useful if you want to see whether lmfa is doing what\nyou expect. Using --show is useful if you want to record the input conditions in the output (be advised that the output is verbose).\n\n

The action of --show is similar to what occurs with lmf; see\nsee annotation of lmf output for further discussion.\n\n

### 3. Header, lattice, and symmetry blocks

\n\n

The header information presents a condensed synopsis of some key\nsettings that are used in the calculation. It is similar to the\nheader table produced by lmf.\n\n

The next blocks print information about the lattice vectors and settings used in Ewald summations. This is not relevant for lmfa; but it is printed out anyway and is identical to lmf\noutput;\nsimilarly for the following block on symmetry and k mesh.\n\n

### 4. Loop over species

\n\n\n

lmfa begins a loop over each species, and performs the following steps.\n\n

#### Self-consistent density

\n\n\n

If no local orbitals have been specified, lmfa’s printout for the first atom (Pb) begins with:\n\n

 Species Pb:  Z=82  Qc=78  R=3.044814  Q=0\n mesh:   rmt=3.044814  rmax=47.629088  a=0.025  nr=497  nr(rmax)=607\n  Pl=  6.5     6.5     6.5     5.5     5.5\n  Ql=  2.0     2.0     0.0     0.0     0.0\n
\n
\n\n

The first line shows the atomic number, number of core charges (core levels are assumed to be filled), augmentation radius\nand net sphere charge.\nThe next line shows the augmentation radius and cutoff radius of the free atom and radial mesh parameters.\n\n

\n\n\n

Wave functions are integrated on a uniform radial mesh of points.\nAll the Questaal codes use a shifted logarithmic radial mesh: point i has a radius\n\n\n\n

Mesh points are linearly spaced by ab near the nucleus. For ri large compared to\na, the mesh points are spaced exponentially (equally spaced on a log scale, spacing a).\n\n

Three numbers are used to specify the mesh: augmentation radius, the number of points inside it, and the spacing parameter a (b can be\ndetermined from them). These can be specified in the input file as SPEC_ATOM_R, SPEC_ATOM_NR, \nSPEC_ATOM_A though usually you can rely on default values.\n\n

The free atom calculation doesn’t need to know about the augmentation\nradius, but it is needed for atm.pbte where\nthe augmentation and interstitial parts are kept separate. More details about the\nhow the Questaal codes perform radial integrations can be found here.\n\n

###### Parameters that specify the charge density
\n\n

The Pl in the table are the logarithmic derivative parameters, (also called\ncontinuous principal quantum numbers)\nfor s, p, d, … valence orbitals. For free atoms the fractional\npart is not relevant since there is a boundary condition that the wave function decay exponentially as\nr→∞). The integer parts of Pl are important because they define what states are valence. All states with smaller principal quantum number, e.g.\nthe 5s, are treated as core. The Ql are corresponding charges.\n\n

Pl and Ql are specified by  SPEC_ATOM_P  and  SPEC_ATOM_Q.\nNeither Pl nor Ql are required inputs: lmfa will use default values from a lookup table for whatever is missing.\n\n

As described in the tutorial, lmfa finds the Pb 5d to be a local orbital.\nWhen the 5d local orbital specified (by PZ= 0 0 15.934) in basp.pbte,\nlmfa will include the 5d in the valence. The printout then reads:\n\n

 Species Pb:  Z=82  Qc=68  R=3.044814  Q=0\n mesh:   rmt=3.044814  rmax=47.629088  a=0.025  nr=497  nr(rmax)=607\n  Pl=  6.5     6.5     5.5     5.5     5.5\n  Ql=  2.0     2.0     10.0    0.0     0.0\n
\n
\n\n

Qc is smaller by 10 and the 5d are included in the valence with 10 electrons (Pl is reduced to 5.5 and Ql becomes 10).\n\n

The Ql and the boundary condition at r→∞ are sufficient to completely determine the charge density. The total\nself-consistent charge density should be the same in either case, but the valence-core partitioning is different.\n\n

lmfa starts with a crude guessed density and after 55 iterations converges to the self-consistent one.\n\n

  iter     qint         drho          vh0          rho0          vsum     beta\n    1   82.000000   2.667E+04      410.0000    0.4078E+03     -164.7879   0.30\n   55   82.000000   4.614E-05     1283.9616    0.3612E+08     -309.4131   0.30\n
\n
\n\n

#### Valence and core wave functions

\n\n\n

In this block information about the eigenvalues of the valence and core states it finds along with some additional information, such as\nwhat fraction of the state falls outside the augmentation radius.\n\n

\n\n

The following is taken from standard output:\n\n

 valence:      eval       node at      max at       c.t.p.   rho(r>rmt)\n   6s      -0.91143         1.014       1.961       2.814     0.168779\n   6p      -0.27876         1.185       2.643       4.790     0.524423\n   5d      -1.56879         0.523       1.073       2.252     0.007786\n...\n\n core:        ecore       node at      max at       c.t.p.   rho(r>rmt)\n   1s   -6465.77343         0.000       0.010       0.022     0.000000\n   2s   -1155.91509         0.020       0.057       0.090     0.000000\n...\n   5p      -6.31315         0.486       0.882       1.314     0.000052\n
\n
\n\n
\n
• eval is the eigenvalue\n
• node at is the largest radius for which the wave function has a node\n
• max at is the radius where the wave function has a maximum value\n
• c.t.p is the classical turning point\n
• rho(r>rmt) is the charge spilling outside the augmentation radius. For Pb 5d, 0.007786 electrons spill out: this is on the\nragged edge of whether it needs to be included as a local orbital (see Additional Exercises in the\ntutorial).\n
\n\n

Note: for GW calculations the Pb 5d state is too shallow to be treated as a core.\n\n

\n\n

#### Generating basis information

\n\n\n

From the self-consistent density and potential, lmfa will build some\nbasis set information which is written to template basp0.pbte. It supplies\n\n

\n
• Envelope function (parameters EH and RSMH) defining the shape of the envelope functions.\n
• Boundary condition at the augmentation radius, encapsulated as logarithmic derivative parameter P.
\nP is also called the “continuous principal quantum number”.\n
• Information about local orbitals, indicated as PZ in the input.\n
\n\n

These quantities are supplied in the input file as SPEC_ATOM_EHSPEC_ATOM_RSMH,  SPEC_ATOM_P,  and SPEC_ATOM_PZ.
\nRSMH, EH, P, and PZ are also saved in basp0.pbte.\nlmf may read these parameters from basp.pbte,\ndepending on settings in HAM_AUTOBAS.\n\n

\n\n\n

\n\n

Fitting RSMH and EH to the numerically derived wave functions can be readily accomplished. (It is a nonlinear procedure.) lmfa actually does it twice. First it fits the occupied levels only, for which boundary conditions are known, and at the\nsame time it computes a variational estimate for the energy. In perturbation theory this differs from the exact value computed from\nnumerical wave functions as the difference in the single-particle sum.\n\n

The following table displays this information for each l that\ncarries electrons. rmt is the augmentation radius.\n\n

 Optimise free-atom basis for species Pb, rmt=3.044814\n l  it    Rsm      Eh     stiffR   stiffE      Eval      Exact     Pnu    Ql\n 0  50   1.794  -0.698      88.6    108.3   -0.91141  -0.91143    6.89   2.00\n 1  26   2.026  -0.161     182.6    936.8   -0.27824  -0.27876    6.81   2.00\n eigenvalue sum:  exact  -2.38037    opt basis  -2.37931    error 0.00106\n
\n
\n\n
\n
• Rsm and Eh are the optimum values for RSMH and EH in the free atom\n
• StiffR and stiffE are the sensitivity of the total energy to changes in Rsm and Eh\n
• Eval is the expectation value of the approximate wave function (numerical for r<rmt\n envelope for r>rmt)\n
• Exact is the exact eigenvalue for the given (self-consistent) potential.\n
• Pnu is the logarithmic derivative of the exact atomic wave function at rmt,\nconverted into the continuous principal quantum number\n
\n\n

Notes:\n\n

\n
• A basis of augmented partial waves for r<rmt and the envelopes for r>rmt is the atomic analog of the crystal code.\n
• Eval, determined from the variational principle, should be less binding than the Exact value\n
• The error in the total energy from augmented partial waves, is given in the last line.\n
• The fit is evidently very good. Unfortunately, it is less good in the crystal because crystal eigenfunctions consist of tails from\nenvelopes centered on multiple atoms. So, even if the potential were the same as atomic potential there (in\nreality it changes a little) the crystal eigenfunction will not be perfect at rmt. The new Jigsaw Puzzle Orbital basis\nis designed to deal exactly with these issues.\n
\n\n

After the initial fit, a second fit is carried out, this time with all the partial waves.\nUnoccupied states may not be bound, so Eh is set to a default value.\nThis information is displayed in the following table.\n\n

 Make LMTO basis parms for species Pb to lmxb=3, rmt=3.0448  vbar=0\n l  it    Rsm       Eh        Eval      Exact     Pnu    Ql   Gmax\n 0  30   1.803   -0.706    -0.91141  -0.91143    6.89   2.00   3.9\n 1  18   2.024   -0.160    -0.27825  -0.27876    6.81   2.00   3.6\n 2   1   2.030+  -0.100+   -0.11512   0.01352    6.24   0.00\n 3   1   2.030+  -0.100+    0.20219   0.02051    5.18   0.00\n\n Autogenerated Pnu:  6.895 6.809 6.250 5.183 5.089\n
\n
\n\n
\n
• \n

Empty states are not necessarily bound, in which case they need not decay exponentially as r→∞.\nNevertheless the smooth Hankel basis set requires decaying functions. For these states EH is set to a default value.
\nNote:\nFor QSGW calculations the envelope functions need to be reasonably short range so that the self-energy can be smoothly\ninterpolated between k points. Usually EH should be −0.3, or deeper for atoms where the potential is deep (second row or column VI, VII, and VII).\n \n

• \n

The key new piece of information is Gmax. The maximum value of this number is used in\nestimating the plane-wave cutoff for the density mesh.\n \n

\n\n

\n\n

\n\n\n

\n\n

Local orbitals may already be specified when lmfa begins execution. Information about them is supplied by PZ in the input file\nor an already-existing basp file (depending on how HAM_AUTOBAS_LOC is set)\n\n

In this event lmfa will try to fit the tail of this orbital to a smooth Hankel for r>rmt, in a manner\nsimilar to its fit of the envelope functions. For the Pb atom, the fit reads\n\n

 Fit local orbitals to sm hankels, species Pb, rmt=3.044814\n l   Rsm    Eh     Q(r>rmt)   Eval      Exact     Pnu     K.E.   fit K.E.  Gmax\n 2  1.041 -1.083   0.00792  -1.56878  -1.56879   5.934  -0.8111  -0.8111    7.8\n
\n
\n\n

Notes:\n\n

\n
• The eigenvalues can be quite deep with the wave function steeply decaying. Left unconstrained Rsm can become quite small. This makes for a very sharply peaked function.\nIn such a case the weight of the wave function (measured by Q(r>rmt)) is small and the fit does not need to be especially accurate. To protect\nagainst functions too sharply peaked, a constraint is placed on lower bound Rsm. Most of the time the default is ok, but if not the\neigenvalue will deviate significantly from the exact one. You can set the lower bound with tag SPEC_ATOM_RS3.\nBe careful not to allow it to become too small; it makes representation of the interstitial density difficult and numerically unstable.\n
• Using the fit Rsm and Eh lmfa can estimate how many plane waves are needed\nto accurately represent the intersttial part of this function. That number is Gmax.\nSee the section on GMAX.\n
\n\n
 Find local orbitals which satisfy E > -2 Ry  or  q(r>rmt) > 5e-3\n l=2  eval=-1.569  Q(r>rmt)=0.0078  PZ=5.934  Use: PZ=15.934\n l=3  eval=-9.796  Q(r>rmt)=3e-8  PZ=4.971  Use: PZ=0.000\n
\n
\n\n

\n\n

#### Fitting the charge density outside the augmentation radius

\n\n\n

lmfa retains two densities on the numerical mesh for points\ninside the augmentation sphere: the core and valence densities.\n\n

In addition it must keep some information about the density outside. This density will become part of the interstitial density in the\ncrystal. Thus it must be represented on the interstitial charge density mesh and one-center expansions of it made to include the\ncontribution to neighboring sites from this atom’s density.\n\n

Both can be readily accomplished if the density is represented as a linear combination of smooth Hankel functions.\nlmfa fits the numerical density to a linear combination of such functions; the smoothing radii, energies, and fit\ncoefficients are stored in atm.pbte.\n\n

\n\n
 tailsm: fit tails to 6 smoothed hankels, rmt= 3.02869, rsm= 1.51434\n HNSMFT:  85 points in interval  3.02869  24.73301;  q=  1.433395\n E:    -1.00000    -2.00000    -4.00000    -6.00000    -9.00000    -15.0000\n C:    -0.10708    13.99477    -208.816    3199.570    -32652.0    736827.1\n        r          rho         fit         diff\n    3.028689    0.013779    0.013777    0.000002\n    3.888922    0.003349    0.003348    0.000000\n    4.993484    0.000541    0.000541    0.000000\n    6.411769    0.000054    0.000054    0.000000\n    8.232883    0.000003    0.000003    0.000000\n    q(fit):     1.433395    rms diff:   0.000002\n    fit: r>rmt  1.433395   r<rmt  6.387103   qtot  7.820498\n    rho: r>rmt  1.433395   r<rmt  4.566605   qtot  6.000000\n
\n
\n\n

The valence density was fit to a linear combination of 6 smooth Hankel functions, with varying energies but a fixed smoothing radius rsm=1.51434.\nThe fit is carried out subject to the constraint that the integrated charge is exact (and the integrated magnetic moment, in the spin polarized case).\n\n

\n\n

Also the core density spills out into the interstitial. Rather than renormalizing the core density\ninside the augmentation sphere, it is allowed spill out and included in the interstitial density.\nlmfa fits the core tail to a single smoothed Hankel function.\n\n

\n\n
 coretail: q=0.00215, rho(rmt)=0.00566.  Fit with Hankel e=-14.401  coeff=639.|\n      r            rhoc          fit\n    3.028689    0.01975240    0.01975240\n    3.347222    0.00650048    0.00651738\n    3.792904    0.00136878    0.00136091\n    4.297927    0.00023338    0.00022687\n    4.870194    0.00003132    0.00002930\n    5.518656    0.00000320    0.00000283\n    6.253461    0.00000024    0.00000020\n    7.086104    0.00000001    0.00000001\n
\n
\n\n

The core density was fit to a single smooth Hankel function. The energy (-14.401) was determined by the fitting procedure.\n\n

\n\n

### 5. Estimating the plane-wave cutoff GMAX

\n\n

The charge density is represented on a uniform mesh of points. The spacing between points\nor equivalently the plane-wave cutoff GMAX used to represent the density in reciprocal space\nis governed by how sharply peaked the envelope functions are.\n\n

The cutoff that will reasonably represent the expansion of envelope functions is determined separately for\nvalence orbitals and local orbitals. Both\nmaximum values for all species are printed in the table below.\n\n

 FREEAT:  estimate HAM_GMAX from RSMH:  GMAX=4.3 (valence)  7.8 (local orbitals)\n
\n
\n\n

\n\n

lmfa is now complete. Parmeters needed for both the augmentation and interstitial parts of the atomic density\nare saved in atm.pbte for each species, and basis information parameters are saved in basp0.pbte.\n\n

### FAQ

\n\n
\n
1. Why can the total energy change be calculated as a sum of\neigenvalues, when fitting an epproximate wave function to the exact one?\n
\n\n

This follows from the Helman-Feynman theorem.\n\n

Around a self-consistent point (the independent variable is the density, in Kohn-Sham theory) the change in total energy from a perturbation\nis the change in the single-particle sum to lowest order, because to first order the wave function is stationary. This is an exact\nstatement.\n\n

For many properties, e.g. magnetocrystalline anisotropy, for the effect of spin orbit coupling on the total energy, the change in\nsingle-particle sum is a pretty good estimate of the change in total energy.\n\n

There are reasons why this is approximately true even when not self-consistent. It is exact for one-body model Hamiltonians (i.e. that that\nhave no electron-electron interactions). Matthew Foulkes showed that density-functional\ntheory can be cast in the form similar to model hamiltonians, with the total energy a sum of the single-particle sum and an extra term that\nis functional of the input density nin only. The extra term vanishes at self-consistency in response to low-order\nperturbation, and often doesn’t change by a large amount even if the density isn’t so different from a self-consistent one.\n","dir":"/docs/outputs/lmfa_output/","name":"lmfa_output.md","path":"pages/lmfa_output.md","url":"/docs/outputs/lmfa_output/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"lmgf-cpa tutorial","permalink":"/tutorial/lmgf/lmgf-cpa/","auto":{"code":"lmgf","physical":"ASA Green's function program","info":"Demonstrates lmgf's implementation of the Coherent Potential Approximation."},"header":false,"content":"

This tutorial explains how to use the Coherent Potential Approximation\n(CPA) in the ASA Green’s function code lmgf.\nThe CPA models disorder by treating a single site as a collection of atoms.\n\n

This code implements two forms of CPA: atomic disorder and spin disorder.\n\n

\n\n\n

### Building the ctrl file

\n
\n\n

CPA documentation should explain all the steps we’re going to take; we advice you to read it before starting the tutorial.\n\n

First of all we need a control file adapted for CPA case. Create ctrl.perma that looks like:\n\n

# Lattice constant 3.57A (taken from RT data in Stremme's PhysLettA46) reduced by 0.2%\n# Choose sc=1 for self-consistency, sc=0 for omega=sc on real axis, sc=-1 for spectral function\n% const sc=1\n% const a=6.73 nk=16 nl=3 cfe=.20 cni=1-cfe xcu=0 # xcu=0 => 2 components only\nHEADER  Alloys of Fe and Ni with other elements\nVERS    LMASA-7.0 LM:7 ASA:7 LMGF:7\nIO      SHOW=F HELP=F VERBOS=31,20 WKP=F IACTIV=F\n% const gamma=2\nOPTIONS ASA[CCOR=F GAMMA={gamma} TWOC=F]\nHAM \tNSPIN=2 REL=T BXCSCAL=1\nSTR\nBZ      TETRA=T NKABC={nk} METAL=1 BZJOB=0 INVIT=F\n%ifdef sc==1\n        EMESH=51 10 -.85 0 .4 0   # For self-consistency\n%endif\n        EMESH=501 2 -.5 .2  .001 0   #for dos\nSTRUC   NBAS=1 NSPEC=3 NL={nl}\n        ALAT={a} PLAT=  0 .5 .5  .5 0 .5  .5 .5 0\nSPEC\n%ifdef xcu==0\n        ATOM=Fe R/W=1 Z=26 CPA=1 2 C={cfe} {cni} MMOM=0,0,2\n%else\n        ATOM=Fe R/W=1 Z=26 CPA=1 2 3 C={cfe}*{1-xcu} {cni}*{1-xcu} {xcu} MMOM=0,0,2\n%endif\n        ATOM=Ni R/W=1 Z=28 MMOM=0,0,1\n        ATOM=Cu R/W=1 Z=29\nSITE    ATOM=Fe POS=0 0 0\n%const  nit=1\nITER    NIT={nit}  MIX=B5,b=0.05 CONV=1e-6 CONVC=1e-6\nSTART   CNTROL=F BEGMOM=T\n%const  gfmod=1\nGF      MODE={gfmod} DLM={sc==1?12:32}\n%ifdef sc==1\n        GFOPTS=p3;padtol=.001;omgmix=0.4;padtol=1d-3;omgtol=1d-3;lotf;nitmax=30\n% elseifd sc==0\n        GFOPTS=p3;omgmix=0.4;padtol=0.001;omgtol=1d-6;lotf;nitmax=50\n% else\n        GFOPTS=p3;specfr;omgmix=0.4;padtol=0.001;omgtol=1d-6;lotf;nitmax=50\n% endif\nSTART   BEGMOM=T\n
\n
\n\n

Check the CPA documentation here. It explains carefully the additions to a control file required to turn on chemical and/or magnetic CPA.\nAdditional species must be defined for chemical CPA, and their concentrations. It’s done in the SPEC category in the following way:\n\n

SPEC ATOM CPA= and C= together turn on chemical CPA for a particular species.\n
\n
\n\n

Look into control file. There we have\n\n

        ATOM=Fe R/W=1 Z=26 CPA=1 2 3 C={cfe}*{1-xcu} {cni}*{1-xcu} {xcu} MMOM=0,0,2\n        ATOM=Ni R/W=1 Z=28 MMOM=0,0,1\n        ATOM=Cu R/W=1 Z=29\n
\n
\n\n

It tells the code that our alloy consists of Fe, Ni and Cu, provides their atomic numbers. The first of the three lines also gives the concentrations for each of the elements: 1, which is Fe, for instance has concentration {cfe}*{1-xcu}. It is determined from the chemical formula and means we can vary the Cu and Fe concentrations from the control line. By default we have no Cu and 20% of Fe (see ctrl.perma):\n\n

% const a=6.73 nk=16 nl=3 cfe=.20 cni=1-cfe xcu=0\n
\n
\n\n

You can also see that we force some initial moment on Fe and Ni (see more info regarding it in ASA-tutorial).\nThe following token turns on the CPA and/or DLM:\n\n

GF DLM= controls what is being calculated.\n
\n
\n\n
DLM=12: normal CPA calculation; both charges and Ω's are iterated\nDLM=32: no charge self-consistency; only CPA it iterated until Ω reaches prescribed tolerance for each z-point.\n
\n
\n\n

If you look into the ctrl file you’ll see that we have both there: 12 and 32 depending on the value of sc since we’ll need to run it with each DLM = 12 and 32 one after another.\n\n

Same way as in for example ASA-tutorial (please try that tutorial first if you haven’t yet done so) you’ll need to create the structure file by doing (we’re going to run a set up for )\n\n

lmstr perma vnit=1 -vxcu=0.2 -vcfe=0.2 --pr35,25 --rs=1,0  | tee out.lmstr\n
\n
\n\n

Same as in ASA-tutorial we’re going to make the initial potential:\n\n

lmgf perma -vnit=0 -vxcu=0.2 -vcfe=0.2 --pr35,25 --rs=0,1\n
\n
\n\n

### Spectral function calculations with lmgf

\n
\n\n

Please real carefully the CPA-documentation; it expains why you’ll need to run the following commands. The calculation is performed in 3 steps:\n\n

\n
• Charge self consistency. (The spectral function can be calculated for any potential, but it is usual to work with the self-consistent one).\n
• CPA self-consistency in the coherent interactor (CPA only). Since is energy dependent, it has to be calculated for the energy points where the spectral function is needed. For drawing spectral functions this is usually a uniform mesh of points close to the real axis.\n
• Calculation of the spectral function on some contour, usually a uniform mesh close to the real axis.\n
\n\n

Charge self consistency is performed in the usual manner (make sure you get the ‘jolly good show’ sign at the end otherwise you need more iterations)\n\n

lmgf  perma -vnit=150 -vxcu=0.2 -vcfe=0.2 -vgamma=4 --pr35,25 | tee out.lmgf1\n
\n
\n\n

Note the EMESH mode (contour type) is elliptical (type 10). If CPA is used, the coherent interactors for all CPA sites are also iterated to self-consistency during this calculation, but this is done for the complex energy points on the elliptical contour. The following additional step is needed in this case to obtain self-consistent at those points where the spectral function will be calculated.\n\n

Omega self-consistency is turned on by setting DLM=32. In this mode only Ω for each CPA site is converged, while the atomic charges are left unchanged. It is important to converge Ω to high precision. Typically omgtol=1d-6 is a good criterion. The contour type should be set to 2.\n\n

Here we’ll need a symmetry file. You can copy lm/startup/syml.fcc (make sure you have the correct path there) to the folder you’re working in. The folder has symmetry files for different structures, e.g. syml.fcc, syml.hcp, etc). Let’s rename it:\n\n

cp lm/startup/syml.fcc syml.perma\n
\n
\n\n

Now run\n\n

lmgf perma -vsc=0 --band:fn=syml -vnit=1 -vgamma=4 -vxcu=0.2 -vcfe=0.2 --pr45,25 | tee out.lmgf2\n
\n
\n\n

Calculation of the spectral function should be done with EMESH set to the same mesh as used for self-consistency. We’ll make them by running\n\n

lmgf  perma -vsc=-1 --band:fn=syml -vnit=1 -vgamma=4 -vxcu=0.2 -vcfe=0.2 --pr45,25 | tee out.lmgf3\n
\n
\n\n

### Plotting of the spectral function

\n
\n\n

Upon successful completion of calculation spf.perma file will be generated. The file has the following format.\nTo plot the spectral functions you’ll need the following script: lm/startup/SpectralFunction.sh. Copy it to your working directory and run it as ./SpectralFunction.sh .\n\n

It should create two files: perma_UP.png and perma_DN.png with the spectral funcrions for spin up and down. y-axis is in mRy.\n\n

They should look somehow like (up and down):\n\n

.\n\n

.\n\n

Now you can try to run different concentrations of Cu and Fe to see how it affects the Spectral functions.\n","dir":"/tutorial/lmgf/lmgf-cpa/","name":"lmgf-cpa.md","path":"pages/lmgf-cpa.md","url":"/tutorial/lmgf/lmgf-cpa/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"lmgf tutorial","permalink":"/tutorial/lmgf/lmgf/","auto":{"code":"lmgf","physical":"ASA Green's function program","info":"A basic tutorial covering the functions of the crystal Green's function code."},"header":false,"content":"

\n\n\n

### Summary

\n
\n

This package implements the ASA local spin-density approximation using Green’s functions. The Green’s functions are contructed by approximating KKR multiple-scattering theory with an analytic potential function. The approximation to KKR is essentially similar to the linear approximation employed in band methods such as LMTO and LAPW. It can be shown that this approximation is nearly equivalent to the LMTO hamiltonian without the “combined correction” term. With this package a new program, lmgf is added to the suite of executables. lmgf plays approximately the same role as the LMTO-ASA band program lm: a potential is generated from energy moments , , and of the density of states. in the same way as the lm code. You can use lmgf to make a self-consistent density as you can do with lm. lmgf is a Green’s function method: Green’s functions have less information than wave functions, so in one sense the things you can do with lmgf are more limited: you cannot make the bands directly, for example. However lmgf enables you do do things you cannot do with lm. The two most imprortant are:\n\n

\n
• Calculate magnetic exchange interactions\n
• Calculate magnetic susceptibility (spin-spin, spin-orbit, orbit-orbit parts)\n
• Calculate properties of disordered materials, either chemically disordered or spin disorder from finite temperature, within the Coherent Potential Approximation, or CPA.\n
• Calculate the ASA static susceptibility at to help converge calculations to self-consistency.\n
\n\n

You can find some extra information on the way lmgf works in lmgf documentation.\n\n

lmgf is a Green’s function program complementary to the ASA band code lm. For some properties, e.g. calculating moments lmgf can be straightforwardly substituted for lm because both calculate the DOS. The DOS is : it can be decomposed into site contributions and thus moments Q0..2 can be generated for each site and l channel, as an alternative to decomposing the eigenfunctions of the bands, as lm does. Thus it can achieve self-consistency in a manner similar to lm, but generating by an alternate route. If the ASA hamiltionian built by lm is suitably simplified, i.e. by\n\n

\n
• omitting the “combined correction term” (OPTIONS_ASA_CCOR)\n
• generating from true power moments as the Green’s function does (HAM_QASA=0),\n
\n\n

then lmgf and lm will produce nearly identical self-consistent solutions. When potential functions are parameterized to 2nd order in both lm and lmgf, and both methods are fully k converged, they should product nearly identical results. By default lm parameterizes the potential function to 3rd order; lmgf can do the same. The 3rd order parameterizations are similar in the two methods, but not identical. To verify this, try the following test:\n\n

gf/test/test.gf co 1 2   ← Test 1 for 2nd order parameterization; test 2 for 3rd order\n
\n
\n\n

lmgf is a bit messier to work with (Green’s functions are harder to stabilize than wave functions), and it a bit less accurate as the simplifications to lm amount to approximations. So, typically lm makes a better self-consistent potential.\n\n

But lmgf can do things lm doesn’t do, e.g. calculate magnetic exchange interactions through linear response as this tutorial demonstrates. Sometimes there is a need or advantage to carrying self-consistency via lmgf, e.g. when performing CPA calculations. Unless there is good reason to do otherwise, it is better use the self-consistent potential generated by lm to calculate other properties such as the magnetic exchange parameters. We follow that strategy here.\n\n

### Preliminaries

\n
\n

For this tutorial the blm, lmchk, lmstr, lm and lmgf executibles are required and are assumed to be in your PATH; the source code for all Questaal exectuables can be found here.\n\n

### Tutorial

\n
\n\n
##### 1. Building input file
\n
\n\n

Before starting working with this tutorial we advise you to read through the ASA-tutorial which explains building the imput file in more details (you can also look through the input described in a full-potential context). In the present tutorial we’ll focus on the part of the input specific for using with lmgf.\n\n

To get started, copy doc/demos/asa-copt/init.copt to your working directory. Inspect the init file and you will see it contains just the minimum structural information, apart from one line supplying some information about the magnetic structure:\n\n

LATTICE\n         ALAT=7.1866\n         PLAT=    1.000000   0.000000   0.000000\n                  0.000000   1.000000   0.000000\n                  0.000000   0.000000   1.000000\nSPEC ATOM=Co MMOM=0,0,2.2\nSITE\n      ATOM=Pt POS=  0.0  0.0   0.0\n      ATOM=Co POS=  0.5  0.5   0.0\n      ATOM=Co POS=  0.0  0.5   0.5\n      ATOM=Co POS=  0.5  0.0   0.5\n
\n
\n\n

Then use the blm tool (described in more details in ASA-tutorial and full-potential tutorial. )\n\n

blm --mag --nk=8 --asa --gf copt\n
\n
\n\n

blm should generate file actrl.copt, which should be essentially the same as doc/demos/asa-copt/ctrl.copt (commented lines might be different though). If this is not the case, something is wrong with your configuration. At the moment if actrl looks slightly different from the one provided just move on to the next steps.\n\n

The command-line arguments are not required, but they supply quantities blm cannot determine automatically, that you will have to supply at some point. If you supply them on the command-line they are folded into the ctrl file at the outset; or, you can edit the ctrl file after it is generated. Command-line switches blm recognizes are summarized in Building FP input file.\n\n

###### The --asa switch
\n\n

This switch tailors the ctrl file for the ASA. To see how it affects the ctrl file, try running blm without --asa. For more details see the ASA-tutorial.\n\n

###### The --mag switch
\n\n

This switch tells blm that you plan on doing a spin polarized calculation. All it does is change the preprocessor variable nsp to 2. This turns on the spin polarization through NSPIN={nsp}.\n\n

Without any other information the spin polarized calculation will proceed with zero magnetic moment. The system needs a “push” in the initial direction to find the magnetic state. You have to supply some initial information about the magnetic structure. Since we know that the magnetization is concentrated on the Co (Pt is paramagnetic, though it has a high magnetic susceptibility), the init file supplies an initial magnetic moment on the Co site of about 2 Bohr on the Co d orbital, in the SPEC category (SPEC ATOM=Co MMOM=0,0,2.2 in the initial file). The precise value 2.2 is not important: this quantity is determined self-consistently later. Choosing it rather large (the bulk moment is 1.8 ) gives it a strong initial push so to encourage it not revert to a (metastable) nonmagnetic state in the course of a self-consistent calculation.\n\n

###### The --gf switch
\n\n

When --gf is used, blm prepares the input file for the Green’s function program lmgf. This tutorial uses lmgf to calculate magnetic exchange interactions. Adding --gf to the blm command line argument modifies actrl.copt in two ways:\n\n

1. The GF category is created:\n\n

% const gfmode=1 c3=t\nGF      MODE={gfmode} GFOPTS={?~c3~p3;~p2;}\n
\n
\n\n

To see the purpose of GF_MODE, do:\n\n

lmgf --input\n
\n
\n\n

and look for GF_MODE. You should see:\n\n

    GF_MODE           reqd   i4       1,  1          default = 0\n           0: do nothing\n           1: self-consistent cycle\n           10: Transverse exchange interactions J(q), MST\n           11: Read J(q) from disk and print derivative properties\n           ...\n
\n
\n

So, if MODE=1, lmgf does a self-consistent calculation, generating the P and for each l channel using Green’s functions rather than wave functions as lm does.\n\n

GFOPTS bundles a variety of lmgf-specific options, which you supply through a sequence of strings separated by semicolons. This tag:\n\n

GFOPTS={?~c3~p3;~p2;}\n
\n
\n\n

becomes GFOPTS=p3 after parsing by the preprocessor, because c3 is nonzero (see preprocessor documentation).\np3 tells lmgf to use order potential functions (somewhat more accurate than order, but also prone to generating false poles not too far from the real axis).\n\n

2. EMESH is added to BZ:\n\n

% const nz=16 ef=0\n        EMESH={nz},10,-1,{ef},.5,.3  # nz-pts;contour mode;emin;emax;ecc;bunching\n
\n
\n\n

Green’s functions are energy resolved; thus physical properties such as the charge density or magnetic exchange interactions require an integration over the energy as well as over the BZ. For both density and static exchange interactions, the integration must be taken on the real axis from below the lowest eigenstate in the system to the Fermi level . Im G is basically the density-of-states. It is very spikey on the real axis, and a very fine energy mesh would be required to integrate Im G close to the real axis. The integration can be accomplished with vastly greater ease by deforming the contour into an elliptical path in the complex plane. A gaussian quadrature is used; typically 15 or so energy points is sufficient for a well converged result.\n\n

This contour is specified through EMESH. Breaking down the constituents of EMESH as autogenerated by blm:\n\n

     EMESH={nz}          ←  number of energy points in the contour; {nz} evaluates 16 in this file\n            10           ←  elliptical contour\n            -1           ←  starting energy on the contour.  Must be deeper than the lowest state in the system (-0.776 Ry)\n           {ef}          ←  Fermi level determined by charge neutrality; see below\n           0.5           ←  eccentricity of the ellipse ranging from 0 (circle) to 1 (line)\n           0.3           ←  bunching parameter, bunching points near Ef. 0→no bunching\n
\n
\n\n

We don’t know what is a priori. In the ASA, a general reasonable guess is 0. If we perform the band calculation, see ASA-tutorial, we get generated by lm: it is −0.12927 Ry. is fixed by charge neutrality. If lmgf generated exactly the same spectrum as lm, and the k-integration were fully converged (or at least identical in the two cases) would be the same for lm as for lmgf. However we can expect that the charge neutrality points will slightly different in the two methods. Further we’ll find using lmgf.\n\n

If you want to practice finding using lm use the following commands (for the details see ASA-tutorial) (We advise you to do those steps since you’ll need some of them further anyway but the following lm-part contains some useful comments):\n\n

Invoking blm with the switches given above is sufficient to make a working input file. Normally you can copy actrl.copt to ctrl.copt as it is.\n\n

All the ASA electronic structure codes (lm, lmgf, and lmpg) use a tight-binding form of the LMTO basis, where the envelope functions are screened to make them short ranged. This information is carried through screened structure constants, which in this package are precomputed and stored using lmstr. Run this setup to make the structure constants:\n\n

 lmstr ctrl.copt                             ← Make and store structure constants\n
\n
\n\n

It should store str.copt and sdot.copt on disk. (If not, something is wrong and you should not proceed.)\n\n

Invoking blm with the switches given above is sufficient to make a working input file. Normally you can copy actrl.copt to ctrl.copt as it is.\n\n

As of yet we have no starting density or potential. You can see this immediately by trying to run the band code straight off:\n\n

lm ctrl.copt\n
\n
\n\n

The program will stop with this message:\n\n

LM:  Q=ATOM encountered or missing input\n
\n
\n\n

In usual LDA calculations, a trial density is obtained by generating densities for free atoms, and superposing them (Mattheis construction). While the ASA code could have been written to do just this, it does something different. This code takes advantage of the simplification the ASA offers, namely that the sphere density is completely determined by a small number of parameters, namely the log derivative parameters P and energy moments of the charge density for each l channel. We can supply reasonable guesses through the ctrl file, or let the program pick some defaults as a first guess. Defaults are typically assigned so that is the charge in the l channel of the atom and are taken to be zero. While this is a pretty crude guess (cruder than the Mattheis construction) usually it is good enough that the program can find its way to the proper self-consistent solution.\n\n

The ASA code can either start from “potential parameters”, which gives it enough information to generate energy bands and calculate moments (, ) , or from the moments (, )  which is sufficient for the sphere routine to fix the potential and calculated potential parameters. The band and sphere blocks of the code are thus complementary: one takes the input of the other and generates output required by the other. The cycle is described in the LMTO-ASA documentation.\n\n

The ctrl file is built with the following START category:\n\n

START CNTROL={nit==0} BEGMOM={nit==0}\n
\n
\n\n

If BEGMOM is nonzero, lm will start from potential parameters (which don’t exist yet, in the present case).\nIf BEGMOM=0 lm will start from the (, ). These haven’t been given either, but lm can pick defaults for them. We get an initial potential by doing:\n\n

lm ctrl.copt -vnit=0         ← Because -vnit=0, BEGMOM={nit} is preprocessed into BEGMOM=0\n
\n
\n\n

lm will start from (default) moments and generate a trial density for each sphere, together with potential parameters corresponding to potential generated.\n\n

The output should generate a table of potential parameters like this:\n\n

PPAR:  Pt        nl=4  nsp=2  ves=  0.00000000\n  l     e_nu          C        +/-del     1/sqrt(p)      gam         alp\n  ...\n  1 -0.33739981  0.66438341  0.17542338   6.2239786  0.13462478  0.13462478\n  2 -0.21536750 -0.17914256  0.02841817   1.1299420  0.01358564  0.01358564\n  ...\n  1 -0.33739981  0.66438341  0.17542338   6.2239786  0.13462478  0.13462478\n  2 -0.21536750 -0.17914256  0.02841817   1.1299420  0.01358564  0.01358564\n  ...\n
\n
\n\n

and a similar table for Co. Particularly important are C, the band center of gravity C and the bandwidth del. You can see that sits far above zero while is a little below. It tells you that the Pt d orbital is important for bonding while the Pt p orbital is pretty far above from the Fermi level and of much less importance. del is the bandwidth parameter; a little more detail is given in the LMTO-ASA documentation. A disk file is created for each class. It contains the (, ), the potential parameters, and possibly other things. Take a look at files co.copt and pt.copt. You can see what defaults were chosen for (, ).\n\n

We are now ready for a self-consistent calculation. Doing:\n\n

lm ctrl.copt -vnit=30 --pr31,20                ← NIT={nit} is preprocessed into NIT=30.\n                                                --pr31,20 sets verbosity fairly low\n
\n
\n\n

will perform up to 30 self-consistent cycles, that is\n\n\n\n

lm will continue until the RMS change in (, ) falls below tolerance ITER_CONVC, or until 30 iterations is reached.\n\n

If it’s converged you’ll get the following phrase at the end of your output:\n\n

Jolly good show! You converged to ...\n
\n
\n\n

In this demo convergence should be reached in 21 iterations.\n\n

Interpreting the output:\n\n

The output can provide some very useful information. For example, the self-consistent Co moment is 1.8 ; Pt has a moment (induced by the neighboring Co) of 0.356 . You can see it in the line of the following form\n\n

ATOM=PT Z=78 Qc=68 R=2.928343 Qv=-0.009029 mom=0.356 a=0.025 nr=491\nATOM=Co ...\n
\n
\n\n

Scrolling up you can find the density-of-states at the Fermi level is D(Ef)=79.729 (units of per unit cell), or about 1.3 . Had the calculation been done without spin polarization, D(Ef) would be ~187, more than twice larger. This is a very large number and suggests there is a likely instability. Indeed, the system can lower its energy by spontaneously magnetizing. Consider the Stoner criterion for spontaneous magnetization, I D(EF) > 1. In 3d transition metals I is about 1 eV. Thus the Stoner criterion is easily satisfied and the system should spontaneously magnetize. In magnetizes so strongly that the Co moment (1.8 ) is larger than that for elemental Co (1.6 ).\n\n

The same line also provides you with the Fermi energy:\n\n

BZINTS: Fermi energy:   -0.129264; ...\n
\n
\n\n
##### 2. Making ctrl file and structure constants
\n
\n\n

If you’ve done the lm-part above go straight to ‘The Green’s function program lmgf’\n\n

Invoking blm with the switches given above is sufficient to make a working input file. Normally you can copy actrl.copt to ctrl.copt as it is.\n\n

For a fuller description of the ctrl file, see the the ASA-tutorial, the FP tutorial, and also Building FP input file.\n\n

All the ASA electronic structure codes (lm, lmgf, and lmpg) use a tight-binding form of the LMTO basis, where the envelope functions are screened to make them short ranged. This information is carried through screened structure constants, which in this package are precomputed and stored using lmstr. Run this setup to make the structure constants (for more detailes see see the the ASA-tutorial):\n\n

 lmstr ctrl.copt                             ← Make and store structure constants\n
\n
\n\n

It should store str.copt and sdot.copt on disk. (If not, something is wrong and you should not proceed.)\n\n

As of yet we have no starting density or potential.We get an initial potential by doing:\n\n

lm ctrl.copt -vnit=0\n
\n
\n\n

We are now ready for a self-consistent calculation. Do:\n\n

lm ctrl.copt -vnit=30 --pr31,20\n
\n
\n\n
##### 3. The Green’s function program lmgf
\n
\n\n
###### a) Finding EF
\n\n

If GF_MODE=1, lmgf will generate the for whatever you give it. However there is only one physically meaningful – the one that satifies charge neutrality. The input file is constructed so you can supply through command-line argument -vef=expr: the preprocessor evaluates  ef  from  expr, substitutes it for  {ef}  in the input file (see preprocessor documentation). We’re going to use the one obtained by running lm (see above).\n\n

The simplest way to find the charge neutrality point is to run lmgf interactively in the self-consistent mode (GF_MODE=1). By running lmgf interactively you can monitor convergence. Do:\n\n

lmgf ctrl.copt -vnit=30 --pr31,20 --iactiv -vef=-.1293\n
\n
\n\n

Since we’re using --iactiv switch the code is going to stop and ask us to make some choices. At first you’ll see\n\n

QUERY: max it (def=30)?\n
\n
\n\n

Just hit Enter (return) to confirm. Output contains two tables the first of which looks like\n\n

GFASA:  integrated quantities to efermi = -0.1293\n    PL      D(Ef)      N(Ef)       E_band      2nd mom      Q-Z\nspin 1   11.450485   21.527413   -7.139582    2.654697    3.027413\nspin 2   79.610384   15.411861   -4.696173    1.699842   -3.088139\ntotal   91.060868   36.940675  -11.835755    4.354540   -0.060726\n       deviation from charge neutrality: -0.060726\n
\n
\n\n

The non-zetro deviation from charge neutrality means that ef=-.1293 results in a slight electron deficiency. lmgf will estimate a constant shift to crystal potential to make the system neutral, and interpolate G to contour adjusted by this shift using a Pade approximant.\n\n

Note lmgf shifts the average crystal potential: ef  is kept fixed.\n\n

Then lmgf prints out some results of the Pade correction in a subsequent table.\n\n

Corrections to integrated quantities estimated by Pade interpolation\n    PL      D(Ef)      N(Ef)       E_band      2nd mom      Q-Z\nspin 1    8.860480   21.530197   -7.151787    2.654754    3.030197\nspin 2  110.802293   15.469803   -4.712034    1.700808   -3.030197\n total  119.662773   37.000000  -11.863960    4.355561   -0.000000\n        deviation from charge neutrality: 0\n
\n
\n\n

At the prompt you should see\n\n

QUERY: redo gf pass (def=F)?\n
\n
\n\n

It is asking you whether you want to accept the Pade approximant, or redo the GF calculation with the potential shift added. Let’s do the latter, to see how good the estimate was.\nAt the prompt type ‘st’ and hit return twice\n\n

QUERY: redo gf pass (def=F)?  st <RET> <RET>\n
\n
\n\n

After the cycle you should see\n\n

deviation from charge neutrality: 0.015781\n
\n
\n\n

The Pade correction reduces the deviation from neutrality but overestimates the shift. A new estimate is made for the potential shift and the prompt reappears. You can repeat the GF cycle as many times as you like. (If you see QUERY: modify vbar (def=…)? just hit return) If you iterate enough you should see something like:\n\n

gfasa:  potential shift this iter = 0.000001.  Cumulative shift = -0.000433\n
\n
\n\n

The shift of this last iteration is negligible.  Cumulative shift’  is the net shift accumulated over all the iterations.\n\n

You can now proceed to self-consistency but we will instead use the potential generated by lm in order to make the exchange parameters. (If you do proceed to self-consistency using lmgf, note that it writes the potential shift and Fermi level to file vshft.copt This shift is automatically read when lmgf is restarted. After self-consistency is reached you can either keep vshft.copt, or remove the file and modify  ef  so charge neutrality is satisfied without the shift.)\n\n

At the prompt enter\n\n

QUERY: redo gf pass (def=F)?  a <RET>\n
\n
\n\n

to prevent lmgf from continuing its self-consistency cycle. The constant potential shift is just the negative the the requisite Fermi level shift to achieve charge neutrality:  ef needs to be adjsted to -0.1293−(-0.000433) = −0.128867 Ry.\n\n

To confirm that this is the correct  ef, repeat the interactive lmgf calculation with  -vef=-0.1289.\n\n

###### b) Magnetic Exchange Interactions
\n
\n\n

As we mentioned before lmgf requires a GF-specific category (look into the ctrl.copt).\n\n

GF  MODE=1 GFOPTS=options\n
\n
\n\n

Token MODE= controls what lmgf calculates. Options are MODE=1, MODE=10, MODE=11, MODE=26.\n\n

Look into ctrl.copt. Two lines are important here:\n\n

% const gfmode=1 c3=t\nGF      MODE={gfmode} GFOPTS={?~c3~p3;~p2;}\n
\n
\n\n

MODE={gfmode} means that you can define MODE in the command line by adding -vgfmode=1/10/11/26; if you don’t it will be set to 1 (from const gfmode=1). In the previous example we used MODE=1 now we’ll need MODE=10 that invokes a special branch computing magnetic exchange interactions using a linear response technique.\n\n

The Heisenberg model is an empirical model that postulates a set of interacting rigid local spins. The Hamiltonian is\n\n\n\n

The are called “Heisenberg exchange parameters”. The Heisenberg applies to a system of rigid spins undergoing small excursions about equilibrium. R and R’ are any pair sites and is a kind of magnetic analog to the dynamical matrix describing small oscillations of nuclei around their equilibrium point. In a crystal with periodic boundary conditions can be Bloch transformed to read:\n\n

, where R and R’ are now confined to sites within a unit cell.\n\n

lmgf calculates from the “Lichtenstein formula.” This famous expression (J. Magn. Magn. Mater. 67, 65 (1987)), closely related the static transverse magnetic susceptibility , is derived from density functional perturbation theory. It establishes a first-principles basis for the Heisenberg model. One elegant (though approximate) feature of the ASA is that the magnetization is everywhere associated with an atomic sphere. For local moment systems, the magnetization is well confined inside a sphere; thus associated with every site R there is a well defined local moment. If sufficiently localized it rotates rigidly under the influence of an external perturbation.\n\n

When you set GF_MODE=10, lmgf will generate , and then perform an inverse Bloch transform (by Fast Fourier Transform) to make for as many lattice translation vectors T as there are k-points.\n\n

Do\n\n

lmgf -vgfmode=10 ctrl.copt -vef=-.1289\n
\n
\n\n

Results are saved in file jr.copt (see below).\n\n

Most of the analysis is done in the next step, but already the output from gfmode=10 contains some useful information. In the first of this pair of tables you see J_0 and 2/3 J_0. J_0 is the net Weiss magnetic field from the surrounding neighbors; 2/3 J_0 would be the (classical) mean-field estimate for the critical temperature if there were one atom/cell. Since the Pt moment is very small it is weakly magnetic and has little effect on . In the second table (J_0 resolved by L) J_0 is decomposed into lm contributions. As expected, the contributions to J_0 originates almost entirely from the d states.\n\n

Now if you run lmgf with GF_MODE=11, it reads jr.copt (which means you have to run MODE=10 first) and does some analysis with the parameters. Invoke lmgf with\n\n

lmgf -vgfmode=11 ctrl.copt -vef=-.1289\n
\n
\n\n

A unit cell of N sites has pairs. Thus jr.copt holds a succession of tables of J, one array for each RR’ pair in the unit cell. Each array has exchange parameters, corresponding to the lattice translation vectors that follow from the Fast Fourier Transform of a k mesh of points. You can find the headers for each array (headers follow a standard format this package uses) by doing, e.g.\n\n

grep rows jr.copt\n
\n
\n\n

to see:\n\n

% rows 64 cols 8 real  rs  ib=1  jb=1\n% rows 64 cols 8 real  rs  ib=1  jb=2\n ...\n
\n
\n\n

ach array has 64×8 entries, for T vectors derived from 8×8×8 k-points (the 3D array is stored in a 2D format). lmgf unpacks these (GFMODE=11) and prints them out in a sequence of tables, e.g. this one coupling all pairs of atoms belong to sites 2 and 3 in the unit cell. Pairs are ordered by separation distance d. Interactions fall off rapidly with d, and oscillate around 0, as might be expected from RKKY theory. Then follow estimates for the critical temperature . is estimated in Weiss mean-field theory, and also according to a spin-waves theory by Tyablikov (sometimes called the “RPA”). Mean-field tends to overestimate ; RPA tends to be a little more accurate but tends to underestimate it. From these two estimates should be around 1000K (see the GFMODE=11 output).\n\n

Next follows an estimate for the spin wave stiffness. We need a symmetry lines file, let’s copy it from /lm/startup/ (make sure you have the correct path there. The folder has symmetry files for different structures, e.g. syml.fcc, syml.hcp, etc):\n\n

cp startup/syml.sc syml.copt\n
\n
\n\n

You can also create syml.copt\n\n

41  0.5 0 0    0 0 0                  X to Gamma\n41   0 0 0    .5 .5 0                 Gamma to M\n41  .5 .5 0   .5 .5 .5                M to R\n41  .5 .5 .5   0 0 0                  R to Gamma\n0 0 0 0 0 0 0\n... For fermi surface plotting\n vx     range  n     vy     range  n   height  band\n1 0 0   -1 1   51   0 1 0   -1 1   51   0.00    4\n
\n
\n\n

lmgf reads this file and calculates the spin wave spectrum from the Heisenberg model, along the lines specified. Results are saved in bnds.copt (the energy scale is now mRy). So let’s run GFMODE=11 again to get it (now we have the symmetry lines file):\n\n

lmgf -vgfmode=11 ctrl.copt -vef=-.1289\n
\n
\n\n

You can plot magnon spectra using the same technology you use for plotting energy bands, see ASA-tutorial. If you have the plbnds and fplot packages installed do:\n\n

echo 0 350 5 10 | plbnds -scl=13.6 -fplot -lbl=X,G,M,R,G bnds.copt\nfplot -f plot.plbnds\n
\n
\n\n

Now you have the fplot.ps file with the spectra (you can rename this file to some-name.ps) and use your favorite postscript reader to view it. You should see something close to what is shown in the figure:\n\n

.\n\n

Magnon energies are in meV.\n\n

Note: The 8×8×8 mesh is a bit coarse. Use a finer k mesh for a smoother and more accurate magnon spectrum.\n","dir":"/tutorial/lmgf/lmgf/","name":"lmgf-tutorial.md","path":"pages/lmgf-tutorial.md","url":"/tutorial/lmgf/lmgf/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"QSGW Tutorial for magnetic bcc Fe","permalink":"/tutorial/gw/qsgw_fe/","auto":{"code":"gw","physical":"","info":"A demonstration of a QSGW calculation for Fe, starting from the LDA.","priority":8000},"header":false,"content":"

\n\n\n

### Preliminaries

\n
\n\n

Executables blm, lmfa, and lmf are required and are assumed to be in your path;\nsimilarly for the QSGW script lmgwsc; and the binaries it requires should be in subdirectory code2.\n\n

When a text editor is required, the tutorial uses the nano text editor.\n\n

The band-plotting part uses the plbnds tool\nand to make the figure, the fplot graphics tool.\n\n

To view the postscript file, this document assumes you are using the apple-style open command.\n\n

It proceeds in a manner similar to the basic QSGW tutorial so you may want to be familiar with that tutorial. It also forms a starting point for other tutorials, for example the calculation of the dynamical self-energy, another for k-resolved DOS, and as well as combined of k-resolved and Mulliken-resolved DOS - going over these tutorials after or during this tutorial may help you better follow both.\n\n

### Command summary

\n
\n

\n\n
\n
1. LDA self-consistency (starting from init.fe)\n
\n\n
nano init.fe\nblm --nit=20 --nk=16 --gmax=7.9 --mag --nkgw=8 --gw fe\ncp actrl.fe ctrl.fe\nlmfa fe\ncat basp0.fe | sed -e 's/\$$Fe.*\$$/\\1 PZ=0 0 4.5'/ > basp.fe\nlmf fe > out.lmf\n
\n
\n\n

Make the energy bands and save in bnds.lda:\n\n

nano syml.fe\nlmf fe --quit=band\nlmf fe --band:fn=syml\ncp bnds.fe bnds.lda\n
\n
\n\n
\n
1. QSGW self-consistency\n
\n\n
lmfgwd --jobgw=-1 --sigw --ib=1:9 ctrl.fe\nnano GWinput\nlmgwsc --mpi=6,6 --sym --metal --tol=1e-5 --getsigp fe > out.lmgwsc\ngrep more out.lmgwsc\n
\n
\n\n

Make the energy bands and save in bnds.gw:\n\n

lmf fe --quit=band\nlmf fe --band:fn=syml\ncp bnds.fe bnds.gw\n
\n
\n\n

Create and view a postscript the energy bands using plbnds and\nfplot.\n\n

echo -2,2 /  | plbnds -wscl=1,.8 -fplot -ef=0 -scl=13.6 --nocol -dat=gw -spin2 bnds.gw\necho -2,2 /  | plbnds -wscl=1,.8 -fplot -ef=0 -scl=13.6 --nocol -lbl=H,N,G,P,H,G -spin2 -dat=lda bnds.lda\n\nrm -f plot.2bands\necho \"% char0 colr=3,bold=5,clip=1,col=1,.2,.3\" >>plot.2bands\necho \"% char0 colb=2,bold=4,clip=1,col=.2,.3,1\" >>plot.2bands\nawk '{if ($1 == \"-colsy\") {sub(\"-qr\",\"-lt {colg} -qr\");sub(\"lda\",\"green\");sub(\"green\",\"gw\");sub(\"colg\",\"colr\");print;sub(\"gw\",\"lda\");sub(\"colr\",\"colb\");print} else {print}}' plot.plbnds >> plot.2bands\n\nfplot -f plot.2bands\nopen fplot.ps\n \n \n\n \n\n ### Introduction \n\n This tutorial carries out a QSGW calculation for Fe, a ferromagnet with a fairly large moment of 2.2μB.\n\n Quasiparticle Self-Consistent GW (QSGW) is a special form of self-consistency within GW. It’s advantages are briefly described in\nthe overview, and also in the summary of the basic QSGW tutorial.\nSelf-consistency is rather necessary in magnetic systems, because the magnetic moment is not reliably described by 1-shot GW, and is\nsomewhat ill-defined. For the most part magnetic moments predicted by QSGW are significantly better than the LDA. Moments in itinerant\nmagnets, however, tend to be overestimated because diagrams with spin fluctuations (absent in GW) tend to reduce the magnetic\nmoment. This is true for both QS_GW_ and LDA.\n\n This tutorial proceeds in a manner similar to the basic QSGW tutorial.\n\n ### 1. Self-consistent LDA calculation for Fe \n\n QSGW requires a starting point. The LDA is a reasonably accurate, and convenient starting point, indeed it is good enough in its own\nright for many magnetic systems.\n\n Following other LDA tutorials, the input file is built with the blm tool, which\nrequires file init.fe.\n\n #### Input file setup \n\n Fe is a bcc metal with a lattice constant 5.408 a0\nand a magnetic moment of 2.2 μB.\nThe LDA needs some breaking of the symmetry to stabilize a nonzero magnetic moment, so we supply\na trial moment of 2μB.\n\n Cut and paste the contents in the box below into init.fe.\n\n # Init file for Fe\nLATTICE\n SPCGRP=Im-3m A=5.408\n# ALAT=5.408 PLAT= -0.5 0.5 0.5 0.5 -0.5 0.5 0.5 0.5 -0.5\n\nSPEC\n ATOM=Fe MMOM=0,0,2 # Trial spin moment on the d channel\nSITE\n ATOM=Fe X=0 0 0\n \n \n\n Supply either the space group (Im-3m)\nor the bcc lattice vectors.\n\n The input file setup and self-consistent cycle are very similar to the PbTe tutorial; review it first if\nyou are not familiar with the structure of the input file, ctrl.fe, or how to set up an LDA\ncalculation from structural information.\n\n Run blm this way:\n\n $ blm --nit=20 --mag --gw --nk=16 --nkgw=8 --gmax=7.9 fe\n$cp actrl.fe ctrl.fe\n \n \n\n The switches do the following:\n\n \n • --nit=20 : sets the maximum number of iterations in lmf self-consistency cycle. \n Not required, the default (10 iterations) is about how many are needed are needed to make it self-consistent\n • --mag : tells blm that you want to do a spin-polarized calculation.\n • --gw : tells blm to prepare for a GW calculation. The effect is to make the basis set a bit larger\n than usual and sets the basis Hankel energies deeper than is needed for LDA. This is to make the basis short enough ranged so\n that the quasiparticlized self-energy Σ0 can be smoothly interpolated between k points.\n • --nk=16 : sets the k mesh. You must supply the mesh. \n We use a rather fine mesh here, because Fe is a transition metal with a high density-of-states near the Fermi level.\n • --nkgw=8 : the k mesh for GW. If you do not supply this mesh, it will use the lmf mesh.\n The self-energy varies much more smoothly with k than does the kinetic energy; 16 divisions is expensive and overkill.\n • --gmax=7.9 : Plane-wave cutoff. You must supply this number.\n It is difficult to determine in advance; however you can leave it out at first and run lmfa.\n You sometimes need to run lmfa twice anyway, since it may find some local orbitals and\n change the valence-core partitioning. (See the LDA tutorial for PbTe).\n \n\n Note: blm writes the input file template to actrl.fe,\nto avoid overwriting a the ctrl.fe, which you may want to preserve.\n\n #### Free atom density \n\n Generate the free atom density and copy the basis set information it generates to\nbasp.fe. See the PbTe tutorial\nfor further explanation.\n\n $ lmfa fe\n$cp basp0.fe basp.fe\n \n \n\n In this case no local orbitals were generated (inspect basp.fe for any PZ present).\nlmfa does not need to be run a second time.\n\n #### The Fe 4d state \n\n It turns out the high-lying Fe 4d state affects the GW potential slightly, enough to affect states near the Fermi\nlevel by 0.05-0.1 eV. It matters little in the LDA, unless very high accuracy is demanded. In contrast to the LDA,\nboth occupied and unoccupied states contribute to the GW self-energy. lmfa detects that a\nGW calculation is intended because of the token autobas_gw, and adjusts basp0.fe\naccordingly. Inspect this file. You should see the following\n\n  Fe RSMH= 1.561 1.561 1.017 1.561 EH= -0.3 -0.3 -0.3 -0.3 RSMH2= 1.561 1.561 1.017 EH2= -1.1 -1.1 -1.1 P= 4.738 4.538 3.892 4.148 5.102 PZ= 0 0 4.4\n \n \n\n PZ=0 0 4.5 adds a 4d local orbital to the basis.\n\n #### Self-consistency in the LDA \n\n\n Make the LDA density self-consistent:\n\n $ lmf fe > out.lmf\n
\n
\n\n

This step overlaps the atomic density taken from file atm.fe generated by lmfa,\ngenerates an output density, and iterates the until the input and output densities are the same (self-consistency).\n\n

lmf should converge in 12 iterations, with the self-consistency density in rst.fe.\nInspect save.fe:\n\n

h mmom=2.0619193 ehf=-2541.0404251 ehk=-2541.0266951\ni mmom=2.173571 ehf=-2541.0406411 ehk=-2541.0395501\n...\nc mmom=2.2003534 ehf=-2541.0405422 ehk=-2541.0405455\n
\n
\n\n

The first line prints what is obtained from the trial Mattheis construction that overlaps free atomic densities.\nThe moment gradually increases from 2.0 (the guessed moment) to 2.20.\n\n

At self-consistency, the Harris-Foulkes and Kohn-Sham total energies\nare nearly identical. (If they are not, something is wrong with the calculation!)\nNote that the magnetic moment (2.20 μB), is very close to the\nexperimental value.\n\n

#### LDA Energy bands

\n\n

In this section we compute the energy bands, which we will compare later with the QSGW result.\nFor this tutorial use symmetry lines given in the box below. Copy its contents\ninto syml.fe.\n\n

51   0   0   0      1   0   0             Gamma to H   (Delta)\n51   1   0   0     .5  .5   0             H to N       (G)\n51   0  .5  .5     .5  .5  .5             N to P       (D)\n51  .5  .5  .5      0   0   0             P to Gamma   (Lambda)\n0    0 0 0  0 0 0\n
\n
\n\n

To get the Fermi level corresponding to the density rst.fe without overwriting it, do:\n\n

$lmf fe --quit=band\n \n \n Note that the Fermi level is -0.000599, very close to the last iteration in the self-consistency cycle.\nYou can find this doing\n\n $ grep Fermi out.lmf\n
\n
\n\n

The Fermi level is saved in file wkp.fe. Make the energy bands with\n\n

$lmf fe --band:fn=syml\n$ cp bnds.fe bnds.lda\n
\n
\n\n

The latter command renames bnds.fe for future use.\n\n

### 2. QSGW calculation for Fe

\n\n\n

#### Setup: the GWinput file

\n\n

The GW codes require a separate GWinput file.\nCreate a template with:\n\n

$lmfgwd --jobgw=-1 --sigw --ib=1:9 ctrl.fe\n \n \n\n Switch --sigw makes small changes to file.ext in preparation to make the dynamical self-energy.\nIt isn’t necessary for the QSGW calculation of this tutorial, but it is needed for the follow-on tutorial that makes\ndynamical self-energy and interacting spectral functions.\n\n Switch --ib=1:9 is used in 1-shot GW mode. It isn’t relevant for this tutorial, but sets list of QP states for which\nthe dynamical self-energy is made in the dynamical self-energy tutorial.\n\n We are particularly interested in Fermi liquid properties, involving states near the Fermi surface. The raw GWinput\ntemplate will generate a reasonable self-energy, but the 3s and 3p core levels affect the Fermi surface enough that we need to treat\nthem at a little better level of approximation than the template gives you.\n\n Edit GWinput:\n\n $ nano GWinput\n
\n
\n\n

In the core part of the product basis you should see these lines:\n\n

  atom   l    n  occ unocc   ForX0 ForSxc :CoreState(1=yes, 0=no)\n    1    0    1    0    0      0    0    ! 1S *\n    1    0    2    0    0      0    0    ! 2S\n    1    0    3    0    0      0    0    ! 3S\n    1    1    1    0    0      0    0    ! 2P\n    1    1    2    1    0      0    0    ! 3P\n
\n
\n\n

With switches as given, no core level participates in the product basis, polarizability or self energy, except that the 3p is included in\nthe product basis (occ=1). For accurate description of the Fermi surface the 3s also needs to be included; moreover, both 3s and\n3p need to be included in the polarization (ForX0 and self-energy (ForSxc).\n\n

Caution: core levels are calculated indpendently of the valence levels, and there is a slight residual\nnonorthogonality that can cause problems if the core levels are too shallow. This can be a serious issue and a safer approach is to include\nthese levels in the valence through local orbitals, though in this case the levels are deep enough that the present treatment is adequate.\n\n

Change the 3s and 3p lines as follows:\n\n

  atom   l    n  occ unocc   ForX0 ForSxc :CoreState(1=yes, 0=no)\n  ...\n    1    0    3    1    0      1    1    ! 3S\n  ...\n    1    1    2    1    0      1    1    ! 3P\n
\n
\n\n

#### QSGW self-consistency

\n\n

Run the QSGW script as follows:\n\n

$rm mixm.fe\n$ lmgwsc --sym --metal --tol=1e-5 --getsigp fe > out.lmgwsc\n
\n
\n\n

or faster\n\n

$lmgwsc --mpi=6,6 --sym --metal --tol=1e-5 --getsigp fe > out.lmgwsc\n \n \n\n The QSGW cycle should complete in a couple of hours, after 9 iterations. When it is finished, do\n\n $ grep more out.lmgwsc\n
\n
\n\n

You should see the following:\n\n

    lmgwsc : completed iteration 0 of 999  more=T Mon Oct 31 09:05:33 GMT 2016 elapsed wall time 15.4m (0.3h) phpdl1\n    lmgwsc : iter 1 of 999  RMS change in sigma = 5.57E-03  Tolerance = 1e-5  more=T Mon Oct 31 09:22:09 GMT 2016 elapsed wall time 32.0m (0.5h) phpdl1\n    lmgwsc : iter 2 of 999  RMS change in sigma = 2.32E-03  Tolerance = 1e-5  more=T Mon Oct 31 09:38:12 GMT 2016 elapsed wall time 48.0m (0.8h) phpdl1\n    lmgwsc : iter 3 of 999  RMS change in sigma = 4.91E-04  Tolerance = 1e-5  more=T Mon Oct 31 09:54:15 GMT 2016 elapsed wall time 64.0m (1.1h) phpdl1\n    lmgwsc : iter 4 of 999  RMS change in sigma = 9.56E-04  Tolerance = 1e-5  more=T Mon Oct 31 10:11:04 GMT 2016 elapsed wall time 80.9m (1.3h) phpdl1\n    lmgwsc : iter 5 of 999  RMS change in sigma = 6.64E-04  Tolerance = 1e-5  more=T Mon Oct 31 10:28:16 GMT 2016 elapsed wall time 98.1m (1.6h) phpdl1\n    lmgwsc : iter 6 of 999  RMS change in sigma = 8.96E-05  Tolerance = 1e-5  more=T Mon Oct 31 10:45:00 GMT 2016 elapsed wall time 114.8m (1.9h) phpdl1\n    lmgwsc : iter 7 of 999  RMS change in sigma = 7.11E-05  Tolerance = 1e-5  more=T Mon Oct 31 11:01:18 GMT 2016 elapsed wall time 131.1m (2.2h) phpdl1\n    lmgwsc : iter 8 of 999  RMS change in sigma = 9.82E-06  Tolerance = 1e-5  more=F Mon Oct 31 11:18:00 GMT 2016 elapsed wall time 147.8m (2.5h) phpdl1\n
\n
\n\n

The self-consistent cycle ends when the RMS change in Σ0 falls below the\nspecified tolerance (–tol=1e-5).\n\n

#### QSGW Energy bands

\n\n

Σ0 is an effective non interacting potential with one-particle levels, similar to Hartree Fock or the LDA.\nThe band structure can be drawn in the same way as in the LDA. First, find the Fermi level:\n\n

$lmf fe --quit=band\n \n \n\n You should get a table like this one:\n\n  BZINTS: Fermi energy: 0.056498; 8.000000 electrons; D(Ef): 16.413\n Sum occ. bands: -0.6890437 incl. Bloechl correction: -0.000979\n Mag. moment: 2.269378\n \n \n\n The Fermi level is higher than in the LDA value (-0.000599); it suggests that the work function would be somewhat smaller.\nThe magnetic moment (2.27 μB) comes out slightly larger as well.\nA better converged QSGW calculation (calculating Σ0 with more k divisions) reduces\nthis value to about (2.2 μB), very similar to what the LDA gets.\n\n Generate the band structure, and copy the file to bnds.gw\n\n $ lmf fe --band:fn=syml\n$cp bnds.fe bnds.gw\n \n \n\n ### Compare QSGW and LDA energy bands \n\n At this point the LDA (bnds.lda) and QSGW (bnds.gw) energy bands should in your working directory,\ncontaining bands along four symmetry lines (Γ-H, H-N, N-P, and P-Γ).\nFor a brief description of the structure of these files, see here.\n\n Use the plbnds tool render both data sets into files\n(bnd[1234].lda) for the four panels of LDA bands, and\n(bnd[1234].gw) for the four panels of QSGW bands.\nThis tutorial will be concerned with the bands near the Fermi level.\nRestrict the range to EF±2 eV, and focus on the minority spin bands:\n\n echo -2,2 / | plbnds -wscl=1,.8 -fplot -ef=0 -scl=13.6 --nocol -dat=gw -spin2 bnds.gw\necho -2,2 / | plbnds -wscl=1,.8 -fplot -ef=0 -scl=13.6 --nocol -lbl=H,N,G,P,H,G -spin2 -dat=lda bnds.lda\n \n \n\n Each command generates a script (plot.plbnds), which fplot\nwill turn into postscript files. The script draws four frames, one for each symmety line.\n\n Here we adapt the second plot.plbnds,\nand create a new script plot.2bands that combines the bands from the two calculations\nin one figure. To distinguish bands the GW and LDA bands will be drawn respectively in red dots and blue dashed lines.\nfplot selects line type and colors with the -lt instruction.\n\n To make script use the same color in each frame, it is convenient to make use of the file preprocessor’s\nability to assign and use character variables. Execture the instructions in the box\nbelow. It creates a new file plot.2bands with character variables colr and colb. They contain strings\nthat modify line types, notably the color (see here for a quick reference).\n\n $ rm -f plot.2bands\n$echo \"% char0 colr=3,bold=5,clip=1,col=1,.2,.3\" >>plot.2bands\n$ echo \"% char0 colb=2,bold=4,clip=1,col=.2,.3,1\" >>plot.2bands\n
\n
\n\n

Next, append plot.plbnds to plot.2bands, adapt it to draw two kinds of bands in each frame, each with its own color.\nThis could be accomplished with a text editor, but it is convenient to accomplish it with an awk command:\n\n

$awk '{if ($1 == \"-colsy\") {sub(\"-qr\",\"-lt {colg} -qr\");sub(\"dat\",\"green\");sub(\"green\",\"gw\");sub(\"colg\",\"colr\");print;sub(\"gw\",\"lda\");sub(\"colr\",\"colb\");print} else {print}}' plot.plbnds >> plot.2bands\n
\n
\n\n

Compare plot.plbnds and plot.2bands.\n\n

$diff plot.plbnds plot.2bands\n \n \n\n Character variables are declared at the top. Each line in the script that draws bands has been split into two lines, one for bndn.lda with line type modifier {colb} and another for bndn.gw with line type modifier {colr}.\n\n After preprocessing the script will contain instructions explained in the fplot manual, e.g.\n-colsy 2:6, lt 3,…,\n and -qr. To see how the script appears after preprocessing, do\n\n $ rdfile plot.2bands\n
\n
\n\n

\n\n
$fplot -f plot.2bands\n$ open fplot.ps\n
\n
\n\n

QSGW makes substantial shifts relative to the LDA. The QSGW bands generated in this tutorial disagree somewhat with experiment, because the QSGW\npotential isn’t quite converged. When well converged, agreement with the available experimental data in the Fermi liquid regime is\nexcellent, though a considerable discrepancy with LDA remains.\n\n

\n\n
\n
1. \n

Tetrahedron vs sampling vs fermi function, and METAL modes\n \n

2. \n

Test the PBE functional\n \n

\n","dir":"/tutorial/gw/qsgw_fe/","name":"qsgw_fe.md","path":"pages/qsgw_fe.md","url":"/tutorial/gw/qsgw_fe/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Partial Densities of States and Core-Level Spectroscopy","permalink":"/tutorial/lmf/pdos/","auto":{"physical":"Partial DOS, EELS, and Core-level spectroscopy.","code":"lmf","info":"How to generate calculate total and partial densities of states, and core-level spectroscopy","priority":7000},"header":false,"content":"

This tutorial explains how to generate total and partial densities-of-states (DOS) with the Questaal package, using the\nband codes lmf, lm, and tbe.\nIt is demonstrated in the tutorial for the total DOS in Co. DOS can be decomposed\nin multiple ways. Questaal has two forms: projection onto partial waves in augmentation spheres\n(see demonstration for Cr3Si6), and by\nMulliken analysis. Partial wave and Mulliken decomposition are compared in the Fe tutorial.\n\n

Core-level spectroscopy [1] describes the excitation of an core electron, calculated by Fermi’s golden\nrule which involves the matrix element of the dipole operator with the core and valence wave functions. It is closely\nrelated to the partial DOS and is computed in much the same way, as described in the Fe\ntutorial. The CLS should be calculated in the presence of\na core hole, where the density redistributes. This is done in the CrN\ntutorial.\n\n

Other forms DOS that Questaal can calculate, but not described in this tutorial are:\n

\n
1. The Green’s function packages lmgf and\nlmpg compute partial DOS.\n
2. The DOS the is the independent-particle approximation to the\nspectral function. The spectral function for the\ninteracting case can be calculated in the GW framework, and also the DMFT framework. The noninteracting and\ninteracting forms are compared at the GW level in this\ntutorial.\n
3. The optics modes in the lmf and lm codes also enable you\nto resolve DOS in other forms\n
\n\n

\n\n
\n
1. Total DOS in Co\n
\n\n

Set up input file\n\n

blm --mag --ctrl=ctrl --wsitex --noshorten co\nlmfa --basfile=basp co\nblm --mag --ctrl=ctrl --wsitex --noshorten --gmax=8.5 --nk=-2000 co\n
\n
\n\n

Self-consistent density\n\n

lmfa --basfile=basp co\nlmf ctrl.co\n
\n
\n\n

Total Co dos\n\n

lmf ctrl.co --quit=dos --dos@npts=2001@window=-1,1\necho 5  8  -10  10 | pldos -esclxy=13.6 -ef=0 -fplot -lst=1 -lst2 dos.co\nfplot -pr10 -f plot.dos\nopen fplot.ps\n
\n
\n\n
\n
1. Partial DOS in Cr3Si6\n
\n\n

Set up input file and self-consistent density:\n\n

blm --loc=0 --mto=1 --ctrl=ctrl --wsitex  cr3si6\nlmfa --basfile=basp cr3si6\nblm --loc=0 --mto=1 --ctrl=ctrl --wsitex --gmax=7.1 --nk=-200 cr3si6\nlmfa --basfile=basp cr3si6\nlmf cr3si6\n
\n
\n\n

Partial DOS resolved by l\n\n

lmf cr3si6 -vnkabc=-5000 --quit=rho --pdos~mode=1~sites=1,4~lcut=2,1\nlmdos cr3si6 -vnkabc=-5000 --quit=rho --pdos~mode=1~sites=1,4~lcut=2,1 --dos:npts=1001:window=-1,1\necho 1.4 5 -8 6 | pldos -fplot~sh~long~open~tmy=.25~dmin=0.40~xl=E -esclxy=13.6 -ef=0 -lst=\"1;2;3;4;5;\" dos.cr3si6\nopen fplot.ps\n
\n
\n\n

Partial DOS resolved by l and m\n\n

rm mixm.cr3si6\nlmf cr3si6 --quit=rho --pdos~nl=3\nlmdos cr3si6 --dos:npts=1001:window=-1,1 --pdos~nl=3\necho .5 3 -6 6 | pldos -fplot~sh~long~open~tmy=.125~dmin=0.20~xl=E -esclxy=13.6 -ef=0 -lst=\"1;2,3,4;5;6;7;8;9;28;29:31\" dos.cr3si6\nopen fplot.ps\n
\n
\n\n
\n
1. DOS and Core-level Spectroscopy in Fe\n
\n\n

Set up input file and self-consistent density\n\n

blm --mag --ctrl=ctrl --wsitex --noshorten fe\nlmfa --basfile=basp fe\nblm --mag --ctrl=ctrl --wsitex --noshorten --gmax=8.3 --nk=16 --nit=20 fe\nlmfa --basfile=basp fe\nlmf ctrl.fe\n
\n
\n\n

Mulliken DOS\n\n

lmf fe --quit=rho -vso=f --mull~mode=2~nl=3\nlmdos fe -vso=f --mull~mode=2~nl=3 --dos:npts=1001:window=-.7,.8\ncp dos.fe dos-mull.fe\necho .5  5  -6 5 | pldos -esclxy=13.6 -ef=0 -fplot -lst=\"9;11;13;15;17\" -lst2 dos-mull.fe\nfplot -pr10 -f plot.dos\nopen fplot.ps\n
\n
\n\n

Partial DOS, and comparison to Mulliken DOS\n\n

lmf fe --quit=rho -vso=f --pdos~mode=2~nl=3\nlmdos fe -vso=f --pdos~mode=2~nl=3 --dos:npts=1001:window=-.7,.8\ncp dos.fe dos-pdos.fe\necho .999  6  -6 5 | pldos -esclxy=13.6 -ef=0 -fplot~ext=mull~dmin=.4~tmy=.25 -lst=\"1;3,5,7;9,11,15;13,17\" -lst2 dos-mull.fe\necho .999  6  -6 5 | pldos -esclxy=13.6 -ef=0 -fplot~ext=pdos~dmin=.4~tmy=.25 -lst=\"1;3,5,7;9,11,15;13,17\" -lst2 dos-pdos.fe\nawk '{if ($NF == \"dosp.pdos\") {print; sub(\"pdos\",\"mull\");sub(\"{ltdos}\",\"2,bold=3,col=1,0,0\");print} else if ($NF == \"dosp2.pdos\") {print; sub(\"pdos\",\"mull\");sub(\"{ltdos}\",\"2,bold=3,col=1,0,0\");print} else {print}}' plot.dos  > plot.dos2\nfplot -pr10 -f plot.dos2\nopen fplot.ps\n
\n
\n\n

Core-level spectroscopy\n\n

lmf fe --quit=rho --cls:1,1,2 -vmet=2 --dos:npts=1001:window=-.7,.8\nmv dos.fe tdos.fe\nlmdos --cls --dos:wtfn=cls:npts=1001:window=-.7,.8 fe\nmv dos.fe dos-cls.fe\ncatdos dos-cls.fe -s1/10 tdos.fe\necho  .5 10 -6 6 |  pldos -esclxy=13.6 -fplot -lst=\"1,3,5;7\" -lst2 dos.dat\nfplot -pr10 -f plot.dos\nopen fplot.ps\n
\n
\n\n
\n
1. Core-level spectroscopy in the presence of a core hole in CrN\n
\n\n

Set up self-consistent density\n\n

cp ~/lm/fp/test/ctrl.crn .\nlmfa gas\nmpirun -n 8 lmf crn -vnit=50\n
\n
\n\n

Core-level spectroscopy\n\n

mpirun -n 8 lmf --rs=1,0 --cls:5,0,1 -vnit=1 -vmetal=2 -vnk=8 crn\nlmdos --dos:cls:window=0,1:npts=1001 --cls crn -vnk=8\necho .25 8 0 1 | pldos -fplot -lst=\"1;3;5\" -lst2=\"2;4;6\" dos.crn\nfplot -disp -pr10 -f plot.dos\nopen fplot.ps\n
\n
\n\n

\n\n
\n

\n\n\n
\n

### Preliminaries

\n\n

This tutorial assumes you have cloned and built the Questaal repository (located\nhere). For the purpose of demonstration, ~/lm will refer to\ntop-level (source) directory of the cloned repository. In practice, this directory can be named differently. Questaal\nexecutables such lmf, lmdos, pldos,\nand catdos are required assumed to be in your path.\n\n

You will also need a postscript viewer.\nThis document assumes you are using the apple-style open command to view postscript files.\n\n

\n

### Introduction

\n\n

The density-of-states is given by a sum over states i as [2]\n\n\n\n

Band methods lmf, lm, and tbe\nwork in a different manner than the Green’s function methods, lmgf and lmpg. They can evaluate Eq. (1) directly by approximating the δ-function with a Gaussian\nfunction. This method (sometimes called gaussian sampling) is simple and safe but is\nslow to converge with k. Convergence can be greatly accelerated with Methfessel and Paxton’s polynomial\ngeneralization of the Gaussian, but it is more cumbersome than the\ntetrahedron method, which is also implemented in the band programs.\nWe use the tetrahedron method here.\n\n

This tutorial lmf to generate DOS, but lm and tbe perform similar functions.\n\n

Programs lm, lmf, and tbe have a facility to resolve, or decompose, the eigenfunction of\na particular eigenfunction into component parts. Note that an eigenstate is normalized:\n. Decomposition amounts to resolving the unit norm of the wave\nfunction in different ways. A myriad of ways are possible [3]:\nQuestaal offers two kinds, “partial waves” and “Mulliken analysis.” Core-level\nspectroscopy (rather closely related to the partial wave analysis), is also explained here.\n\n

#### Partial Waves

\n\n

The eigenfunction inside an augmentation sphere is given by solutions to the radial wave equation . The\nfull energy-dependence of is approximated by to linear\norder, expanded to first order in a Taylor series in energy.\nThus, inside an augmentation sphere there are two partial waves for a particular site R and angular momentum l\nthat contribute to the DOS: and the energy derivative\n. The (,) pair are assumed to\ncompletely span the hilbert space inside augmentation sphere R (unless there is an additional wave from a local\norbital). See this page for the definition of the lmf basis set.\n\n

Denoting the l and m quantum numbers by a compound index L, and labeling and\n respectively as and , the eigenfunction can\nbe projected onto an augmentation sphere centered at R as\n\n\n\n

denotes a projection onto augmentation sphere R, ranges from 0 to 1 (and if local\norbitals are present, encompasses them), up to the\naugmentation cutoff lmxa.\n\n

Coefficients (which is determined from a solution of the secular matrix) then\nrepresent a particular kind of decomposition of . Assuming the (, )\nbasis is complete, this decomposition is independent of basis set. However, it does depend on the augmentation\nradius. In sum Eq. (2) can be expressed in terms of the energy-dependent partial wave as\n\n\n\n

where is a linear combination of , (and possibly local orbitals) normalized so that\n.\n\n

The make up partial contributions to , Eq. (1). The contribution to from\na particular partial wave is well defined, positive and less than 1, since contributions from\nall partial waves at most sum to one and the interstitial also adds a positive a contribution.\n\n

Notes:\n\n

\n
1. \n

In the ASA, with space-filling spheres, the sum of partial waves comprises the total wave function, and the separate\ncontributions to sum to 1.\n \n

2. \n

tbe is not an augmented wave method; this kind of decomposition is not possible.\n \n

\n\n

#### Mulliken Analysis

\n\n

Mulliken analysis is a decomposition of an eigenfunction into the separate orbital contributions.\nThe eigenfunction is written as a linear combination of lmf basis functions\n\n\n\n\n

The are augmented smooth Hankel functions.\n\n

We can decompose through coefficients . In this case the\n are eigenvectors of the lmf hamiltonian: they diagonalize\nboth the hamiltonian and overlap. In matrix form\n\n\n\n

If the overlap matrix were diagonal, it is evident from Eq. (5) that the eigenvectors would satisfy\n.\nThe overlap is not diagonal; however there is a generalization\n\n\n\n

is a vector; there is one eigenvector for each of the components.\nThus is a square matrix that can be inverted.\n\n

The sum over components in Eq. (5) evaluates to 1 for a particular state , so we can\ndecompose or resolve the unit norm into separate elements, resolving by , and .\nDecomposition by is not so meaningful (lmf contracts over ;\nwhile lm and tbe only have a single ),\nbut resolving by or can offer a great deal of\nphysical insight. This decomposition is used to assign color weights in band plots. Examples can be found in the\nplbnds manual and in the lmf\nband plotting tutorial. How to do it in the partial dos context\nwill be shown below.\n\n

#### How information is assembled for analysis

\n\n

The following outlines the general procedure for making partial wave analysis. Steps are explained in more detail\nlater, in the examples.\n\n

Both Mulliken and partial pave analysis enable decomposition of the unit norm into partial contributions associated with\na particular site R and L=lm character. The band programs (lm, lmf, and tbe) will accumulate weights for a partial wave or Mulliken\nanalysis in the course of a usual band pass, by adding a\ncommand-line switch --pdos or --mull. Both switches have\nnumerous options that can select or group a subset of all states, to contract over m (leaving the resolution by R\nand l) or over both l and m, resolving by R only. This is described in more detail below. The band\nprogram will write a file moms.ext to disk with information about the partial decomposition.\n\n

With moms.ext in hand, run lmdos with exactly the same switch\n--pdos or --mull, including any modifiers. This should generate a file dos.ext\nwith the requisite information. By default this file will take traditional standard format\nfor DOS files; but you can change the format.\n\n

The pldos utility is designed to read DOS files, and select out or combined particular DOS,\nand either make a postscript file directly (for quick and dirty results) or format the data in easily read formats.\n\n

#### Notes on Partial wave and Mulliken analysis, and their relative merits

\n\n
\n
1. \n

Mulliken analysis has somewhat imprecise meaning, as the results are dependent on the user’s choice of basis.\nHowever, to the basis functions do resemble atomic orbitals, especially for d and f electrons, they are a useful\ntool.\n \n

2. \n

As noted above, partial wave analysis is approximately independent of basis, except for the choice of augmentation\nradius. As such, it is often preferable to Mulliken analysis.\n \n

3. \n

The Jigsaw Puzzle Orbital basis is very short ranged, so association with a particular\natomic orbital is more clear. The distinction between partial wave and Mulliken analysis will be much smaller.\n \n

4. \n

In the ASA, with space-filling spheres, the sum of partial waves comprises the total wave function, and the separate\ncontributions to sum to 1.\n \n

5. \n

lm typically generate the moments file moms.ext automatically as\npart of the band pass. However the moments are generated for inequivalent classes only; the weights are ordered by\nclass instead of by site. You can run lmpg after a band pass (without argument\n--pdos) to generate partial DOS for each class (typically resolved by l but not by m).\n \n

6. \n

tbe is not an augmented wave method; partial wave decomposition is not possible.\n \n

\n\n
\n

### Making total DOS using band programs lmf, lm, or tbe

\n\n

The simplest DOS is the total DOS/cell (not resolved into any components). This is automatically generated when you\nturn on  SAVDOS=T  in category  BZ. A band program (lmf, lm, or tbe) will generate DOS in a\nparticular energy window, on a uniform mesh of points.\n\n

Note: you can also cause lmf to generate dos using the\ncommand-line argument  --dos. Modifiers to this switch allow you to\ncontrol the energy mesh (and format) of the dos file.\n\n

\n\n

lmf will generate DOS in a particular energy window.\nTag BZ_DOS specifies the energy window, BZ_NPTS the number of points.\n\n

If BZ_DOS is specified in the input file, lmf will use the specified window.\nOtherwise lmf will select the window as follows.\nIt makes a rough estimate of the Fermi level from the first k point, subtracts  0.5 Ry from the first\neigenvalue, and adds  0.5 Ry to the estimate for the Fermi level.\n\n

However, if you further use the command-line switch --no-fixef0, default values are used. You can find them with\n

lmf --input | grep BZ_DOS\n
\n
\n\n

If BZ_NPTS is specified, it uses the specified value for the number of points. Otherwise it uses a default, which\nyou can find by invoking\n

lmf --input | grep BZ_NPTS\n
\n
\n\n

\n\n

lmf writes the DOS to dos.ext, normally in the traditional standard format for dos files.\nYou can reformat it yourself to use your favorite graphics package, or use pldos utility to format the dos into\nstandard Questaal format for two-dimensional arrays, which are more easily read by other\ngraphics packages.\n\n

At this stage, you can use your favorite graphics package to draw a figure from files dosp.dat and dosp2.dat. Alternatively pldos will have written an fplot script; you can immediately create a postscript file using\nfplot.\n\n

\n

### 1. Total DOS in elemental Co

\n\n

#### Building a Co input file

\n\n

Copy the contents of the box below into file init.co.\n\n

LATTICE\n% const a=4.730 c=7.690\n  ALAT={a} PLAT= 1.0 0.0 0.0 0.5 0.8660254 0.0 0.0 0.0 {c/a}\nSPEC\n   ATOM=Co   MMOM=0,0,1.6\nSITE\n   ATOM=Co X=0 0 0\n   ATOM=Co X=1/3 1/3 1/2\n
\n
\n\n

Construct the input file in the usual manner, see for example the Si tutorial or the PbTe tutorial:\n\n

blm --mag --ctrl=ctrl --wsitex --noshorten co\nlmfa --basfile=basp co\nblm --mag --ctrl=ctrl --wsitex --noshorten --gmax=8.5 --nk=-2000 co\n
\n
\n\n

The mesh density cutoff set by --gmax=8.5 can not be determined in advance, but a good value can be obtained from the\noutput of lmfa, as explained in the\nintroductory tutorials. blm is run\ntwice, once to set up lmfa, and again to set the final version of the input file, ctrl.co.\n\n

--nk=-2000 sets the number of k points. The negative value is a flag telling lmf to find a\nset of (n1,n2,n3) divisions of the reciprocal lattice such that the number of microcells\nn1×n2×n3 is approximately 2000, while rendering the microcells as close to\nequidimension as possible (Gi/ni as uniform as possible).\n2000 points makes a reasonably fine mesh, good enough to generate a reasonably smooth DOS with the tetrahedron method. Coarser\nmeshes will cause the dos to be much less smooth and this is especially severe if the integration is performed by simple\nsampling integration.\n\n

#### Self-consistent Co density

\n\n

Make the density self-consistent:\n\n

$lmfa --basfile=basp co\n$ lmf ctrl.co\n
\n
\n\n

You should get a reasonably self-consistent density in 10 iterations. The last line of the file save.ext should read\n\n

c mmom=3.1596775 ehf=-5564.3100279 ehk=-5564.310028\n
\n
\n\n

The magnetic moment/atom is then calculated to be 3.1596775/2, close to the experimental moment (1.6 μB).\n\n

#### Total DOS in Co

\n\n

Use the command line argument--dos \nto generate the total DOS with lmf:\n\n

$lmf ctrl.co --quit=dos --dos@npts=2001@window=-1,1\n \n \n\n --quit=dos tells lmf to stop after the dos is generated.\n\n Near the end of the standard output the following line should appear:\n  ... Generating total DOS\n \n \n\n The pldos utility will extract and reconfigure the contents of dos.co, saving the data in a more palatable format :\n \necho 5 8 -10 10 | pldos -esclxy=13.6 -ef=0 -fplot -lst=1 -lst2 dos.co\n ↑ ↑ ↑ ↑\n dmx ht emin emax\n \n\n pldos reads data in the\ntraditional dos file format the band codes normally use. It can make a\npostscript figure directly, or be used as a preparatory step for fplot or another graphics package. We do the latter here.\n\n pldos takes four arguments from standard\ninput:\n\n \n • dmx DOS upper bound in the figure\n • ht approximate height of figure, in cm\n • emin minimum energy to draw (left point of abscissa)\n • emax maximum energy to draw (right point of abscissa)\n \n\n Note: no interactive input is required from the command as written above.\nHowever, you can run pldos in an interactive mode by entering simply\npldos dos.co.\n\n Switches to pldos have the following effect:\n\n \n • −esclxy=13.6 scales the abscissa (energy) to convert it from Ry to eV,\n and the ordinate (dos) converting it from Ry−1 to eV−1.\n • −ef=0 Shift the abscissa, putting the Fermi energy at 0.\n • −fplot Set up input for fplot. This entails the following:\n \n 1. Create file dosp.dat for the spin-1 dos,\nwritten in the standard Questaal format for 2D arrays.\n 2. Create a corresponding file dosp2.dat for the spin-2 dos\n(applicable only to spin polarized cases). \n Note: The spin-2 dos are scaled by −1 to make it convenient for drawing the figure (see below).\n 3. Create an fplot script plot.dos\n \n \n • −lst=1 Select which channels in the dos file (dos.co) to combine for the majority spin. \n \n In this case there is only a single channel per spin; but when the dos is resolved into components there will be many.\n • −lst2 Select which channels in the dos file (dos.co) to combine for the second spin. \n \n −lst2 without arguments tells pldos to copy the list from -lst, incrementing\n each element by 1. \n \n Since (majority,minority) dos are interleaved, it simply generates the spin-2 channels counterpart to spin-1.\n • dos.co causes pldos to read DOS from dos.co,\n formatted in the way lmf usually writes dos files.\n \n\n The order of switches is not important, but the file name specifying DOS must come last.\n\n File dosp.dat contains the spin-1 dos (majority in this case), and dosp2.dat the negative of the spin-2 (minority) dos,\nwritten in Questaal’s standard 2D array format.\n\n Use your favorite graphics package to draw a figure from files dosp.dat and dosp2.dat.\nAlternatively, use fplot : pldos has already created a script\nplot.dos for fplot. Create a handsome picture with the following\n\n $ fplot -pr10 -f plot.dos\n$open fplot.ps\n \n \n\n \n\n The majority spin dos is shown above y=0, the minority spin below it. (Energy is on the x axis with the Fermi level\nat 0.) Co d bands dominate near the Fermi level EF: they form two broad peaks with the majority d\nfalling completely below EF and the minority d straddling it.\n\n \n\n Add this line to ctrl.co :\n\n BZ SAVDOS=t NPTS=2001 DOS=-1,1 NEVMX=999\n \n \n\n Copy the original dos.co to a backup and invoke lmf without a command-line argument\na\n mv dos.co dos.bk\nlmf ctrl.co --quit=dos\ndiff dos.co dos.bk\n \n \n\n The last line compares the two dos. There should be no difference.\n\n However, remove tag NEVMX=999 and remake the dos. Now a small difference appears near\n emax. lmf does not necessarily compute all the eigenvalues and eigenvectors. When\nNEVMX is present it specifies how many eigenfunctions to make. Now all eigenvalues are found since the rank of the\nhamiltonian is 36, much less than 999, and there is no loss.\n(Command line switch --dos also causes lmf\nto generate all the eigenvalues.)\n\n \n\n \n ### 2. Partial DOS in Cr3Si6 \n\n #### Input file and self-consistency in Cr3Si6 \n\n Cr3Si6 (AKA CrSi2) is a transition metal silicide with a small band gap\n[4], measured to be between 0.27 and 0.67 eV. The three Cr and six Si atoms are\nsymmetry-equivalent.\n\n To set up the computational conditions, copy the following box into init.cr3si6.\n\n # Init file for Cr3Si6\nLATTICE\n ALAT=8.37 PLAT= sqrt(3/4) -0.5 0.0 0.0 1.0 0.0 0.0 0.0 1.43369176\nSITE\n ATOM=Cr X= 1/2 1/2 -1/6\n ATOM=Cr X= 0 1/2 1/6\n ATOM=Cr X= 1/2 0 1/2\n ATOM=Si X= 1/3 1/6 1/6\n ATOM=Si X=-1/3 -1/6 1/6\n ATOM=Si X=-1/6 1/6 -1/6\n ATOM=Si X= 1/6 -1/6 -1/6\n ATOM=Si X= 1/6 1/3 1/2\n ATOM=Si X=-1/6 -1/3 1/2\n \n \n\n In this tutorial we will use a small, single-kappa basis. It is not\nnecessary, but it speeds up the calculation with minimal effect on the accuracy since the system is fairly\nclose-packed.\n\n The following steps up the input file and generate a self-consistent density.\nThe purpose for the first invocation of the (blm,lmfa) pair\nis solely to determine gmax:\n\n $ blm --loc=0 --mto=1 --ctrl=ctrl --wsitex  cr3si6\n$lmfa --basfile=basp cr3si6\n$ blm --loc=0 --mto=1 --ctrl=ctrl --wsitex --gmax=7.1 --nk=-200 cr3si6\n$lmfa --basfile=basp cr3si6\n$ lmf cr3si6\n
\n
\n\n
\n
• --loc=0 suppresses lmfa’s search\nfor deep lying states to be treated as local orbitals.\n
• --mto=1 specifies a single-kappa LMTO basis (minimal basis).\n
• --nk=-200 specifies a somewhat coarse k mesh of 7×7×4 divisions\n(24 inequivalent points)\n
• --ctrl=ctrl tells blm to write the input file directly ctrl.cr3si6.\n
• --wsitex tells blm to write the coordinates in the site as multiples of the lattice vectors,\nas they are in the init file.\n
• –basfile=basp tells lmfa to write the basp file directly to basp.cr3si6.\n
\n\n

When lmf’s completes execution you should find that the 10th and final iteration\nis (nearly) self-consistent with and RMS DQ=1.46e-5. You should find that the last line of\nfile save.cr3si6 is\n\n

x ehf=-9761.745587 ehk=-9761.7455858\n
\n
\n\n

#### Partial DOS in Cr3Si6 resolved by l

\n\n

Note: A figure for partial DOS similar to the one generated here is shown in the\npldos manual. Other features of the\n--pdos switch and switches to pldos are used there.\n\n

DOS can be decomposed by site R, by R and l within R, and by R and both l and m within R.\n\n

First, try using --pdos without any modifiers\n\n

$rm mixm.cr3si6\n$ lmf cr3si6 --quit=rho --pdos\n
\n
\n\n

At the beginning of the band pass you should see this line\n\n

 sumlst:  Partial DOS mode 2 (all sites lm-projected)  9 sites 171 channels\n
\n
\n\n

Each of the 9 sites will decomposed into DOS, resolved by both l and m. There is a grand total of 171 channels,\nbecause DOS are expanded to lmxa=4 for Cr (25 channels) and lmxa=3 for Si (16 channels), as the input file\nspecifies. This is overkill: l>2 for Cr and l>1 for Si is of limited interest.\nAlso, most often, it is not necessary to resolve each l into individual m components.\nHere we resolve DOS by l, leaving the m resolution to Further Exercises.\nSince the three Cr and six Si atoms should be equivalent by symmetry, we will generate l resolved DOS for only the first Cr (site\n1) and the first Si atom (site 4).\n(Symmetry is explored in more detail in Further Exercises.)\nRun this command:\n\n

$lmf cr3si6 -vnkabc=-5000 --quit=rho --pdos~mode=1~sites=1,4~lcut=2,1\n \n \n\n \n • -vnkabc=-5000 makes a much finer k mesh so that the DOS look smooth.\n • --quit=rho stops lmf after the DOS had been generated\n • --pdos~mode=1~sites=1,4~lcut=2,1 makes Cr DOS for l=0,1,2 and Si DOS for l=0,1 ; see command line options.\n \n\n Data is written into file moms.cr3si6.\n\n Next run lmdos. You must include the --pdos switch in exactly the same way \nyou ran lmf to make moms.cr3si6.\n\n $ lmdos cr3si6 -vnkabc=-5000 --quit=rho --pdos~mode=1~sites=1,4~lcut=2,1 --dos:npts=1001:window=-1,1\n
\n
\n\n

If you leave off the --dos switch\nyou will be prompted for three numbers that define the energy mesh (number of points, minimum and maximum energies).\n\n

lmdos should generate the following output:\n\n

 ASADOS: reading weights from file MOMS\n         expecting file to be resolved by l\n         file has 5 channel(s)\n         Using npts=1001  emin=-1  emax=1\n IOMOMQ: read 308 qp  efermi=0.163599  vmtz=0.000000\n
\n
\n\n

Don’t worry that the output refers to “ASADOS.” lmdos\nhandles both ASA and FP cases. lmdos exists \nwith a table showing how the panels are broken out:\n\n

 Channels in dos file generated by LMDOS:\n site class label   spin-1\n    1    1   Cr     1:3\n    4    2   Si     4,5\n
\n
\n\n

Generate a postscript file using pldos:\n\n

echo 1.4 5 -8 6 | pldos -fplot~sh~long~open~tmy=.25~dmin=0.40~xl=E -esclxy=13.6 -ef=0 -lst=\"1;2;3;4;5;\" dos.cr3si6\nopen fplot.ps\n
\n
\n\n

This makes 5 panels, corresponding to Cr s, p, d, and Si s and p.\n\n

The standard input tells pldos to:\n

\n
• limit the maximum DOS to 1.5 eV−1\n
• A panel should not exceed 5 cm\n
• DOS spans (−8,6) eV\n
\n\n

The -fplot switch tells pldos to:\n

\n
• create files and an input for the fplot(/docs/misc/fplot) utility\n
• Run -fplot in a subshell to generate the fplot.ps directly\n
• The other pldos command line switches modify the\nstyle of the figure.\n
\n\n

The remaining switches do the following\n

\n
• -esclxy=13.6 converts abscissa to eV and ordinate to eV−1\n
• -ef=0 puts the Fermi level at 0\n
• -lst=”1;2;3;4;5” creates 5 panels\n
\n\n

\n\n

\n\n

\n\n

The figure shows that there is a small gap, and that the DOS at the valence and conduction band edges are dominated by Cr d, with some\nSi p mixed in.\n\n

\n

### 3. DOS and Core-level Spectroscopy in Fe

\n\n

#### Input file and Self-consistent density in Fe

\n\n

Copy the following into init.fe.\nAs an initial guess, we use a trial moment of 2 μB.\n(Fe has a moment of 2.2 μB in the ground state).\n\n

LATTICE\n% const a=5.4235\n  ALAT={a} PLAT= 0.5 0.5 0.5   0.5 -0.5 0.5   0.5 0.5 -0.5\nSPEC\n   ATOM=Fe   MMOM=0,0,2\nSITE\n   ATOM=Fe X=0 0 0\n
\n
\n\n

Construct the input file.\nThe first two lines are present to determine a value for gmax.\n\n

$blm --mag --ctrl=ctrl --wsitex --noshorten fe\n$ lmfa --basfile=basp fe\n$blm --mag --ctrl=ctrl --wsitex --noshorten --gmax=8.3 --nk=16 --nit=20 fe\n \n \n\n Make the Fe density self-consistent:\n\n $ lmfa --basfile=basp fe\n$lmf ctrl.fe\n \n \n\n You should find that the at the last (11th) iteration the density\nis self-consistent with a magnetic moment of 2.23 μB.\n\n Note: the magnetic moment is not variational in the density, so the\nvalue is more sensitive to k convergence than the total energy.\nWith 13 divisions you should find a value of 2.168 μB;\nwith 24 divisions you should find a value of 2.218 μB.\n\n #### Mulliken analysis in Fe \n\n Here we perform Mulliken analysis. Use --mull~mode=0 to resolve by R only – not meaningful here since there is\nonly a single site; Use --mull~mode=1 to resolve by R and l. We use --mull~mode=2~nl=3 to resolve\nby both l and m, and limit the number of l to spd.\n\n $ lmf fe --quit=rho -vso=f --mull~mode=2~nl=3\n$lmdos fe -vso=f --mull~mode=2~nl=3 --dos:npts=1001:window=-.7,.8\n$ cp dos.fe dos-mull.fe\n
\n
\n\n

You should see this table just before lmdos exits:\n\n

 Channels in dos file generated by LMDOS:\n site class label   spin-1                       spin-2\n    1    1   Fe     1:17:2                       2:18:2\n
\n
\n\n

Spin channels are interleaved, so odd channels hold spin-1 (majority spin) and even channels minority spin Mulliken dos.\n\n

Draw a figure showing each of the 5 d channels\n\n

$echo .5 5 -6 5 | pldos -esclxy=13.6 -ef=0 -fplot -lst=\"9;11;13;15;17\" -lst2 dos-mull.fe\n$ fplot -pr10 -f plot.dos\n$open fplot.ps\n \n \n\n The figure is drawn with the convention that spin-1 DOS is shown above y=0, spin-2 DOS below it.\n\n \n\n Mulliken DOS are confined to a window of about (−4,3) eV. Note that the three and two states\nshould be identical. The former are xy, yz, and xz states, which correspond to orbitals 5,6,8 in Questaal’s\nordering, and the latter 3z2−1 and\nx2y2 states correspond to orbitals 7,9. With the interleaving of spins, the\nspin 1 states correspond to channels (9,11,15) and to channels (13,17) in dos-mull.fe. You can see that panels 1,2,4 appear identical, as do panels 3,5\n[5].\n\n \n\n lmf symmetrizes the Mulliken DOS by rotating each\nirreducible k point to all points in the star, so that the full Brillouin zone is used.\nThe DOS should be the same whether symmetry operations are used or not.\n\n To test to what extent this is actually the case, remake the DOS just calculated, but this time writing to an mcx-readable format:\n\n lmdos fe -vso=f --mull~mode=2~nl=3 --dos:npts=1001:window=-.7,.8:rdm\ncp dos.fe dos-mull-sym.fe\n \n \n\n Remake the DOS without symmetry operations:\n\n lmf fe --quit=rho -vso=f --nosym --mull~mode=2~nl=3\nlmdos fe -vso=f --nosym --mull~mode=2~nl=3 --dos:npts=1001:window=-.7,.8:rdm\ncp dos.fe dos-mull-nosym.fe\n \n \n\n Find the globally maximum change in DOS in any channel:\n\n mcx dos-mull-sym.fe dos-mull-nosym.fe -- -abs -max:g\n \n \n\n This shows that there are some numerical errors even in something that should be formally exact.\n\n For a visual comparison, try the following, which compare the minority-spin\nd channels with and without symmetry\n\n fplot -colsy 1+10:1+18:2 dos-mull-sym.fe -colsy 1+10:1+18:2 -lt 2,col=1,0,0 dos-mull-nosym.fe\nopen fplot.ps\n \n \n\n The list of columns (1+10:1+18:2) follows standard Questaal syntax for integer lists,\nand correspond to columns 11,13,15,17,19 (in this format columns are shifted by one to accommodate the energy in the first column.)\n\n The red and black curves should be nearly identical. Also the three and two states\nshould be identical. Visually inspect the difference in the states\nas follows:\n\n $ fplot -colsy 11 dos-mull-sym.fe -lt 2,col=1,0,0 -colsy 13 dos-mull-sym.fe -lt 3,col=0,1,0 -colsy 17 dos-mull-sym.fe\n$open fplot.ps\n$ fplot -y 0,10 -colsy 15 dos-mull-sym.fe -lt 2,col=1,0,0 -colsy 19 dos-mull-sym.fe\n$open fplot.ps\n \n \n\n \n\n \n\n The wave function rotator has not yet been implemented in the noncollinear case [5].\nTo see the effect of SO coupling, the original calculation (without SO coupling) must be run without symmetry operations\nto compare against the result with SO coupling:\n\n The following steps accomplish this:\n\n lmf fe --quit=rho -vso=f --nosym --mull~mode=2~nl=3\nlmdos fe -vso=f --nosym --mull~mode=2~nl=3 --dos:npts=1001:window=-.7,.8:rdm\ncp dos.fe dos-mull-noso.fe\n\nlmf fe --quit=rho -vso=t --nosym --mull~mode=2~nl=3\nlmdos fe -vso=t --nosym --mull~mode=2~nl=3 --dos:npts=1001:window=-.7,.8:rdm\ncp dos.fe dos-mull-so.fe\n \n \n\n Without spin orbit coupling, the xy and xz DOS should be identical.\nBut SO coupling reduces the symmetry and this is no longer the case. Make the following figure:\n\n $ fplot -frme 0,1,0,.7 -frmt th=3,1,1 -colsy 11 dos-mull-noso.fe -colsy 11 -lt 2,col=1,0,0 dos-mull-so.fe -colsy 13 -lt 3,col=0,1,0 dos-mull-so.fe\n
\n
\n\n

\n\n

It draws the xy without SO in black, the xy with SO in red, and the xz with SO as a dotted green line.\nYou can see how SO modifies the xy orbital. SO modifies the xz orbital in a similar, but\nslightly different manner, owing to the reduction in symmetry.\n\n

\n\n

#### Partial DOS in Fe

\n\n

The partial DOS proceeds in much the same way as Mulliken analysis just presented.\n\n

lmf fe --quit=rho -vso=f --pdos~mode=2~nl=3\nlmdos fe -vso=f --pdos~mode=2~nl=3 --dos:npts=1001:window=-.7,.8\ncp dos.fe dos-pdos.fe\n
\n
\n\n

You can draw the partial DOS in the same manner as the Mulliken DOS. In the steps below we combine\nthe two so the similarities and differences can be compared.\n\n

$echo .999 6 -6 5 | pldos -esclxy=13.6 -ef=0 -fplot~ext=mull~dmin=.4~tmy=.25 -lst=\"1;3,5,7;9,11,15;13,17\" -lst2 dos-mull.fe\n$ echo .999  6  -6 5 | pldos -esclxy=13.6 -ef=0 -fplot~ext=pdos~dmin=.4~tmy=.25 -lst=\"1;3,5,7;9,11,15;13,17\" -lst2 dos-pdos.fe\n$awk '{if ($NF == \"dosp.pdos\") {print; sub(\"pdos\",\"mull\");sub(\"{ltdos}\",\"2,bold=3,col=1,0,0\");print} else if ($NF == \"dosp2.pdos\") {print; sub(\"pdos\",\"mull\");sub(\"{ltdos}\",\"2,bold=3,col=1,0,0\");print} else {print}}' plot.dos > plot.dos2\n$ fplot -pr10 -f plot.dos2\n$open fplot.ps\n \n \n\n The first command makes four panels consisting of , , and Mulliken\nchannels; the second does the same for partial wave decomposition. awk combines the two\nkinds of data to make a single fplot script, plot.dos2.\nfplot creates the postscript figure.\n\n \n\n Mulliken and partial wave analysis show modest differences in the and channels, while the channels are nearly identical.\n\n #### Core-level spectroscopy in Fe \n\n Tell lmf to compute EELS, (also called core-level spectroscopy) by adding\n--cls to the command-line. This switch acts in a manner roughly similar to the\n--mull and --pdos switches. In the CLS case, matrix element\n of the core level with the valence states are calculated, and the number of\nchannels is the number of core-level states. The weights file is written to cls.fe, and\nincludes the matrix element.\n\n You must specify a particular core level. There are several ways to do it.\nHere we consider the excitation from the 2p level, which can be specified as\n --cls:1,1,2 for atom 1, l=1, n=2.\n\n Run the following to simultaneously generate cls.fe\n(--cls) for CLS and the total dos (--dos).\nThe two will be compared later.\n\n $ lmf fe --quit=rho --cls:1,1,2 -vmet=2 --dos:npts=1001:window=-.7,.8\n$mv dos.fe tdos.fe\n \n \n\n The --cls tag requires BZ_METAL=2 or BZ_METAL=3.\n\n The second command renames the file containing the total DOS, since that\nfile will be overwritten CLS.\n\n You should see a table of matrix elements printed just before lmf exits\n\n  CLS atom 1 (Fe) n=2 l=1\n Spin 1 ..\n vcdmel: ecor0=-50.757934 ecore=-50.757934\n (not including electrostatic potential shift)\n l <u|core> <s|core> <u|r|core> <s|r|core>\n 0 0.013933 -0.008083 -0.037621 0.018932\n 1 -0.000471 0.000136 -0.057507 0.014659\n ...\n \n \n\n Make the CLS and rename the file:\n\n $ lmdos --cls --dos:wtfn=cls:npts=1001:window=-.7,.8 fe\n$mv dos.fe dos-cls.fe\n \n \n\n lmdos converts the cls weights into k-integrated spectra in much\nthe same way it converts the moms into DOS. You must supply lmdos\nwith a switch telling it that this is a CLS calculation and also tell it to read data from file cls.\n\n cls.fe should contain three channels per spin for x, y, and z.\nConcatenate it and the DOS into a single file. They have different units,\nso the latter is scaled by 1/10 to make them about the same size:\n\n $ catdos dos-cls.fe -s1/10 tdos.fe\n
\n
\n\n

catdos concatenates the two DOS, writing the\noutput to file dos.dat with 8 channels.\nThe first 6 channels are the CLS, the last two are the total DOS.\n\n

Draw two panels, one with the three CLS combined and the other with DOS\n\n

$echo .5 10 -6 6 | pldos -esclxy=13.6 -fplot -lst=\"1,3,5;7\" -lst2 dos.dat\n$ fplot -pr10 -f plot.dos\n$open fplot.ps\n \n \n\n The two panels look very similar.\n\n \n\n \n Notes:\n \n \n 1. the final state is better described in terms the self-consistent density in the presence\nof a core hole (sudden approximation). In other words, you should compute the matrix elements with the core partially\noccupied. We ignore that step here, but see this tutorial.\n 2. the m resolved CLS should be calculated without symmetry operations, since the\ncode does not rotate irreducible k points to the star of k [4] for CLS.\nSee Further exercises.\n \n \n \n\n \n ### 4. Core-level spectroscopy in the presence of a core hole in CrN \n\n EELS, also known as core-level spectroscopy, involves the excitation of a core electron to an excited state. In this\ntutorial we demonstrate core-level spectroscopy for the N 1 state, in CrN [5].\n\n The self-consistent calculation proceeds with an electron missing from the N 1 core, which corresponds to the ‘sudden\napproximation’ (system relaxes instantaneously from electron ejected out of a core hole).\n\n #### CrN input file \n\n The electron should be ejected from a single, isolated N atom. We must use periodic boundary conditions,\nso we simulate it with a supercell of 4 N atoms, with one (Nh) differentiated as having a core hole.\n\n This tutorial uses an already-built file from the source directory ~/lm.\nThis file is essentially similar to the input used in Ref [5].\nA tutorial detailing the steps required to generate a basic input file can be found here.\n\n $ cp ~/lm/fp/test/ctrl.crn .\n
\n
\n\n

Inspect ctrl.crn, and note in particular this line in species Nh:\n\n

  C-HOLE=1s C-HQ=-1,-1\n
\n
\n\n

These tags tell lmf to fractionally occupy the Nh state, with\none missing electron and a magnetic moment of −1.\n\n

#### Self-consistent density in CrN

\n\n

This test runs a little slowly, so we use lmf in the MPI mode.\nIf you only have the serial mode installed, just remove mpirun 8.\n\n

$lmfa gas\n$ mpirun -n 8 lmf crn -vnit=50\n
\n
\n\n

In the output of lmfa, the part concerning Nh, you should see a table like this:\n\n

 Species Nh:  Z=7  Qc=1  R=1.800000  Q=0  mom=-1\n mesh:   rmt=1.800000  rmax=23.783012  a=0.03  nr=223  nr(rmax)=309\n         Add core hole:  kcor=1  lcor=0  qcor=-1  amom=-1\n  Pl=  2.5     2.5     3.5     4.5     spn 2   2.5     2.5     3.5     4.5\n  Ql=  1.0     2.0     0.0     0.0     spn 2   1.0     2.0     0.0     0.0\n\n
\n
\n\n

The core charge has only one electron; the net magnetic moment of the system is −1 because the core hole has a\nmagnetic moment.\n\n

lmf also indicates that a core hole is present. These lines of its output:\n\n

 site  5  z=  7.0  rmt= 1.80000  nr=223   a=0.030  nlml=16  rg=0.450  Vfloat=T\n core hole:  kcor=1  lcor=0  qcor=-1  amom=-1\n
\n
\n\n

indicate that the core hole is present on atom 5 with principal and l quantum numbers 1 and 0, respectively.\n\n

lmf should converge to self-consistency in 32 iterations and terminate with the following:\n\n

c nit=50 mmom=-.775742 ehf=-8797.2800063 ehk=-8797.2800322\n
\n
\n\n

#### Core-hole spectroscopy

\n\n

You must specify a particular core level, which can be done in several ways.\nFor CLS of the state on Nh (the fifth atom), do:\n\n

mpirun -n 8 lmf --rs=1,0 --cls:5,0,1 -vnit=1 -vmetal=2 -vnk=8 crn\nlmdos --dos:cls:window=0,1:npts=1001 --cls crn -vnk=8\n
\n
\n\n

lmf makes weights and stores dos decorated by matrix elements in cls.crn.\nSome matrix elements are printed just before lmf exits:\n\n

 CLS atom 5 (Nh) n=1 l=0\n Spin 1 ..\n vcdmel: ecor0=-29.419700 ecore=-29.419695\n (not including electrostatic potential shift)\n   l   <u|core>     <s|core>    <u|r|core>  <s|r|core>\n   0   -0.000090   -0.000273    0.086293   -0.081045\n   ...\n
\n
\n\n

lmdos converts cls.crn weights into k-integrated spectra.\nYou must supply lmdos with a switch telling it that this is a CLS calculation and also tell\nit to read data from file cls\ncls.crn. This file should contain three channels per spin.\nConvert the result into a more convenient form using the pldos utility:\n\n

$echo .25 8 0 1 | pldos -fplot -lst=\"1;3;5\" -lst2=\"2;4;6\" dos.crn\n \n \n\n It generates dosp.dat, easily read by standard graphics packages, and a script plot.dos file readable by the fplot graphics package in particular.\nMake and view a postscript figure of the CLS DOS:\n\n $ fplot -disp -pr10 -f plot.dos\n$open fplot.ps\n \n \n\n \n ### Further exercises \n\n \n 1. This exercise picks up on Partial DOS in Cr3Si6 resolved by l,\nbut now resolving DOS by both l and m.\n \n\n Run lmf again, this time globally limiting the maximum number of l’s to 3 at any site.\nThis time we compute DOS for all 9 sites. The number of channels should be 81:\n\n $ rm mixm.cr3si6\n$lmf cr3si6 --quit=rho --pdos~nl=3\n$ lmdos cr3si6 --dos:npts=1001:window=-1,1 --pdos~nl=3\n
\n
\n\n

Here is the breakdown of channels:\n\n

 Channels in dos file generated by LMDOS:\n site class label   spin-1\n    1    1   Cr     1:9\n    2    1   Cr     10:18\n    3    1   Cr     19:27\n    4    2   Si     28:36\n    5    2   Si     37:45\n    6    2   Si     46:54\n    7    2   Si     55:63\n    8    2   Si     64:72\n    9    2   Si     73:81\n
\n
\n\n

While the three Cr and six Si atoms should be equivalent by symmetry, the orbitals of a given l transform into\none another for the different sites. The sum over all m for a particular l should be the same for symmetry\nequivalent atoms, but any particular m may look different.\n\n

The following steps combine the 5 Cr d orbitals on each atom, into three panels (panel 1 for the first Cr,\npanel 2 for the second Cr, panel 3 for the third Cr). Then we can check to see how well this invariance is kept.\n\n

$echo 40 5 -.5 .5 | pldos -ef=0 -fplot -lst=\"5:9;14:18;23:27\" dos.cr3si6\n \n \n\n This sets up DOS in three panels. --lst tells lmdos which\nDOS to combine into a single data set, and how many data sets to make.\nIt uses “;“ as a separator to tell lmdos to\nstart a new data set. Each data set gets its own panel.\nDOS in channels 5:9, 14:18, and 23:27 are each added together to create DOS respectively for the first, second, and third panels.\nNote from the table above that these channels correspond to d orbitals for the first, second and third Cr atoms.\n\n DOS is drawn on a Ry energy scale in this case. pldos creates a data\nfile dosp.dat in the\nstandard Questaal format for two-dimensional\narrays. pldos also generates a script file plot.dos readable by\nfplot.\nTo see a picture do:\n\n $ fplot -pr10 -f plot.dos\n$open fplot.ps\n \n \n\n You can compare directly the last three columns in dosp.dat,\nto check how similar they are. This is easily accomplished with the\nmcx calculator:\n\n $ mcx dosp.dat -e2 x2-x3 x2-x4\n
\n
\n\n

The differences are much smaller than the dos itself; but evidently there is some difference.\nThis is largely an artifact of incomplete k convergence. Repeat the calculation with more k points\n\n

lmf cr3si6 --quit=rho --pdos~nl=3 -vnkabc=-1000\nlmdos cr3si6 --dos:npts=1001:window=-1,1 --pdos~nl=3 -vnkabc=-1000\necho 40 5 -.5 .5 | pldos -ef=0 -fplot -lst=\"5:9;14:18;23:27\" dos.cr3si6\nmcx dosp.dat -e2 x2-x3 x2-x4\n
\n
\n\n

and the error becomes much smaller.\n\n

The Co orbital (the d orbital) also should not depend on the Cr atom. This orbital is the middle one (7 for\nCr1, 16 for Cr2, 25 for Cr3). Do the following:\n\n

$echo 20 5 -.5 .5 | pldos -ef=0 -fplot -lst=\"7;16;25\" dos.cr3si6\n$ fplot -pr10 -f plot.dos\n$open fplot.ps\n \n \n\n The three panels should look nearly identical.\n\n The following creates a figure with the following panels:\n\n \n • The s Co orbital (first atom)\n • The sum of Co p orbitals (first atom)\n • The 5 Co d orbitals, each given its own panel (first atom)\n • The Si s orbital (fourth atom)\n • The sum of Si p orbitals (fourth atom)\n \n\n This makes a grand total of 9 panels.\n\n The command below sets up figure in eV units.\n\n echo .5 3 -6 6 | pldos -fplot~long~open~tmy=.125~dmin=0.20~xl=E -esclxy=13.6 -ef=0 -lst=\"1;2,3,4;5;6;7;8;9;28;29:31\" dos.cr3si6\n \n \n\n Modifiers to the −fplot switch alter plot.dos,\nto “prettify” the figure when fplot generates it.\nTo see what they do, run pldos with no arguments.\n\n Make and display a postscript figure:\n\n fplot -pr10 -f plot.dos\nopen fplot.ps\n \n \n\n You should see a figure like the one shown below.\n\n \n\n The first and second panels (Cr s and p) show very little DOS near the Fermi level. Panels 3 through 7 show the\nfive Cr d DOS; they dominate the electronic structure near the Fermi level (shown by the blue dot-dashed line). The\nSi p also makes a significant contribution.\n\n From an aesthetic perspective, the autogenerated script plot.dos makes a reasonable figure but\nsome tweaking is needed.\n \n • number labelling for adjacent panels collide with each other. This\ncan easily be rectified by editing plot.dos and making a global change dmax=0.5 →\ndmax=0.499.\n • \n Labels are needed and the energy axis label (-xl E) needs some improvement. Try one of:\n\n -xl '&\\{E} (eV)'\n-xl \"~\\{w} (eV)\"\n-lbl 3.8,-.25 rd '~\\{w} (eV)'\n \n \n \n \n\n \n 1. \n For Cr3Si6, try improving the basis and see the effect on the DOS.\nRemove switches --loc=0 --mto=1 from the command line when running blm.\n \n 2. \n The x, y and z components of the CLS in Fe should be equivalent, but they are not,\nbecause wave functions are not rotated [5].\n\n Rerun the calculation suppressing symmetry operations (lmf --nosym and \n lmdos --nosym) and confirm that they are essentially identical. Try also the CrN case. There the\nsymmetry operations have no effect.\n \n \n\n \n ### References \n\n \n 1. \n A. T. Paxton, M. van Schilfgaarde, M. MacKenzie and A. J. Craven,\nThe Near-edge Structure in Energy-Loss Spectroscopy:\nMany-Electron and Magnetic Effects in Transition Metal Nitrides\nand Carbides,’’ J. Phys. Cond. Mat.12, 729 (2000).\n \n 2. \n Equation (1) only applies to noninteracting effective hamiltonians. In the interacting case the δ-function\ngets broadened, as described in this tutorial. It is similarly broadened\nin the Coherent Potential Approximation.\n \n 3. \n One decomposition of the DOS is to resolve the charge density by energy, or just evaluate the charge density for a\nsingle state. We do not consider such a decomposition in this tutorial.\n \n 4. \n 5. \n That the Fe xy, xz, and yz DOS come out the same is non-trivial. To resolve DOS by m the full Brillouin zone\nmust be used. lmf rotates the eigenstate at an irreducible\npoint in the Brillouin to each point in the star of k, to accumulate partial DOS.\n \n \n\n","dir":"/tutorial/lmf/pdos/","name":"tut_density-of-states.md","path":"pages/tut_density-of-states.md","url":"/tutorial/lmf/pdos/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"QSGW calculations for ErAs starting from LDA+U","permalink":"/tutorial/gw/ldau_eras/","auto":{"code":"gw","physical":"LDA+U and QSGW","info":"How to perform a QSGW calculation for ErAs, starting from an LDA+U calculation."},"header":false,"content":" This tutorial presents an LDA+U calculation for ErAs\nThe LDA provides a very poor description of the Er f states\n(a large number of them are clustered at the Fermi level).\nIt is followed QS_GW_ calculation, using LDA+U as the starting point.\n\n The tutorial starts under the heading “Tutorial”; you can see a synopsis of the commands by clicking on the box below.\n\n Note: this page is under construction.\n\n \n\n blm --nit=20 --nk=6 --gmax=9 --mag --gw eras\nnano actrl.eras\ncp actrl.eras ctrl.eras\nlmfa eras\nmpix -np=16 lmf-MPIK ctrl.eras -vnit=20\nmpix -np=16 lmf-MPIK ctrl.eras -vnit=1 --rs=1,0 -vldau=t eras\nrm mixm.eras\nmpix -np=16 lmf-MPIK ctrl.eras -vnit=20 -vldau=t eras\nlmfgwd ctrl.eras -vnit=1 -vumix=1 -vldau=t --job=-1\nnano GWinput\n \n \n\n \n\n ### Table of Contents \n \n\n #### Input file setup \n\n Eras forms in the rocksalt structure with a lattice constant 5.408 a0\nand a magnetic moment of 3 μB.\nTo stabilize a nonzero magnetic moment the symmetry must be broken, so we supply\na trial moment of 3μB on the f channel.\n\n Cut and paste the contents in the box below into init.eras.\n\n # Init file for antiferromagnetic ErAs\n# blm --nit=20 --nk=6 --gmax=9 --mag --gw eras\nLATTICE\n ALAT=10.83\n PLAT= 0.5 0.5 1.0 0.5 1.0 0.5 1.0 0.5 0.5\nSPEC\n ATOM=Er MMOM=0,0,0,3 PZ=0 0 0 5.5 # Trial spin moment on the f channel\n ATOM=Er2 MMOM=0,0,0,-3 PZ=0 0 0 5.5 # Trial spin moment on the f channel\nSITE\n ATOM=Er POS= 0.0 0.0 0.0\n ATOM=Er2 POS= 1.0 1.0 1.0\n ATOM=As POS= 0.5 0.5 0.5\n ATOM=As POS= 1.5 1.5 1.5\n \n \n","dir":"/tutorial/gw/ldau_eras/","name":"tut_ldau_gw_eras.md","path":"pages/tut_ldau_gw_eras.md","url":"/tutorial/gw/ldau_eras/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Molecular Statics in Se","permalink":"/tutorial/lmf/molstat/","auto":{"code":"lmf","info":"Using lmf to relax internal coordinate in Se.","priority":5100},"header":false,"content":" \n\n This tutorial demonstrates how to carry out lattice relaxations of basis positions\nin lmf, by finding the equilibrium positions\n(molecular statics). It uses elemental Se as a representative material.\n\n \n ### Table of Contents \n\n\n \n ### Command summary \n\n \n\n LDA self-consistency (starting from init.fe)\n\n nano init.se\nblm --ctrl=ctrl --pbe --gmax=5.4 --nk=6 --wsitex=site --molstat init.se\nlmchk se --shell --angles\nlmfa se --basfile=basp\nlmf se\nlmf se -vminx=t --wpos=pos\nlmchk se --rpos=pos --angles\n \n \n\n \n\n \n ### Introduction \n\n Se and Te crystallize in the same hexagonal structure, which has atoms per cell. The Se (Te) s state is very deep and\nparticipates only weaking in the bonding. Each atom has three neighbors at approximately 90o angles. This\nallows each of the three p orbital to form strong covalent bonds with each of its neighbors. Thus this system may be\nconsidered as a covalently bonded spn bonded semiconductor, with n→∞.\n\n The angle between Se atoms is not given by symmetry; it is approximately 90o, but not exactly so. Thus there\na degree of freedom in the site positions not determined by symmetry. This tutorial uses molecular statics to find the\nminimum-energy value of this free parameter.\n\n \n ### Tutorial \n\n #### 1. Building the input file \n\n For the structure, copy in the contents of the box below into file init.se.\nNote the parameter u is the undetermined parameter the molecular statics algorithm\nwill find by minimizing the energy.\n\n # Se and Te structures. From Wyckoff pg. 36. Space group D_3^4 (C3(_1)21).\n% const se=t\n% ifdef se # For SE\n% const a=8.234 cbya=1.136 u=.217\n% char nam=Se\n% else # For Te\n% const a=8.406 cbya=1.330 u=.269\n% char nam=Te\n% endif\n\nLATTICE\n ALAT={a} PLAT= 1 0 0 -0.5 sqrt(3)/2 0 0 0 {cbya}\n# This one is for Bi2Te3\nSITE\n ATOM={nam} X= {u} 0.000 0\n ATOM={nam} X= -{u} -{u} 1/3\n ATOM={nam} X= 0.000 {u} 2/3\n \n \n\n We will use the PBE functional. Enter the following command:\n\n $ blm --ctrl=ctrl --pbe --wsitex=site --molstat init.se\n
\n
\n\n

Switches have the following meaning:\n\n

\n
• --ctrl=ctrl   Tells blm to write directly to the actual input file ctrl.se.\n By default it writes to actrl.ext so as not to overwrite the input file.\n
• --pbe     Use the PBE functional\n
• --wsitex=site  Write the site file with site positions expressed in units of PLAT\n
• --molstat   Set up a category for molecular statics; see below\n
\n\n

There are two quantities you must supply yourself,\n GMAX  and the k-point mesh.\nFor the former, lmfa can\ndetermine GMAX  for you\nonce the basis set is known. Since lmfa also supplies\na basis set provided\n HAM_AUTOBAS_LMTO is appropriately set, it will knows what the basis set is\nand tell you what GMAX  should be.\nDo the following\n\n

$lmfa se\n \n \n\n At the end of the standard output you should find\n\n  FREEAT: estimate HAM_GMAX from RSMH: GMAX=5.4\n \n \n\n This tells you what GMAX to use. For the k mesh, we will use 6 k divisions\n(216 points in the full Brillouin zone).\nRerun both blm and lmfa,\nnow specifying these numbers and also telling\nlmfa\nto write the basis set directly to the basp.se.\nBy default it writes to basp0.ext so as not to overwrite\nwhatever is already present.\n\n $ blm --ctrl=ctrl --pbe --gmax=5.4 --nk=6 --wsitex=site --molstat init.se\n$lmfa se --basfile=basp\n \n \n\n --molstat \nhas the effect of adding the following category to the input file:\n\n % ifdef minx\nDYN MSTAT[MODE=6 HESS=t XTOL=.001 GTOL=0 STEP=.010 NKILL=0] NIT=10\n% endif\n \n \n\n This line will be parsed only if variable minx is\ndefined with a nonzero value.\n\n ##### 1.1 bond lengths and angles \n\n To confirm the that bond angles are approximately 90o\nangles, run lmchk with the\nfollowing switches\n\n $ lmchk se --shell --angles\n
\n
\n\n

You should see this table for bond pairs:\n\n

 Shell decomposition for class Se        class   1  z=34\n shell   d     nsh csiz  class ...\n   1  0.000000   1    1  1:Se\n   2  0.533531   2    3  1:Se(2)\n   3  0.796025   4    7  1:Se(4)\n   4  0.845471   2    9  1:Se(2)\n   5  1.000000   6   15  1:Se(6)\n   ...\n
\n
\n\n

This establishes that there are three NN bonds. For bond angles,\nthis table should appear\n\n

 Bond angles for site 1, species 1:Se\n shl1    d1    shl2    d2     cl1      cl2       angle(s) ...\n   1  0.533531   1  0.533531  Se       Se        104.81\n   1  0.533531   2  0.796025  Se       Se         95.52   95.52   99.86  159.67\n   ...\n
\n
\n\n

Angles between the NN Se atoms is somwhat larger 105o, somewhat\nlarger than the simple nearest-neighbor tight-binding model would suggest.\n\n

#### 2. Self-consistency

\n\n

Make the system self-consistent with:\n\n

$lmf se\n \n \n\n If you have compiled it in parallel mode you can do it a bit faster, e.g.\n\n $ mpirun -n 6 lmf se\n
\n
\n\n

lmf should converge to self-consistency in 9 iterations.\n\n

You should see this table at the end:\n\n

 Forces, with eigenvalue correction\n  ib           estatic                  eigval                    total\n   1  970.90    0.00    0.00  -917.24    0.00    0.00    53.67    0.00    0.00\n   2 -485.45 -840.83    0.00   458.62  794.35    0.00   -26.83  -46.47    0.00\n   3 -485.45  840.83    0.00   458.62 -794.35    0.00   -26.83   46.47    0.00\n Maximum Harris force = 53.7 mRy/au (site 2)  Max eval correction = 5.8\n
\n
\n\n

The forces are all equal in magnitude, but rotated by 120o angles.\n\n

Note:\nUnlike the total energy forces are not variational in the density;\nthus they are more difficult to converge.\n\n

\n\n

That is, the forces do not converge to their self-consistent value\nas , where and are\nthe current and self-consistent densities. Rather it converges as\n. However, an estimate for the correction can be performed.\nOne way is to find a contribution to the force that would arise\nif the free-atomic density were dragged along with the nucleus.\nThat is the ansatz used here (this ansatz is used when HAM_FORCE=1).\nAn alternative is to use HAM_FORCE=12.\n\n

Inspect the output from the first iteration. You should find this table\n\n

 Harris correction to forces: shift in free-atom density\n  ib         delta-n dVes             delta-n dVxc               total\n   1 -846.44    0.00    0.00   -30.21    0.00    0.00   876.65    0.00    0.00\n   2  423.22  733.04    0.00    15.11   26.16    0.00  -438.32 -759.20    0.00\n   3  423.22 -733.04    0.00    15.11  -26.16    0.00  -438.32  759.20    0.00\n shift forces to make zero average correction:            0.00    0.00    0.00\n
\n
\n\n

It says that the correction term to the force is about 880 mRy/au. This\nis a very large term!\n\n

The correction table is soon followed by\n\n

 Forces, with eigenvalue correction\n  ib           estatic                  eigval                    total\n   1  152.09    0.00    0.00  -118.67    0.00    0.00    33.42    0.00    0.00\n   2  -76.05 -131.72    0.00    59.34  102.77    0.00   -16.71  -28.94    0.00\n   3  -76.05  131.72    0.00    59.34 -102.78    0.00   -16.71   28.94    0.00\n Maximum Harris force = 33.4 mRy/au (site 1)  Max eval correction = 876.6\n
\n
\n\n

Without the correction term, the would be 33.42−876.65 mRy/au. But\nwith this ansatz, the force is only 33.42 mRy/a.u.. So the correction term\nis huge — much larger than the force itself. The corrected force,\neven from the initial [Mattheis construction]/tutorial/lmf/si_calculation/#self-consistency),\nis not so far from the self-consistent one (see below).\n\n

Now look at the equivalent output from the last iteration. You should find\n\n

 Harris correction to forces: shift in free-atom density\n  ib         delta-n dVes             delta-n dVxc               total\n   1   -5.64    0.00    0.00    -0.14    0.00    0.00     5.78    0.00    0.00\n   2    2.82    4.88    0.00     0.07    0.12    0.00    -2.89   -5.00    0.00\n   3    2.82   -4.88    0.00     0.07   -0.12    0.00    -2.89    5.00    0.00\n shift forces to make zero average correction:            0.00    0.00    0.00\n
\n
\n\n

The correction term has become very small; indeed the tighter the tolerance the\ndensity is converged, the smaller this term becomes.\n\n

\n\n

Look for the table shown below in the output of the last iteration,\nwhen self-consistency has been reached. It should read:\n\n

 Forces, with eigenvalue correction\n  ib           estatic                  eigval                    total\n   1  970.90    0.00    0.00  -917.24    0.00    0.00    53.67    0.00    0.00\n   2 -485.45 -840.83    0.00   458.62  794.35    0.00   -26.83  -46.47    0.00\n   3 -485.45  840.83    0.00   458.62 -794.35    0.00   -26.83   46.47    0.00\n Maximum Harris force = 53.7 mRy/au (site 2)  Max eval correction = 5.8\n
\n
\n\n

#### 3. Molecular statics

\n\n

lmf can relax the site positions to their\nequilibrium point where the forces vanish (molecular statics).\n\n

The parameters that control how this relaxation proceeds are given\nin as tokens in the DYN_MSTAT tag. Notice the last lines\nof the input file. To see whether the proprocessor includes this\nline or not, compare the output of the following two commands.\n\n

$lmf se --showp\n$ lmf se -vminx=t --showp\n
\n
\n\n

In the second command the preprocessor includes the DYN category in the input file.\n\n

Note:: you should consider values for tokens\nin DYN_MSTAT. Some default values were chosen, but it is very\ndifficult to make a general algorithm that relaxes atoms. In this\ncase it uses a Broyden scheme (a kind of Newton-Raphson algorithm), with an\ninitial step size of 0.01. This a good choice in the present context,\nbut in other contexts it may not be.\n\n

To relax the structure, do\n\n

$lmf se -vminx=t --wpos=pos\n \n \n\n lmf iterates the density to self-consistency;\nwhen it is reached it shifts the nuclear positions using the Broyden scheme.\n\n At the end of the first self-consistency cycle you should see\n\n  RELAX: (warning) failed to read Hessian; set to unity\n gradzr: begin Broyden xtol=1e-3 dxmx=0.01 isw=211\n brmin: start xtol=|1e-3| isw=15 |g|=0.0931\n brmin: max shift = 0.05376 is larger than dxmx. Scale by 0.1860\n brmin: iter 1 max shift=0.01 |g|=0.09312 max g=0.05376\n Updated x:\n 0.227000 0.000000 0.000000 -0.113500 -0.196588 0.378667 -0.113500 0.196588\n -0.378667\n RELAX: completed Broyden iter 1; max shift=0.01000 |g|=0.0931\n Gradients:\n -0.054 -0.000 -0.000 0.027 0.047 0.000 0.027 -0.047 0.000\n Diagonal inverse Hessian:\n 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000\n\n Updated atom positions:\n Site Class Position(relaxed)\n 1 Se 0.22700000(T) 0.00000000(T) 0.00000000(T)\n 2 Se -0.11350000(T) -0.19658777(T) 0.37866663(T)\n 3 Se -0.11350000(T) 0.19658777(T) -0.37866663(T)\n \n \n\n The x coordinate of the first Se atom changed by 0.01 (this was controlled by STEP=.010,\nwhich limits the largest allowed change in any component).\n\n Next follows this table:\n\n  smshft: add shifted free atom densities\n site old pos new pos shift\n 1:Se 0.21700 0.00000 0.00000 0.22700 0.00000 0.00000 0.010000\n 2:Se -0.10850 -0.18793 0.37867 -0.11350 -0.19659 0.37867 0.010000\n 3:Se -0.10850 0.18793 -0.37867 -0.11350 0.19659 -0.37867 0.010000\n \n \n\n Rather than build the density from a Mattheis construction, it takes\nthe self-consistent density, adds a Mattheis construction calculated from the new\npositions and subtracts the same construction built from the starting\npositions. This provides a reasonable ansatz for the density at the new positions.\n\n When self-consistency is reached with these positions the forces read:\n\n  Forces, with eigenvalue correction\n ib estatic eigval total\n 1 899.40 0.00 0.00 -879.01 0.00 0.00 20.39 0.00 0.00\n 2 -449.70 -778.90 0.00 439.50 761.24 0.00 -10.20 -17.66 0.00\n 3 -449.70 778.90 0.00 439.50 -761.24 0.00 -10.20 17.66 0.00\n Maximum Harris force = 20.4 mRy/au (site 2) Max eval correction = 1.4\n \n \n\n They are about half as large as the starting force. At the close of\nthe fourth relaxation step the forces read\n\n  Forces, with eigenvalue correction\n ib estatic eigval total\n 1 835.61 0.00 0.00 -835.12 0.00 0.00 0.48 0.00 0.00\n 2 -417.80 -723.65 0.00 417.56 723.24 0.00 -0.24 -0.42 0.00\n 3 -417.80 723.65 0.00 417.56 -723.24 0.00 -0.24 0.42 0.00\n Maximum Harris force = 0.483 mRy/au (site 2) Max eval correction = 1.1\n \n \n\n This is indeed a very small force. The final site positions\nare printed to stdout and also to file pos.se\n(because of --wpos=pos).\n\n The x coordinate of the first atom in pos.se\nshould be 0.2346.\nNote that the coordinates last output by lmf\nare slightly different: these correspond to what would be the updated\ncoordinates if the molecular statics would proceed another step.\n\n It is interesting to see how the total energy changes with each\nrelaxation step. Do the following:\n\n $ grep ^c save.se\n
\n
\n\n

You should see\n\n

c minx=1 ehf=-14580.5132479 ehk=-14580.5132302\nc minx=1 ehf=-14580.5221027 ehk=-14580.5220784\nc minx=1 ehf=-14580.523951 ehk=-14580.5239234\nc minx=1 ehf=-14580.524057 ehk=-14580.5240287\n
\n
\n\n

The energy drops monotonically, with a large change after the first relaxation step,\nand almost no change at the last step. This is because the energy stops changing\nas the forces go to zero.\n\n

You can see how the Se-Se bond length and angles change on relaxation:\n\n

$lmchk se --rpos=pos --angles\n \n \n\n You should find that the bond angle drops to 101o, and the\nbond length increases a few percent.\n\n Note also the bandgap\n\n  VBmax = 0.136522 CBmin = 0.201860 gap = 0.065338 Ry = 0.88860 eV\n \n \n\n The experimental gap is about 1.8 eV.\n\n ### Additional Exercises (optional) \n\n \n 1. Check out how the relaxed x coordinate depends on the choice of functional.\nThe PBESOL functional (lxcf1=116 lxcf2=133) and the LDA (lxcf=2)\nboth yield very similar values for u.\n \n","dir":"/tutorial/lmf/molstat/","name":"tut_se_molecular_statics.md","path":"pages/tut_se_molecular_statics.md","url":"/tutorial/lmf/molstat/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Applications of the static sigma editor","permalink":"/tutorial/gw/sigma_editor/","auto":{"code":"gw","physical":"QSGW","info":"This tutorial demonstrates applications of lmf's static self-energy editor."},"header":false,"content":" This tutorial presents various applications of the static sigma editor.\nWith it you can manipulate the QSGW static self-energy Σ0(k)\nin a variety of ways. The present tutorial displays some of the features of the editor\nin the context of some practical applications.\n\n Questaal has two self-energy editors corresponding to the two forms of\nself energy in QSGW:\n\n \n 1. \n a static self-energy Σ0(k) that substitutes for the\nexchange-correlation potential in LDA, GGA, Hartree-Fock or LDA+U theory.\nΣ0(k) is static and hermitian, and generates\na noninteracting hamiltonian H0 and a corresponding noninteracting Green’s function\nG0. This potential is the primary output of the\nthe QSGW cycle and Σ0(k)\n (actually )\nis saved on disk, usually in file sigm.ext.\nThere are numerous ways to use and transform\nΣ0; most are accomplished through the Σ0(k) editor described here.\n \n 2. \n a frequency-dependent, nonhermitian self energy Σ(k,ω). The ω-dependence broadens the states;\nthe non-hermitian part gives the quasiparticle a finite lifetime.\nThis is not generated automatically, but must be done\nusing a special setup, as described in this tutorial.\nOnce the dynamical Σ(k,ω) is made, there is a corresponding\ndynamical self-energy editor\nto facilitate analysis.\n \n \n\n Note: this page is under construction.\n\n \n\n \n\n Sheared GaSb\n\n Follow the steps that create input files and carry out QSGW self-consistency \nin the Command Summary of the superlattice tutorial.\n\n The do:\n\n \nlmscell gasb -vz=11.5/11.43 --stack~scale=1/z~stretch=z^3~wsitex@short\nlmf ctrl.gasb --wsig:fbz\ncp sigm2.gasb sigm.gasb\ncp sites.gasb site.gasb\nlmf ctrl.gasb --rsig:fbz:rlxkp --iactiv --wsig:newkp\ncp sigm2.gasb sigm.gasb\nlmgwsc --wt --insul=14 --mpi=12,12 --tol=2e-5 --sym --getsigp --save= gasb-shear gasb > out.job\nmpix -n 16 lmf-MPIK ctrl.gasb > out.lmf\n \n\n \n\n ### Table of Contents \n\n\n ### Preliminaries \n\n This tutorial uses the MPI parallel form of lmf. It assumes a script mpix is present in your path that runs an MPI job with # processors as follows:\n\n \nmpix -n # MPI-job\n \n mpix can be simply mpirun.\n\n If you have compiled lmf in serial mode,\nyou can run the tutorials here in serial mode, by omitting the mpix -n #.\n\n ### Change in sigma on Shearing Zincblende GaSb \n\n Here we demonstrate how to modify the static self-energy in the presence of a lattice shear. The shear\nreduces the symmetry, and must be adapted accordingly. For demonstration purposes we build on the\ntutorial on building superlattices, and shear GaSb in the manner used in that tutorial.\n\n Here we modify calculated for the zincblende lattice, using it as a starting point for a new QSGW\nwith the sheared lattice. Of course the entire QSGW calculation could be redone from scratch, but with small\nshears like this one it is a reasonable approximation that the matrix elements of remain invariant under\nthe shear. Here we will check how good that ansatz is. In any case the ansatz gives a good estimate for the\nself-consistent , avoiding the need to start from scratch.\n\n To set up input conditions of the original zincblende structure, cut and paste the init file\ndesigned for InAs and GaSb\nshown in the superlattice tutorial and name it\ninit.gasb. Then build the input file and carry out both LDA and QSGW self-consistency\nas described in detail in that tutorial. If you don’t want to\nread the tutorial, follow the instructions for Zincblende GaSb in the\nCommand Summary, skipping the last part about drawing energy bands.\n\n Assuming you followed instructions you will have run this step\n\n mpix -n 16 lmf-MPIK ctrl.gasb > out.lmf\n \n \n\n Find the gap :\n\n grep gap out.lmf\n \n \n\n You should find that the gap is 1.29 eV.\n\n Now we are ready to make the shear.\nUse the superlattice editor built into lmscell to scale and stretch\nthe lattice, so that (1) the basal plane matches that of InAs and (2) the shear conserves volume.\n\n $ lmscell gasb -vz=11.5/11.43 --stack~scale=1/z~stretch=z^3~wsitex@short\n
\n
\n\n

In this instruction preprocessor variable z is set to the ratio\nof GaSb and InAs lattice constants and:\n

\n
• ~scale=1/z      scales the lattice constant by 1/z\n
• ~stretch=z^3    stretches the third lattice vector by z3\n
• ~wsitex@short    saves the modified structure into into site file sites.gasb\n
\n\n

The two scalings together preserve the volume.\n\n

Compare sites.gasb to site.gasb and note that that the lattice\nconstant has been reduced while the third lattice vector p3 has been stretched.\n\n

The shear reduces the symmetry. To obtain for reduced symmetry, first write for points in the\nfull Brillouin zone. Then for the sheared lattice, read this and write it again under reduced symmetry.\n\n

lmf ctrl.gasb --wsig:fbz\ncp sigm2.gasb sigm.gasb\ncp sites.gasb site.gasb\nlmf ctrl.gasb --rsig:fbz:rlxkp --iactiv --wsig:newkp\ncp sigm2.gasb sigm.gasb\n
\n
\n\n
\n
• Steps (1) and (2) generate a sigm.gasb without any symmetry operations.\n
• Step (3) replaces the site containing the zincblende structure with the sheared structure\n
• Steps (4) and (5) read sigm.gasb for the full BZ and writes it for the reduced symmetry operations of the sheared lattice.\nSwitch  --rsig:fbz:rlxkp tells lmf that contains k points for\nthe full Brillouin zone, and also to ignore the mismatch in the k sought and file values of k (k points are shifted because the lattice is sheared).\nSwitch  --wsig:newkp  tells lmf to write for the symmetry of the sheared mesh.\n
\n\n

Try running\n\n

mpix -n 16 lmf-MPIK ctrl.gasb --rs=1,0 -vnit=1 > out &\n
\n
\n\n

This segment of output shows the symmetry operations of the sheared lattice\nis much reduced from the 24 point group operations of the Zincblende lattice:\n\n

\n GROUPG: the following are sufficient to generate the space group:\n         m(1,-1,0)\n         m(1,-1,0)\n
\n\n

This segment of output\n

\n iors  : read restart file (binary, mesh density) \n         remesh density from    20  *  20  *  20    to    20  *  20  *  21\n         use from  restart file: ef window, pos(sheared), pnu \n         ignore in restart file: *\n
\n\n

indicates the given lattice is sheared relative to the contents in the restart file, rst.gasb.\nlmf can nevertheless read the file.\n\n

Look a little farther down can you can see the bandgap\n\n

\n VBmax = 0.097372  CBmin = 0.182519  gap = 0.085147 Ry = 1.15799 eV\n
\n\n

With this ansatz for the gap is reduced from 1.29 eV to 1.16 eV.\n\n

Now make it self-consistent\n\n

lmgwsc --wt --insul=14 --mpi=12,12 --tol=2e-5 --sym --getsigp --save= gasb-shear gasb > out.job\nmpix -n 16 lmf-MPIK ctrl.gasb > out.lmf\n
\n
\n\n

You should find that the ansatz for is very close to the self-consistent one:\n\n

$grep more out.job\nlmgwsc : iter 1 of 999 RMS change in sigma = 2.53E-05 Tolerance = 2e-5 more=T ...\nlmgwsc : iter 2 of 999 RMS change in sigma = 5.58E-06 Tolerance = 2e-5 more=F ...\n \n \n\n Run lmf with the self-consistent and find the gap once again\n\n mpix -n 16 lmf-MPIK ctrl.gasb --rs=1,0 -vnit=1 > out.lmf &\ngrep gap out.lmf\n \n \n\n It should be essentially unchanged from the 1.16 eV found earlier. See also Additional Exercises.\n\n ### Reading and writing Real-Space sigm Files \n\n Files associated with this tutorial are too large to be included with the basic distribution.\nDownload and unpack the tarball FeTutorial.tar.gz\nand change to directory fetutorial.\n \n cp input/* .\n cp bas2.tppc3.tpd4.sep12/rst.fe .\n cp bas2.tppc3.tpd4.sep12/nk12/* .\n ln -s -f sigm sigm.fe\n \n If your computer hardware does not not-use-ieee-conventions-for-binary-files, see\nhere before proceeding.\n\n Verify that the input conditions result in a self-consistent potential.\n \n rm -f mixm.fe log.fe\n mpix -n 12 lmf -vnit=1 --rs=1,0 ctrl.fe cat switches-for-lm > out.noso.001\n \n If you want to carry out a corresponding LDA calculation, do:\n \n cp bas2.tppc3.tpd4.sep12/rst.lda rst.fe\n rm -f mixm.fe log.fe\n mpix -n 12 lmf -vsig=0 -vnit=1 --rs=1,0 ctrl.fe cat switches-for-lm > out.noso.lda.001\n \n\n Problems arise if you try to include use the given self-energy in a calculation with\nlower symmetry, e.g. a shear distortion or the addition of spin-orbit coupling.\nIt immediately appears if you repeat the calculation lmf with\nspin-orbit coupling on (note tag SO in the input file!):\n \n lmf -vso=1 -vnit=1 --rs=1,0 ctrl.fe cat switches-for-lm\n \n\n This is because by the given Σ0xc is stored on a mesh of k-points. SO coupling\nreduces symmetry and requires that Σ0 be available on a different k-mesh.\n\n You can work around this by saving Σ0 in a real space form; that is, map\nΣ0RL,RL(k) to\nΣ0RL,RL(T) = Σ0R+TL,RL.\nT is a crystal lattice translation vector; there are as many\nT-points as k points in k-space. The\ntransformation is exact and no information is lost. (It is\naccomplished in practice using FFT techniques, and the original\nΣ0RL,RL(k)\ncan be recovered by a Bloch sum.) Once generated Σ0(T)\ndoesn’t depend on the number of k-points, so it is\npreferable in this context even while it is less compact.\n\n ### Spin Orbit Coupling in Fe \n\n ### As Antisite Defect \n\n ### Computers that do not use IEEE conventions for binary files. \n\n Files sigm._ext and rst._ext\nare stored in binary form following IEEE conventions. If your computer doesn’t read binary files in this format, do the following additional steps:\n \n cp bas2.tppc3.tpd4.sep12/rsta.fe.gz .\n gunzip rsta.fe.gz\n gunzip sigma.fe.gz\n lmf -vnit=0 --rs=2,1 ctrl.fe cat switches-for-lm\n lmf ctrl.fe cat switches-for-lm --rsig:ascii --wsig\n cp sigm2.fe sigm\n \n\n ### Additional Exercises \n\n For the GaSb shear demo, compare\nenergy bnds for the ansatz and the self-consistent one. You should find them nearly identical.\n","dir":"/tutorial/gw/sigma_editor/","name":"tut_siged.md","path":"pages/tut_siged.md","url":"/tutorial/gw/sigma_editor/"} ); autoGen( {"show_meta":false,"comments":false,"floating_toc":true,"author":"Questaal","layout":"page-fullwidth","title":"Superlattices in QSGW","permalink":"/tutorial/misc/lmscell/","auto":{"code":"lmscell","physical":"Supercells and Superlattices","info":"Applications of the supercell maker."},"header":false,"content":" This tutorial shows how to construct a superlattice using Questaal tools.\n\n A short-period superlattice of InAs and GaSb is constructed on the [001] axis and a self-consistent QSGW made for\nit. Longer period superlattices are built by using the sigma editor, embedding the QSGW self-energy into bulk\nregions away from the interface, calculated from QSGW calculations for bulk InAs and GaSb. This makes it\npossible to generate QSGW quality band structure for much large superlattices that would be possible by direct\nQSGW calculations.\n\n \n ### Table of Contents \n\n\n \n\n \n\n Zincblende InAs\n\n \n • Input file and site file\n \n\n cp init.dat init.inas\nblm -vinas=t --sort=no --shorten=no --wsitex,quad1 --findes,rmin=1.3,float,1spec --ehmx=-.3 --nit=20 --gw~gcutb=2.7~gcutx=2.3~pbtol=3e-4,3e-4,1e-3,1e-3,1e-2 --nk=6 --nkgw=4 --gmax=9.2 --eloc=-3.5 --ctrl=ctrl inas\nmkdir inas-zb\ncp ctrl.inas site.inas inas-zb\n \n \n\n Zincblende GaSb\n\n \n • Site file\n \n\n cp init.dat init.gasb\nblm -vinas=f --wsitex,quad1 --findes,rmin=1.3,float,1spec --ctrl=ctrl gasb\nmkdir gasb-zb\ncp ctrl.gasb site.gasb gasb-zb\n \n \n\n Input files for superlattices\n\n \n • Conventional cell(1) for InAs\n \n\n echo .5 .5 0 .5 -.5 0 0 0 1 | lmscell inas --wsite~short~fn=site\nlmscell inas '--stack~sort@h3-z/1000~wsite@short@fn=site'\nmkdir inas2gasb0\ncp site.inas inas2gasb0/site.inasgasb\n \n \n\n \n • Conventional cell(1) for sheared GaSb\n \n\n echo .5 .5 0 .5 -.5 0 0 0 1 | lmscell gasb --wsite~short~fn=site\nlmscell ctrl.gasb -vz=11.5/11.43 '--stack~scale=1/z~stretch=z^3~sort@h3-z/1000~wsitex@short@fn=site'\nmkdir inas0gasb2\ncp site.gasb inas0gasb2/site.inasgasb\n \n \n\n ctrl, basp, and site files for short-period [001] superlattices\n\n \n • ctrl\nfile for (InAs)2(GaSb)2, which can be applied to any [001] superlattice.\nAlso make the (InAs)2(GaSb)2 site file.\n \n\n\n\n cp ./inas-zb/* .\ncp inas2gasb0/site.inasgasb site.inas\ncp inas0gasb2/site.inasgasb site.gasb\nlmscell inas '--stack~show~file@site.gasb@dpos=0,0,-.032~show~wsite@short'\ncp sites.inas sitein.inasgasb\nblm --molstat --ewald=1d-10 --rdsite --omax=-.04 --addes,end --nosort --shorten=no --findes,rmin=1.3,float,1spec --ehmx=-.3 --nit=20 --gw~gcutb=2.7~gcutx=2.3~pbtol=3e-4,3e-4,1e-3,1e-3,1e-2 --nk=6,6,6 --nkgw=4,4,4 --gmax=9.2 --eloc=-3.5 --ctrl=ctrl inasgasb\n \n \n\n \n • basp\nfile for (InAs)2(GaSb)2, which can be applied to any [001] superlattice.\n \n\n lmfa -vles=1 --basfile=basp ctrl.inasgasb\nlmfa ctrl.inasgasb\necho -vnk2=4 -vnkgw2=2 > switches-for-lm\nmkdir -p inas2gasb2/relax0\ncp ctrl.inasgasb basp.inasgasb site.inasgasb switches-for-lm inas2gasb2/relax0\n \n \n\n \n • Complete the input file setup for the two conventional cells\n \n\n echo -vnk2=4 -vnkgw2=4 > switches-for-lm\ncp ctrl.inasgasb basp.inasgasb switches-for-lm inas2gasb0\ncp ctrl.inasgasb basp.inasgasb switches-for-lm inas0gasb2\n \n \n\n \n • Site file and other essential inputs for the (4,4) and (6,6) superlattices\n \n\n lmscell inas '--stack~show~file site.inas dup=1~file@site.gasb@dpos=0,0,-.032@dup=2~show~wsite@short'p\necho -vnk2=2 -vnkgw2=1 > switches-for-lm\ncp sites.inas site.inasgasb\nmkdir -p inas4gasb4/relax0\ncp ctrl.inasgasb basp.inasgasb site.inasgasb switches-for-lm inas4gasb4/relax0\n \n \n\n lmscell inas '--stack~show~file site.inas dup=2~file@site.gasb@dpos=0,0,-.032@dup=3~show~wsite@short'\necho -vnk2=2 -vnkgw2=1 > switches-for-lm\ncp sites.inas site.inasgasb\nmkdir -p inas6gasb6/relax0\ncp ctrl.inasgasb basp.inasgasb site.inasgasb switches-for-lm inas6gasb6/relax0\n \n \n\n LDA, QSGW self-consistency, energy bands in conventional cells\n\n \n • InAs and GaSb conventional cell, LDA self-consistency + QSGW self-consistency\n \n\n cp inas2gasb0/* .\nlmfa ctrl.inasgasb\nmpix -n 16 lmf ctrl.inasgasb\n \n \n\n The preceding applies to InAs. Use the same instructions for GaSb, substituting inas2gasb0inas0gasb2.\n\n lmfgwd --job=-1 ctrl.inasgasb cat switches-for-lm\nlmgwsc --wt --insul=28 --mpi=16,16 --tol=2e-5 --sym --getsigp --save= inas2gasb0 inasgasb > out.job\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm; mpix -n 16 lmf ctrl.inasgasb cat switches-for-lm --rs=1,0 -vnit=1 > out.lmf\ncp rst.inasgasb out.lmf inas2gasb0\n \n \n\n \n • Energy bands in conventional cells, with SO coupling, with and without scaling Σ0\n \n\n lmf ctrl.inasgasb --wsig:fbz; cp sigm2.inasgasb sigm.inasgasb\nhead -2 ~/lm/startup/syml.fcc > syml.inasgasb\nmpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1\nmpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1 --band~fn=syml\necho -7,6 / | plbnds -nocol -fplot~sh~scl=.7 -ef=0 -scl=13.6 -lbl=L,G,X bnds.inasgasb\nopen fplot.ps\n \n \n\n mpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1 --mixsig=0.8\nmpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1 --band~fn=syml --mixsig=0.8\necho -7,6 / | plbnds -nocol -fplot~sh~scl=.7 -ef=0 -scl=13.6 -lbl=L,G,X bnds.inasgasb\nopen fplot.ps\n \n \n\n LDA + QSGW self-consistency in superlattices\n\n Set shell variable dir to be one of the following inas2gasb2/relax0, inas4gasb4/relax0, inas6gasb6/relax0\n\n Initially make a self-consistent density within the LDA\n\n cp$dir/* .\nrm -f rst.inasgasb mixm.inasgasb\nlmfa ctrl.inasgasb\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm\n
\n
\n\n

QSGW self-consistency\n\n

lmfgwd --job=-1 ctrl.inasgasb cat switches-for-lm\nlmgwsc --wt --insul=$nel --mpi=16,16 --tol=2e-5 --sym --getsigp --save=$dir inasgasb > out.job\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm;  mpix -n 16 lmf ctrl.inasgasb cat switches-for-lm --rs=1,0 -vnit=1 >  out.lmf\ncp rst.inasgasb out.lmf $dir\n \n \n\n Partial DOS and reference energies\n\n The steps below apply to any of the superlattices. Set shell variables according to the\ntable.\n\n \n • Generate moms file for partial DOS\n \n\n cp$dir/* . ; rm -f mixm.inasgasb; ln -s sigm sigm.inasgasb\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm --rs=1,0 -vnit=1\nlmf ctrl.inasgasb --wsig:fbz; cp sigm2.inasgasb sigm\nmpix -n 16 lmf -vso=1 ctrl.inasgasb -vnk1=$nk1 -vnk2=$nk2 --rs=1,0 -vnit=1 --rsig:fbz --pdos~mode=0~sites=$sitelist --mixsig=.80 --pr35,40 > out.pdos\ncp out.pdos$dir\n
\n
\n\n

Partial DOS and integrated DOS\n\n

lmdos -vso=1 ctrl.inasgasb -vnk1=$nk1 -vnk2=$nk2 --rs=1,0 -vnit=1 --rsig:fbz --pdos~mode=0~sites=$sitelist --mixsig=.80 --dos:npts=2001:window=-1,1\necho 0.999 4 -3 2 | pldos -fplot~sh~long~open~tmy=.25~dmin=0.40~xl=E -esclxy=13.6 -ef=0 -lst=\"$doschan\" dos.inasgasb\ncp dosp.dat $dir/pdos.80\nopen fplot.ps\n \n \n\n Integrated DOS\n\n lmdos -vso=1 ctrl.inasgasb -vnk1=$nk1 -vnk2=$nk2 --rs=1,0 -vnit=1 --rsig:fbz --pdos~mode=0~sites=$sitelist --mixsig=.80 --dos:npts=40001:window=-3,1:rdm:idos\ncp dos.inasgasb $dir/idos.80\nfplot -frme 0,.7,0,.4 -x -3,0 -y 0,7 -tmx .1:5 -colsy 1+1:1+4 -qr dos.inasgasb\nopen fplot.ps\n \n \n\n In d DOS in the (6,6) superlattice\n\n fplot -frme 0,.7,0,.4 -x -1.2,-1 -y 0,5 -tmx .05 -1p -map -i 'x1>-1.2&x1<-1' 1:nr -colsy 4:24:4 -lt 1,col=0,0,0 -qr dos.inasgasb\nopen fplot.ps\n \n \n\n Valence Band Offset\n\n To be completed; for now follow the Tutorial\n\n Relaxation of the interface\n\n To be completed; for now follow the Tutorial\n\n Longer Period superlattices\n\n To be completed\n\n \n\n ### Preliminaries \n\n This tutorial assumes ~/lm is the top-level directory for the Questaal repository, and that\nQuestaal executables are in your path.\n\n This tutorial uses mpix to execute MPI jobs. Typically mpirun is\nused for MPI jobs. We assume your system has 16 processors on a core, but you can use any number.\n\n For drawing postscript files, this tutorial assumes you are use the Apple open.\nSubstitute your postscript viewer of choice for open.\n\n \n ### Basic strategy \n\n QSGW can make very high quality band structures. In principle it can\nbe done for many atoms, but in practice QSGW is limited to relative\nsmall sizes (up to about 50 atoms, depending on the context).\n\n By using the “near sightedness” principle and cutting and pasting\nself-energies in various regions, we can using small calculations\nto construct a high-quality potential for much larger systems.\n\n Here we use QSGW to perform calculations on :\n\n \n 1. Bulk InAs in the zincblende structure\n 2. Bulk GaSb in the a sheared zincblende structure, tailored to match InAs\n 3. Short-period superlattice of (InAs)n(GaSb)n along [001]\n \n\n Finally the three calculations are merged to construct an approximate\nself-energy for a longer period superlattice.\n\n There are many steps required to accomplish this, but the result is a very\nhigh quality band structure for the superlattice.\n\n This tutorial is somewhat involved, and you may wish to go through some basic tutorial such as the PbTe\ntutorial, the Bi2Te3 tutorial\nwhich describes the basis set, and the introductory QSGW tutorial\nbefore embarking on this one.\n\n ### Getting Started \n\n Three files are required to make any calculation. All are autogenerated once supplied\nstructural information.\n \n • A ctrl file, which is the main input file.\nWe will autogenerate this file using the blm utility.\n • A site file with structural data. (The\n ctrl file can also hold structural information, but we keep it separate so\n only the site changes as the structure changes.)\nblm also makes this file.\n • A basp file,\nwhich defines the basis set.\nThe free-atom code lmfa makes this file.\n • Along [001], the zincblende lattice has a repeat length of two unit cells.\nIt is simpler (but not essential) to use a doubled unit cell as the building block for the superlattice.\nWe will call this the “conventional cell.” (1)\n \n\n One more user-supplied file is needed, switches-for-lm. It\ncontains algebraic variables, enabling control of parameters such as the\nnumber of k points without altering the ctrl file.\n\n For lmfa to make parameters for the basp file, it needs information\nabout each kind of atom and the augmentation sphere radii. We want to use a fixed basis set for all calculations, which\nmeans we need to set up a minimal superlattice which contains all the atoms before doing any electronic structure\ncalculations. This will be (InAs)2(GaSb)2 [001] superlattice.\n\n The prescription is then:\n \n • Use blm to build site files for bulk InAs and GaSb in the zincblende structure.\n • Use these files and the lmscell utility to assemble a site file\nfor the (InAs)2(GaSb)2 [001] superlattice.\n • Construct the ctrl and basp files from this structure.\nThey can remain (more or less) fixed for different structures;\nOnly files site and switches-for-lm change between structures.\n \n\n #### Site files for zincblende InAs and GaSb \n\n This init file\ncontains the requisite structural information for bulk InAs and GaSb.\nCopy the box below into file init.dat.\n\n \nHEADER InAs and GaSb\nLATTICE\n% ifdef inas\n% const a=11.43 # For InAs\n% endif\n% const a=11.50 # For GaSb\n ALAT={a} PLAT= 0.0 0.5 0.5 0.5 0.0 0.5 0.5 0.5 0.0\n\n% ifdef inas\nSITE\n ATOM=In X= 0 0 0\n ATOM=As X= 1/4 1/4 1/4\n% else\nSITE\n ATOM=Ga X= 0 0 0\n ATOM=Sb X= 1/4 1/4 1/4\n% endif\n \n\n Notes:\n\n \n • init.dat is designed to work with blm to make site files for both\nInAs and GaSb.\n • Both form in the zincblende structure, but InAs and GaSb are slightly lattice-mismatched. We assume here that InAs is\nthick and that the global lattice constant is that of InAs.\nTo make GaSb conform to that lattice, it must be sheared by elongating it on the [001] direction.\nWe make the simple (and reasonably accurate) assumption that the amount of shear is fixed by keeping the volume constant.\n • Reliable treatment of the In and As d states will require local orbitals.\nblm will automatically include them; however\nit will be necessary to set the tolerances for identifying them a bit tighter than the default; see --eloc below.\n \n\n Make the site file for zincblende GaSb:\n\n cp init.dat init.gasb\nblm -vinas=f --wsitex,quad1 --findes,rmin=1.3,float,1spec --ctrl=ctrl gasb\nmkdir gasb-zb\ncp ctrl.gasb site.gasb gasb-zb\n \n \n \n\n blm creates ctrl.inas and site.inas.\nIts switches a do the following:\n\n \n\n\n\n\n\n  -vinas=f\n sets preprocessor variable inas (allowing init.inas to be used for both InAs and GaSb)\n \n –wsite,quad1\n Translates all sites to be in the first quadrant\n \n –findes,rmin=1.3,float,1spec\n Identifies open interstitial regions in which to place floating orbitalsb\n \n –ctrl=ctrl\n Write output ctrl file directly to ctrl.gasb\n \n \n \n\n a Many of these switches have no effect on the site files (which is all we are after\nin this context) but they are included here anyway since they will be used later. \nb The lmf basis is slightly too small for converged GW calculations. This will be remedied when\nJigsaw Puzzle orbitals become available.\n\n \n\n #### Site files for conventional cells of InAs and GaSb \n\n We define the conventional cell(1) to be a doubled unit cell along [001].\nThis will be the basic building block for (InAs)n(GaSb)m superlattices.\nThe InAs and GaSb conventional cells are then the (InAs)2(GaSb)0 and\nThe (InAs)0(GaSb)2 superlattices.\n\n echo .5 .5 0 .5 -.5 0 0 0 1 | lmscell gasb --wsite~short~fn=site\nlmscell ctrl.gasb -vz=11.5/11.43 '--stack~scale=1/z~stretch=z^3~sort@h3-z/1000~wsitex@short@fn=site'\nmkdir inas0gasb2\ncp site.gasb inas0gasb2/site.inasgasb\n \n \n\n \n\n lmscell is first invoked in the supercell mode.\nThis takes as input any desired primitive lattice vectors. (For the supercell to be well defined, these vectors should\nbe integer multiples of the starting cell). In this case it generates a site file for the\nconventional cell.\n\n lmscell is invoked a second time, invoking the superlattice editor.\nThis editor is tailored to build supercells. In the present case, it does not stack any cells together\nbut merely shears the lattice and orders the sites:\n\n \n\n\n\n\n\n\n\n  -vz=11.5/11.43\n declares variable z as the ratio of GaSb/InAs lattice constants, needed to determine the shear\n \n –stack~…\n invokes the superlattice mode\n \n –stack~scale=1/z\n scales the lattice constant by 1/z\n \n –stack~stretch=z^3\n shears (stretches) the lattice along the third axisa by z3.\n \n –stack~sort@h3-z/1000\n sorts the atoms in the supercellb. Note the @ is used as a delimiter separating subarguments belonging to ~sort.\n \n –stack~wsitex@short@fn=site\n Writes a site file to file site.gasb, overwriting the existing file.\n \n \n \n\n a Taken together, the volume compression and the shear keep the cell volume constant. \nb Sites are sorted by increasing height h3, which is the axis along the third lattice vector (the z axis in this case).\n The extra small term of -z/1000 is use to disambiguate sites of equal height: the physical site with z>0, takes\n precedence over the floating orbital site with z=0.\n\n \n\n Make the corresponding site files for InAs. No shear is required in this case.\n\n cp init.dat init.inas\nblm -vinas=t --wsitex,quad1 --findes,rmin=1.3,float,1spec --ctrl=ctrl inas\nmkdir inas-zb\ncp ctrl.inas site.inas inas-zb\n \n \n\n (The ctrl.ext file is retained only because\nit is needed to construct superlattices).\n\n The conventional cell:\n\n echo .5 .5 0 .5 -.5 0 0 0 1 | lmscell inas --wsite~short~fn=site\nlmscell inas '--stack~sort@h3-z/1000~wsite@short@fn=site'\nmkdir inas2gasb0\ncp site.inas inas2gasb0/site.inasgasb\n \n \n\n At the close of lmscell, the following table is printed:\n\n  Found 2 q points in original cell that map to q=0:\n q (2*pi/a) q (multiples of qlat)\n 0.000000 0.000000 1.000000 0.500000 0.500000 0.000000\n 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000\n \n \n\n It tells you the other k point (an X point) that gets folded into the Γ point because\nof the artificial construction of the superlattice.\n\n #### Site, ctrl, and basp files using the (2,2) superlattice as template \n\n The following instructions build the ctrl file we will\nuse for all calculations, and a site for the\n(InAs)2(GaSb)2 superlattice.\n\n cp ./inas-zb/* .\ncp inas2gasb0/site.inasgasb site.inas\ncp inas0gasb2/site.inasgasb site.gasb\nlmscell inas '--stack~show~file@site.gasb@dpos=0,0,-.032~show~wsite@short'\ncp sites.inas sitein.inasgasb\nblm --molstat --ewald=1d-10 --rdsite --omax=-.04 --addes,end --nosort --shorten=no --findes,rmin=1.3,float,1spec --ehmx=-.3 --nit=20 --gw~gcutb=2.7~gcutx=2.3~pbtol=3e-4,3e-4,1e-3,1e-3,1e-2 --nk=6,6,6 --nkgw=4,4,4 --gmax=9.2 --eloc=-3.5 --ctrl=ctrl inasgasb\n \n \n\n \n\n This time lmscell stacks a superlattice of the InAs and GaSb conventional cells together.\n\n \n\n\n\n\n  ~show\n Not required, but shows the structure at the current stage of construction\n \n ~file@site.gasb@dpos=0,0,-.032\n stacks the GaSb conventional cell on top, rigidly shifting the cell by (0,0,−0.032) a\n \n ~wsite@short\n Writes a site file. The default name is sites\n \n \n \n\n a The (InAs)m(GaSb)n superlattice has two interfaces. At one interface frontier\natoms (In,Sb) are nearest neighbors, while (Ga,As) are neighbors at the other. Away from the interface the (InAs) and\n(GaSb) bulk part look like the bulk; however the entire (GaSb) block can shift relative to the (InAs), increasing one\nfrontier bond and decreasing the other. To a first approximation to a full lattice relaxation, the entire\n(GaSb)n part of the lattice can be shifted, increasing one frontier bond length and decreasing the other. It\nturns out that residual forces are small if this constrained relaxation is allowed, and (0,0,−0.032) is the rigid\nshift that minimizes the energy. Relaxations are explained in this section.\n\n blm is invoked with a somewhat complex combination of switches\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n  –molstat\n Adds a category for molecular statics (for doing lattice relaxations)\n \n –ewald=1d-10\n Sets a stricter tolerance for Ewald sums. This is needed because long cells require it\n \n –rdsite\n Read structure information for a site file. By default it reads from file sitein.ext)\n \n –omax=-.04\n Restrict the augmentation sphere overlap to −4 % of touching.a\n \n –addes,end\n Tells blm to put the E species last in the SPEC category (for aesthetics)\n \n –nosort\n Tells blm not to sort the sites (for aesthetics)\n \n –shorten=no\n Do not shorten the basis vectors\n \n –findes,rmin=1.3,float,1spec\n Identifies open interstitial regions in which to place floating orbitalsb\n \n –ehmx=-.3\n Specifies the upper bound to the smooth Hankel energy\n \n –nit=20\n maximum number of iterations (not required)\n \n –gw\n Tailor input file for a GW calculation\n \n –gw~gcutb=2.7~gcutx=2.3\n Set G cutoffs for 1-particle and 2-particle quantities in the GW calculationc\n \n –gw~pbtol=3e-4,3e-4,1e-3,1e-3,1e-2\n product basis tolerances in the GW calculationc\n \n –nk=6,6,6\n Number of k divisions for lmf\n \n –nkgw=4,4,4\n Number of k divisions for GWd\n \n –gmax=9.2\n G cutoff for lmfe\n \n –eloc=-3.5\n Set default energy cutoff when searching for local orbitalsf\n \n –ctrl=ctrl\n Write ctrl file to ctrl.inasgasb\n \n \n \n\n a This is not necessary for the bulk, but gives some “wiggle room” to avoid spheres overlapping at an interface.\nIt turns out it is not necessary for this interface either, but you can verify that the band structures depend little on the choice of overlap. \nb The lmf basis is slightly too small for converged GW calculations. This will be remedied when\nJigsaw Puzzle orbitals become available. \n Meanwhile we augment the basis by adding smooth Hankels without augmentation spheres (“floating orbitals”). \n All floating orbitals are constrained to be the same species (the modifiers to --findes are described\nin the command-line switches page). \nc You do not need to supply these cutoffs but the default values are a bit more conservative.\nThese slightly coarser values speed up the calculation without any significant change the result. \nd The GW mesh of 4×4×4 divisions slightly overestimates the gap (by 0.05 eV). We keep this mesh for economy. \n In any case the QSGW gap is generally too large, and we will scale the QSGW to reduce the gap. \ne gmax is not known in advance; however lmfa will print out a recommended value. \nf With the default cutoff, lmfa does not pick up the deep As 3d state, which reduces the gap by 0.05 eV.\n\n \n\n Construct the basis set file, basp.inasgasb\n\n lmfa -vles=1 --basfile=basp ctrl.inasgasb\nlmfa ctrl.inasgasb\necho -vnk2=3 -vnkgw2=2 > switches-for-lm\nmkdir -p inas2gasb2/relax0\ncp ctrl.inasgasb basp.inasgasb site.inasgasb switches-for-lm inas2gasb2/relax0\n \n \n\n lmfa creates the basis file basp.inas and the atomic density file atm.ext.\nIt must be run twice, initially to determine what local orbitals are to be included.\nA second pass is necessary to properly partition the valence-core density.\nArguments do the following:\n\n \n\n\n\n  -vles=1\n variable causes E “sites” to have an augmentation radius, like at “atom”: with atomic number 0a\n \n –basfile=basp\n write the auto-generated basis to basp.inas (default = basp0.inas)\n \n \n \n\n a\nThis temporarily turns the floating orbitals into “empty spheres” with augmentation radii. Empty spheres are not used\nin the electronic structure calculations, but the radius is used to make the basis set.\n\n The essential files needed for the superlattice are saved in inas2gasb2/relax0.\n\n Inspect basp.inas. Note that In 4d is the normally augmented valence state; the 5d is treated as a local orbital.\nThe corresponding As 3d state is deeper than the In 4d, so for As, the 3d is treated as a local orbital, and the 4d is the normally augmented valence state.\n\n Copy necessary files to complete the set of required input files for basic building blocks\n\n echo -vnk2=4 -vnkgw2=4 > switches-for-lm\ncp ctrl.inasgasb basp.inasgasb switches-for-lm inas2gasb0\ncp ctrl.inasgasb basp.inasgasb switches-for-lm inas0gasb2\n \n \n\n #### Additional site files \n\n The rigid shift (0,0,-.032). optimized for the (2,2) superlattice\nis nearly optimal for any (InAs)n(GaSb)m superlattice.\n\n Make various (InAs)n(GaSb)n superlattices (with and without shifts)\n\n lmscell inas '--stack~show~file site.inas dup=1~file@site.gasb@dpos=0,0,-.032@dup=2~show~wsite@short'\necho -vnk2=2 -vnkgw2=1 > switches-for-lm\ncp sites.inas site.inasgasb\nmkdir -p inas4gasb4/relax0\ncp ctrl.inasgasb basp.inasgasb site.inasgasb switches-for-lm inas4gasb4/relax0\n \n \n\n lmscell inas '--stack~show~file site.inas dup=2~file@site.gasb@dpos=0,0,-.032@dup=3~show~wsite@short'\necho -vnk2=2 -vnkgw2=1 > switches-for-lm\ncp sites.inas site.inasgasb\nmkdir -p inas6gasb6/relax0\ncp ctrl.inasgasb basp.inasgasb site.inasgasb switches-for-lm inas6gasb6/relax0\n \n \n\n ### LDA + QSGW self-consistency, bulk systems (conventional cells) \n\n Make a self-consistent density and potential in the LDA:\n\n cp inas2gasb0/* .\nlmfa ctrl.inasgasb\nmpix -n 16 lmf ctrl.inasgasb\n \n \n\n Note that at the LDA level, there is no bandgap. You can see this in these lines from the standard output:\n\n  BZWTS : --- Tetrahedron Integration ---\n ... only filled or empty bands encountered: ev=0.100216 ec=0.100216\n VBmax = 0.100216 CBmin = 0.100216 gap = 0.000000 Ry = 0.00000 eV\n BZINTS: Fermi energy: 0.100216; 56.000000 electrons; D(Ef): 0.000\n Sum occ. bands: -72.6386525 incl. Bloechl correction: 0.000000\n \n \n\n The following makes InAs self-consistent at the QSGW level and\nsaves essential files in inas2gasb0\n\n lmfgwd --job=-1 ctrl.inasgasb cat switches-for-lm\nlmgwsc --wt --insul=28 --mpi=16,16 --tol=2e-5 --sym --getsigp --save= inas2gasb0 inasgasb > out.job\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm --rs=1,0 -vnit=1 > out.lmf\ncp rst.inasgasb out.lmf inas2gasb0\n \n \n\n You should find lmgwsc converges to a high degree of self-consistency in 4 iterations.\nThe first invocation of lmf isn’t necessary. It touches up the restart file\nmaking a self-consistent density for the given QSGW Σ0.\n\n Before drawing energy bands, check the bandgap:\n\n grep gap out.lmf\n \n \n\n You should see that the bandgap is 0.76 eV, significantly larger than the experimental value of 0.42 eV.\nThe error can be traced to several sources:\n \n 1. incomplete k convergence\n 2. neglect of spin-orbit coupling\n 3. neglect of ladder diagrams in the RPA dielectric function\n 4. neglect of phonon contributions to the self-energy\n \n\n All of them are relatively small; but each reduces the gap by 0.05 eV to 0.1 eV.\n\n #### Energy bands in conventional cells with spin-orbit coupling \n\n Spin-orbit coupling plays a non-negligible role. It is readily taken into account because ctrl.inas is already set up for a calculation with SO coupling.\n\n However if you run lmf straight off it will fail with the message\n\n \n Exit -1 rdsigm unexpected value 21 for file sigm nqp ... expected 64\n \n\n This is because the QSGW self-energy was constructed on the irreducible wedge of the zincblende lattice; however\nspin-orbit coupling reduces the symmetry. The simplest solution (though not most efficient)\nworkaround is to remake the QSGW self energy file Σ0 at all k points\n\n lmf ctrl.inasgasb --wsig:fbz\ncp sigm2.inasgasb sigm.inasgasb\n \n \n\n The following steps will:\n \n • find the Fermi level with SO coupling included (only needed to tell the band plotter knows where to set the energy zero)\n • generate the energy bands\n • make a postscript file\n \n\n We use a symmetry lines file for the fcc lattice from the Questaal distribution.\nsince we have an artificial supercell, use only the first two symmetry lines :\n\n head -2 ~/lm/startup/syml.fcc > syml.inasgasb\nmpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1\nmpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1 --band~fn=syml\necho -7,6 / | plbnds -nocol -fplot~sh~scl=.7 -ef=0 -scl=13.6 -lbl=L,G,X bnds.inasgasb\nopen fplot.ps\n \n \n\n lmf is invoked initially to establish the Fermi level.\nThis is not essential but it is convenient when drawing the energy bands.\n\n Inspect the first row of bnd2.dat (the Γ point is the first point in the second panel of the energy bands).\nYou should find the following:\n\n \n\n\n\n  k-point\n split off band\n light hole band\n heavy hole band\n conduction band\n \n \n 0.00000\n -0.3618 -0.3618\n -0.0299 -0.0299\n 0.0000 0.0001\n 0.6623 0.6623\n default cutoffs\n \n \n \n\n The split-off band, at −0.36 eV, is split slightly less than the experimental splitting (−0.43 eV).\nThe light-hole and heavy-hold bands should be degenerate; there is a slight splitting because the cubic symmetry\nwas artificially broken(1) (the c axis is not equivalent, e.g. the k mesh is different).\nThe bandgap, 0.66 eV, still significantly larger than the experimental value of 0.42 eV.\nBand gaps are overestimated, and indeed they should be because the RPA screened coulomb interaction W is not\nsufficiently screened. And also zero-point motion has been left out. Improvement of W by the addition of ladder\ndiagrams indeed does improve the gaps, as Kutepov has shown.\nHowever, these higher order diagrams are expensive, and we adopt a simpler approach here. The dielectric constant is\nabout 80% of experiment (it seems always to be the case for semiconductors and insulators), because ladder diagrams are\nmissing in the RPA. We have found that scaling ε by 0.8\n(assuming the full gets scaled by a fixed number), or alternatively using a\nhybrid of 80% QSGW and 20% LDA we can mimic the effect of the\nladders. This eliminates most of the error.\n\n mpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1 --mixsig=0.8\nmpix -n 16 lmf ctrl.inasgasb -vso=1 cat switches-for-lm --rs=1,0 -vnit=1 --band~fn=syml --mixsig=0.8\necho -7,6 / | plbnds -nocol -fplot~sh~scl=.7 -ef=0 -scl=13.6 -lbl=L,G,X bnds.inasgasb\n \n \n\n Click here to view the band structure of InAs and GaSb comparing QSGW with\nhybrid QSGW, .\nWith the scaling, agreement with ellipsometry measurements is excellent (shown as circles).\nThe fundamental gap drops to 0.42 eV in InAs.\n\n GaSb proceeds in much the same way as InAs. Repeat the preceding LDA+QSGW instructions,\nsubstituting inas2gasb0inas0gasb2. The direct gap is 1.21 eV,\nlarger than the experimental value 0.82 eV.\nWith SO coupling and scaling it drops to 0.78 eV.\nNote that to get more perfect agreement with experiment, the scaling factor 0.8 can be modified slightly.\n\n ### The InAs/GaSb [001] interface \n\n The procedure for a superlattice is nearly identical to the bulk. We have already generated the\nnecessary input files.\n\n Set shell variable dir to inas2gasb2/relax0 or inas4gasb4/relax0, or another directory where a\nsite file resides. The inas2gasb2 case is useful to construct the ctrl\nfile and to determine the forces at the interface\nbut the system is to small to be of relevance for electronic structure.\n\n Start with LDA self-consistency:\n\n cp$dir/* .\nlmfa ctrl.inasgasb\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm\n
\n
\n\n

You should find that the forces are all small. Forces on the frontier atoms will\nbe modest but still less that 10 mRy/au. Lattice relaxations are\ndiscussed later.\n\n

For the QSGW calculation, do the following. The number of electrons (set here through\nshell variable nel) isn’t essential.\n\n

lmfgwd --job=-1 ctrl.inasgasb cat switches-for-lm\nlmgwsc --wt --insul=$nel --mpi=16,16 --tol=2e-5 --sym --getsigp --save=$dir inasgasb > out.job\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm; mpix -n 16 lmf ctrl.inasgasb cat switches-for-lm --rs=1,0 -vnit=1 >  out.lmf\ncp rst.inasgasb  out.lmf $dir\n \n \n\n Self-consistency should be reached in 4 iterations.\n(InAs)2(GaSb)2 takes about 30 minutes/iteration;\n(InAs)4(GaSb)4 about 12 hours/iteration;\n(InAs)6(GaSb)6 about two days.\n\n ### Site-resolved Partial and Integrated Densities of States \n\n If you are not familiar with Questaal’s implementation of Densities-of-States (DOS) resolved by site, it is recommended\nthat you review the tutorial on partial DOS in Cr3Si6\nbefore going through this section.\n\n By projecting DOS onto sites, we can resolve the superlattice DOS layer by layer and compare to bulk InAs and GaSb.\nThis is useful in determining the valence band offset.\nHere we set up the DOS for the reference bulk systems.\n\n The instructions below refer to bulk InAs, bulk GaSb, and the (InAs)4(GaSb)4 superlattice.\nThe quantities in the table below distinguish which system the instructions apply to\n\n \n\n \n\n\n\n\n\n\n\n\n  Structure/variable\n directory\n k-divisions in-plane\n k-divisions normal\n site list\n dos channels\n \n \n \n dir\n nel\n nk1\n nk2\n sitelist\n doschan\n \n InAs\n inas2gasb0\n 28\n 12\n 9\n 1:8:2\n 1:4\n \n GaSb\n inas0gasb2\n 28\n 12\n 9\n 1:8:2\n 1:4\n \n (2,2) SL\n inas2gasb2/relax0\n 56\n 12\n 4\n 1:16:2\n 1:4;seq=5:16:4\n \n (4,4) SL\n inas4gasb4/relax0\n 112\n 12\n 2\n 1:32:2\n 1:4;seq=5:32:4\n \n (6,6) SL\n inas6gasb6/relax0\n 168\n 12\n 3\n 1:48:2\n 1:4;seq=5:48:4\n \n \n \n\n Assign shell variables to each of these quantities, e.g. in bash, dir=inas2gasb0 nk1=12 nk2=9 sitelist=1:8:2 doschan=\"1:4\"\nfor the InAs case.\n\n \n\n Variable sitelist is used in the argument --pdos~sites in lmf. It is a an integer list, e.g.\n1:31:2 → 1,3,5,…31.\n\n Variable doschan is used in the argument -lst= in pldos.\nIt is a generalized integer list; the argument to seq= is another list,\nwhich creates a new panel for each element in the list.\nIn particular, seq=1:4;seq=5:32:4 makes eight panels consisting of the following channels \n 1:4 5:8 9:12 13:16 17:20 21:24 25:28 29:32 \nwhile seq=1:4;seq=5:48:4 makes twelve panels consisting of the following channels \n 1:4 5:8 9:12 13:16 17:20 21:24 25:28 29:32 33:36 37:40 41:44 45:48\n\n These correspond to the individual (InAs) or (GaSb) layers when making partial DOS in the superlattice\n\n \n\n To make the DOS and iDOS, a moments file must be created.\n\n cp$dir/* . ; rm -f mixm.inasgasb\nln -s sigm sigm.inasgasb\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm --rs=1,0 -vnit=1\n
\n
\n\n

The last step is not needed, but run it anyway to confirm that the RMS DQ is small and that the bandgap is\nas it should be (0.76 eV in InAs).\n\n

It is important to include spin-orbit coupling, so we need to render the QSGW  Σ0 \nsuitable for reduced symmetry operations. Here we use the 80% hybrid to well reproduce the experimental band structure. Do:\n\n

lmf ctrl.inasgasb --wsig:fbz; cp sigm2.inasgasb sigm\nmpix -n 16 lmf -vso=1 ctrl.inasgasb -vnk1=$nk1 -vnk2=$nk2 --rs=1,0 -vnit=1 --rsig:fbz --pdos~mode=0~sites=$sitelist --mixsig=.80 --pr35,40 > out.pdos\ncp out.pdos$dir\n
\n
\n\n

Note the large number of k-divisions used. This is not necessary but a fine k mesh generates a smooth DOS.\nThe --pdos switch is explained in some detail in the partial densities of states\ntutorial. See also documentation for the command-line switch for\n–pdos.\n\n

lmf generates file moms.inasgasb, which contains the weights\nnecessary to generate site-resolved DOS. In what follows, DOS are generated in two forms: first to extract the partial\nDOS near the band edges, for drawing local DOS, and also the integrated DOS (iDOS) to extract the position of the\ndeep d states, which will be used\nalign reference levels in\nthe bulk with the superlattice, to extract the valence band offset.\n\n

##### Partial DOS resolved by site
\n\n

Partial DOS are made using the lmdos utility, once lmf has\ngenerated the appropriate file.\nThis utility generates the projection of DOS into augmentation spheres2,\ngiven a moms file generated by a band program,\nas documented in the\npartial densities of states tutorial, and also documentation for\nthe --dos command-line argument.\nYou must invoke lmdos with the same switches\nthat were supplied to lmf, and also an additional argument, --dos.\n\n

lmdos -vso=1 ctrl.inasgasb -vnk1=$nk1 -vnk2=$nk2 --rs=1,0 -vnit=1 --rsig:fbz --pdos~mode=0~sites=$sitelist --mixsig=.80 --dos:npts=2001:window=-1,1\n \n \n\n On exit, lmdos should print the following table (inas2gasb0 case)\n\n Channels in dos file generated by LMDOS:\n site class label spin-1 spin-2\n 1 1 In 1 2\n 3 2 As 3 4\n 5 4 In2 5 6\n 7 5 As2 7 8\n \n \n\n As the table shows, DOS are resolved for eight channels, interleaving (spin-up,spin-down). This system is\nnonmagnetic so the two are equal and there is no point in distinguishing them. Also the two In and two As should be equivalent.\nlmdos writes the DOS to file dos.inasgasb\nin a (not-particularly friendly) format.\npldos reads files in this format to make figures, as documented in the\npldos manual.\n\n There are thus four channels per layer. Since we don’t need to resolve DOS by site yet, make a figure of the In+As DOS\nfor a single layer by combining DOS for a single layer, i.e. channels 1:4. For the bulk InAs and GaSb cases, shell variable doschan should be set to “1:4”.\nMake a postscript file for the DOS with (instructions also apply to the superlattice, as described below)\n\n echo 0.999 4 -3 2 | pldos -fplot~sh~long~open~tmy=.25~dmin=0.40~xl=E -esclxy=13.6 -ef=0 -lst=\"$doschan\" dos.inasgasb\ncp dosp.dat dir/pdos.80\nopen fplot.ps\n \n \n\n fplot~... tells pldos to create a DOS data file dosp.dat, formatted in\nStandard Questaal format for xy data. The second\ncommand saves this file for future use, to draw reference and superlattice DOS on the same figure. pldos also makes a script plot.dos for the\nfplot utility, which will in turn generate a postscript file,\nfplot.ps. (You can edit plot.dos to customize the figure as we will\ndo when aligning superlattice and reference DOS). Modifiers ~long~open~tmy=.125~dmin=0.40~xl=E make the figure more\naesthetic, while ~sh tells pldos to run fplot in a subshell,\nmaking fplot.ps directly. -esclxy=13.6 converts ordinate and abscissa from atomic units to eV and\neV−1, respectively, and the abscissa is shifted to place the Fermi level at zero (ef=0).\n\n The arguments from standard input (0.999 5 -3 2) cap the DOS to just under 1, with a frame of about 5 cm, in an energy window (−3,2) eV.\n\n \n\n Superlattice DOS \n\n For the (InAs)4(GaSb)4 or (InAs)6(GaSb)6 superlattice,\nfollow essentially the same steps from the beginning of the pdos section,\nand it is instructive to resolve the DOS by layer.\nNow there are a multiplicity of layers (8 or 12) and 32 or 48 channels, four channels per layer;\npldos will draw 8 or 12 panels of DOS, one panel for each layer.\ndoschan is constructed to group the DOS for each layer into one panel\n(see sitelist and doschan shell variables explained).\n\n \n\n \n\n In+As DOS in InAs. Valence band maximum shown by the blue dashed line.\n\n \n\n Ga+Sb DOS in strained GaSb\n\n \n\n Layer resolved DOS in (InAs)6(GaSb)6 superlattice, with bulk DOS shifted by local electrostatic\nshifts shown as dashed lines.\n\n \n\n \n\n ##### Integrated DOS to extract position of core levels \n\n Invoke lmdos as before, but change the --dos switch to\n--dos:npts=40001:window=-3,1:rdm:idos. This generates the integrated DOS on a very fine energy\nmesh over a wide energy window, writing data in\nStandard Questaal format for xy data.\n\n lmdos -vso=1 ctrl.inasgasb -vnk1=nk1 -vnk2=$nk2 --rs=1,0 -vnit=1 --rsig:fbz --pdos~mode=0~sites=$sitelist --mixsig=.80 --dos:npts=40001:window=-3,1:rdm:idos\ncp dos.inasgasb dir/idos.80\n \n \n\n Inspect dos.inasgasb. Energy is stored in the first column\nand the iDOS starting in column 2. The second instruction saves\nthe iDOS for later, when we align bands to extract the valence band maximum.\n\n For the bulk cases, e.g. InAs, draw a picture of the integrated DOS over a broad energy window (−3,1) Ry:\n\n fplot -frme 0,.7,0,.4 -x -3,0 -y 0,7 -tmx .1:5 -colsy 1+1:1+4 -qr dos.inasgasb\nopen fplot.ps\n \n \n\n Four iDOS are drawn but spin-1 and spin-2 overlay each other. In one curve, at −2.8 Ry there are\ntwo closely spaced step-function changes in the iDOS to 2, and then 5 electrons. These are the five 5 As\nd states split into 2 + 3 levels by spin-orbit coupling. The other curve shows a similar shape near\n−1.1 . Above −0.8 Ry where the valence bands begin, the iDOS begin to rise again.\n\n For the superlattices there are many levels. To see the evolution of In d levels in a\n(−1.2,−1) Ry energy window, try\n\n fplot -frme 0,.7,0,.4 -x -1.2,-1 -y 0,5 -tmx .05 -1p -map -i 'x1>-1.2&x1<-1' 1:nr -colsy 4:24:4 -lt 1,col=0,0,0 -qr dos.inasgasb\nopen fplot.ps\n \n \n\n For the strained bulk GaSb or the superlattice, repeat the steps starting at Site-resolved Partial Densities of States, substituting the appropriate set of shell variables.\n\n \n\n iDOS showing core levels\">\n\n In+As iDOS in InAs\n\n \n\n Ga+Sb iDOS in strained GaSb\n\n \n\n In 4d iDOS in the (InAs)6(GaSb)6 superlattice on a finer energy scale\n\n \n\n \n\n ### Valence band offset \n\n #### Reference points needed for superlattice band offsets \n\n Interfacial effects — apart from possible long range electrostatic shifts — die out quickly. Then the local valence\nband maximum (l-VBM), sufficiently far from an interface, will not depend on the interface. A good way to\ndetermine the alignment of the l-VBM on two sides of an interface, is to choose a reference energy or potential\nwhose position relative to the l-VBM is constant far enough away from the interface; call it\nEref. Two good choices for Eref are:\n \n • the position of semicore states such as 3d or Sb 4d\n • the potential on the augmentation sphere boundary\n \n\n This construction enables us to determine a local valence band maximum (l-VBM) for any layer, but because of nonlocal quantum effects, its\nmeaning is not precise close to the interface.\n\n It is common practice to align bands from separate bulk calculations. This is how “natural band offsets” are\ndetermined, for example. Aligning bands for two independent materials relies on an assumption, namely that if an\ninterface were formed between two materials, no change in the dipole contribution to the electrostatic potential would\narise with respect superposition of the potentials from the independent materials. The “natural band offsets”\nscheme aligns bands from independent calculations of two surface structures. Other assumptions can be made, for example\nfrom the following. Imagine a lattice of spheres that fill space. If each sphere is neutral, a sensible definition of\nthe electrostatic potential is to choose 0 at the sphere boundary. As a next step, transfer charge between spheres.\nThe electrostatic potential (the Madelung potential) is now completely defined, since the reference was defined. In any\ncase the assumption can be tested by comparing how the potential differs from the potential of an actual interface.\nSince in fact the offset depends on details of the relaxation of the interface, any assumption is likely to be suspect.\n\n Absent additional dipoles forming at a junction relative to the bulk potentials as defined by the\nimplementation, valence band maxima are merely those of the bulk systems.\n\n This information is contained in the file out.pdos, of the\nbulk directory, e.g. for InAs (directory inas2gasb0) there should be this table:\n\n  BZWTS : --- Tetrahedron Integration ---\n ... only filled or empty bands encountered: ev=0.120480 ec=0.151794\n VBmax = 0.120480 CBmin = 0.151794 gap = 0.031314 Ry = 0.42587 eV\n \n \n\n Extract the VBM for the two bulk systems:\n\n grep -A 2 'VBmax' inas2gasb0/out.pdos | head -1 | awk '{print3}' > vb1\ngrep -A 2 'VBmax' inas0gasb2/out.pdos | head -1 | awk '{print 3}' > vb2\n \n \n\n If no additional dipole forms at the interface the band offset would be (0.120480-0.164545)×13.6 = −0.599 eV.\nThat is, the VBM of InAs falls below that of GaSb by about 0.6 eV.\n\n We need to add to this the dipole shift, which can be obtained by taking the difference in reference energies.\n\n ##### Dipole shifts by aligning d states in the superlattice to the bulk \n\n We align the d states (16 of them in the (4,4) superlattice), against the corresponding reference states. Thus we need\n \n 1. Energies of the bulk InAs + bulk GaSb d states\n 2. Energies of the d states in the superlattice\n \n\n For the former, figures were already drawn identifying the levels pictorially. There is\nsome arbitrariness in how a numerical value is extracted, but the arbitrariness is not large except for a possible uniform\nconstant which is irrelevant. For convenience let’s pick the energy where the electron count is exactly 4 for each lattice.\nThis readily accomplished with the mcx calculator.\nFor the bulk systems\n\n mcx -qr inas2gasb0/idos.80 -at 4 x2 -w:nohead . > d1\nmcx -qr inas2gasb0/idos.80 -at 4 x4 -w:nohead . >> d1\nmcx -qr inas0gasb2/idos.80 -at 4 x2 -w:nohead . > d2\nmcx -qr inas0gasb2/idos.80 -at 4 x4 -w:nohead . >> d2\n \n \n\n -at val expr finds the abscissa where the ordinate matches expr.\nNote that the first and third channels (In spin-1 and As spin-1) lie in columns 2 and 4.\nInspect files d1 and d2.\nYou should get about −1.038 Ry for the In level and −2.673 Ry for the As level.\n\n The d levels of a superlattice are a bit more complicated as there are many of them. \nThey are readily extracted in mcx using the\nlooping construct [ ... ]. Set shell variable\ndir according to the table and invoke mcx for the (4,4) superlattice as follows:\n\n mcx -qrdir/idos.80 -a idos [ ix=1:31:2 idos -at 4 x\\{ix+1} -tog -pop '?ix>1' -rcat ] > d3\n
\n
\n\n\n\n

For the (6,6) superlattice substitute 1:31:2 → 1:47:2.\n\n

\n\n

mcx extracts the crossing point of 4 electrons for columns 2,4,6,…32 and concatenates\nthem into a 16×2 array. 1:31:2 is the integer list 1,3,5,…31. Note\nhowever that these channels correspond to columns 1+1,1+3,1+5,…1+31 in file idos.80.\nBefore entering the loop  […]  mcx loads idos.80 onto the stack and names it array idos.\n\n

Within the loop arguments are expanded into\nidos -at 4 x2 -tog -pop idos -at 4 x4 -tog -pop -rcat .... Note that -rcat is executed only after\nthe iteration because of the conditional ?ix>1. For each column xn in the list,\nmcx finds the abscissa where column xn crosses 4 and pushes on the stack a 1×2 array\nwith the first column being the abscissa. idos, initially loaded onto the stack, is still present; thus\n-tog -pop toggles and pops the stack leaving only the desired result in as 1×2 array.\nIn the second and subsequent iterations -rcat concatenates the top two arrays, thus eventually accumulating a 16×2 array.\n\n

\n\n

Inspect file d3. You should see the 16 d levels of the superlattice. The\ndifference in the bulk and superlattice data is the local shift in VBM. Compute this difference and convert to eV.\nFor the (4,4) superlattice:\n\n

mcx [ ix=1:4 d1 '?ix>1' -rcat ] [ ix=1:4 d2 '?ix>1' -rcat ]  -rcat d3 -ccat -e2 x3 x1 -e1 x1-x2 -s13.6\n
\n
\n\n\n\n

For the (6,6) superlattice, substitute 1:4 → 1:6.\n\n

Inspect the output of this command. The (4,4) superlattice still has strong interface effects, so we discuss\nthe (6,6) case instead. Around row 6 the shift is about 0.05 eV; this corresponds to the middle (InAs)\nlayer. Around row 18 it is 0.01 eV. Note that all the elements can be shifted by a uniform constant,\nwhich arises from arbitrariness in the choice of the G=0 part of the potential.\nThus net dipole shift is about 0.04 eV.\n\n

##### Extracting electrostatic potentials from standard output
\n\n

An alternate way to obtain the band offset is to align bulk and superlattice electrostatic potentials on the\naugmentation sphere boundary. Apart from interfacial effects, it should yield the same result as the d level shifts.\n\n

lmf calculates the potential at each augmentation sphere\nboundary and sets the average to zero. This information is also contained in out.pdos;\nfor example for InAs there should be a table\n\n

 Average es pot at MT boundaries after vconst shift\n Site    ves        Site    ves        Site    ves        Site    ves\n   1  -0.033546  |    3   0.036403  |    5  -0.033548  |    7   0.036403\n   2   0.714034  |    4   0.662523  |    6   0.714049  |    8   0.662523\n
\n
\n\n\n\n

Sites 2,4,6,8 are floating orbital sites which we will ignore for the purpose of aligning bulk and superlattice states.\n\n

For the (InAs)4(GaSb)4 and (InAs)6(GaSb)6\nsuperlattices there are 32 or 48 potentials, of which the odd numbered sites correspond to the real atoms.\n\n

The following instructions extract these potentials from out.pdos for the two bulk systems and\nthe (InAs)4(GaSb)4 superlattice, saving results in files v1, v2, v3. In each of the instructions grep,\nawk and sed are used to extract the table and render it into a\nform of xy data that mcx can read. Then mcx extracts\nthe relevant potentials.\n\n

grep -A 2 'Average es pot at MT boundaries' inas2gasb0/out.pdos | awk '$1 ~ /^[0-9]+$/{print }' | sed 's/|//g' | mcx -nc=2 . -sort x1 -inc 'i%4==1|i%4==2' > v1\ngrep -A 2 'Average es pot at MT boundaries' inas0gasb2/out.pdos | awk '$1 ~ /^[0-9]+$/{print }' | sed 's/|//g' | mcx -nc=2 . -sort x1 -inc 'i%4==1|i%4==2' > v2\n... for the (4,4) superlattice:\ngrep -A 9 'Average es pot at MT boundaries' inas4gasb4/relax0/out.pdos | awk '$1 ~ /^[0-9]+$/{print }' | sed 's/|//g' | mcx -nc=2 . -sort x1 -inc 'i%2==1' > v3\n... for the (6,6) superlattice:\ngrep -A 13 'Average es pot at MT boundaries' inas6gasb6/relax0/out.pdos | awk '$1 ~ /^[0-9]+$/{print }' | sed 's/|//g' | mcx -nc=2 . -sort x1 -inc 'i%2==1' > v3\n
\n
\n\n
##### Aligning superlattice levels to reference
\n\n

We now have files d1d3… for the d levels\nand files v1v3… for the electrostatic potentials.\n\n

It is convenient to tabulate the levels as a function of height from the basal plane. This is easily accomplished with\nthe lmplan utility. For one of the superlattices, e.g. the (6,6) superlattice, set shell\nvariables according to the table and do\n\n

cp $dir/* .\necho q | lmplan ctrl.inasgasb\n \n \n\n lmplan prints out a table of positions of each site its\nprojection h on the axis perpendicular to the basal plane:\n\n  Gtplan: 24 different planes normal to ( 0.000000 0.000000 1.000000)\n Projection of normal onto P1, P2, P3: 0.000000 0.000000 6.055456\n ib Class Plane PL x-x.h y-y.h z-z.h h del h\n\n 1 1:In 1 0 0.00000 0.00000 0.00000 0.00000 0.28662\n 2 5:E 1 0 0.50000 0.00000 0.00000 0.00000 0.00000\n 3 2:As 2 0 0.25000 0.25000 0.00000 0.25000 0.25000\n 4 10:E2 2 0 0.25000 -0.25000 0.00000 0.25000 0.00000\n 5 6:In2 3 0 0.50000 0.00000 0.00000 0.50000 0.25000\n 6 15:E3 3 0 0.00000 0.00000 0.00000 0.50000 0.00000\n 7 7:As2 4 0 0.25000 -0.25000 0.00000 0.75000 0.25000\n 8 20:E4 4 0 0.25000 0.25000 0.00000 0.75000 0.00000\n \n \n\n Extract h from this table and store in file h, excluding floating sites:\n\n echo q | lmplan ctrl.inasgasb | grep -A 100 Plane | grep -v :E | awk '$1 ~ /^[0-9]+$/{print$8,\"#\",$2}' > h\n \n \n\n Make a single file with the superlattice and bulk electrostatic potentials, and another with the corresponding d levels. Note the conversion to electron volts.\nAlso plot these changes as a function of h, solid lines for the electrostatic potential and dashed for the d levels.\nThe following applies for the (4,4) case; for the (6,6) superlattice, substitute 1:4 → 1:6.\n\n mcx v3 [ ix=1:4 v1 '?ix>1' -rcat ] [ ix=1:4 v2 '?ix>1' -rcat ] -rcat -ccat -e2 x2 x4 -s13.6 -w:nohead . | pr -m -t - h > estat\nmcx d3 [ ix=1:4 d1 '?ix>1' -rcat ] [ ix=1:4 d2 '?ix>1' -rcat ] -rcat -ccat -e2 x1 x3 -s13.6 -w:nohead . | pr -m -t - h > dlevel\nfplot -frme 0,.7,0,.7 -ab x3 -ord x1-x2 estat -ab x3 -ord x1-x2 -lt 2 dlevel\n \n \n\n\n\n \n\n Shifts in d levels (dashed line) and potentials (solid line) at the augmentation boundary in the\n(InAs)6(GaSb)6 superlattice, relative to the bulk, as a function of height h from the basal plane.\n\n \n\n \n\n In the figure, the vertical dot-dashed lines show the center point of the (InAs) and (GaSb) layers, respectively.\nNote the following points:\n \n 1. The two references are slightly inconsistent, especially at the boundary layers. These are consequences of finite-size effects. \nEven where the potential is most bulk-like there is still a nearly constant 0.02 eV discrepancy.\n 2. A global constant can be added to either of these shifts, since they are determined by the arbitrary definition of the G=0 potential. \nTaking this into account, the relevant dipole shift is the change at the midpoints (compare blue and red lines).\nThe shift is approximately 0.05 eV.\n 3. The potential shift is not quite flat even in the middle regions. This is not an artifact of the\nsmall cell: if a still longer cell were calculated it would become clear that there is a linear term, which if many\nlayers are present, would cause a dielectric breakdown. This is to be expected because the [001]\ninterface is polar. In the real world the crystal will reconstruct somehow, possibly by introducing charged defects at the\ninterface.\n 4. The dipole adds to the “natural” (or reference) valence band offset\nwhich is −0.599 eV. Thus the band offset is 0.55 eV.\n \n\n ##### Interpretation of (6,6) superlattice \n\n With this information in hand let’s revisit the partial DOS of the (6,6) superlattice and observe the following\n\n \n 1. DOS in the frontier layers (InAs)1, (InAs)6, (GaSb)1 (GaSb)6\ndiffers significantly from the bulk counterpart. GaSb valence bands just near the valence band maximum\ntunnel into the InAs (see (InAs)1 near the VBM); similarly InAs conduction band states near the conduction band minimum tunnel into the GaSb\n(see (GaSb)1 near the CBM). These states decay exponentially away from the interface.\n 2. Even while the band offset exceeds the bulk InAs bandgap (0.43 eV), the gap does not close, even in the (6,6) superlattice.\nLook for the gap in inas6gasb6/relax0/out.pdos: it is 0.28 eV.\nThis appears to originate from confinement effects: the GaSb acts like an effective quantum well confining the (highly extended) states in the\nInAs conduction band.\n \n\n To more clearly see this, make and inspect the energy bands along the c axis around a (−1,1) eV window around the Fermi energy\n\n echo 11 0 0 0 0 0 .5 > symlz.inasgasb\nmpix -n 11 lmf -vso=1 ctrl.inasgasb -vnk1=12 -vnk2=2 --rs=1,0 -vnit=1 --rsig:fbz --mixsig=.80 --band~mq~col=1:30,dup=936,seq=79:391:78~col2=40:69,dup=936,seq=118:430:78~fn=symlz\necho -1,1,5,10 | plbnds -fplot~scl=.7~sh -ef=0 -scl=13.6 -dat=green -lt=1,bold=3,col=0,0,1,colw=1,0,0,colw2=0,1,0 -lbl=G,X bnds.inasgasb\n \n \n\n \n\n \n\n \n\n Bands colored blue are of GaSb character. There is a nearly dispersionless state at the VBM (E=0). To the extent a\nband is red, it is of InAs character. The lowest conduction band has significant, but by no means all InAs character:\nInAs has a very small effective mass, and this state it is higher than it would be in a longer period superlattice\nbecause of confinement effects. The extended range of this state is also evident by its significant dispersion.\nStates colored green are of As character. The highest valence-band state of nearly pure As character lies at around −0.8 eV.\nThose between −0.8 eV and −0.1 eV are of mixed GaSb/As character, with increasing GaSb approaching the E=0.\n\n\n\n ### Atomic Relaxation of Superlattices \n\n This section explains how a limited relaxation of the (2,2) superlattice is accomplished.\nAs noted when it was constructed (see lmscell and blm arguments explained\nThe (2,2) superlattice was used as a template to construct ctrl.inasgasb, and a the (GaSb) layers were stacked on\nwith a particular offset (0,0,−0.032) that minimized the total energy.\n\n Here we explain how that shift was determined by parameterizing the shift as (0,0,delta) and examining the total energy and forces as a function of delta\n\n Set shell variable delta to (0,0,−0.032), e.g. in the bash shell, delta=-.032,\nand revisit the generation of the (InAs)2(GaSb)2 site file\n\n cp ./inas-zb/* .\ncp inas2gasb0/site.inasgasb site.inas\ncp inas0gasb2/site.inasgasb site.gasb\nlmscell inas \"--stack~show~file@site.gasb@dpos=0,0,$delta~show~wsite@short\"\ncp inas2gasb2/relax0/* .\ncp sites.inas site.inasgasb\n
\n
\n\n

You should find, for delta=−0.032, that site.inasgasb and inas2gasb2/relax0/site.inasgasb\nare identical, but change with delta.\n\n

Repeat the instructions above for delta=0 and make the calculation self-consistent\n\n

rm -f mixm.inasgasb rst.inasgasb\nlmfa ctrl.inasgasb\nmpix -n 16 lmf ctrl.inasgasb cat switches-for-lm -vdelta=\$delta\n
\n
\n\n

Forces are printed in a table from stdout:\n\n

 Forces, with eigenvalue correction\n  ib           estatic                  eigval                    total\n   1    0.00    0.00  -13.34     0.00    0.00   60.85     0.00    0.00   47.51\n...\n   7    0.00    0.00   18.44     0.00    0.00   17.52     0.00    0.00   35.96\n   9    0.00    0.00   26.55     0.00    0.00  -56.90     0.00    0.00  -30.34\n...\n  15    0.00    0.00   -7.94     0.00    0.00  -45.71     0.00    0.00  -53.65\n
\n
\n\n

Forces are large and opposite at the (1,15) interface, and similarly so at the (7,9) interface\nBy rigidly translating the GaSb block all of the forces should drop.\n\n

Repeat the setup and relaxation for delta=−0.01 and the maximum force should drop from\n53.7 to 38.9. Also you should find that the total energy drops by about 9 mRy.\nRepeat the steps for the sequence delta=0, −0.01, −0.02, −0.03, −0.04\nand you should see the following emerge\n\n

\n\n\n\n\n\n\n\n\n\n
 delta\n Mean abs force\n Maximum force\n Total energy\n \n 0\n 22.15\n 53.65\n -66205.7300418\n \n -0.01\n 15.56\n 38.89\n -66205.7386342\n \n -0.02\n 9.20\n 25.00\n -66205.7442142\n \n -0.03\n 3.51\n 12.08\n -66205.7468116\n \n -0.032\n 2.98\n 9.62\n -66205.7469775\n \n -0.034\n 2.48\n 7.20\n -66205.7470269\n \n -0.04\n 3.84\n 11.52\n -66205.7464823\n \n \n
\n\n

The mean absolute value of the force is minimum around delta=−0.034, as is the minimum in total energy. For\nthe SL calculations we selected delta=−0.032 — not quite optimum because a slightly cruder minimization process was used. At the\nrelaxed point the maximum force is 9.6 (delta=−0.032) and 7.2 (delta=−0.034).\n\n

The lattice should properly be fully relaxed. This is readily accomplished through the DYN category.\nAdding -vminx=t includes this category in the input:\n\n

mpix -n 16 lmf ctrl.inasgasb cat switches-for-lm -vminx=t > out &\n
\n
\n\n

but the forces are already small at the first stage and the additional relaxation hardly affects the band structure.\n\n

### Longer period superlattices

\n\n

… To be finished\n\n

### Footnotes and references

\n\n

1 The zincblende lattice doubled along the z is a conventional cell in the sense that all primitive lattice\nvectors are orthogonal. It differs from the proper conventional for the zincblende lattice (a cube, with 8 atoms), and\nis not a true conventional cell because it reduces the symmetry from cubic to tetragonal symmetry.\n\n

2\nThe In+As DOS do not sum to the total DOS because there is a missing interstitial contribution.\nThis is unimportant for the present purposes.\n\n\n","dir":"/tutorial/misc/lmscell/","name":"tut_superlattice.md","path":"pages/tut_superlattice.md","url":"/tutorial/misc/lmscell/"} ); tableOfContents();