chemcoord.zmat_functions.CleanDihedralOrientation
- class chemcoord.zmat_functions.CleanDihedralOrientation(clean_dihedral_orientation, cls=None)[source]
Clean the orientation of dihedral references.
It can sometimes be, that a change in a Z-matrix coordinate flips the orientation of a dihedral reference lateron in the molecule. Note that there is an implicit dependence on the previous state of the Z-matrix that could still be transformed to cartesian coordinates, since a smooth trajectory forms a reference frame for the next step by itself. Hence, this problem can be altogether generally avoided by applying smaller steps, i.e. instead of changing
zmat_1.loc[1, 'angle'] = 170in one step, it is better to increment/decrement the angle in steps.If this does not help, one can use this contextmanager to clean the orientation:
with CleanDihedralOrientation(True): zmat_1.loc[1, 'angle'] = 170
Even then it is advised to apply small steps changes.
- Parameters:
clean_dihedral_orientation (bool)
- __init__(clean_dihedral_orientation, cls=None)[source]
- Parameters:
clean_dihedral_orientation (bool)
- Return type:
None
Methods
__init__(clean_dihedral_orientation[, cls])