pmutt.reaction.Reactions

class pmutt.reaction.Reactions(reactions)

Bases: _pmuttBase

Contains multiple reactions. Serves as a parent class for other objects

reactions
Type:

list of Reaction objects

__init__(reactions)

Methods

__init__(reactions)

from_dict(json_obj)

Recreate an object from the JSON representation.

get_E_span(units, **kwargs)

Gets the energy span of a set of reactions.

get_species([include_TS, key])

Returns the unique species included in the reactions.

plot_coordinate_diagram(method_name[, ...])

Plots a reaction coordinate diagram.

to_dict()

Represents object as dictionary with JSON-accepted datatypes

classmethod from_dict(json_obj)

Recreate an object from the JSON representation.

Parameters:

json_obj (dict) – JSON representation

Returns:

Reactions

Return type:

Reactions object

get_E_span(units, **kwargs)

Gets the energy span of a set of reactions. Equations sourced from

\(\delta E = T_{TDTS} - I_{TDI}\)

if the TOF-determining transition state (TSTS) appears after the TOF-determining intermediate (TDI):

\(\delta E = T_{TDTS} - I_{TDI} + \Delta G_r\)

if the TSTS appears before the TDI:

Parameters:
  • units (str) – Units as string. See R() for accepted units but omit the ‘/K’ (e.g. J/mol).

  • kwargs (keyword arguments) – Parameters to evaluate Gibbs energy at each state.

Returns:

E_span – Energy span of the Reactions

Return type:

float

get_species(include_TS=True, key='name')

Returns the unique species included in the reactions.

Parameters:
  • include_TS (bool, optional) – Whether transition states should be included. Default is True

  • key (str, optional) – Attribute to use as the key in the output dictionary. Default is name

Returns:

species – Unique species in the reactions

Return type:

dict

plot_coordinate_diagram(method_name, ref_index=0, ref_state='reactants', x_offset=1.0, include_TS=True, x_scale_TS=0.5, y_scale_TS=0.5, include_TS_labels=True, y_TS_label_offset=0.1, x_TS_label_offset=0.0, TS_label_format='.2f', figure=None, axes=None, plt_kwargs={}, **reaction_kwargs)

Plots a reaction coordinate diagram.

Parameters:
  • method_name (str) – Name of method to use to calculate quantity. Calculates any quantity as long as the relevant objects have the same method name. Some examples include: get_HoRT, get_H, get_EoRT, get_E

  • ref_index (int, optional) – Reaction index to use to reference states. Default is the first reaction (i.e. ref_index = 0)

  • ref_state (str, optional) –

    State of the reference to use. Supported options include:

    • reactants (default)

    • products

    • transition state

    • ts (same as transition state)

  • x_offset (float, optional) – Spacing between reaction states. Shape of curve likely does not change with this parameter since the x axis would rescale appropriately

  • include_TS (bool, optional) – Whether transition states should be included. Default is True

  • x_scale_TS (float, optional) – Value between 0 and 1 that controls curvature of transition state peaks. Higher values produce sharper peaks. Default is 0.5

  • y_scale_TS (float, optional) – Value between 0 and 1 that controls curvature of transition state peaks. Higher values produce sharper peaks. Default is 0.5

  • include_TS_labels (bool, optional) – If True, adds a label to the peaks indicating the difference between the reactants and the transition state. Default is True

  • y_TS_label_offset (float, optional) – Vertical value to offset TS_label from the TS position. This value scales with the difference between major ticks. Negative values will shift the label downwards. Default is 0.10

  • x_TS_label_offset (float, optional) – Horizontal value to offset TS_label from the TS_position. This value scales with the x_offset value. Negative values will shift the label rightward. Default is 0 (i.e. labels are directly above peaks by default)

  • TS_label_format (str, optional) – String format to print TS_labels. Uses the str.format syntax. Default is ‘.2f’ (i.e. a floating point value rounded to the second decimal place)

  • figure (matplotlib.figure.Figure) – Add plot to this figure. If not specified, one will be generated

  • axes (matplotlib.axes.Axes.axis, optional) – Adds plot to this axis. If not specified, one will be generated

  • plt_kwargs (dict, optional) – Extra arguments that will be fed to matplotlib.pyplot.subplots

  • reaction_kwargs (keyword arguments) – Extra arguments that will be fed to the reactions

Returns:

to_dict()

Represents object as dictionary with JSON-accepted datatypes

Returns:

obj_dict

Return type:

dict