Ewald summation modification

Hello all,

I am trying to modify ewald summation in lammps based on paper doi: 10.1063/1.2464084. Since gaussian-distributed atom charge of graphene is involved, I am thinking to change the atom_style.cpp/h, and kspace.cpp/h with pair_stylecpp/h, since the changes on summation term include the interactions between gaussian-dis atom charge and ion charge, and that between gaussian-dis atom charges.

I have been browsing ewald.cpp, but except for lines such as follows, I didn’t find much related to parallel computing. If I change the summation term, should I also write new parallel codes?

if (comm->me == 0) {

if (screen) fprintf(screen,“Ewald initialization …\n”);
if (logfile) fprintf(logfile,“Ewald initialization …\n”);
}

if (fabs(qsum) > SMALL && comm->me == 0) {
char str[128];
sprintf(str,“System is not charge neutral, net charge = %g”,qsum);
error->warning(FLERR,str);
}

if (comm->me == 0) {
if (screen) {
fprintf(screen," G vector (1/distance) = %g\n",g_ewald);
fprintf(screen," estimated absolute RMS force accuracy = %g\n",
estimated_accuracy);
fprintf(screen," estimated relative force accuracy = %g\n",
estimated_accuracy/two_charge_force);
fprintf(screen," KSpace vectors: actual max1d max3d = %d %d %d\n",
kcount,kmax,kmax3d);
fprintf(screen," kxmax kymax kzmax = %d %d %d\n",
kxmax,kymax,kzmax);
}
if (logfile) {
fprintf(logfile," G vector (1/distance) = %g\n",g_ewald);
fprintf(logfile," estimated absolute RMS force accuracy = %g\n",
estimated_accuracy);
fprintf(logfile," estimated relative force accuracy = %g\n",
estimated_accuracy/two_charge_force);
fprintf(logfile," KSpace vectors: actual max1d max3d = %d %d %d\n",
kcount,kmax,kmax3d);
fprintf(logfile," kxmax kymax kzmax = %d %d %d\n",
kxmax,kymax,kzmax);
}
}

Thank you for your insights.

Andrew

This gaussian distributed charge around atoms is very similar to the
Streitz-Mintmire potential (See Streitz and Mintmire, PRB 50 1994 and
Zhou et al, PRB 69 2004).

You don't need to modify ewald.cpp and it would be incorrect to modify
atom_style.cpp and kspace.cpp. What you need to do is to implement a
new pair_style to handle the real space summation part of the
potential. Reciprocal space part of the potential does not need to be
changed so you can use kspace_style ewald directly without changing
ewald.cpp.

What is the most complicated is solving the Gaussian integrals, which
can be very difficult - you should see that the Authors seeked help
from Refs. 17 & 18 to solve these integrals.

Ray

Hello Ray,

Thank you for this insightful suggestion, and sorry I couldn’t read it earlier.

I have read Streitz & Mintmire’s paper, and it seems right to do as you suggested. I have written a new pair style, and I am still a bit confused about gaussian integrals. If I don’t modify ewald.cpp/h, in which reciprocal space summation has been taken care of, the real space summation will only be as before but with two more terms, the summation between the integrated gaussian distributed charges, and that between ion atom charge and the integrated gaussian charge. It seems like these extra summations do not involve gaussian integrals, because only the integrated charge are applied.

Looking forward to your suggestion, and thanks again for your time.

Andrew

I suggest you also carefully read the Zhou 2004 paper since it
provides how Coulomb Integrals were solved in the Streitz-Mintmire
potential.

"the summation between the integrated gaussian distributed charges,
and that between ion atom charge and the integrated gaussian charge."
require solving Gaussian Integrals. This is precisely the reason that
the Authors of the paper you provided specifically cited Refs. 17 &
18.

I suggest you carefully read all those papers and sit down with your
advisor. This mailing list can not substitute both that.

Cheers,
Ray