Dear LAMMPS users and developers,

likely this question had already been asked, but I couldn't find something specific in the mailing list archive, so please forgive me, if I'm asking again.

In compute/msd and compute/displace the calculation for one dimension, in the case of a simple cubic box and the cm flag turned off, goes like follows:

dx = x + ix*Lx - xo

where x is the current position, ix is the image number, Lx is the current box length and xo is the position of the atom at the initialization time of compute/msd.

xo is calculated in the ctor like this:

xo = x_0 + ix_0 * Lx_0 .

Lx and Lx_0 may be different due to integration in NPT ensemble.

In the case the atom has not crossed any boundary since initialization of compute/msd (ix == ix_0) inserting xo gives:

dx = x-x_0 + ix*(Lx-Lx_0)

Which makes the displacement different for each image of the particle.

But shouldn't the displacement be independent of the image one is looking at?

The same holds for compute/displace.

Can someone please verify this or show me were I'm making an error of reasoning?

Thanks,

Richard