sponge.partition.IndexVectors

View Source On Gitee
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 to False.

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.]]]]