.. module:: ase.calculators.dftb ===== DFTB+ ===== Introduction ============ `DFTB+`_ is a density-functional based tight-binding code using atom-centered orbitals. This interface makes it possible to use `DFTB+`_ as a calculator in ASE. You need Slater-Koster files for the combination of atom types of your system. These can be obtained at dftb.org_. .. _DFTB+: https://www.dftbplus.org/ .. _dftb.org: http://www.dftb.org/ Environment variables ===================== .. highlight:: bash The default command that ASE will use to start DFTB+ is ``dftb+ > PREFIX.out``. You can change this command by setting the :envvar:`ASE_DFTB_COMMAND` environment variable, e.g.:: $ export ASE_DFTB_COMMAND="/path/to/dftb+ > PREFIX.out" For compatibility, also the old :envvar:`DFTB_COMMAND` variable can be used, and the resulting command will be ``$DFTB_COMMAND > PREFIX.out``. Before each DFTB+ calculation, also make sure that the :envvar:`DFTB_PREFIX` variable points to the directory where the Slater-Koster files are kept, e.g.:: $ export DFTB_PREFIX=/path/to/mio-0-1/ Parameters ========== As a FileIOCalculator, ``ase.calculators.dftb.Dftb`` writes input files, runs DFTB+, and extracts the required information from the resulting output. The input files are :file:`dftb_in.hsd` (the calculation settings), :file:`geo_end.gen` (the initial geometry) and :file:`dftb_external_charges.dat` (the external point charges in case of electrostatic QM/MM embedding). .. highlight:: none All keywords for the :file:`dftb_in.hsd` input file (see the DFTB+ manual) can be set by ASE. Consider the following input file block:: Hamiltonian = DFTB { SCC = Yes SCCTolerance = 1e-8 MaxAngularMomentum = { H = s O = p } } .. highlight:: python This can be generated by the DFTB+ calculator by using the following settings:: calc = Dftb(Hamiltonian_='DFTB', # this line is included by default Hamiltonian_SCC='Yes', Hamiltonian_SCCTolerance=1e-8, Hamiltonian_MaxAngularMomentum_='', Hamiltonian_MaxAngularMomentum_H='s', Hamiltonian_MaxAngularMomentum_O='p') In addition to keywords specific to DFTB+, also the following keywords arguments can be used: restart: str Prefix for restart file. May contain a directory. Default is None: don't restart. ignore_bad_restart_file: bool Ignore broken or missing restart file. By default, it is an error if the restart file is missing or broken. label: str (default 'dftb') Prefix used for the main output file (