3.5.4. ACErxnNetwork

Class representing a reaction network. It contains a networkx graph, as well as a list of PLAMS Molecule objects for the intermediates

class ACErxnNetwork(intermediates=None, graph=None)

A class that represents an ACE reaction network

List of constructor arguments:

  • intermediates – Optional list of PLAMS Molecule objects representing the intermediates (vertices) of the network
  • graph – Optional networkx DiGraph object with vertices that match the names of the intermediates (intermediate[i].properties.name)

All information on the reaction network is stored in two instance variables :

  • intermediates – List of PLAMS Molecule objects representing the intermediates (vertices) of the network
  • graph – Networkx DiGraph object with vertices that match the names of the intermediates (intermediate[i].properties.name)
set_intermediates(intermediates)

Set the intermediates instance variable

  • intermediates – List of PLAMS Molecule objects representing the intermediates (vertices) of the network. Each Molecule object must contain a name and an energy in mol.properties.name and mol.properties.energy.
set_graph(graph)

Set the graph instance variable (a networkx DiGraph object)

  • graph – Networkx DiGraph object with vertices that match the names of the intermediates (intermediate[i].properties.name)
write(dirname='ams.results', filename='ams.rkf', write_ts=False)

Writes the reaction network to RKF

  • dirname – The name of the folder where the RKF files shoud be written
  • filename – The name of the main RKF file that contains the network data (in the EnergyLandscape section)
  • write_ts – The option to link all connected vertices with a fabricated transition state. May be useful for visualization in AMSMovie
read(filename)

Read the network from RKF.

  • filename – Accepts either the full path to the main RKF file (‘path/to/acerxn.results/ams.rkf’) or the corresponding folder name (‘path/to/acerxn.results’)
get_graph()

Return the networkx DiGraph object

get_acenetwork()

Convert the networkx DiGraph object to ACE format

write_graph(path, file_format='ace')

Write the networkx graph to file, in one of the available formats

  • path – The full filename of the main file to be written (‘/path/to/acercn.results/ams.rkf’)
  • file_format – Currently the only option are the original ACE format and RKF (‘ace’,’rkf’)
has_graph()

Check if a networkx DiGraph object has already been created

has_intermediates()

Check if the intermediates have already been created

get_intermediates(format='plams')

Get the intermediates as a list of PLAMS molecules

  • format – One of [‘plams’,’ace’]
write_intermediates(dirname='Intermediates', file_format='mol')

Write intermediates in human readable format

  • dirname – The name of the folder to which the intermediates should be written
  • file_format – One of the extensions writable by PLAMS [‘mol’,’xyz’]
get_all_paths()

Get all paths from reactant to product in the network

get_shortest_paths()

Returns the shortest paths from reactant to products

get_chemdists_for_path(path)

For a single path out of the network, get the weights

  • path – Sequence of names for the vertices, representing a path
get_path_block(path)

Return a string that represents the path

  • path – List of names for the vertices in the path
get_subnetwork(names)

Get the subnetwork ACErxnNetwork object for the list of intermediates

  • names – List/iterable of names for the intermediates