stk.MoleculeState

class stk.MoleculeState[source]

Bases: object

Represents the state of a molecule under construction.

Initialize a _MoleculeState instance.

Methods

clone

Return a clone.

get_atom_infos

Yield the atom infos of the molecule.

get_atoms

Yield the atoms of the molecule.

get_bond_infos

Yield the bond infos of the molecule.

get_bonds

Yield the bonds of the molecule.

get_edge_group_functional_groups

Yield the functional groups associated with edge_group.

get_position_matrix

Get the position matrix of the molecule.

with_placement_results

Return a clone holding the placement results.

with_position_matrix

Return a clone holding the position_matrix.

with_reaction_results

Return a clone holding the reaction results.

clone()[source]

Return a clone.

Returns:

The clone. Has the same type as the original instance.

Return type:

_MoleculeState

get_atom_infos()[source]

Yield the atom infos of the molecule.

Yields:

AtomInfo – An atom info of the molecule.

get_atoms()[source]

Yield the atoms of the molecule.

Yields:

Atom – An atom of the molecule.

get_bond_infos()[source]

Yield the bond infos of the molecule.

Yields:

BondInfo – The bond info of the molecule.

get_bonds()[source]

Yield the bonds of the molecule.

Yields:

Bond – A bond of the molecule.

get_edge_group_functional_groups(edge_group)[source]

Yield the functional groups associated with edge_group.

Parameters:

edge_group (EdgeGroup) – The edge group, whose functional groups are desired.

Yields:

FunctionalGroup – A functional group which belongs to edge_group.

get_position_matrix()[source]

Get the position matrix of the molecule.

Returns:

The position matrix.

Return type:

numpy.ndarray

with_placement_results(vertices, edges, building_blocks, results)[source]

Return a clone holding the placement results.

Parameters:
  • vertices (tuple of Vertex) – The vertices used for placement.

  • edges (tuple) – For each vertex in vertices, a tuple of Edge instances connected to it.

  • building_blocks (tuple of BuildingBlock) – For each vertex in vertices, the building block placed on it.

  • results (tuple of _PlacementResult) – For every vertex in vertices, the result of the placement.

Returns:

The clone holding the placement results. Has the same type as the original instance.

Return type:

_MoleculeState

with_position_matrix(position_matrix)[source]

Return a clone holding the position_matrix.

Parameters:

position_matrix (numpy.ndarray) – The position matrix of the clone. The shape of the matrix is (n, 3).

Returns:

The clone holding the new position matrix. Has the same type as the original instance.

Return type:

_MoleculeState

with_reaction_results(reactions, results)[source]

Return a clone holding the reaction results.

Parameters:
Returns:

The clone holding the reaction results. Has the same type as the original instance.

Return type:

_MoleculeState