smores.xtb.optimize_geometry#

smores.xtb.optimize_geometry(molecule, output_directory, level='extreme', xtb_path='xtb')[source]#

Optimize the geometry of a molecule.

Warning

xtb will not work if you have an activate Python environment in which psi4 is installed.

Examples

Optimize the geometry of a molecule

The values of the calculated steric parameters depend on the geometry of the molecule. As a result, you might want to optimize the geometry, for example using xtb

>>> import smores
>>> molecule = smores.rdkit_from_smiles("CBr")
>>> optimized = smores.xtb.optimize_geometry(molecule, "xtb_output")
>>> smores_molecule = smores.Molecule.from_rdkit(optimized, dummy_index=0, attached_index=1)
>>> smores_molecule.get_steric_parameters()
StericParameters(L=3.57164113574581, B1=1.9730970556668774, B5=2.320611610648539)
Parameters:
  • molecule (Mol) – The molecule to optimize.

  • output_directory (Path | str) – The directory in which xtb places its files.

  • level (str) – The optimization level. Passed directly to xtb.

  • xtb_path (Path | str) – The path to the xtb binary.

Returns:

The optimized molecule.

Return type:

Mol