deepmd.dpmodel.utils.env_mat#

Classes#

EnvMat

The unit operation of a native model.

Functions#

compute_smooth_weight(→ deepmd.dpmodel.array_api.Array)

Compute smooth weight for descriptor elements.

compute_exp_sw(→ deepmd.dpmodel.array_api.Array)

Compute the exponential switch function for neighbor update.

_make_env_mat(→ tuple[Any, Any, Any])

Make smooth environment matrix.

Module Contents#

deepmd.dpmodel.utils.env_mat.compute_smooth_weight(distance: deepmd.dpmodel.array_api.Array, rmin: float, rmax: float) deepmd.dpmodel.array_api.Array[source]#

Compute smooth weight for descriptor elements.

deepmd.dpmodel.utils.env_mat.compute_exp_sw(distance: deepmd.dpmodel.array_api.Array, rmin: float, rmax: float) deepmd.dpmodel.array_api.Array[source]#

Compute the exponential switch function for neighbor update.

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

Make smooth environment matrix.

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

Bases: deepmd.dpmodel.NativeOP

The unit operation of a native model.

rcut[source]#
rcut_smth[source]#
protection = 0.0[source]#
use_exp_switch = False[source]#
call(coord_ext: deepmd.dpmodel.array_api.Array, atype_ext: deepmd.dpmodel.array_api.Array, nlist: deepmd.dpmodel.array_api.Array, davg: deepmd.dpmodel.array_api.Array | None = None, dstd: deepmd.dpmodel.array_api.Array | None = None, radial_only: bool = False) tuple[deepmd.dpmodel.array_api.Array, deepmd.dpmodel.array_api.Array, deepmd.dpmodel.array_api.Array][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)

diff

The relative coordinate of neighbors. shape: nf x nloc x nnei x 3

switch

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

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