spycci.engines.dftbplus sub-module

DFTBInput class

class spycci.engines.dftbplus.DFTBInput(method='DFTB', parameters='3ob/3ob-3-1', solver=None, thirdorder=True, dispersion=False, fermi=False, fermi_temp=300.0, parallel='mpi', verbose=True, DFTBPATH=None, DFTBPARAMDIR=None)

Interface for running DFTB+ calculations

Parameters:
  • method (str) – level of theory, by default “DFTB”. “xTB” also supported.

  • parameters (str) – parameters to be used for the DFTB Hamiltonian (by default 3ob)

  • solver (str) – LAPACK eigensolver method (check manual for available options)

  • thirdorder (bool) – activates the 3rd order terms in the DFTB Hamiltonian

  • dispersion (bool) – activates D3 dispersion corrections (off by default)

  • fermi (bool) – Fills the single particle levels according to a Fermi distribution (off by default).

  • fermi_temp (float) – Electronic temperature in Kelvin units. Note, this is ignored for thermostated simulations. By default, 300 K.

  • parallel (str) – selects either openmpi-parallel version (mpi) or shared memory version (nompi)

  • verbose (bool) – if set to True, saves the full DFTB+ output, otherwise, only the smaller files

  • DFTBPATH (str) – the path to the dftb+ executable. If set to None (default) the dftb+ executable will be loaded automatically.

  • DFTBPARAMDIR (str) – the path to the DFTBPLUS_PARAM_DIR environment variable, where the Slater-Koster files are located

method

level of theory, by default “DFTB”. “xTB” also supported.

Type:

str

parameters

parameters to be used for the DFTB Hamiltonian (by default 3ob)

Type:

str

solver

LAPACK eigensolver method (check manual for available options)

Type:

str

dispersion

activates D3 dispersion corrections (off by default)

Type:

bool

parallel

selects either openmpi-parallel version (mpi) or shared memory version (nompi)

Type:

str

verbose

if set to True, saves the full DFTB+ output, otherwise, only the smaller files

Type:

bool

md_nvt(mol, steps, timestep=1.0, temperature=298.0, mdrestartfreq=100, box_side=None, ncores=None, maxcore=None, inplace=False, remove_tdir=True, compress_traj=True)

Molecular Dynamics simulation in the Canonical Ensemble (NVT).

Parameters:
  • mol (System object) – Input molecule to use in the calculation.

  • steps (int) – Total steps of the simulation

  • timestep (float, optional) – Time step (in fs) for the simulation.

  • temperature (float, optional) – Temperature (in Kelvin) of the simulation

  • mdrestartfreq (int, optional) – MD information is printed to md.out every mdrestartfreq steps, by default 100

  • box_side (float, optional) – for periodic systems, defines the length (in Å) of the box side

  • ncores (int, optional) – number of cores, by default all available cores

  • maxcore (dummy variable) – dummy variable used for compatibility with Orca calculations

  • inplace (bool, optional) – updates info for the input molecule instead of outputting a new molecule object, by default False

  • remove_tdir (bool, optional) – Temporary work directory will be removed, by default True

  • compress_traj (bool, optional) – if True, parses the geo.end and md.out files into a single, smaller file, which is then zipped in an archive.

Returns:

Ensemble containing the NVT MD trajectory data

Return type:

Ensemble

opt(mol, latticeopt=False, ncores=None, maxcore=None, inplace=False, remove_tdir=True)

Geometry optimization.

Parameters:
  • mol (System object) – Input molecule to use in the calculation.

  • latticeopt (bool, optional) – If True, also optimize PBC conditions. By default, False

  • ncores (int, optional) – number of cores, by default all available cores

  • maxcore (dummy variable) – dummy variable used for compatibility with Orca calculations

  • inplace (bool, optional) – updates info for the input molecule instead of outputting a new molecule object, by default False

  • remove_tdir (bool, optional) – Temporary work directory will be removed, by default True

Returns:

newmol – Output molecule containing the new energies.

Return type:

System object

parse_output(mol)

The function will parse a DFTB+ output file automatically looking for all the relevant numerical properties derived form a calculation. All the properties of the given molecule will be set or updated.

Parameters:

mol (System) – The System to which the properties must be written to.

Raises:

RuntimeError – Exception raised if the given path to the output file is not valid.

Return type:

None

simulated_annealing(mol, start_temp=1.0, target_temp=2000.0, ramp_steps=500, hold_steps=1000, timestep=1.0, mdrestartfreq=100, box_side=None, ncores=None, maxcore=None, inplace=False, remove_tdir=True, compress_traj=True)

Molecular Dynamics simulated annealing simulation in the Canonical Ensemble (NVT)

Parameters:
  • mol (System object) – Input molecule to use in the calculation.

  • start_temp (float, optional) – Starting temperature (default, 1K)

  • target_temp (float, optional) – Maximum temperature reached during the simulation (default, 2000K)

  • ramp_steps (int, optional) – Number of MD steps for the heating/cooling ramps (default, 500 steps)

  • hold_steps (int, optional) – Number of MD steps held at target_temp (default, 1000 steps)

  • timestep (float, optional) – Time step (in fs) for the simulation.

  • mdrestartfreq (int, optional) – MD information is printed to md.out every mdrestartfreq steps, by default 100

  • box_side (float, optional) – for periodic systems, defines the length (in Å) of the box side

  • ncores (int, optional) – number of cores, by default all available cores

  • maxcore (dummy variable) – dummy variable used for compatibility with Orca calculations

  • inplace (bool, optional) – updates info for the input molecule instead of outputting a new molecule object, by default False

  • remove_tdir (bool, optional) – Temporary work directory will be removed, by default True

  • compress_traj (bool, optional) – if True, parses the geo.end and md.out files into a single, smaller file.

Returns:

System obtained at the end of the simulated annealing

Return type:

System

spe(mol, ncores=None, maxcore=None, inplace=False, remove_tdir=True)

Single point energy calculation.

Parameters:
  • mol (System object) – Input molecule to use in the calculation.

  • ncores (int, optional) – number of cores, by default all available cores

  • maxcore (dummy variable) – dummy variable used for compatibility with Orca calculations

  • inplace (bool, optional) – updates info for the input molecule instead of outputting a new molecule object, by default False

  • remove_tdir (bool, optional) – Temporary work directory will be removed, by default True

Returns:

newmol – Output molecule containing the new energies.

Return type:

System object