xnn.ffnn.models.geometry.minimum_image_vectors#

xnn.ffnn.models.geometry.minimum_image_vectors(vec, cell, pbc=None)[source]#

Minimum-image displacements in one, possibly triclinic, cell.

Parameters:
  • vec (Tensor) – Displacement vectors (M, 3).

  • cell (Tensor) – Lattice vectors as rows (3, 3); a reduced cell for the result to be the true minimum image at every distance (see the module notes).

  • pbc (Tensor or None, optional) – Periodic axes (3,); None means all three.

Returns:

Shortest images (M, 3), differentiable in vec and cell through fixed integer image shifts.

Return type:

Tensor