xnn.ffnn.models.geometry#
Shared bonded-term geometry for fixed-topology force fields.
Minimum-image displacement vectors, the dihedral cosine and a
differentiable-at-zero geometric mean, used by every fixed-topology model
(OPLS, DREIDING). All functions operate on a batched
AtomicGraph plus explicit atom-index tensors, so
bonded terms are correct for molecules wrapped across periodic boundaries
while gradients still flow to positions and cell.
The minimum image of a displacement is found in two steps: round its
fractional coordinates to the nearest lattice point, and, for a cell with
non-orthogonal axes, pick the shortest of the 27 images around that point.
Rounding alone is exact for vectors shorter than half the smallest spacing
between lattice planes; the 27-image search is exact for every vector on a
reduced cell (the Wigner-Seitz cell of a Minkowski-reduced lattice lies
inside the +-1 shell of its parallelepiped). Cells must therefore be reduced
once at the data level (ase.geometry.minkowski_reduce), the convention
of every molecular-dynamics code, rather than searched in every evaluation.
Functions
|
Cosine of the dihedral angle over each atom quadruple. |
|
Cosine and sine of the signed dihedral angle over each atom quadruple. |
|
Whether each pair |
|
Geometric mean with a differentiable zero (for zero-LJ hydrogens). |
|
The neighbor list's pairs once each, with the exclusions of a bound topology. |
|
Minimum-image displacements in one, possibly triclinic, cell. |
|
The integer image shifts |
|
Minimum-image displacement vectors |