# Using tabulated potentials in gromacs

GROMACS version: 2020.5
GROMACS modification: No

I am running a coarse-grained simulation using iterative Boltzmann Inversion in GROMACS. For this simulation, I am using a custom potential which is
V = -kT*log(g®)
where g® is the rdf of the all-atom simulation. i do not have g® in a symbolic form, but in the form of tuples, (r, g®). In order for me to use this custom potential V, I believe I would need to use tabulated potentials in GROMACS.

I look at this piece of documentation, and I see that if I generate a cubic splines between my points in (r,g®), I can make my tabulated potentials.

My question is, how do I make such custom tabulated potentials? Most of the files I see are for LJ potentials, but what if I have a custom potential of the form I have mentioned above?

Hi,
Please note that to use tabulated potential you have to use GROMACS 2018 (the options is not active from 2019 and it will probably come back in the future)
As described in the documentation Tabulated interaction functions — GROMACS 2021.1 documentation

The potential function is defined as

V(rij) = (qiqj/4πϵ0) * f(rij) + C6 * g(rij) + C12* h(rij)

where C6, C12 and the charges are read from the topology.
To generate the tabulated potential for your potential
I suggest is to assign a value of 1 to C6 and C12 (in the topology), then you can set g(rij) = 0 for any rij, thus you have
h(rij) = V
It is always good to run a small test to check that the potential is implemented correct.

I hope it helps. You can also have a look to previuos posts on “tabulated potential” Search results for 'tabulated potential' - GROMACS forums

Alessandra

@alevilla thank you for your response! So that is exactly what I have done. What I am wondering about is, what should my value of k (Boltzmann’s constant) be? Plugging in 1.38e-23 seems incorrect. How do the units work? For example, in the 6-9 LJ fluid, they simply plug in 1/r^9 in the C12 column. 1/r^9 has units of 1/(nm)^9, but the units of C12 is 4epsilonsigma^12 has units of kJ/mol(nm)^12

Hi
here you find the units and definition used in GROMACS Definitions and Units — GROMACS 2021.1 documentation
\Alessandra

@alevilla wow, I see. Thank you!