deepmd.tf2.model.dp_zbl_model#
Classes#
Combine DP and ZBL atomic energies by a short-range switch. |
Module Contents#
- class deepmd.tf2.model.dp_zbl_model.DPZBLModel(*args: Any, **kwargs: Any)[source]#
Bases:
deepmd.dpmodel.model.dp_zbl_model.DPZBLModelCombine DP and ZBL atomic energies by a short-range switch.
For the soft minimum neighbor distance \(\sigma_i\), define \(u_i=(\sigma_i-r_{\min})/(r_{\max}-r_{\min})\) and
\[\begin{split}s_i=\begin{cases} 1,&\sigma_i<r_{\min},\\ 1-10u_i^3+15u_i^4-6u_i^5, &r_{\min}\leq\sigma_i<r_{\max},\\ 0,&\sigma_i\geq r_{\max}. \end{cases}\end{split}\]The total energy and forces are
\[E=\sum_i\left[(1-s_i)E_i^{\mathrm{DP}}+s_iE_i^{\mathrm{ZBL}}\right], \qquad \mathbf F_i=-\nabla_{\mathbf r_i}E.\]Thus the force also contains derivatives of the coordinate-dependent switching weights in the interpolation region.
- forward_common_atomic(extended_coord: deepmd.tf2.env.xp.ndarray, extended_atype: deepmd.tf2.env.xp.ndarray, nlist: deepmd.tf2.env.xp.ndarray, mapping: deepmd.tf2.env.xp.ndarray | None = None, fparam: deepmd.tf2.env.xp.ndarray | None = None, aparam: deepmd.tf2.env.xp.ndarray | None = None, do_atomic_virial: bool = False, extended_coord_corr: deepmd.tf2.env.xp.ndarray | None = None, comm_dict: dict | None = None, charge_spin: deepmd.tf2.env.xp.ndarray | None = None) dict[str, deepmd.tf2.env.xp.ndarray][source]#
- format_nlist(extended_coord: deepmd.tf2.env.xp.ndarray, extended_atype: deepmd.tf2.env.xp.ndarray, nlist: deepmd.tf2.env.xp.ndarray, extra_nlist_sort: bool = False) deepmd.tf2.env.xp.ndarray[source]#
Format the neighbor list.
1. If the number of neighbors in the nlist is equal to sum(self.sel), it does nothong
2. If the number of neighbors in the nlist is smaller than sum(self.sel), the nlist is pad with -1.
3. If the number of neighbors in the nlist is larger than sum(self.sel), the nearest sum(sel) neighbors will be preserved.
Known limitations:
In the case of not self.mixed_types, the nlist is always formatted. May have side effact on the efficiency.
- Parameters:
- extended_coord
coordinates in extended region. nf x nall x 3
- extended_atype
atomic type in extended region. nf x nall
- nlist
neighbor list. nf x nloc x nsel
- extra_nlist_sort
whether to forcibly sort the nlist.
- Returns:
formatted_nlistthe formatted nlist.