Possible bug in MLIP-LAMMPS interface when using hybrid/overlay and active-learning.
Dear MLIP developers,
I am trying to fit an MTP potential to model liquid NaCl. To treat the long-range interactions I subtract the Coulomb contributions from the observables prior to fitting, and then use LAMMPS hybrid/overlay to add Coulomb parts back onto the MTP potential in the LAMMPS simulation. I have found what I think is a bug which occurs when I use AL ('select TRUE' in the .ini file). Namely, the predicted forces for a perfect NaCl structure are finite. The bug only occurs when I used hybrid/overlay mode. If I instead just use the MTP potential, predictions of forces from LAMMPS are identical with AL both on and off.
I have included the relevant files as attachments. The file 'fit_al1.tar.gz' contains the directory where I performed the fit. Predicted properties of the trained potential are in configs_out.cfg. Note the 'perfect' structure is not the first structure in the training set, but you can find it in configs_out.cfg by searching for '5.90710'. You will see the predicted forces are ~ 0 and energy is 178.17000. I generated the state.als using: /mlp select-add Trained.mtp_ train_set.cfg train_set.cfg diff.cfg
The file ‘lmp_al1.tar.gz’ contains the files relating to the LAMMPS run. Here I copied over ‘Trained.mtp_’ and ‘state.als’ from the optimization directory and ran a single shot LAMMPS job. I tried first without Coulomb interactions, both with and then without AL:
$ ~/progs/interface-lammps-mlip-2/lmp_intel_cpu_intelmpi < lammpsIn_noCoul_noAL | grep -A1 'Step' Step Temp Press Lx Ly Lz Volume TotEng PotEng 0 2000 68104.931 11.814206 11.814206 11.814206 1648.9733 194.45678 178.17 $ ~/progs/interface-lammps-mlip-2/lmp_intel_cpu_intelmpi < lammpsIn_noCoul | grep -A1 'Step' Step Temp Press Lx Ly Lz Volume TotEng PotEng 0 2000 68104.931 11.814206 11.814206 11.814206 1648.9733 194.45678 178.17
(PotEng here is a compute to just return the MTP energy, which you see agrees with the MLIP value.) All seems to be well here. Then I tried with Coulomb interactions (I.e. using hybrid/overlay), again first without and then with active learning:
$ ~/progs/interface-lammps-mlip-2/lmp_intel_cpu_intelmpi < lammpsIn_noAL | grep -A1 'Step' Step Temp Press Lx Ly Lz Volume TotEng PotEng c_pe_mtp 0 2000 -20196.184 11.814206 11.814206 11.814206 1648.9733 -78.183835 -94.470614 178.17 $ ~/progs/interface-lammps-mlip-2/lmp_intel_cpu_intelmpi < lammpsIn | grep -A1 'Step' Step Temp Press Lx Ly Lz Volume TotEng PotEng c_pe_mtp 0 2000 -77440.899 11.814206 11.814206 11.814206 1648.9733 -78.183835 -94.470614 178.17
Note that the pressures are different. Also from the dump2.meam file in the former case (saved as ‘dump2_noAL.meam’): ITEM: ATOMS id type xs ys zs fx fy fz 1 1 0 0 0 8.32667e-16 1.16573e-15 9.31547e-16 2 1 0 0 0.5 5.55112e-16 6.80012e-16 -3.19189e-16 ...
In the latter (saved as ‘dump2.meam’): ITEM: ATOMS id type xs ys zs fx fy fz 1 1 0 0 0 -0.270288 -0.250742 -0.233164 2 1 0 0 0.5 -0.261007 -0.241461 0.0180695 ...
Please let me know if you think this is a bug (apologies if instead I have made some mistake on my end), and thank you very much for your time,
Other info: LAMMPS version: 23 Jun 2022 MLIP: version = 1.1.0 (from mtp.cpp)
Best wishes, Andy