XTBMethod
The XTBMethod
object specifies the settings for using Grimme's xTB as the method for a calculation.
xTB is a family of methods based on density functional tightbinding, suitable for the calculation of structures, vibrational frequencies, and noncovalent interactions in large molecular systems. A key feature of these methods is that it almost entirely avoids elementpairwise parameterisation. The parameterisation consequently covers all spdblock elements and the lanthanides, up to Z = 86, using reference data at the hybrid density functional theory level.
There is one field required for creating an XTBMethod
object:
model
for specifying the xTB model (available models are GFN0 and GFN1)
All other calculation details can be specified in the details
dictionary.
In case of convergence issues, it is recommended to
 use
solver=scc
andguess=eeq
 successively decrease the
broyden_damping
 successively increase
max_iter
This will lead to convergence in almost all cases.
Example
The following examples demonstrate how to create and use XTBMethod
with a SingleInput
to calculate the energy of a molecule.
import sierra
from sierra.inputs import *
# Create a water molecule from pubchem (internet connection required)
water = Molecule(pubchem="water")
# Perform a singlepoint energy calculation using the GFN0xTB method
xtb0_basic_input = SingleInput(molecule=water, method=XTBMethod(model="GFN0"))
xtb0_basic_result = sierra.run(xtb0_basic_input)
print(f"GFN0xTB energy: {xtb0_basic_result.energy:.6f} Hartree")
#> GFN0xTB energy: 4.367421 Hartree
# Perform a singlepoint energy calculation using the GFN1xTB method
xtb1_basic_input = SingleInput(molecule=water, method=XTBMethod(model="GFN1"))
xtb1_basic_result = sierra.run(xtb1_basic_input)
print(f"GFN1xTB energy: {xtb1_basic_result.energy:.6f} Hartree")
#> GFN1xTB energy: 5.768441 Hartree
# Use more advanced settings for the GFN1xTB method
xtb1_advanced_input = SingleInput(
molecule=water,
method=XTBMethod(model="GFN1", details={"broyden_damping": 0.2}),
)
xtb1_advanced_result = sierra.run(xtb1_advanced_input)
print(f"GFN1xTB energy: {xtb1_advanced_result.energy:.6f} Hartree")
#> GFN1xTB energy: 5.768441 Hartree
Fields
All of the fields in MethodBase and the following:
model

Specify the xTB model, allowed xTB form are GFN0 and GFN1
 Type:
str
 Default:
GFN1
 Type:
details

Dict containing additional detail options. See below.
 Type:
Dict[str, Any]
 Type:
Available options for details
max_iter

Maximum number of iterations.
 The type is int
 The default is 128
 The value must be nonnegative
energy_threshold

Convergence threshold using the absolute value of the energy difference between iterations.
 The type is float
 The default is 1e6
 The value must be nonnegative
orbital_grad_threshold

Convergence threshold using the infinity norm of the orbital gradient.
 The type is float
 The default is 1e5
 The value must be nonnegative
solver

Type of solver to use for determining the density and orbitals. The default is automatically set depending on the xTB model.
 The type is str
 There is no default value.
 The value must be one of:
scf
 Perform a standard selfconsistent field calculationscc
 Perform a selfconsistent charge calculation with Broyden mixingnon_iterative
 Perform a noniterative (single diagonalization) calculation
guess

Initial guess for the xTB wavefunction.
 The type is str
 The default is SAD
 The value must be one of:
SAD
 Superposition of Atomic Densities (SAD).eeq
 Use EEQ charges as the initial guess.
broyden_damping

Factor of new shellresolved charges to be used in Broyden mixing: \( q_{n+1} = f * q_{n} + ... \) where \( f \) is the factor.
 The type is float
 The default is 0.4