Bond Rearrangement#

class autode.bond_rearrangement.BondRearrGenerator(reactant: Species, product: Species, delta_bond_tot: int, extra_move_pairs: int = 0)#
__init__(reactant: Species, product: Species, delta_bond_tot: int, extra_move_pairs: int = 0)#

Create a class that obtains all possible bond rearrangements that will transform the reactant into the product based on the types of bonds that must be broken and formed

Parameters:
  • reactant

  • product

  • delta_bond_tot – Total number of bonds changing from reactant to product

  • extra_move_pairs – Number of pairs of extra graph moves that can be made in addition to the known types

get_valid_bond_rearrs() → list[BondRearrangement]#

Get all bond rearrangements that are actually valid, i.e. transforms the reactant to product based on graph isomorphism

Return type:

(list(BondRearrangement))

class autode.bond_rearrangement.BondRearrangement(forming_bonds: list[tuple] | None = None, breaking_bonds: list[tuple] | None = None)#
__eq__(other)#

Return self==value.

__init__(forming_bonds: list[tuple] | None = None, breaking_bonds: list[tuple] | None = None)#

Bond rearrangement

Keyword Arguments:

breaking_bonds (list(tuple(int))) – List of atom pairs that are breaking in the reaction

__str__()#

Return str(self).

property active_atoms#

Unique atom indexes in forming or breaking bonds

property batoms#

Unique atoms indexes involved in breaking bonds

property fatoms#

Unique atoms indexes involved in forming bonds

get_active_atom_neighbour_lists(species, depth)#

Get neighbour lists of all the active atoms in the molecule (reactant complex)

Parameters:

depth (int) – Depth of the neighbour list to consider

Return type:

(list(list(str)))

property n_bbonds#
property n_fbonds#
n_membered_rings(mol)#

Find the membered-ness of the rings involved in this bond rearrangement will add the forming bonds to the graph to determine

Return type:

(list(int))

class autode.bond_rearrangement.MoveSet(fbond_types: list[tuple[str, int]], bbond_types: list[tuple[str, int]])#

A set of moves with bond types, breaking and forming

__init__(fbond_types: list[tuple[str, int]], bbond_types: list[tuple[str, int]])#
Parameters:
  • fbond_types (list[tuple]) – A list of bond types forming with numbers of each e.g. [(‘CH’, 2), (‘OH’, 4)]

  • bbond_types (list[tuple]) – A list of bond types breaking with numbers of each

autode.bond_rearrangement.add_bond_rearrangment(bond_rearrangs, reactant, product, fbonds, bbonds)#

For a possible bond rearrangement, sees if the products are made, and adds it to the bond rearrang list if it does

Parameters:
  • reactant (Species) – Reactant complex

  • product (Species) – Product complex

  • fbonds (list(tuple)) – list of bonds to be made

  • bbonds (list(tuple)) – list of bonds to be broken

Return type:

(list(autode.bond_rearrangements.BondRearrangement))

autode.bond_rearrangement.generate_rearranged_graph(graph, fbonds, bbonds)#

Generate a rearranged graph by breaking bonds (edge) and forming others (edge)

Parameters:
  • fbonds (list[tuple]) – list of bonds to be made

  • bbonds (list[tuple]) – list of bonds to be broken

Returns:

rearranged graph

Return type:

(nx.Graph)

autode.bond_rearrangement.get_bond_rearrangs(reactant, product, name, save=True)#

For a reactant and product (mol_complex) find the set of breaking and forming bonds that will turn reactants into products. This works by determining the types of bonds that have been made/broken (i.e CH) and then only considering rearrangements involving those bonds.

Parameters:
  • product (autode.species.ProductComplex)

  • name (str)

Keyword Arguments:

save (bool) – Save bond rearrangements to a file for fast reloading

Return type:

(list(autode.bond_rearrangements.BondRearrangement))

autode.bond_rearrangement.get_bond_rearrangs_from_file(filename='bond_rearrangs.txt')#

Extract a list of bond rearrangements from a file

Return type:

(list(autode.bond_rearrangements.BondRearrangement))

autode.bond_rearrangement.prune_small_ring_rearrs(possible_brs, mol)#

Remove any bond rearrangements that go via small (3, 4) rings if there is an alternative that goes vie

Parameters:

mol (autode.species.Complex) – Reactant

autode.bond_rearrangement.save_bond_rearrangs_to_file(brs, filename='bond_rearrangs.txt')#

Save a list of bond rearrangements to a file in plane text

Parameters:

filename (str)

autode.bond_rearrangement.strip_equiv_bond_rearrs(possible_brs, mol, depth=6)#

Remove any bond rearrangement from possible_brs for which there is already an equivalent in the unique_bond_rearrangements list

Parameters:

mol (autode.species.Complex) – Reactant

Keyword Arguments:

depth (int) – Depth of neighbour list that must be identical for a set of atoms to be considered equivalent (default: {6})

Returns:

stripped list of BondRearrangement objects

Return type:

(list(BondRearrangement))