# Force function for Dispersive PME

**URL:** <https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325>\
**Category:** Developers discussions\
**Created:** [March 25, 2026, 1:25am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325 "2026-03-25T01:25:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 25, 2026, 1:25am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/1 "2026-03-25T01:25:02Z")

</div>

Hi,

Does anyone know which scheme is used for determining the forces for dispersive PME (r^-6) non bonded interactions? As far as I know, for PME electrostatics, you can use ik scheme and spline differentiation schemes.

The ik scheme works well for dispersive but is time intensive as it requires 3+ 3d fast fourier transforms. The spline differentiation is faster, but I didn’t see any dispersive PME papers mention the use of spline differentiation for force calculation. In my numerical experiments as well, the spline differentiation for dispersive was WAY off from the ewald and ik force function values, which seemed to reconcile.

In summary, I have the following 2 questions:

1. Which force calculation scheme does GROMACS use for non bonded electrostatic force calculations?

2. Which force calculation scheme does GROMACS use for non bonded dispersive PME calculations?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [March 25, 2026, 7:34am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/2 "2026-03-25T07:34:16Z")

</div>

GROMACS uses spline differentiation for all. The main reason is that we require a conservative potential / forces. But it is also much faster, in particular in parallel. There is nothing special about r^-6. Just that the functions have a slightly different form.

---

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 26, 2026, 12:49am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/3 "2026-03-26T00:49:47Z")

</div>

Got it. I had a few follow up questions / clarifications :

I’m trying to understand how the term in LJ (SR) and LJ (Recip) is calculated.

1. Is LJ (SR) = V\_dir + V\_0, and LJ (recip) = V\_recip from this link : [Long Range Van der Waals interactions - GROMACS 2026.1 documentation](https://manual.gromacs.org/current/reference-manual/functions/long-range-vdw.html)?
2. What is the significance of LJ\_14 parameters and interactions? If PME is used, LJ 14 is not considered, and if vdw type = cutoff is used, only then does that energy get included. Is this correct?
3. From what I understand, the c6ii parameters are determined from the atom “types”. the atom type is determined, and the corresponding index (0, 1, 2, …. ) is used in the lookup table for LJ\_SR. Those c6 and c12 values are c6i and c12i, for which geometric rules can be applied (c12ij = sqrt(c12ii \* c12jj)). Is this correct? And what is the unit of c12i and c6i parameters? Couldn’t find them specified in any documentation, or else I must not have found the right page for it.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [March 26, 2026, 8:28am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/4 "2026-03-26T08:28:34Z")

</div>

1. No, LJ (SR) = V\_dr + V\_0 - V\_recip\_for\_excluded\_pairs
2. LJ\_14 are listed interactions and are applied independently from the non-bonded interactions. Usually 1-4 atom pairs are excluded from the non-bonded pair interactions
3. Yes. Simple dimension analysis tells you that units have to be energy/distance^(6 or 12), this is also listed in the topology parameter table. Note that the non-bonded machinery internally stores 6\*c6 \*and 12 \*\*c12.

---

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 27, 2026, 2:06am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/5 "2026-03-27T02:06:53Z")

</div>

Got it. I was able to reproduce the exact LJ recip. values for Argon, which doesn’t have any exclusion lists, but not able to reproduce the exact LJ values for alanine dipeptide, which does have exclusion lists. Also I’m having a hard time reconciling the V\_dir values from the formula you gave me.

1. I was able to deduce from a 2 particle Argon system with distance between the particles \> rC, that the negative of V0 is added to LJ (SR), i.e. as per my understanding, LJ (SR) = V\_dir - V\_0 - V\_recip\_for\_excluded\_pairs. Could you please check this, or let me know if I am wrong?
2. Do exclusion lists play any part in calculating the **reciprocal part** from PME, or are they not considered?
3. What happens to the C12 / r^12 terms in LJ-PME? Do we neglect them in V\_dir, or are they included? I couldn’t find any papers that mention why they neglect that term, or if the dispersive function (r^-6) is a subset of LJ (r^-12 with r^-6), and that we have to add the r^-12 terms as well.

Any clarification would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [March 27, 2026, 9:56am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/6 "2026-03-27T09:56:43Z")

</div>

1. Why the minus sign in front of V\_0? Otherwise correct.
2. No, reciprocal part and energy contains all interactions, including excluded and self.
3. 1/r^12 decays so fast that there is never a need for long-range treatment.

---

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 28, 2026, 12:06am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/7 "2026-03-28T00:06:47Z")

</div>

I was able to calculate the LJ (SR) value for argon system of any number of particles as follows:

V\_{rep-sr} = \frac{1}{2}\sum\_{n\_x}\sum\_{n\_y}\sum\_{n\_z\*}\sum\_{i,j}^{N} \frac{C^{(12)}\_{ij}}{(r\_{ijn})^{12}}

Where V\_{rep-sr} is the repulsive part of the short term interactions.

For Argon, I got :

LJ (SR) = V\_{rep-sr} + V\_{dir} - V\_0 - V\_{recip-excluded-pairs}

