sponge.partition.IndexVectors
- class sponge.partition.IndexVectors(use_pbc: bool = None)[source]
Get vectors by index
- Parameters
use_pbc (bool, optional) – Whether to use periodic boundary condition. Default value:
None
, defaults toFalse
.
- Supported Platforms:
Ascend
GPU
Examples
>>> import sponge >>> from sponge.partition import IndexVectors >>> import mindspore >>> from mindspore import Tensor >>> idx_vector = IndexVectors(use_pbc=False) >>> coordinate = Tensor([[[0.0, 0.0, 0.0], [0.0, 0.0, 1.0]]]) >>> index = Tensor([[[1],[0]]]) >>> print(idx_vector(coordinate, index)) # B=1, A=2, N=1 [[[[ 0. 0. 1.]] [[ 0. 0. -1.]]]]