-
Notifications
You must be signed in to change notification settings - Fork 25
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
createMixedSystem() for switching a whole waterbox #52
Comments
It's an interesting question. For your case, though, this is all unnecessary complexity. You don't need to separate out internal from external interactions. You really just need to create a CustomCVForce, add all the ML and MM forces to it, and set the energy expression to interpolate between them. You can copy everything you need from the existing code. openmm-ml/openmmml/mlpotential.py Lines 275 to 279 in c3d8c28
openmm-ml/openmmml/mlpotential.py Lines 288 to 292 in c3d8c28
openmm-ml/openmmml/mlpotential.py Lines 336 to 338 in c3d8c28
|
@peastman : Perhaps we can add functionality for easily simulating periodic ML systems into the next feature release? |
|
Thank you very much for these insights and the helpful comment! |
Interpolating between MM and ML potentials is complicated, and I'm not sure all the possible combinations have been fully explored or thought out yet. You need to make sure both of them are valid. In your case you're simulating a water box. Most classical water models are designed to be fully rigid. That's how they were parametrized. You can make them flexible, but they may not do a good job of reproducing experimental quantities if you do. ML models are generally designed to be completely flexible with no constraints. It's possible there's a way you could add some constraints and still get realistic behavior, but that hasn't been studied much yet. At the very least, the constrained distances would likely need to be different from the ones in the classical water model. The |
I would like to use the
OpenMM-ML
package to switch a complete waterbox from MM to ML description using thecreateMixedSystem()
functionality. I know that technically it is not made for that, but I wonder if that might - in theory - be possible.For the simulation, I’m using the
CutoffPeriodic
option and set up the ML system the following way (I can provide a more detailed minimal example if needed):I believe that when using a cutoff, the
CustomBondForce
within theCustomCVForces
may cause issues in reproducing the Nonbonded Interaction for particles described only as ML atoms (https://github.com/openmm/openmm-ml/blob/c3d8c28eb92bf5c4b16efb81ad7a44b707fc5907/openmmml/mlpotential.py#LL298C14-L298C14). It seems that the PBC is not replicated for the ML portion of the system, which may not be problematic if only one small molecule is being treated by ML. However, when dealing with a system where all (or multiple) particles are described using ML (like the waterbox I would be interested in), this is not describing PBC correctly and leads to strange behavior of the box during the simulation (box blowing up). Therefore, I have created a Nonbonded Force using theopenmm.CustomNonbondedForce
according to the steps outlined in this discussion (openmm/openmm#3281). In the context of theCustomCVForce
this might look like this:Using this approach, I have been able to reproduce the expected energies that would result from simulating the box using only MM (
ff.createSystem
) or only ML (potential.createSystem
).createSystem
)createMixedSystem
)createMixedSystem
)createSystem
)In your opinion, do you believe that this is a valid approach for transitioning a box from MM to ML? Or is there anything I am missing?
The text was updated successfully, but these errors were encountered: