deepmd.dpmodel.atomic_model.linear_atomic_model
Module Contents
Classes
Linear model make linear combinations of several existing models. | |
Model linearly combine a list of AtomicModels. |
- class deepmd.dpmodel.atomic_model.linear_atomic_model.LinearEnergyAtomicModel(models: List[deepmd.dpmodel.atomic_model.base_atomic_model.BaseAtomicModel], type_map: List[str], **kwargs)[source]
Bases:
deepmd.dpmodel.atomic_model.base_atomic_model.BaseAtomicModel
Linear model make linear combinations of several existing models.
- Parameters:
- mixed_types() bool [source]
If true, the model 1. assumes total number of atoms aligned across frames; 2. uses a neighbor list that does not distinguish different atomic types.
If false, the model 1. assumes total number of atoms of each atom type aligned across frames; 2. uses a neighbor list that distinguishes different atomic types.
- get_model_nsels() List[int] [source]
Get the processed sels for each individual models. Not distinguishing types.
- forward_atomic(extended_coord, extended_atype, nlist, mapping: numpy.ndarray | None = None, fparam: numpy.ndarray | None = None, aparam: numpy.ndarray | None = None) Dict[str, numpy.ndarray] [source]
Return atomic prediction.
- Parameters:
- extended_coord
coodinates in extended region, (nframes, nall * 3)
- extended_atype
atomic type in extended region, (nframes, nall)
- nlist
neighbor list, (nframes, nloc, nsel).
- mapping
mapps the extended indices to local indices.
- fparam
frame parameter. (nframes, ndf)
- aparam
atomic parameter. (nframes, nloc, nda)
- Returns:
result_dict
the result dict, defined by the fitting net output def.
- static remap_atype(ori_map: List[str], new_map: List[str]) numpy.ndarray [source]
This method is used to map the atype from the common type_map to the original type_map of indivial AtomicModels.
- Parameters:
- Returns:
- fitting_output_def() deepmd.dpmodel.output_def.FittingOutputDef [source]
Get the output def of developer implemented atomic models.
- classmethod deserialize(data: dict) LinearEnergyAtomicModel [source]
- _compute_weight(extended_coord: numpy.ndarray, extended_atype: numpy.ndarray, nlists_: List[numpy.ndarray]) List[numpy.ndarray] [source]
This should be a list of user defined weights that matches the number of models to be combined.
- get_dim_aparam() int [source]
Get the number (dimension) of atomic parameters of this atomic model.
- class deepmd.dpmodel.atomic_model.linear_atomic_model.DPZBLLinearEnergyAtomicModel(dp_model: deepmd.dpmodel.atomic_model.dp_atomic_model.DPAtomicModel, zbl_model: deepmd.dpmodel.atomic_model.pairtab_atomic_model.PairTabAtomicModel, sw_rmin: float, sw_rmax: float, type_map: List[str], smin_alpha: float | None = 0.1, **kwargs)[source]
Bases:
LinearEnergyAtomicModel
Model linearly combine a list of AtomicModels.
- Parameters:
- dp_model
The DPAtomicModel being combined.
- zbl_model
The PairTable model being combined.
- sw_rmin
The lower boundary of the interpolation between short-range tabulated interaction and DP.
- sw_rmax
The upper boundary of the interpolation between short-range tabulated interaction and DP.
- type_map
Mapping atom type to the name (str) of the type. For example type_map[1] gives the name of the type 1.
- smin_alpha
The short-range tabulated interaction will be swithed according to the distance of the nearest neighbor. This distance is calculated by softmin.
- classmethod deserialize(data) DPZBLLinearEnergyAtomicModel [source]
- _compute_weight(extended_coord: numpy.ndarray, extended_atype: numpy.ndarray, nlists_: List[numpy.ndarray]) List[numpy.ndarray] [source]
ZBL weight.
- Returns:
List
[np.ndarray
]the atomic ZBL weight for interpolation. (nframes, nloc, 1)