morfeus.xtb module#

xtb interface code.

class morfeus.xtb.XTB(elements, coordinates, version='2', charge=0, n_unpaired=None, solvent=None, electronic_temperature=None)[source]#

Bases: object

Calculates electronic properties with the xtb-python package.

Parameters:
  • elements (Iterable[int] | Iterable[str]) – Elements as atomic symbols or numbers

  • coordinates (ArrayLike2D) – Coordinates (Å)

  • version (str) – Version of xtb to use. Currently works with ‘1’ or ‘2’.

  • charge (int) – Molecular charge

  • n_unpaired (int | None) – Number of unpaired electrons

  • solvent (str | None) – Solvent. See xtb-python documentation

  • electronic_temperature (int | None) – Electronic temperature (K)

get_bond_order(i, j)[source]#

Returns bond order between two atoms.

Parameters:
  • i (int) – Index of atom 1 (1-indexed)

  • j (int) – Index of atom 2 (1-indexed)

Returns:

Bond order

Return type:

bond_order

get_bond_orders(charge_state=0)[source]#

Returns bond orders.

Parameters:

charge_state (int) – Charge state relative to original charge

Returns:

Bond orders

Return type:

bond_orders

get_charges(charge_state=0)[source]#

Returns atomic charges.

Parameters:

charge_state (int) – Charge state relative to original charge

Returns:

Atomic charges

Return type:

charges

get_dipole(charge_state=0)[source]#

Calculate dipole vector (a.u.).

Parameters:

charge_state (int) – Charge state relative to original charge

Returns:

Dipole vector

Return type:

dipole

get_ea(corrected=False)[source]#

Calculate electron affinity.

Parameters:

corrected (bool) – Whether to apply correction term

Returns:

Electron affinity (eV)

Return type:

ea

get_fukui(variety)[source]#

Calculate Fukui coefficients.

Parameters:

variety (str) – Type of Fukui coefficient: ‘nucleophilicity’, ‘electrophilicity’, ‘radical’, ‘dual’, ‘local_nucleophilicity’ or ‘local_electrophilicity’.

Returns:

Atomic Fukui coefficients

Return type:

fukui

Raises:

ValueError – When variety does not exist

get_global_descriptor(variety, corrected=False)[source]#

Calculate global reactivity descriptors.

Parameters:
  • corrected (bool) – Whether to apply correction term

  • variety (str) – Type of descriptor: ‘electrophilicity’, ‘nucleophilicity’, ‘electrofugality’ or ‘nucleofugality’

Returns:

Global reactivity descriptor (eV)

Return type:

descriptor

Raises:

ValueError – When variety does not exist

get_homo()[source]#

Calculate HOMO energy.

Returns:

HOMO energy (a.u.)

Return type:

homo_energy

get_ip(corrected=False)[source]#

Calculate ionization potential.

Parameters:

corrected (bool) – Whether to apply correction term

Returns:

Ionization potential (eV)

Return type:

ip

get_lumo()[source]#

Calculate LUMO energy.

Returns:

LUMO energy (a.u.)

Return type:

lumo_energy

morfeus.xtb.cli(file)[source]#

CLI for XTB.

Parameters:

file (str) – Geometry file

Returns:

Partially instantiated class

Return type:

Any