Criterion for the verification of a table pair_style

Hello everyone!
I am testing a type of potential (modified lj/expand) using the pair_style table command. Through visual verification, plotting the graphs of force and energy as a function of distance, I did not notice differences between the different tests that I have carried out, all the curves overlap between the table files and the output through the write command.
The table file has the following form:

#Pair potential for atom types 1 2: i,r,energy,force

A_B
N 8000

1 2.0000 78.000000 1080.000000
2 2.0250 55.310074 756.507446
3 2.0500 39.313358 537.062012
4 2.0750 27.892754 385.736847

Now, generating a file by placing a large N (approximately 8000) more than 40% of warnings appear:
WARNING: 3868 of 8000 force values ​​in table are inconsistent with -dE/dr. Should only be flagged at inflection points (…/pair_table.cpp:483)

Is this probably due to ondulations generated in the interpolation when it having so many points ?

On the other hand, placing N small (approximately 200) the warnings decrease notably, it only outputs:
WARNING: 1 of 200 force values ​​in table are inconsistent with -dE/dr. Should only be flagged at inflection points (…/pair_table.cpp:483)

Finally if I generate a table file with only 100 points (between 100 and 150) there are no warnings.

So my query to the community is, have you worked with a table with so few points?
I am guided by the warnings of lammps and I place few points?
What would be another way to verify… analyze the generated trajectory and analyze the dynamics and structure of the system?

Thank you in advance.

Greetings,
Cristian

1 Like

Usually yes. Numerical differentiation becomes increasingly noisy with smaller deltas. You can easily verify this by using fewer points.

No. Try something in between like 1000 or 2000.

These warnings can be useful, but should not be overinterpreted.

What is usually more important are checking between equidistant and squared spacing (usually the gradient is larger for shorter r and and thus r**2 distances can give you more accuracy. And between linear and spline interpolation. With splines you would need fewer points to get a good representation than with linear, but linear cannot have ondulations for high gradients.

The important thing to realize is that tabulation would result in diverging trajectories, but the accuracy of the tabulation determines how quickly the divergence happens. This can usually be seen in an exponential growth of the difference in potential energy between original and tabulated value.

Since you are doing a tabulation on lj/expand, do this first with some lj/expand settings.

To determine structural differences, you can look at radial distribution functions (aka g(r) or rdf), but those are not very sensitive and noisy. So there should be a very good match for statistically converged results.

1 Like

Thank you for your help and kind regards!