6.6. XTB Input/Output interfaces

class pharmaforge.interfaces.xtbio.XTBInterface(default=False, **options)[source]

Bases: AbstractIO

This class is used to calculate the energies and forces for a single point calculation using XTB and the atomic simulation environment (ASE). For more information on the XTB calculator, see the ASE documentation.

self.xtb_options = {
    "method": "GFN2-xTB",
    "accuracy": 1.0,
    "electronic_temperature": 300.0,
}
Parameters:
  • default (bool) – If True, use the default options for the XTB calculator. Default is False.

  • options (dict) – A dictionary of options to pass to the XTB calculator. Default is an empty dictionary.

calculator

The XTB calculator object.

Type:

object

allow_parallel

Whether to allow parallelization. Default is False.

Type:

bool

level_of_theory

The level of theory used for the calculations. Default is “XTB”.

Type:

str

options_dict

A dictionary of options for the XTB calculator, that can include things not sent to the calculator.

Type:

dict

xtb_options

A dictionary of options for the XTB calculator, that are passed to the calculator.

Type:

dict

See also

pharmaforge.interfaces.abstractio.AbstractIO

The abstract interface class for the Psi4Interface.

xtb.ase.calculator.XTB

The XTB calculator object.

Example

>>> from pharmaforge.interfaces.xtbio import XTBInterface
>>> from ase import Atoms
>>> h2 = Atoms('HH', positions=[(0, 0, 0), (0, 0, 1)])
>>> xtb = XTBInterface(default=True)
>>> xtb.single_point(h2)
(-26.300431519257398, array([[-0.        , -0.        ,  3.24309609],
... [-0.        , -0.        , -3.24309609]]))

Methods

ObtainDeepData(filename)

Obtain the system data from the DeepIO interface and converts each configuration to an ASE atoms object.

ObtainQueryData(queryresults)

Obtain the system data from a query

calculate([limit, verbose, num_workers])

Calculate the energies and forces of the system using the interface.

find_clusters(structure[, cutoff])

Identify clusters of atoms in a structure based on a distance cutoff.

single_point(structure[, charge])

Perform a single point calculation on the system.

process_structure

Initialize the XTBInterface class.

Methods

ObtainDeepData(filename)

Obtain the system data from the DeepIO interface and converts each configuration to an ASE atoms object.

ObtainQueryData(queryresults)

Obtain the system data from a query

calculate([limit, verbose, num_workers])

Calculate the energies and forces of the system using the interface.

find_clusters(structure[, cutoff])

Identify clusters of atoms in a structure based on a distance cutoff.

single_point(structure[, charge])

Perform a single point calculation on the system.

process_structure

single_point(structure, charge=0)[source]

Perform a single point calculation on the system.

Parameters:

structure (ase.Atoms) – The ASE atoms object containing the system data.

Returns:

  • e (float) – The energy of the system.

  • f (list) – The forces acting on the atoms in the system.