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) – Molecular system in any supported MolSysMT format.
selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.
structure_indices (int, list, tuple, or numpy.ndarray, default='all') – Structure indices (0-based) to include or process.
weights (numpy.ndarray, list, or tuple, default=None) – Atomic mass weights array for center calculation.
syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).
engine (str, default='MolSysMT') – Backend used to perform the calculation.
heavy_mode ({'auto', 'force', 'off'}, default='auto') – Policy controlling the chunked path for memory-intensive calculations.
use_gpu (bool, default=None) – Whether to perform computation using GPU acceleration.
parallel (bool or None, default=None) – Whether to use CPU parallelism, or None to use the configured default.
num_threads (int or None, default=None) – Number of CPU worker threads, or None to use the configured default.
skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.
- 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.