molsysmt.structure.get_maximum_distances#
- molsysmt.structure.get_maximum_distances(molecular_system, selection='all', center_of_atoms=False, weights=None, as_entity=True, structure_indices='all', molecular_system_2=None, selection_2=None, center_of_atoms_2=False, weights_2=None, as_entity_2=True, structure_indices_2=None, pairs=False, pbc=False, engine='MolSysMT', syntax='MolSysMT')[source]#
Find the maximum pairwise distances between two sets of atoms (or atom-group centers).
Internally calls
get_distancesand then reduces the full distance matrix by selecting the maximum entry according to theas_entity/as_entity_2flags.- Parameters:
molecular_system (molecular system) – Input system in any form supported by MolSysMT.
selection (str, list, tuple or numpy.ndarray, default 'all') – First set of atoms. Nested iterables are treated as groups of atoms when
center_of_atoms=True.center_of_atoms (bool, default False) – If
True, use the (weighted) centroid of each group inselectioninstead of individual atom positions.weights (array-like, optional) – Per-atom weights for centroid computation of the first selection.
as_entity (bool, default True) – If
True, reduce over the entire first set to yield a single maximum per frame. IfFalse, return the maximum partner for each element in the first set.structure_indices ('all' or array-like, default 'all') – Frame indices over which the computation is performed.
molecular_system_2 (molecular system or None, default None) – Second system. When
None, both selections are drawn frommolecular_system.selection_2 (str, list, tuple or numpy.ndarray or None, default None) – Second set of atoms. When
None, the maximum is computed within the first selection.center_of_atoms_2 (bool, default False) – If
True, use the (weighted) centroid of each group inselection_2.weights_2 (array-like, optional) – Per-atom weights for centroid computation of the second selection.
as_entity_2 (bool, default True) – If
True, reduce over the entire second set to yield a single maximum per frame. IfFalse, return the maximum partner for each element in the second set.structure_indices_2 ('all', array-like or None, default None) – Frame indices for the second system. When
None, the same frames asstructure_indicesare used.pairs (bool, default False) – If
True,selectionis interpreted as an array of pre-defined pairs and the maximum is found among those pairs only. Requires bothas_entityandas_entity_2to beTrue.pbc (bool, default False) – Apply minimum-image convention for periodic boundary conditions.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend used for distance computation.
syntax (str, default 'MolSysMT') – Selection syntax used when selections are strings.
- Returns:
pairs_indices (numpy.ndarray) – Indices of the element pair (within the selection arrays) that achieves the maximum distance. Shape depends on the
as_entityflags and whetherpairsmode is active.dists (quantity) – PyUnitWizard length quantity of the corresponding maximum distances in the standard length unit (nm).
- Raises:
ArgumentConflictError – If both
as_entityandas_entity_2areFalse(useget_distancesdirectly in that case), or ifpairs=Truewithas_entity=Falseoras_entity_2=False... versionadded: – 1.0.0: