sponge.function.vector_in_pbc
- 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}\).
- Parameters
vector (Tensor) – Tensor of shape (B, …, D). Data type is float. Vector \(\vec{v}\). B means batchsize, i.e. number of walkers in simulation. D means spatial dimension of the simulation system. Usually is 3.
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