delfta.xtb module#

© 2021, ETH Zurich

delfta.xtb.read_xtb_json(json_file, mol)[source]#

Reads JSON output file from xTB.

Parameters:
  • json_file (str) – path to output file

  • mol (pybel molecule object) – molecule object, needed to compute atomic energy

Returns:

dictionary of xTB properties

Return type:

dict

delfta.xtb.get_homo_and_lumo_energies(data)[source]#

Extracts HOMO and LUMO energies.

Parameters:

data (dict) – dictionary from xTB JSON output

Returns:

HOMO/LUMO energies in eV

Return type:

tuple(float)

Raises:

ValueError – in case of unpaired electrons (not supported)

delfta.xtb.get_wbo(wbo_file)[source]#

Reads WBO output file from xTB and generates a dictionary with the results.

Parameters:

wbo_file (str) – path to xTB wbo output file

Returns:

list with Wiberg bond orders (only covalent bonds)

Return type:

list

delfta.xtb.run_xtb_calc(mol, opt=False, return_optmol=False)[source]#

Runs xTB single-point calculation with optional geometry optimization.

Parameters:
  • mol (pybel molecule object) – assumes hydrogens are present

  • opt (bool, optional) – Whether to optimize the geometry, by default False

  • return_optmol (bool, optional) – Whether to return the optimized molecule, in case optimization was requested, by default False

Returns:

Molecular properties as computed by GFN2-xTB (formation energy, HOMO/LUMO/gap energies, dipole, atomic charges)

Return type:

dict

Raises:

ValueError – If xTB calculation yield a non-zero return code.