sponge.function.vector_in_pbc

View Source On Gitee
sponge.function.vector_in_pbc(vector: Tensor, pbc_box: Tensor, offset: float = - 0.5)[source]

Make the value of vector \(\vec{v}\) at a single PBC box \(\vec{L}\).

Note

B: Batchsize, i.e. number of walkers in simulation D: Spatial dimension of the simulation system. Usually is 3.

Parameters
  • vector (Tensor) – Tensor of shape (B, …, D). Data type is float. Vector \(\vec{v}\).

  • pbc_box (Tensor) – Tensor of shape (B, D). Data type is float. Size of PBC box \(\vec{L}\).

  • offset (float) – Offset ratio \(c\) of the vector relative to box size \(\vec{L}\). The value of vector will be between \(c \vec{L}\) and \((c+1) \vec{L}\). Default: -0.5.

Returns

pbc_vector (Tensor), a tensor of shape (B, …, D). Data type is float.

Supported Platforms:

Ascend GPU