deepmd.dpmodel.utils.region

Module Contents

Functions

phys2inter(→ numpy.ndarray)

Convert physical coordinates to internal(direct) coordinates.

inter2phys(→ numpy.ndarray)

Convert internal(direct) coordinates to physical coordinates.

normalize_coord(→ numpy.ndarray)

Apply PBC according to the atomic coordinates.

to_face_distance(→ numpy.ndarray)

Compute the to-face-distance of the simulation cell.

b_to_face_distance(cell)

deepmd.dpmodel.utils.region.phys2inter(coord: numpy.ndarray, cell: numpy.ndarray) numpy.ndarray[source]

Convert physical coordinates to internal(direct) coordinates.

Parameters:
coordnp.ndarray

physical coordinates of shape [*, na, 3].

cellnp.ndarray

simulation cell tensor of shape [*, 3, 3].

Returns:
inter_coord: np.ndarray

the internal coordinates

deepmd.dpmodel.utils.region.inter2phys(coord: numpy.ndarray, cell: numpy.ndarray) numpy.ndarray[source]

Convert internal(direct) coordinates to physical coordinates.

Parameters:
coordnp.ndarray

internal coordinates of shape [*, na, 3].

cellnp.ndarray

simulation cell tensor of shape [*, 3, 3].

Returns:
phys_coord: np.ndarray

the physical coordinates

deepmd.dpmodel.utils.region.normalize_coord(coord: numpy.ndarray, cell: numpy.ndarray) numpy.ndarray[source]

Apply PBC according to the atomic coordinates.

Parameters:
coordnp.ndarray

orignal coordinates of shape [*, na, 3].

cellnp.ndarray

simulation cell shape [*, 3, 3].

Returns:
wrapped_coord: np.ndarray

wrapped coordinates of shape [*, na, 3].

deepmd.dpmodel.utils.region.to_face_distance(cell: numpy.ndarray) numpy.ndarray[source]

Compute the to-face-distance of the simulation cell.

Parameters:
cellnp.ndarray

simulation cell tensor of shape [*, 3, 3].

Returns:
dist: np.ndarray

the to face distances of shape [*, 3]

deepmd.dpmodel.utils.region.b_to_face_distance(cell)[source]