# [lammps-users] "compute pair" and "compute pe/atom pair "

Dear all,
I simulated a process, and the system has two different molecules.
Molecule A with 4 different atoms (atom 1\2\3\4); Molecule B with 1 atom (atom 5).
Atom 5 has a charge of “0”, Atom 1-4 have nonzero charges.

Three kinds of pair styles are used: lj/charmm/coul/charmm 1, lj/charmm/coul/charmm 2, and lj/charmm/coul/charmm 3
lj/charmm/coul/charmm 1 is used for the inside of Molecule A: 1-1, 1-2, 1-3, 1-4, 2-2, 2-3, 2-4, 3-3, 3-4, and 4-4.
lj/charmm/coul/charmm 2 is used for the interaction between Molecule B and Molecule A: 5-1, 5-2, 5-3, and 5-4.
lj/charmm/coul/charmm 3 is used for the inside of Molecule B: 5-5.
Then I used the command :
compute Apeatompair A pe/atom pair
compute Apepair A reduce sum c_Apeatompair

compute Apeatomdih A pe/atom dihedral
compute Apedih A reduce sum c_Apeatomdih

compute pairBB all pair lj/charmm/coul/charmm 3 epair
compute pairAB all pair lj/charmm/coul/charmm 2 epair
compute pairAA pair lj/charmm/coul/charmm 1 epair
I thought that Apepair represented the pair energy on molecule A (the inside of A and the interaction between A and B), that is, the value of Apepair might be close to pairAA+pairAB. The final results show that Apepair is very different from pairAA+pairAB. I don’t know why.
And I found in the manual :“The dihedral_style charmm style calculates pairwise interactions between 1-4 atoms. The energy contribution of these terms is included in the pair energy, not the dihedral energy.” What does this sentence mean? Is dihedral energy included in Apepai? BUT, Apedih still has a non-zero value.
Thank you so much

[

2296804970

[email protected]

](头像签名)

a) compute pe/atom contains contributions to the potential energy of each atom. with the option “pair” that is restricted to contributions from pair styles only, but from all pair styles.
b) the charmm force field has two settings for the non-bonded interactions between 1-4 pairs that depend on the type of the dihedral interaction between those two atoms. often they use the same epsilon and sigma values, but sometimes they don’t. due to how LAMMPS handles the computation of force fields internally, the pair style does not know anything about what dihedral interaction there is. thus the non-bonded interactions for those special pairs are skipped during the pair style calculation, but then computed during the dihedral interaction calculation. for consistency those non-bonded energy terms will be tallied with the “pair” energy and not “dihedral”. that is what the sentence says.