Skip to content

Add long-range dispersion correction, Beutler soft-core, and LambdaSchedule.reverse()#440

Merged
lohedges merged 21 commits intodevelfrom
feature_lrc
May 7, 2026
Merged

Add long-range dispersion correction, Beutler soft-core, and LambdaSchedule.reverse()#440
lohedges merged 21 commits intodevelfrom
feature_lrc

Conversation

@lohedges
Copy link
Copy Markdown
Contributor

@lohedges lohedges commented May 7, 2026

This PR adds support for the long-range LJ dispersion correction (LRC), adds a new Beutler LJ soft-core form designed for absolute binding/hydration free energy simulations, and adds a LambdaSchedule.revese() method to reverse a schedule, allowing it to be used with the swap_end_states option, e.g. for ring-breaking.

Rather than using OpenMM to compute the LRC, which requires costly recalculation of coefficients when changing lambda and updating force parameters, we numerically compute and cache the LRC for each lambda, then apply it as a CustomVolumeForce. When ghost atoms are present we handle the total LRC by decomposing into a "background" term and a "ghost-lrc" that adds contributions for ghost/ghost and ghost/non-ghost interactions. For GCMC simulations we handle the LRC for solvent atoms separately so that we can dynamically update the correction as water molecules are inserted or deleted from the system. Unit tests show that end-state energies for a perturbable system agree with those that would be computed by OpenMM when using LRC with the NonbondedForce. We also validate the the water LRC code works correctly by numerically comparing the change in energy for a GCMC insertion.

The PR also adds a new Beutler soft-core form designed for ABFE simulations. The form matches that used by GROMACS, providing a useful reference for benchmarks simulations. In updating the soft-core I have also removed the coulomb_power option, since it is incorrect for any non-zero value.

Finally, the PR adds a LambdaSchedule.reverse() method, allowing the direction of any schedule to be reversed. This is particularly useful when testing complex multi-stage schedules, e.g. ring-breaking, with the swap_end_states dynamics option.

  • I confirm that I have merged the latest version of devel into this branch before issuing this pull request (e.g. by running git pull origin devel): [y]
  • I confirm that I have added a test for any new functionality in this pull request: [y]
  • I confirm that I have added documentation (e.g. a new tutorial page or detailed guide) for any new functionality in this pull request: [y]
  • I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
  • I confirm that I have permission to release this code under the GPL3 license: [y]

@lohedges lohedges added the enhancement New feature or request label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant