deepmd.dpmodel.utils.env_mat

Module Contents

Classes

EnvMat

The unit operation of a native model.

Functions

compute_smooth_weight(distance, rmin, rmax)

Compute smooth weight for descriptor elements.

_make_env_mat(nlist, coord, rcut, ruct_smth[, ...])

Make smooth environment matrix.

deepmd.dpmodel.utils.env_mat.compute_smooth_weight(distance: numpy.ndarray, rmin: float, rmax: float)[source]

Compute smooth weight for descriptor elements.

deepmd.dpmodel.utils.env_mat._make_env_mat(nlist, coord, rcut: float, ruct_smth: float, radial_only: bool = False, protection: float = 0.0)[source]

Make smooth environment matrix.

class deepmd.dpmodel.utils.env_mat.EnvMat(rcut, rcut_smth, protection: float = 0.0)[source]

Bases: deepmd.dpmodel.NativeOP

The unit operation of a native model.

call(coord_ext: numpy.ndarray, atype_ext: numpy.ndarray, nlist: numpy.ndarray, davg: numpy.ndarray | None = None, dstd: numpy.ndarray | None = None, radial_only: bool = False) numpy.ndarray | numpy.ndarray[source]

Compute the environment matrix.

Parameters:
nlist

The neighbor list. shape: nf x nloc x nnei

coord_ext

The extended coordinates of atoms. shape: nf x (nallx3)

atype_ext

The extended aotm types. shape: nf x nall

davg

The data avg. shape: nt x nnei x (4 or 1)

dstd

The inverse of data std. shape: nt x nnei x (4 or 1)

radial_only

Whether to only compute radial part of the environment matrix. If True, the output will be of shape nf x nloc x nnei x 1. Otherwise, the output will be of shape nf x nloc x nnei x 4. Default: False.

Returns:
env_mat

The environment matrix. shape: nf x nloc x nnei x (4 or 1)

switch

The value of switch function. shape: nf x nloc x nnei

_call(nlist, coord_ext, radial_only)[source]
serialize() dict[source]
classmethod deserialize(data: dict) EnvMat[source]