stk.MoleculeState
- class stk.MoleculeState[source]
Bases:
objectRepresents the state of a molecule under construction.
Initialize a
_MoleculeStateinstance.Methods
Return a clone.
Yield the atom infos of the molecule.
Yield the atoms of the molecule.
Yield the bond infos of the molecule.
Yield the bonds of the molecule.
Yield the functional groups associated with edge_group.
Get the position matrix of the molecule.
Return a clone holding the placement results.
Return a clone holding the position_matrix.
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_bond_infos()[source]
Yield the bond infos of the molecule.
- Yields:
BondInfo– The bond info 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:
- with_placement_results(vertices, edges, building_blocks, results)[source]
Return a clone holding the placement results.
- Parameters:
vertices (
tupleofVertex) – The vertices used for placement.edges (
tuple) – For each vertex in vertices, atupleofEdgeinstances connected to it.building_blocks (
tupleofBuildingBlock) – For each vertex in vertices, the building block placed on it.results (
tupleof_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:
results (
ReactionResult) – For each reaction in reactions, its result.
- Returns:
The clone holding the reaction results. Has the same type as the original instance.
- Return type:
_MoleculeState