sponge.colvar.AtomsBase

View Source On Gitee
class sponge.colvar.AtomsBase(keep_in_box: bool = False, dimension: int = 3, name: str = 'atoms')[source]

Base class for specific atoms group, used as the "atoms group module" in MindSPONGE.

The AtomsBase Cell is a special subclass of Colvar. It has the shape (a_1, a_2, … , a_n, D), where D is the dimension of the atomic coordinates (usually 3). As with the Colvar Cell, when it takes as input coordinates of shape (B, A, D), it returns the shape of the Tensor with an extra dimension B, i.e. (B, a_1, a_2, … , a_n, D). B means Batchsize, i.e. number of walkers in simulation. {a_i} means Dimensions of the Atoms Cell.

Parameters
  • keep_in_box (bool) – Whether to keep the coordinate in PBC box. Default: False.

  • dimension (int) – Spatial dimension of the simulation system. Default: 3

  • name (str) – Name of the Colvar. Default: 'atoms'

Supported Platforms:

Ascend GPU

coordinate_in_pbc(coordinate: Tensor, pbc_box: Tensor = None)[source]

displace the coordinate in PBC box.

get_unit(units: Units = None)[source]

return unit of the collective variables

property ndim: int

rank (number of dimensions) of the atoms

reshape(input_shape: tuple)[source]

rearranges the shape of atoms

set_dimension(dimension: int = 3)[source]

set the spatial dimension of the simulation system

property shape: tuple

shape of the atoms