Templates#

class autode.transition_states.templates.TStemplate(graph=None, charge=None, mult=None, solvent=None, species=None, filename=None)#
__init__(graph=None, charge=None, mult=None, solvent=None, species=None, filename=None)#

TS template

neighbours

Keyword Arguments:
property filename: str#
graph_has_correct_structure()#

Check that the graph has some active edges and distances

load(filename)#

Load a template from a saved file

Raises:

(autode.exceptions.TemplateLoadingFailed)

save(basename='template', folder_path=None)#

Save the TS template object in a plain text .txt file. With folder_path =None then the template will be saved to the default directory (see get_ts_template_folder_path). The name of the file will be basename.txt where i is an integer iterated until the file doesn’t already exist.

Keyword Arguments:

folder_path (str or None)

autode.transition_states.templates.get_ts_template_folder_path(folder_path)#

Get the full path to the directory containing the transition state templates, if it’s unset then use the default folder in Config if it is set, or the autode/transition_states/lib folder where autodE is installed

Returns:

Path to the folder containing TS templates

Return type:

(str)

autode.transition_states.templates.get_ts_templates(folder_path=None)#

Get all the transition state templates from a folder, or the default if folder path is None. Transition state templates should be .txt files with at least a charge, multiplicity, solvent, and a graph with some active edge including distances.

Returns:

List of templates

Return type:

(list(autode.transition_states.templates.TStemplate))

autode.transition_states.templates.get_value_from_file(key, file_lines)#

Get the value given a key from a list of file lines i.e. a saved template

Example:

Input:
file_lines=
_________________________
.
multiplicity: 1
.
------------------------
key='multiplicity'

Output:
1
Parameters:

file_lines (list(str))

Returns:

Value

Return type:

(str)

Raises:

(autode.exceptions.TemplateLoadingFailed) – If values not found

autode.transition_states.templates.get_values_dict_from_file(key, file_lines)#

Get the value given a key from a list of file lines i.e. a saved template. Example:

Input:
file_lines=
_________________________
.
.
multiplicity: 1
nodes:
    0: atom_label=F
    2: atom_label=C
         .
         .
------------------------
key='nodes'

Output:
{0: {'atom_label': 'F'}, 2: {'atom_label': 'C'}, ..}
Parameters:

file_lines (list(str))

Returns:

Value

Return type:

(dict)

Raises:

(autode.exceptions.TemplateLoadingFailed) – If values not found

autode.transition_states.templates.template_matches(reactant, truncated_graph, ts_template)#

Determine if a transition state template matches a truncated graph. The truncated graph includes all the active bonds in the reaction and the nearest neighbours to those atoms e.g. for a Diels-Alder reaction:

     H        H
      \      /
    H-C----C-H          where the dotted lines represent active bonds
      .    .
  H  .      .   H
   \.        . /
H - C        C - H
     \      /
      C    C

where the full reaction is between ethene and butadiene.#

param reactant:

type reactant:

autode.complex.ReactantComplex

param truncated_graph:

type truncated_graph:

nx.Graph

param ts_template:

type ts_template:

autode.transition_states.templates.TStemplate

returns:

Template matches

rtype:

(bool)