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_quartetsas an array of shape(n_quartets, 4)containing the atom indices that define each dihedral.Named backbone/side-chain dihedrals — omit
dihedral_quartetsand pass keyword arguments such asphi=True,psi=True,omega=True,chi1=True, etc. The required quartets are then obtained frommolsysmt.topology.get_dihedral_quartetsfor the atoms inselection. 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=Trueand the system has a periodic box. Results are always returned in the MolSysMT standard angle unit (degrees).- Parameters:
molecular_system (molecular system) – Input system in any form supported by MolSysMT.
selection (str, list, tuple or numpy.ndarray, default 'all') – Atom selection used to resolve named dihedral types (ignored when
dihedral_quartetsis provided explicitly).dihedral_quartets (numpy.ndarray of shape (n_quartets, 4) or None, default None) – Global atom indices for each dihedral quartet. When
None, the quartets are built from the named keyword arguments (phi,psi, etc.).structure_indices ('all' or array-like, default 'all') – Frame indices over which the angles are computed.
syntax (str, default 'MolSysMT') – Selection syntax used when
selectionis a string.pbc (bool, default False) – Apply minimum-image convention when the system has a periodic box.
**kwargs – Named dihedral angle flags:
phi,psi,omega,chi1,chi2,chi3,chi4,chi5. Each must be set toTrueto include that dihedral type.
- Returns:
quantity or list of quantity – 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... versionadded:: 1.0.0