Compute pe/atom pair returning negative values despite using pair_modify shift yes for lj potential

Hello all,

I am running a simulation in which I use pair_modify shift yes command to make the truncated leonard jones potential (cut off at 2^1/6) which is supposed to effectively shifts the potential up making its endpoint continue along the x axis and therefore ensuring it has no negative output in the energy.

However when invoking the the pe/atom pair compute, it returns negative values where as I expected it would return positive values. Is there an option to fix this?

This is my prm file:

pair_style lj/cut 1.122462048309373
pair_modify shift yes

pair_coeff 1 1 1.000000 1.000000 1.1220000000
pair_coeff 1 2 2.000000 1.000000 1.1220000000
pair_coeff 1 3 1.000000 1.000000 1.1220000000
pair_coeff 2 2 0.000000 1.000000 1.1220000000
pair_coeff 2 3 1.000000 1.000000 1.1220000000
pair_coeff 3 3 1.000000 1.000000 1.1220000000

Hi,

Using pair_modify shift yes will only slightly shift the value of the potential so that it is equal to 0 at the cut-off. Regardless, you still expect the energy of your system to be negative at equilibrium, so I dont think that there is anything wrong with your result.

Best,

Simon

Institute for Computational Physics
University of Stuttgart
https://simongravelle.github.io

In LAMMPS the order of commands matters. You do issue pair_modify shift yes, but at that point there were no pair coefficients set. You do this later and with a different cutoff. Try putting the pair_modify command last of all pair interaction settings.