torch.Tensor, ks: torch.Tensor) torch.Tensor[source]

Periodic torsion term with n_phases = 6, periodicities = 1..n_phases, phases = zeros

  • dihedrals (torch.Tensor, shape=(n_snapshots, n_dihedrals)) – dihedral angles – TODO: confirm in radians?

  • ks (torch.Tensor, shape=(n_dihedrals, n_phases)) – force constants – TODO: confirm in esp.unit.ENERGY_UNIT ?


u – potential energy of each snapshot

Return type

torch.Tensor, shape=(n_snapshots, 1)


TODO: is there a way to annotate / type-hint tensor shapes? (currently adding many assert statements) TODO: merge with – adding this because I was having difficulty debugging runtime tensor

shape errors in, which allows for a more flexible mix of input shapes and types