Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking(lmp): do not apply scale factor to model deviation #3036

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/third-party/lammps-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Evaluate the interaction of the system by using [Deep Potential][DP] or [Deep Po
This pair style takes the deep potential defined in a model file that usually has the .pb extension. The model can be trained and frozen by package [DeePMD-kit](https://github.com/deepmodeling/deepmd-kit), which can have either double or single float precision interface.

The model deviation evalulates the consistency of the force predictions from multiple models. By default, only the maximal, minimal and average model deviations are output. If the key `atomic` is set, then the model deviation of force prediction of each atom will be output.
The unit follows [LAMMPS units](#units) and the [scale factor](https://docs.lammps.org/pair_hybrid.html) is not applied.

By default, the model deviation is output in absolute value. If the keyword `relative` is set, then the relative model deviation of the force will be output, including values output by the keyword `atomic`. The relative model deviation of the force on atom $i$ is defined by

Expand Down
12 changes: 6 additions & 6 deletions source/lmp/pair_deepmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,12 @@ void PairDeepMD::compute(int eflag, int vflag) {
all_v_avg = sqrt(all_v_avg / 9);
}
if (rank == 0) {
all_v_max *= scale[1][1] * ener_unit_cvt_factor;
all_v_min *= scale[1][1] * ener_unit_cvt_factor;
all_v_avg *= scale[1][1] * ener_unit_cvt_factor;
all_f_max *= scale[1][1] * force_unit_cvt_factor;
all_f_min *= scale[1][1] * force_unit_cvt_factor;
all_f_avg *= scale[1][1] * force_unit_cvt_factor;
all_v_max *= ener_unit_cvt_factor;
all_v_min *= ener_unit_cvt_factor;
all_v_avg *= ener_unit_cvt_factor;
all_f_max *= force_unit_cvt_factor;
all_f_min *= force_unit_cvt_factor;
all_f_avg *= force_unit_cvt_factor;
fp << setw(12) << update->ntimestep << " " << setw(18) << all_v_max
<< " " << setw(18) << all_v_min << " " << setw(18) << all_v_avg
<< " " << setw(18) << all_f_max << " " << setw(18) << all_f_min
Expand Down
Loading