molsysmt.topology.get_covalent_blocks#
- molsysmt.topology.get_covalent_blocks(molecular_system, selection='all', remove_bonds=None, output_type='sets', syntax='MolSysMT')[source]#
Identifying covalent blocks (connected components) in a molecular system.
- Parameters:
molecular_system (molecular system) – Input system in any supported form.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atom selection used to build the bond graph.
remove_bonds (array-like, optional) – Bonds to remove before computing components (pairs of atom indices).
output_type ({'sets', 'numpy.ndarray'}, default 'sets') – Output format: a list of sets of atom indices, or an array labeling each atom with a component id.
syntax (str, default 'MolSysMT') – Selection syntax for string-based selections.
- Returns:
Covalent blocks as sets or an array of component labels (one per atom).
- Return type:
numpy.ndarray or list
- Raises:
NotImplementedMethodError – If output_type is unsupported.
Notes
Builds a bond graph via get_bondgraph and returns its connected components.
Added in version 1.0.0.