deepmd.pt.utils.region

Module Contents

Functions

phys2inter(→ torch.Tensor)

Convert physical coordinates to internal(direct) coordinates.

inter2phys(→ torch.Tensor)

Convert internal(direct) coordinates to physical coordinates.

to_face_distance(→ torch.Tensor)

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

_to_face_distance(cell)

b_to_face_distance(cell)

normalize_coord(→ torch.Tensor)

Apply PBC according to the atomic coordinates.

deepmd.pt.utils.region.phys2inter(coord: torch.Tensor, cell: torch.Tensor) torch.Tensor[source]

Convert physical coordinates to internal(direct) coordinates.

Parameters:
coordtorch.Tensor

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

celltorch.Tensor

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

Returns:
inter_coord: torch.Tensor

the internal coordinates

deepmd.pt.utils.region.inter2phys(coord: torch.Tensor, cell: torch.Tensor) torch.Tensor[source]

Convert internal(direct) coordinates to physical coordinates.

Parameters:
coordtorch.Tensor

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

celltorch.Tensor

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

Returns:
phys_coord: torch.Tensor

the physical coordinates

deepmd.pt.utils.region.to_face_distance(cell: torch.Tensor) torch.Tensor[source]

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

Parameters:
celltorch.Tensor

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

Returns:
dist: torch.Tensor

the to face distances of shape [*, 3]

deepmd.pt.utils.region._to_face_distance(cell)[source]
deepmd.pt.utils.region.b_to_face_distance(cell)[source]
deepmd.pt.utils.region.normalize_coord(coord: torch.Tensor, cell: torch.Tensor) torch.Tensor[source]

Apply PBC according to the atomic coordinates.

Parameters:
coordtorch.Tensor

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

Returns:
wrapped_coord: torch.Tensor

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