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
PROCARfile (vasp format) and other vasp-like ouput files. Loading aPROCARis much faster than the DFTB+ wavefunctions. If thePROCARfile 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
scfdirectory.Create directory called
bands.Move the
charges.binfile in thescfdirectory to thebandsdirectoryAdd 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,EigenvectorsAsTexttoYesin their respective blocks.Perform a non-self consistent calculation, by adding
ReadInitialCharges = Yes,MaxSCCIterations = 1to theHamiltonianblock ofdftb_in.hsdRun 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,EigenvectorsAsTexttoYesin their respective blocks.Run pyprocar.bandsplot(dirname = ‘bands’ ,mode = ‘plain’, code = ‘dftb+’)
Fermi (SCC)#
Create directory called
scf.Perform self-consistent calculation in this
scfdirectory.Create directory called
fermi.Move the
charges.binfile in thescfdirectory to thefermidirectory.Make sure there is a kmesh in the
KPointsAndWeightstag of theHamiltonianblock,dftb_in.hsdfile in thefermidirectory.Make sure to add the tags
WriteBandOut,WriteDetailedXML,WriteDetailedOut,WriteEigenvectors,EigenvectorsAsTexttoYesin their respective blocks.Perform a non-self consistent calculation in the
fermiby settingReadInitialCharges = Yes,MaxSCCIterations = 1to theHamiltonianblock 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’])