molsysmt.structure.set_dihedral_angles#

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

Set dihedral angles to specified target values by rotating covalent blocks.

For each dihedral quartet (i, j, k, l), the function determines which atoms form a covalently connected block on the side of atom l after the bond j-k is removed. That block is then rotated about the j-k axis so that the dihedral angle reaches the target value.

When pbc=True and the system has a periodic box the minimum-image dihedral kernel is used; otherwise the standard (non-periodic) kernel is applied.

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.

  • angles (PyUnitWizard quantity or None, default=None) – Target dihedral angles in angular units.

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

Returns:

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

Return type:

molecular system or None

Raises:

NotImplementedMethodError – If an unsupported engine is requested.

Added in version 1.0.0.