DFTB+ Preparation#
This guide is here to help you prepare DFTB+ Calculations to be used with pyprocar.
Required files : bands.out, detailed.xml, detailed.out, eigenvectors.out
flag : code=’dftb+’
In the DFTB+ code, the wavefunction is written in eigenvectors.out
by setting WriteEigenvectors = Yes
and EigenvectorsAsText =
Yes
in the Analysis
Block. From the wavefunction the projections
are calcualted by pyprocar.
The information of the energy levels (bands) are written in the file
bands.out
, by setting WriteBandOut = Yes
, also in the
Analisys
block. The Fermi level, k-points, and crystal structure
is written in the files detailed.out
and detailed.xml
. It
needs the flags WriteDetailedXML = Yes
and WriteDetailedOut =
Yes
in the Options
block.
In summary, your dftb_in.hsd
file should have the following sections:
Analysis = {
EigenvectorsAsText = Yes
WriteEigenvectors = Yes
WriteBandOut = Yes
}
Options = {
WriteDetailedOut = Yes
WriteDetailedXML = Yes
}
- MIND: Once pyprocar loads the DFTB+ wavefunctions, it creates a
PROCAR
file (vasp format) and other vasp-like ouput files. Loading aPROCAR
is much faster than the DFTB+ wavefunctions. If thePROCAR
file is present, pyprocar automatically load it instead of the wavefunctions.
Density of states is not supported
Preparing Calculations#
To use DFTB+, one has to run various calculations in independent directories. Here, we will show examples for the different calculations.
Band Structure (SSC)#
Create directory called
scf
.Perform self-consistent calculation in this
scf
directory.Create directory called
bands
.Move the
charges.bin
file in thescf
directory to thebands
directoryAdd the relevant k-points to the input
dftb_in.hsd
. See an example in the DFT recipes <https://dftbplus-recipes.readthedocs.io/en/latest/basics/bandstruct.html#calculating-the-band-structure>Make sure to add the tags
WriteBandOut
,WriteDetailedXML
,WriteDetailedOut
,WriteEigenvectors
,EigenvectorsAsText
toYes
in their respective blocks.Perform a non-self consistent calculation, by adding
ReadInitialCharges = Yes
,MaxSCCIterations = 1
to theHamiltonian
block ofdftb_in.hsd
Run pyprocar.bandsplot(dirname = ‘bands’ ,mode = ‘plain’, code = ‘dftb+’)
Band Structure (non-SSC)#
Add the relevant k-points to the input
dftb_in.hsd
. See an example in the DFT recipes <https://dftbplus-recipes.readthedocs.io/en/latest/basics/bandstruct.html#calculating-the-band-structure>Make sure to add the tags
WriteBandOut
,WriteDetailedXML
,WriteDetailedOut
,WriteEigenvectors
,EigenvectorsAsText
toYes
in their respective blocks.Run pyprocar.bandsplot(dirname = ‘bands’ ,mode = ‘plain’, code = ‘dftb+’)
Fermi (SCC)#
Create directory called
scf
.Perform self-consistent calculation in this
scf
directory.Create directory called
fermi
.Move the
charges.bin
file in thescf
directory to thefermi
directory.Make sure there is a kmesh in the
KPointsAndWeights
tag of theHamiltonian
block,dftb_in.hsd
file in thefermi
directory.Make sure to add the tags
WriteBandOut
,WriteDetailedXML
,WriteDetailedOut
,WriteEigenvectors
,EigenvectorsAsText
toYes
in their respective blocks.Perform a non-self consistent calculation in the
fermi
by settingReadInitialCharges = Yes
,MaxSCCIterations = 1
to theHamiltonian
block ofdftb_in.hsd
.Run pyprocar.FermiHandler(dirname = ‘fermi’, code = ‘vasp’)
Adding names to k-points#
You can provide relevant names of the k-points as an argument to pyprocar.bandsplot(...)
.
Suppose you have the following Hamiltonian
block
Hamiltonian = DFTB {
SCC = Yes
SccTolerance = 1e-5
MaxSCCIterations = 1
...
KPointsAndWeights = KLines {
1 0.0 0.0 0.0
10 0.333333 0.333333 0.0
10 0.5 0.0 0.0
10 0.0 0.0 0.0
}
}
you can use pyprocar.bandsplot(dirname = ‘bands’, mode = ‘plain’, code = ‘dftb+’, kticks=[0,10,20,30], knames=[r’Gamma’, ‘K’, ‘M’, r’Gamma’])