Negative value for pairwise interaction between like charges

Hi, I am working on a crystal system with five atoms. I calculate the pairwise interaction between all possible pairs of atoms. Here I got negative interaction energy for like charges and positive for unlike charges which is opposite of our regular sign convention. Strangely, when I added all these parts I got the exact total potential energy that was printed by Lammps. So what is wrong I am doing here? Another thing is it shows the net charge is non-zero for the pair atoms so there is no correction to the boundary energy value.

@Lukun There is lots of required information missing here to give competent and meaningful suggestions.

How did you do that? Manually? Or through LAMMPS? Considering periodic boundaries? with/without using a long-range Coulomb solver?

One has to be an mind reader to know exactly what you did, and without knowing that one cannot tell you what you did wrong. Since you are talking about a tiny system, you should provide all details and explain what you computed how so that we can actually see what you did and also show what you computed with LAMMPS, and - perhaps - then it is possible to tell you what you did wrong.

How large is this non-zero charge? Sometimes this is just due to rounding, sometimes due to imprecise input. sometimes an indication of an incorrect input. Again, without actually seeing the files you use and the output you got, it is next to impossible to make a meaningful assessment of the situation.

I have already pointed you toward the forum guidelines and have to do this again. Your chances of getting meaningful and useful advice strongly depends on how well you follow the suggestions presented there.

Sorry for my incomplete information. I did all the things using lammps. I use the following command under pbc to calculate pairwise interaction let say between Lithium amd Silicon.

compute 4 Li group/group Si pair yes kspace yes

Here I get negative interaction for Li-Si which is not physical. So for the all possible pair the interaction emergy is coming negative for like charges and positive for unlike charges lets say between Li-O which is basically opposite of conventional sign.

Now I calculate this pairwise terms by considering only coulombic part from ewald summation using lammps. Then I calculate the short range coulombic part and ignore the long range part that coming from ewald summation by setting kspace no command. The long range part then calculated by by subtracting the short range coulombic part from total coulombic part.

Here the intresting thing is that the dign convention for pairwise interaction follows for short range part,but in long range part it reversed . That mean for Li Si short range coulombic part is positive whereas long range part is negative.

But the total energy is coming correct by adding all the pairwise interactions.

Please re-read my previous post. Your “update” contains next to no additional information and the additional information is without context (e.g. how are the groups defined, what is the force field, what are the charges and more). There are still far too many ways how you could have made mistakes that are impossible to infer from what you provide.

Please review the guidelines properly. We have written them down for a purpose. Having to play a game of 20 questions with a person asking for help to get the information required to provide help is wasting a lot of effort. Please keep in mind that we cannot easily look over your shoulder or read your mind, so we only know what you tell us and that is extremely little in this case. Please keep in mind that people responding here are volunteering their time, so you don’t want to make them asking for the same stuff over and over again.

Bottom line, the quality and level of help you can get depends crucially of the level and quality of information you provide. At the moment, you have not been given any useful help toward solving your problem.

Here I am attaching the input script.

Lammps input file for Li2SiO3

units real

dimension 3

boundary p p p

#read data

atom_style full

read_data Li2SiO3.lmp

Potential

kspace_style ewald 0.00001

pair_style buck/coul/long 12.0

pair_coeff 1 1 154969.9200 0.1466275660 118.3 12.0

pair_coeff 1 2 5519488.923 0.1060602847 252.052 12.0

pair_coeff 1 3 55138.85100 0.2488676522 765.841 12.0

pair_coeff 1 4 55138.85100 0.2488676522 765.841 12.0

pair_coeff 2 2 20141477400 0.0657000007 538.002 12.0

pair_coeff 2 3 247536.7740 0.2085114369 1633.15 12.0

pair_coeff 2 4 247536.7740 0.2085114369 1633.15 12.0

pair_coeff 3 3 40564.29900 0.3513209668 4958 12.0

pair_coeff 3 4 40564.29900 0.3513209668 4958 12.0

pair_coeff 4 4 40564.29900 0.3513209668 4958 12.0

#pair_modify tail yes

group Li type 1
group Si type 1
group O1 type 3
group O2 type 4

timestep 2.0

thermo 1

compute 4 Li group/group Li pair yes kspace yes
compute 5 Li group/group Si pair yes kspace yes
compute 6 Li group/group O1 pair yes kspace yes
compute 7 Li group/group O2 pair yes kspace yes
compute 8 Si group/group Si pair yes kspace yes
compute 9 Si group/group O1 pair yes kspace yes
compute 10 Si group/group O2 pair yes kspace yes
compute 11 O1 group/group O1 pair yes kspace yes
compute 12 O1 group/group O2 pair yes kspace yes
compute 13 O2 group/group O2 pair yes kspace yes
compute 14 all group/group all pair yes kspace no

thermo_style custom step temp pe etotal c_4 c_5 c_6 c_7 c_8 c_9 c_10 c_11 c_12 c_13 c_14

rerun Traj300_Li2SiO3 dump x y z vx vy vz box yes

…and - again - you are not following the guidelines and suggestions and do not provide enough information to reproduce what you are doing. You have now used up all my patience.
Perhaps somebody else is willing to help you.

What I am doing here is explained previously. I am calculating the pairwise interaction for all atoms infividually in Li2SiO3 crystal system. Basically the problem is the opposite sign energy came for pairwise interactions here. Please ask if there is still any confusion.

please sir. i really need your help. I am new to this page so some confusion is there in my mind.

???

You had your chance. You blew it.

In my input structure file Li has assigned as 1 and Si as 2. Here there is a mistake for Si I typed.

Thanks for your patience.