  Gradients in free energies are the driving forces of physical and biochemical
systems. To predict free energy differences with high accuracy, Molecular
Dynamics (MD) and other methods based on atomistic Hamiltonians conduct
sampling simulations in intermediate thermodynamic states that bridge the
configuration space densities between two states of interest ('alchemical
transformations'). For uncorrelated sampling, the recent Variationally derived
Intermediates (VI) method yields optimal accuracy. The form of the VI
intermediates differs fundamentally from conventional ones in that they are
non-pairwise, i.e., the total force on a particle in an intermediate states
cannot be split into additive contributions from the surrounding particles. In
this work, we describe the implementation of VI into the widely used GROMACS MD
software package (2020, version 1). Furthermore, a variant of VI is developed
that avoids numerical instabilities for vanishing particles. The implementation
allows the use of previous non-pairwise potential forms in the literature,
which have so far not been available in GROMACS. Example cases on the
calculation of solvation free energies, and accuracy assessments thereof, are
provided.
