molsysmt.structure.get_rmsd#

molsysmt.structure.get_rmsd(molecular_system, selection='atom_type!="H"', structure_indices='all', reference_molecular_system=None, reference_selection=None, reference_structure_index=0, syntax='MolSysMT', engine='MolSysMT', heavy_mode='auto', use_gpu=None, parallel=None, num_threads=None)[source]#

Compute the RMSD between structures without prior superposition.

The function measures the root-mean-square deviation of atomic positions relative to a reference frame. No rotation or translation is applied; use get_least_rmsd if you want the optimal superposition (Kabsch) RMSD, or least_rmsd_fit to align the coordinates first.

For large trajectories a chunked execution path is activated automatically (heavy_mode='auto') to keep memory usage bounded.

The function handles three broadcasting scenarios:

  • Many query structures vs. one reference — each query frame is compared to the single reference frame.

  • One query structure vs. many reference frames — the single query is compared to each reference frame.

  • Equal numbers of frames on both sides — frame-by-frame comparison.

Parameters:
  • molecular_system (molecular system) – Molecular system in any supported MolSysMT format.

  • selection (str, list, tuple, or numpy.ndarray, default='atom_type!="H"') – 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.

  • reference_molecular_system (molecular system or None, default=None) – Reference molecular system; None uses the input molecular system.

  • reference_selection (str, list, tuple, or numpy.ndarray, or None, default=None) – Atoms selected from the reference molecular system.

  • reference_structure_index (int, default=0) – Zero-based structure index selected from the reference system.

  • 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. Chunk coordinates and the reference are converted explicitly to nm; the returned quantity follows the session’s length-unit policy.

  • 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.

Returns:

PyUnitWizard length quantity of shape (n_structures,) containing the RMSD values in the standard length unit (nm).

Return type:

quantity

Raises:
  • NotImplementedMethodError – If an unsupported engine is requested.

  • StructuralInconsistencyError – If the number of atoms resolved by selection and reference_selection differ.

Added in version 1.0.0.