Regarding compute pe/atom for coul/long with slab geometry

Hi all

I have a question regarding the compute pe/atom.

Say I have two oppositely charged lattices parallel to the x-y plane at two ends of a simulation box. ( I use 10x10 square lattice, area 100A^2, one at plane z=-50A having charged particles with charge -1e at each lattice point and one at plane z=150A, having charged particles with charge 1e at each lattice point, so the system is charge neutral.)

I use the following parameters with no fixes (i.e. charges are stationary)

boundary p p f
pair_style coul/long 30.0
kspace pppm 1e-5

kspace_modify slab 3.0

Now when I compute the pe/atom values for each of these charges, I find that the pe/atom values for the charges at z=-50 are different from those at z=150. I expected these two values to be the same since the charges are in similar environments, so where does this difference come from?

When I use boundary p p p i get a different value for the energy per atom as is expected, but this value is same for all particles in the system (irrespective of whether they belong to the z=-50 plane or z=150 plane)

What contribution to the energy am I missing in the first case?



Stan can answer this. I can’t recall how the slab
correction is handled with the per-atom energies.