stko.XTBFFCREST
- class stko.XTBFFCREST(crest_path, xtb_path, output_dir=None, opt_level='normal', md_len=None, ewin=5, speed_setting=None, keepdir=False, num_cores=1, charge=0, cross=True, unlimited_memory=False)[source]
Bases:
OptimizerUses GFN-FF to run CREST on molecules.
See also
- Parameters:
crest_path (str) – The path to the CREST executable.
xtb_path (str) – The path to the xTB executable. Version >6.3.0 is required.
output_dir (Path | str | None) – The name of the directory into which files generated during the optimization are written, if
Nonethenuuid.uuid4()is used.opt_level (str) – Optimization level to use. Can be one of
'crude','sloppy','loose','lax','normal','tight','vtight'or'extreme'. For details see https://xtb-docs.readthedocs.io/en/latest/optimization.html .md_len (float | None) – Set length of the meta-dynamics simulations (MTD) in ps. Default is chosen based on size and flexibility of the system.
ewin (float) – Set the energy threshold in kcal/mol for conformer selection. Double this is used in crude optimization. Defaults ot 5 kcal/mol and is overridden by
speed_setting.speed_setting (str | None) – Conformer search speed setting. Fast methods turn off parts of the calculations and alter MD run times. Defaults to no modification of iMTD-GC algorithm: None. Can be one of
'norotmd','quick','squick'or'mquick'. Overridesewinwith chosen parameters. For details see https://xtb-docs.readthedocs.io/en/latest/crestcmd.html.keepdir (bool) – True to keep subdirectories from MD runs. Defaults to False. For details see https://xtb-docs.readthedocs.io/en/latest/crestcmd.html.
num_cores (int) – The number of cores CREST should use.
charge (int) – Formal molecular charge.
cross (bool) – Whether or not structure crossing is performed.
unlimited_memory (bool) – If
Trueoptimize()will be run without constraints on the stack size. If memory issues are encountered, this should beTrue, however this may raise issues on clusters.
Notes
GFN-FF requires version 6.3 of xtb.
When running
optimize(), this calculator changes the present working directory withos.chdir(). The original working directory will be restored even if an error is raised, so unless multi-threading is being used this implementation detail should not matter.Currently, we only provide inputs that work with GFN-FF, specifically the charge of the system. Other electronic properties of the molecule are not relavent to a forcefield optimisation. We intend on adding more options in the future!
Restrictions to iMTD-GC Algorithm Z-matrix sorting is forced to be off because
stk.Moleculescannot have their atom ordering changed by an external program at this stage.Examples
Note that for
ConstructedMoleculeobjects constructed bystk,XTBFFCRESTshould usually be used in aOptimizerSequence. This is because xTB only uses xyz coordinates as input and so will not recognize the long bonds created during construction. An optimizer which can minimize these bonds should be used beforeXTBFFCREST. Further, CREST runs best on an input structure optimized at the same level used throughout the algorithm (i.e.XTBFF).import stk import stko bb1 = stk.BuildingBlock('NCCNCCN', [stk.PrimaryAminoFactory()]) bb2 = stk.BuildingBlock('O=CCCC=O', [stk.AldehydeFactory()]) polymer = stk.ConstructedMolecule( stk.polymer.Linear( building_blocks=(bb1, bb2), repeating_unit="AB", orientations=[0, 0], num_repeating_units=1 ) ) xtb = stko.OptimizerSequence( stko.UFF(), stko.XTBFF( xtb_path='/opt/gfnxtb/xtb', unlimited_memory=True, ), # Perform quick conformer search. stko.XTBFFCREST( crest_path='/opt/crest/crest', xtb_path='/opt/gfnxtb/xtb', opt_level='normal', speed_setting='quick', unlimited_memory=True, ), ) polymer = xtb.optimize(polymer)
While most auxiliary and MD run files will be deleted if
keepdiris False, the files listed below are kept inoutput_dirand could be useful for further analysis!crest_best.xyz: Structure of the lowest energy conformer.This structure is output byoptimize().crest_conformers.xyz: Structure of all conformers.All conformers with RMSD and energy threshold of thelowest energy conformer.crest_rotamers.xyz: Structure of all rotamers.All unique rotamers explored by CREST.crest.energies: Relative conformer energies in a.u..gfn_topo: GFN-FF binary topology file.Defines the molecules force field topology.Methods
Optimize mol.