Dear Lammps user and developer,

I’m confused by something when I look at the lammps code pair_coul_long_soft.cpp recently.

Specifically, looking at the real-space portion of the code they calculate the real-space contribution to the Coulomb energy as:

ecoul = prefactor*erfc

where prefactor is the soft coulomb potential ie:

prefactor = \lambda^n * q_i * q_j / ( \epsilon * \sqrt{ \alpha_c(1-\lambda)^2 + r^2 )^{1/2} )

what confuses me is that the formula for ecoul is using the soft form of the potential to calculate the interactions between the point charges **AND the Gaussian** in real-space. What’s strange to me, is if the coul_long_soft code is paired with the same kspace solver as the regular coul_long code, then that kspace solver is calculating the interactions between the Gaussian using the full coulomb potential, not the soft coulomb potential. If this is true it would make it seem like the coul_long_soft code wouldn’t actually reproduce the correct soft potential. To me, the real-space code should actually be calculating:

ecoul = prefactor - full_coul * erf

i.e. the prefactor accounts for the point-charge interactions using the soft potential, and the - full_coul * erf term accounts for Gaussian interacting with the full coulomb potential - this latter term is then cancelled by the k-space code which calculates the interactions with the Gaussian using the full potential.

Best,

Yang Hong