molsysmt.structure.get_dihedral_angles#

molsysmt.structure.get_dihedral_angles(molecular_system, selection='all', dihedral_quartets=None, structure_indices='all', syntax='MolSysMT', pbc=False, use_gpu=None, **kwargs)[source]#

Compute dihedral angles for a set of atom quartets over one or more structures.

Two usage modes are available:

  • Explicit quartets — provide dihedral_quartets as an array of shape (n_quartets, 4) containing the atom indices that define each dihedral.

  • Named backbone/side-chain dihedrals — omit dihedral_quartets and pass keyword arguments such as phi=True, psi=True, omega=True, chi1=True, etc. The required quartets are then obtained from molsysmt.topology.get_dihedral_quartets for the atoms in selection. When more than one named type is requested the function returns a list of arrays, one per type.

Angles are computed in the minimum-image convention when pbc=True and the system has a periodic box. Results are always returned in the MolSysMT standard angle unit (degrees).

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.

  • dihedral_quartets (list, tuple, numpy.ndarray, or None, default=None) – Zero-based atom-index quartets defining the dihedral angles.

  • structure_indices (int, list, tuple, or numpy.ndarray, default='all') – Structure indices (0-based) to include or process.

  • syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).

  • pbc (bool, default=False) – Whether to take periodic boundary conditions into account.

  • use_gpu (bool, default=None) – Whether to perform computation using GPU acceleration.

Returns:

PyUnitWizard angle quantity of shape (n_structures, n_quartets) in the standard angle unit (degrees). When more than one named dihedral type is requested, a list of such quantities is returned — one per type, in the order the kwargs were provided.

Return type:

quantity or list of quantity

Added in version 1.0.0.