tfep.utils.geometry.proper_dihedral_angle
- tfep.utils.geometry.proper_dihedral_angle(x1, x2, x3)[source]
Compute the proper dihedral angle between the plane
x1-x2andx2-x3.If both
x1,x2, andx3have multiple vectors, the angles are computed in a batchwise fashion.In the description of the parameters, we will use the example of four atoms at positions p0, p1, p2, and p3.
- Parameters:
x1 (torch.Tensor) – The vector p1 - p0 with shape
(*, D), whereDis the vector dimensionality.x2 (torch.Tensor) – The vector p2 - p1 with shape
(*, D), whereDis the vector dimensionality.x3 (torch.Tensor) – The vector p3 - p2 with shape
(*, D), whereDis the vector dimensionality.
- Returns:
dihedrals – A tensor of shape
(*,). As an example, if all inputs have shape(batch_size, D), thendihedralshas shape(batch_size,)anddihedrals[i]is the angle between the planesx1[i]-x2[i]andx2[i]-x3[i].- Return type:
torch.Tensor