Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement support for decoupled electrostatics with exact PME and GROMACS-type direct-space PME

See original GitHub issue

I’m looking to perform some alchemical free energy calculations and recently started using OpenMM to do this. You’ve all done some nice work here, so I don’t want to re-invent the wheel, but I initially set out to try and make these calculations work without openmmtools.alchemy, mainly to deepen my own understanding of how this all works.

Just to clearly define the problem, I want to take a particular molecule and decouple it from the rest of the system, leaving all direct-space intramolecular interactions on. From what I understand, this is what GROMACS achieves (someone please correct me here if necessary), and so I’ve been checking potential energies at different states against calculations from GROMACS.

This is relatively straight-forward in terms of sterics, as there is no reciprocal space term to deal with. However, electrostatics is a different story. Ideally, the coupled state includes all direct and reciprocal space interactions while the uncoupled state includes direct and reciprocal space interactions for the system minus the alchemical molecule and the direct-space interactions for the molecule with itself. I think I figured out a way to do this with OpenMM, and it mostly matches with GROMACS, but it doesn’t seem to match any of the options for handling electrostatics provided by AbsoluteAlchemicalFactory. In my approach, I use the following scheme:

  • NonbondedForce using PME with all electrostatics (except 1-4 terms and with all alchemical/alchemical terms set to zero with exceptions), and all non-alchemical/non-alchemical sterics (LJ)

  • CustomNonbondedForce using CutoffPeriodic implementing a soft-core potential for alchemical/non-alchemical sterics

  • NonbondedForce using PME with ONLY exceptions (zero for all particle charges and epsilons), including 1-4 terms and other alchemical/alchemical non-bonded interactions

Is this doing what I think it is? And for the options you have in AbsoluteAlchemicalFactory, what are the exact end states (coupled molecule with lambda of say 0, to uncoupled molecule with lambda of 1)? In terms of the potential energy function?

In my tests, I have set up the alchemical system with the following code:

alchFactory = alchemy.AbsoluteAlchemicalFactory(consistent_exceptions=False, 

alchemicalRegion = alchemy.AlchemicalRegion(alchemical_atoms=soluteIndices, 
                                            softcore_a=1, softcore_b=1, softcore_c=1,
                                            softcore_d=1, softcore_e=1, softcore_f=1

Obviously consistent_exceptions plays a role here too, but based on other discussions I’ve seen around this point I’m pretty sure I want to keep it as False.

I’m sorry if this is documented and I missed it. I also know there has been a lot of tangentially-related discussion on github, but I’m having difficulty synthesizing it into something cohesive.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

JIMonroecommented, Nov 9, 2018

Thank you! Sorry for the silence for awhile, but I will fork and take a stab at modifying to include this option when I get the chance. For now it’s been easier for me to just stick with my own code, but you guys have a lot of nice features I eventually want to take advantage of.

andrrizzicommented, Nov 9, 2018

I’ve changed the title of this to remind us to implement decoupled electrostatics with exact PME and direct-space PME preserving the reciprocal space during the alchemical transformation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found