molsysmt.structure.shift_dihedral_angles#

molsysmt.structure.shift_dihedral_angles(molecular_system, dihedral_quartets=None, shifts=None, blocks=None, structure_indices='all', pbc=True, in_place=False, engine='MolSysMT', skip_digestion=False)[source]#

Shift (increment/decrement) dihedral angles by specified amounts.

Reads the current dihedral angles with get_dihedral_angles, adds the requested shifts, and writes the result back with set_dihedral_angles. All covalent-block detection and PBC handling are delegated to set_dihedral_angles.

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

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

  • shifts (PyUnitWizard quantity or None, default=None) – Angular increments applied to the current dihedral angles.

  • blocks (list, tuple, numpy.ndarray, or None, default=None) – Atom-index blocks that move together when changing each dihedral.

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

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

  • in_place (bool, default=False) – Whether to modify the input molecular system in place.

  • engine (str, default='MolSysMT') – Backend used to perform the calculation.

  • skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.

Returns:

A new molecular system with the shifted dihedral angles when in_place=False; None when in_place=True.

Return type:

molecular system or None

Raises:
  • ArgumentError – If dihedral_quartets is not an array-like object, does not have 4 elements in a 1-D case, or does not have shape (n, 4) in the 2-D case.

  • ArgumentLengthError – If a scalar shifts value is provided but there is more than one frame or quartet.

Added in version 1.0.0.