DP
DP Model
DP Model Overview

For the DP model, see the following references:
-
[SC’20] Weile Jia, Han Wang, Mohan Chen, Denghui Lu, Lin Lin, Roberto Car, E Weinan, Linfeng Zhang*, "Pushing the Limit of Molecular Dynamics with Ab Initio Accuracy to 100 Million Atoms with Machine Learning," SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, 2020, pp. 1-14, doi: 10.1109/SC41405.2020.00009.(CCF-A)(Gordon Bell Prize)
-
Han Wang, Linfeng Zhang, Jiequn Han, and Weinan E. "DeePMD-kit: A deep learning package for many-body potential energy representation and molecular dynamics." Computer Physics Communications 228 (2018): 178-184. doi:10.1016/j.cpc.2018.03.016
-
Zhang L, Han J, Wang H, et al. End-to-end symmetry preserving inter-atomic potential energy model for finite and extended systems[J]. Advances in neural information processing systems, 2018, 31.
-
Lu D, Jiang W, Chen Y, et al. DP compress: A model compression scheme for generating efficient deep potential models[J]. Journal of chemical theory and computation, 2022, 18(9): 5559-5567.
type embedding
A DP model contains Embedding Nets, where is the number of element types. When a system contains many element types, this design limits both training and inference speed and restricts the potential of DP as a general-purpose large model. Because the Embedding Nets implicitly encode element types, we modify by concatenating it with the physical properties of the corresponding element type. This enables a single Embedding Net to achieve results comparable to those of networks.
For , is the central atom. The physical properties of the element type corresponding to are concatenated with to form a vector of length the number of physical properties, which is then passed to the Embedding Net. Tests on our five-component alloy (Ru, Rh, Ir, Pd, and Ni) dataset and quaternary LiGePS dataset (1200 K) show that a DP model using this type-embedding method matches or exceeds the prediction accuracy of a standard DP model while reducing training time by 27%. See the performance benchmarks for details.
Usage
To enable type embedding with the default physical properties, add the parameter to the JSON training configuration. See example/LiGePS/ligeps.json in the project examples.
{
"type_embedding": true
}
You can also specify the required physical properties in the model parameters of the JSON file.
Performance Benchmark: Accuracy
Comparison of validation-set prediction accuracy between the type-embedding method and a standard DP model on the mixed five-component alloy dataset (9,486 configurations):

Comparison of validation-set prediction accuracy between the type-embedding method and a standard DP model on the quaternary LiGePS dataset (10,000 configurations at 1200 K):

Performance Benchmark: Training Time

The force field is invoked in LAMMPS in the same way as the standard DP model described above.
Polynomial Model Compression
A DP model contains Embedding Nets, where is the number of atom types. As the number of types increases, the number of Embedding Nets grows rapidly, enlarging the computational graph used for backpropagation and becoming an inference bottleneck. The timing breakdown below for DP inference on a five-component alloy shows that Embedding Net evaluation and gradient computation account for more than 90% of the total time, leaving substantial room for optimization. An Embedding Net takes a scalar as input and outputs values, where is the number of neurons in its final layer. It can therefore be replaced by scalar functions.
MatPL implements the fifth-order polynomial compression method described in Lu D, Jiang W, Chen Y, et al., DP compress: A model compression scheme for generating efficient deep potential models. It also provides a third-order polynomial method based on Hermite interpolation.

Usage
To compress a trained DP model, use the following command:
MatPL compress dp_model.ckpt -d 0.01 -o 3 -s cmp_dp_model
compressis the compression command.dp_model.ckptis the required model file to compress.-dsets the grid spacing for ; the default is0.01.-osets the compression order:3for third order or5for fifth order. The default is3.-ssets the compressed model name. The default iscmp_dp_model.
After compression, the model is used for molecular-dynamics simulations in LAMMPS in the same way as a standard DP model.
Model compression accuracy
We compressed DP models for bulk copper and a five-component alloy and evaluated them on their respective test sets. The results are shown below. For copper, second-order interpolation is included for comparison; unlike the third- and fifth-order methods, it does not provide sufficient accuracy.

Polynomial Model Compression Procedure
Grid Construction
We scan the entire training set to obtain the maximum value of . Because is a function of the three-dimensional distance between atoms and , it reaches its minimum when . The range of is divided into equal intervals of width , yielding interpolation points denoted by . In practice, an incomplete training set may not cover every encountered during inference. The grid is therefore extended from the original upper limit to using a spacing of .
Third-Order Polynomial
For each interval , the Embedding Net is replaced by the following third-order polynomial:
Here, is the number of neurons in the final layer of the Embedding Net—that is, the number of output values—and the polynomial variable is . The following two conditions must hold at every grid point:
-
The polynomial value equals the Embedding Net output:
-
The first derivative of the polynomial equals the first derivative of the Embedding Net with respect to :
The resulting coefficients are
where and .
Fifth-Order Polynomial
We also implement the fifth-order polynomial compression method from DP Compress.
For the fifth-order polynomial, is partitioned in the same way as for the third-order method, and the Embedding Net is replaced by the following polynomial:
Note that the polynomial variable is . The following three conditions must hold at every grid point:
-
The polynomial value equals the Embedding Net output:
-
The first derivative of the polynomial equals the first derivative of the Embedding Net with respect to :
-
The second derivative of the polynomial equals the second derivative of the Embedding Net with respect to :
The six coefficients are therefore:
where and .
Verification of the Model Compression Formula
The model-compression scheme divides the range of into equal intervals, giving interpolation points denoted by . For each interval , the embedding network is replaced by the following fifth-order polynomial:
Note that the polynomial variable is . The following three boundary conditions must hold at every grid point:
-
The function values are equal:
-
The first derivatives are equal:
-
The second derivatives are equal:
The six coefficients are therefore:
where and .