[lammps-users] question about tail correction implementation

Dear LAMMPS users,

I would like to ask how the tail correction is implemented
in the NPT simulations. In the documentation page
it is specified that:

“These corrections are bookkeeping terms which do not affect dynamics, unless a constant-pressure simulation is being performed”

“Their effect will also be included in constant NPT or NPH simulations where the pressure influences the simulation box dimensions”

In other words, does that mean that if this option is enabled, the tail correction
is included in Hamiltionian of the system and is not a “constant” value as it would
be in the NVT (or any other with no constant pressure) ensemble?

Best wishes,

the tail correction is an approximation of the error in energy and pressure due to the use of a cutoff in the potential.
it is based on the total number of atoms of each type assuming a homogeneous distribution.

it affects the dynamics of constant pressure simulations because the pressure influences the volume, the rescaling of the volume affects the positions and that affects the dynamics. however, this is not an “extra term” in the hamiltonian, but rather a correction for the error made by using a cutoff. while for the forces the error mostly cancels that is quite as true for pressure. because of this and because it is an approximation, it can be precomputed (except for its volume dependence).

the value of the tail correction depends on the volume of the system thus it has to be a constant when the volume is constant. and pressure is a diagnostic property in such simulations anyway.

if you want a full and not approximative treatment of the long-range contributions to energy and pressure you need to use a corresponding /long pair style and the matching kspace style. e.g. lj/long/coul/long.