WARNING: force values in table are inconsistent with -dE/dr

Hi all,
I’m trying to perform an MD simulation in LAMMPS using a tabulated pair potential, but I keep getting warnings about force inconsistencies. To isolate the problem, I created a minimal working example:

  • I first dumped the tabulated potential from the TrappeN2 LJ+Coulomb potential using pair_write.
  • Then I read back the exact same potential that LAMMPS itself generated.
Reading pair table potential file table_NN.pot with DATE: 2025-11-03
WARNING: 30904 of 50000 force values in table NN are inconsistent with -dE/dr.
WARNING:  Should only be flagged at inflection points (src/pair_table.cpp:466)
Reading pair table potential file table_NCp.pot with DATE: 2025-11-03
WARNING: 34422 of 50000 force values in table NCp are inconsistent with -dE/dr.
WARNING:  Should only be flagged at inflection points (src/pair_table.cpp:466)
Reading pair table potential file table_CpCp.pot with DATE: 2025-11-03
WARNING: 34422 of 50000 force values in table CpCp are inconsistent with -dE/dr.
WARNING:  Should only be flagged at inflection points (src/pair_table.cpp:466)

No matter how accurate or finely sampled the tables are, these warnings persist.

My questions are:

  1. Are these warnings critical, or can they be safely ignored?
  2. Could this be due to having too many data points (I currently use 50,000 points between r = 1 and 15)?
  3. Is there a way to dump the -dE/dr values computed internally by LAMMPS so I can compare them directly to my input force values?

LAMMPS version: 20240207+dfsg-1.1build5
Thanks in advance for your insights!

Here are the input files:
Write_Table.inp.txt (1.1 KB)
Read_Table.inp.txt (1002 Bytes)
geom.cfg (735 Bytes)

Part of the problem is that you are writing out table with constant r spacing. However LAMMPS uses internally rsq spaced tables and thus your tables are splined and then converted. This can add noise. What is making matters worse, is that you use the default tabulation for long-range coulomb that is adding significant noise on top. Try adding pair_modify table 0 to turn that off.

1 Like

Hi, thank you. Adding pair_modify table 0 to the first script that generated the tabulated potential fixed the issue. Now I only have the warning:
1 of 50000 force values in table NN are inconsistent with -dE/dr.
Since this is just one value, I hope this can be ignored.

This fixed my minimum working example, but this is not completely answering my problem as the main issue is arising when I use some other tabulated potentials ( which I got from DFT calculations).

LAMMPS uses internally rsq spaced tables and thus your tables are splined and then converted. This can add noise.

I understand that this could add a small noise, but I hope it will not significantly alter the energy and force curve right?
When LAMMPS says the force is not matching to -dV/dr, what is the tolerance? Is there any way to make LAMMPS print the calculated -dV/dr values so that I can compare against my input force?

There should be one message when you pass the minimum of the potential. The second line of the warning message actually says so.

You would have to look at and edit the source code of the table pair style in src/pair_table.cpp