deepmd.pt.utils.preprocess

Module Contents

Classes

Region3D

Functions

normalize_coord(coord, region, nloc)

Move outer atoms into region by mirror.

compute_serial_cid(cell_offset, ncell)

Tell the sequential cell ID in its 3D space.

compute_pbc_shift(cell_offset, ncell)

Tell shift count to move the atom into region.

build_inside_clist(coord, region, ncell)

Build cell list on atoms inside region.

append_neighbors(coord, region, atype, rcut)

Make ghost atoms who are valid neighbors.

build_neighbor_list(nloc, coord, atype, rcut, sec, mapping)

For each atom inside region, build its neighbor list.

compute_smooth_weight(distance, rmin, rmax)

Compute smooth weight for descriptor elements.

make_env_mat(coord, atype, region, rcut, sec[, pbc, ...])

Based on atom coordinates, return environment matrix.

Attributes

log

deepmd.pt.utils.preprocess.log[source]
class deepmd.pt.utils.preprocess.Region3D(boxt)[source]
phys2inter(coord)[source]

Convert physical coordinates to internal ones.

inter2phys(coord)[source]

Convert internal coordinates to physical ones.

get_face_distance()[source]

Return face distinces to each surface of YZ, ZX, XY.

deepmd.pt.utils.preprocess.normalize_coord(coord, region: Region3D, nloc: int)[source]

Move outer atoms into region by mirror.

Args: - coord: shape is [nloc*3]

deepmd.pt.utils.preprocess.compute_serial_cid(cell_offset, ncell)[source]

Tell the sequential cell ID in its 3D space.

Args: - cell_offset: shape is [3] - ncell: shape is [3]

deepmd.pt.utils.preprocess.compute_pbc_shift(cell_offset, ncell)[source]

Tell shift count to move the atom into region.

deepmd.pt.utils.preprocess.build_inside_clist(coord, region: Region3D, ncell)[source]

Build cell list on atoms inside region.

Args: - coord: shape is [nloc*3] - ncell: shape is [3]

deepmd.pt.utils.preprocess.append_neighbors(coord, region: Region3D, atype, rcut: float)[source]

Make ghost atoms who are valid neighbors.

Args: - coord: shape is [nloc*3] - atype: shape is [nloc]

deepmd.pt.utils.preprocess.build_neighbor_list(nloc: int, coord, atype, rcut: float, sec, mapping, type_split=True, min_check=False)[source]

For each atom inside region, build its neighbor list.

Args: - coord: shape is [nall*3] - atype: shape is [nall]

deepmd.pt.utils.preprocess.compute_smooth_weight(distance, rmin: float, rmax: float)[source]

Compute smooth weight for descriptor elements.

deepmd.pt.utils.preprocess.make_env_mat(coord, atype, region, rcut: float | list, sec, pbc=True, type_split=True, min_check=False)[source]

Based on atom coordinates, return environment matrix.

Returns:
nlist: nlist, [nloc, nnei]
merged_coord_shift: shift on nall atoms, [nall, 3]
merged_mapping: mapping from nall index to nloc index, [nall]