Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alchemically modify charges with updateParametersInContext #319

Closed
andrrizzi opened this issue Jan 12, 2018 · 1 comment
Closed

Alchemically modify charges with updateParametersInContext #319

andrrizzi opened this issue Jan 12, 2018 · 1 comment

Comments

@andrrizzi
Copy link
Contributor

This is how I plan to add exact treatment of PME electrostatics in alchemy.

  1. Allow the value "exact" for the argument alchemical_pme_treatment in the AbsoluteAlchemicalFactory constructor.
  2. An exception is raised if achemical_pme_treatment is set to "exact", but charges are decoupled and/or if (softcore_beta, softcore_d, softcore_e, softcore_f) != (0, 1, 1, 1).
  3. AbsoluteAlchemicalFactory creates a CustomNonbondedForce with empty interaction groups that permanently store the fully interacting charges of alchemical atoms.
  4. AlchemicalState reads the original charges only once and cache them internally (charges are associated to the standard system hash).

The advantage of this approach is that AlchemicalState completely masks how the lambda_electrostatics parameter is implemented in the OpenMM System. Better ideas for how to keep in memory the original charges are welcomed.

@jchodera
Copy link
Member

This sounds like a great plan!

Some observations for the near-term implementation:

  • Generally, only a very small number of particles will have their charges change, so we only need to keep track of a dict of which ones are changing
  • The particles without charges changing in the CustomNonbondedForce can have their reference charges set to zero. Particles with nonzero charges are the ones that are changing.

Longer-term, we should work to see how we can get support for changing charges in OpenMM as context parameters:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants