DFTB+ is a density-functional tight-binding implemenation. More information about DFTB can be found on its official website.
DFTB+ is not a part of ADF Suite. To run DFTB+ calculations with PLAMS you need to obtain and install DFTB+ manually.
4.5.1. Preparing a calculation¶
Preparing an instance of
DFTBPlusJob follows the general principles for
SingleJob. Information adjusting the input file is stored in the
myjob.settings.input branch. The geometry of your system can be supplied via the class
Molecule. Note that the molecule is transformed into the
GenFormat with the
C (cluster) or
S (supercell) option, meaning the class can handle clusters and supercell systems. The option
F for fractional coordinates is not available! See the manual for further information on the different geometry-input types.
Input files for DFTB+ are either in HSD (human-friendly structured data) or XML format. This interface will produce HSD format input files. See the manual for further information on keywords and structure. The input file must be named dftb_in.hsd and is therefore created using this name. Note that many values have standard settings, those will all be printed to dftb_pin.hsd when you start a calculation. Check both files for errors when having problems.
- HSD input files are organized using different properties. Each property is represented by a key. The key can be of type logical, integer, real, string, property list or method type. The last two begin and end with curly brackets. Since property lists and method types are very similar in notation we require a way of representing that style in the tree-like structure of
Settings. This is done by automatically creating either property lists or method types whenever a key has a subkey.
If a key has a subkey and a key
_h, the string assigned to
_hwill be used as a method name.
If a key has one or more subkeys it will be created as a property list:
>>> myjob.setting.input.hamiltonian._h = 'DFTB' #sets the hamiltonian property to be of a method type named DFTB >>> myjob.setting.input.parseroptions.parserversion = '4' #sets the key parserversion of the property list parserversion to 4
Empty method types can be created by not giving any subkeys to a key except
The runscript will call the binary
dftb+, so make sure it is in your
$PATH. No options are supported. The standard output is redirected to
$JN.out, errors to
4.5.2. Results extraction¶
DFTB+ creates multiple outputfiles, none of them are renamed. See
detailed.out for the results of your calculation. Resulting geometries are saved in
.gen format by DFTB+. Other files might be created depending on your calculation type.
common = Settings() common.input.driver._h = 'ConjugateGradient' common.input.hamiltonian._h = 'DFTB' common.input.hamiltonian.scc = 'yes' common.input.hamiltonian.mixer._h = 'Broyden' common.input.hamiltonian.mixer.mixingparameter = '0.2' common.input.hamiltonian.slaterkosterfiles._h = 'Type2Filenames' common.input.hamiltonian.slaterkosterfiles.prefix = '"~/SLAKO/mio-1-1/"' common.input.hamiltonian.slaterkosterfiles.separator = '"-"' common.input.hamiltonian.slaterkosterfiles.suffix = ".skf" common.input.hamiltonian.slaterkosterfiles.lowercasetypename = 'No' common.input.hamiltonian.maxangularmomentum.c = '"p"' common.input.hamiltonian.maxangularmomentum.h = '"s"' common.input.parseroptions.parserversion = '4' mol = Molecule(filename='mol.xyz') # read Molecule from mol.xyz job = DFTBPlusJob(name='plamstest', molecule=mol, settings=common) jobres = job.run() energy = jobres.get_energy(string='Fermi energy', unit='ev') print(energy) mol = jobres.get_molecule() print(mol) atomic_charges = jobres.get_atomic_charges() print(atomic_charges)
DFTBPlusJob(molecule=None, name='plamsjob', settings=None, depend=None)¶
A class representing a single computational job with DFTB+. Only supports molecular coordinates, no support for lattice yet.
Transform all contents of
setting.inputbranch into string with blocks, keys and values.
Automatic handling of
moleculecan be disabled with
settings.ignore_molecule = True.
dftb+ has to be in your $PATH!
Returns true if ‘ERROR!’ is not found in the output.
A Class for handling DFTB+ Results.
Returns the molecule from the ‘geo_end.gen’ file. If there is no ASE, try to read the ‘geo_end.xyz’ file.
get_energy(string='Total energy', unit='au')¶
Fucntion returning the energy given in the output with description ‘<string>:’ in units of ‘<string>:’, standard is ‘Total energy’ and ‘au’.
Function returning dictonary with atom numbers and their charges, ordering is the same as in the input.