I am attaching a tpr file here (argon\_42\_tpr). I did the following:

[argon\_42\_tpr.dat](https://gromacs.bioexcel.eu/uploads/short-url/A7ETd2aVUHTX7e2I1mVlEBhC5vn.dat) (4.7 KB)

Run the simulation, extract energy:

```auto
#move file from dat to tpr
mv argon_42_tpr.dat argon_42.tpr
# run simulation
gmx_mpi mdrun -deffnm argon_42
gmx_mpi energy -f argon_42.edr -o lj_sr_argon_42.xvg
head -n 30 lj_sr_argon_42.xvg
# note the lj_sr value at timestep 0, that is the expected value for LJ (SR)

```

Use my python script to calculate LJ (SR) as per my understanding:

[calculate\_lj\_sr\_py.dat](https://gromacs.bioexcel.eu/uploads/short-url/nKs9fOLoVewhbnQormWdltYhqw0.dat) (9.5 KB)

```auto
# convert dat to py
mv calculate_lj_sr_py.dat calculate_lj_sr.py
# Port tpr file to human readable format for python
gmx_mpi dump -s argon_42.tpr > argon_42_verbose.tpr
# Run the python script with the verbose file
python calculate_lj_sr.py argon_42_verbose.tpr

```

This script only gave the correct LJ (SR) for configurations of argon system. For NaCl, and alanine dipeptide, it did not reconcile with energy values from gromacs.

So there’s something I am doing wrong.

---

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 28, 2026, 7:27am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/8 "2026-03-28T07:27:47Z")

</div>

I misunderstood how c6 values are interpreted from the verbose tpr file. I have fixed the script, and LJ (SR) calculated with the script now reconciles with argon as well as nacl tpr files. I am attaching the nacl tpr file here:

[nvt\_nacl\_tpr.dat](https://gromacs.bioexcel.eu/uploads/short-url/mzv6XhhhHOtijamYPKgMCDjSQiM.dat) (16.3 KB)

Updated script:

[calculate\_lj\_sr\_py.dat](https://gromacs.bioexcel.eu/uploads/short-url/3K37YKVd3vE7FQ2CcfYgbsvYcmw.dat) (9.5 KB)

However, I am still unable to reconcile it with alanine dipeptide :

[aladi\_nve\_tpr.dat](https://gromacs.bioexcel.eu/uploads/short-url/h6kFiqtS7LJF3UNrVahHyK24igI.dat) (11.4 KB)

The difference between them is that V\_recip\_excluded\_pairs != 0 for aladi.

1. Is this formula correct for V\_recip\_excluded\_pairs?

2. I’m assuming that V\_dir also excludes terms of (i,j) which are part of the excluded pair. Is this correct?

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [March 30, 2026, 8:04am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/9 "2026-03-30T08:04:50Z")

</div>

1. Looks correct.
2. I don’t completely understand your question. You mean that term of 1. is included in V\_dir? The answer to that is yes.

Note that things are more complicated when the parameters do not follow geometric combinations rules.

---

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 30, 2026, 8:48am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/10 "2026-03-30T08:48:45Z")

</div>

Let me clarify a little more on the question 2 above.

We calculate V\_{dir} as follows:

V\_{dir} = -\frac{1}{2}\sum\_{i,j}^N \sum\_{n\_x}\sum\_{n\_y}\sum\_{n\_z\*} \frac{C\_{ij}^{(6)} \phi(\beta r\_{ij, n})}{r\_{ij,n}^6}

In the above summation, we are summing over all possible (i, j) pairs. When exclusion lists are not empty, do we exclude the pairs from the above sum that belong to the exclusion list?

Is this the correct formula then for V\_dir? :

V\_{dir} = -\frac{1}{2}\sum\_{i,j, (i,j) \not\in EXCL}^N \sum\_{n\_x}\sum\_{n\_y}\sum\_{n\_z\*} \frac{C\_{ij}^{(6)} \phi(\beta r\_{ij, n})}{r\_{ij,n}^6}

Yes, for now I am only discussing about geometric combination rules.

I did read up about how things can get a little more complex with Lorentz Berthelot combination rules.

---

<div class="post-metadata">

**Author:** ![shaunak](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@shaunak](https://gromacs.bioexcel.eu/u/shaunak)\
**Post date:** [March 31, 2026, 3:38am UTC](https://gromacs.bioexcel.eu/t/force-function-for-dispersive-pme/13325/11 "2026-03-31T03:38:06Z")

</div>

I got all of my answers with numerical experiments.

Thank you Dr. Hess.

I still think this is the formula for LJ (SR):

𝐿𝐽(𝑆𝑅)=𝑉𝑟𝑒𝑝−𝑠𝑟 + 𝑉𝑑𝑖𝑟 − 𝑉0 − 𝑉𝑟𝑒𝑐𝑖𝑝−𝑒𝑥𝑐𝑙𝑢𝑑𝑒𝑑−𝑝𝑎𝑖𝑟𝑠

as I mentioned above. All of my numerical experiments say that, but please let me know if you think I am wrong.
