xnn.ffnn.models.geometry.dihedral_cos#
- xnn.ffnn.models.geometry.dihedral_cos(data, idx, shifts=None)[source]#
Cosine of the dihedral angle over each atom quadruple.
Uses the plane-normal formula with
phi = 0at cis. Onlycos phiis returned; periodic torsion terms are even inphi, so the multiple angles come from Chebyshev identities and noarccos/atan2(whose derivatives are singular at planar geometries) enters the graph.- Parameters:
data (AtomicGraph) – The batched graph.
idx (Tensor) – Atom indices of shape
(4, M).shifts (Tensor, optional) – The image shifts
(3, M, 3)of the three bond vectors (seepair_vectors()), when already found.
- Returns:
cos phiof shape(M,).- Return type:
Tensor