deepmd.dpmodel.utils.env_mat#
Classes#
The unit operation of a native model. |
Functions#
| Compute smooth weight for descriptor elements. |
| Compute the exponential switch function for neighbor update. |
| 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.NativeOPThe unit operation of a native model.
- 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_matThe environment matrix. shape: nf x nloc x nnei x (4 or 1)
diffThe relative coordinate of neighbors. shape: nf x nloc x nnei x 3
switchThe value of switch function. shape: nf x nloc x nnei