xnn.ffnn.models.geometry.dihedral_cos_sin#
- xnn.ffnn.models.geometry.dihedral_cos_sin(data, idx, vectors=None, shifts=None)[source]#
Cosine and sine of the signed dihedral angle over each atom quadruple.
The same plane-normal construction as
dihedral_cos()(phi = 0at cis), plus the sine from the triple product of the two normals with the central bond, so terms with a phase (cos(n phi - gamma), the AMBER torsion) can be formed fromcos phiandsin phiby multiple-angle recurrences withoutarccos/atan2.- Parameters:
data (AtomicGraph) – The batched graph.
idx (Tensor) – Atom indices of shape
(4, M).vectors (callable, optional) –
vectors(a, b)returns the bond vectors;pair_vectors()by default.shifts (Tensor, optional) – The image shifts
(3, M, 3)of the three bond vectors for the defaultvectors, when already found.
- Returns:
(cos phi, sin phi), each of shape(M,); the sign ofphifollows the IUPAC convention (positive for a clockwise rotation of the far bond when looking along the central bond).- Return type:
tuple of Tensor