molsysmt.structure.get_radius_of_gyration#
- molsysmt.structure.get_radius_of_gyration(molecular_system, selection='all', structure_indices='all', weights=None, syntax='MolSysMT', engine='MolSysMT', heavy_mode='auto', use_gpu=None, parallel=None, num_threads=None, skip_digestion=False)[source]#
Computing the radius of gyration over one or more structures.
- Parameters:
molecular_system (molecular system) – Input system in any supported form.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atom selection over which the radius of gyration is computed.
structure_indices ('all' or array-like, default 'all') – Structures/frames to include.
weights (array-like, 'masses' or None, default None) – If None, all atoms have equal weight (geometric radius of gyration). If ‘masses’, atoms are weighted by their atomic mass. Explicit weights must be non-negative and have a positive sum.
syntax (str, default 'MolSysMT') – Selection syntax.
engine ({'MolSysMT'}, default 'MolSysMT') – Backend used for the computation.
heavy_mode (str, default 'auto') – Chunked execution path: ‘auto’ | ‘force’ | ‘off’.
use_gpu (bool or 'auto', optional) – Whether to use a supported GPU backend on the eager path.
parallel (bool or str, optional) – Parallel mode override: True | False | ‘auto’.
num_threads (int, optional) – Number of threads override.
skip_digestion (bool, default False) – Whether to skip argument digestion.
- Returns:
Radius of gyration per structure as a PyUnitWizard quantity in length units. Shape: (n_structures,).
- Return type:
quantity
- Raises:
ArgumentError – If the atom or frame selection is empty, or weights are non-finite, negative, or have zero total weight.
ArgumentLengthError – If the number of weights does not match the selected atoms.
NotImplementedMethodError – If an unsupported engine is requested.
Examples
>>> import molsysmt as msm >>> molsys = msm.convert(msm.systems['alanine dipeptide']['alanine_dipeptide.h5msm'], to_form='molsysmt.MolSys') >>> msm.structure.get_radius_of_gyration(molsys).shape (1,)
Added in version 1.0.0.