-
Notifications
You must be signed in to change notification settings - Fork 26
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
enhancement for switching between MM and TorchForce
with GlobalParameter
s
#12
Comments
@peastman : Just to be clear here, the simplest broadly applicable use case just needs two parameters, and there is no need for softcore for common uses:
|
I think the
I don't understand what the |
Tagging @dominicrufa here for further input. The |
For the bonded interactions, that would be easy to do by applying a scale factor in the CustomCVForce. For the nonbonded interactions within the ML region it's more complicated. For each exception, you need to calculate charge and epsilon such that the total interaction comes out exactly right given lambda and alpha. |
Alternatively you could just keep all the exceptions as 0. Then add a CustomBondForce inside the CustomCVForce to compute their energies. |
I handle the MM region with this; the nonbonded regions withing ML region, i do what @peastman suggested: |
How about this. We can add a boolean flag to |
That sounds like a great solution to me!
By "everything", do you mean that it would put only the MM region being
removed in the CustomCVForce? If the whole system, how would this work for
replacing only part of the system with ML?
Is there any reason not to use the CustomCVForce solution by default? It
seems like it wouldn't slow things down and would provide a lot of
flexibility that can be illustrated in tutorials.
@dominicrufa: Any concerns with this approach?
|
Correct. For example, there would be a HarmonicBondForce directly contained in the System, with all bonds outside the ML region. And there would be a second HarmonicBondForce inside the CustomCVForce, with the bonds inside the ML region.
CustomCVForce does add overhead. Whether that's significant depends on your potential. Compared to typical MM force fields, it's significant. Compared to most ML potentials, it probably isn't. It also adds complexity. |
it's not obvious to me how intra-MM nonbonded interactions will behave if you allow for a simple linear scaling. ive seen nans happen with |
Any idea what causes that? The exact shape of the short range repulsive potential is different for the two. But still, any conformation that is very high energy in one should also be very high energy in the other. |
What are "aggressive" timesteps here? Presumably, this feature would initially require the ML subsystem uses no constraints in the MM parameters (which may require some extensions to
Would be great to know which force term was responsible. It's hard to imagine how LJ could be responsible for this. |
By default, |
4fs
I'll have to dig into this more to figure out what the problematic force is. |
From my conversations with the ANI folks and @raimis @giadefa, we need to stick to 1-2 fs timesteps, since ANI is not stable at 4 fs timesteps. I think this issue arises from ANI, and not the MM system. We've discussed some ways we could reach 4 fs outer timesteps with multiple timestep methods, but we would essentially require a cheaper surrogate potential that would be used for inner timesteps. |
The changes described above are implemented in #24. Is it ok to close this now? |
@dominicrufa : Can you see if this fits your needs? |
I think it might be worthwhile to add an enhancement to the createMixedSystem functionality where instead of modelling a region (set of atoms) with a
TorchForce
and the rest of the system with conventional MM forcefields, we might want to haveGlobalParameters
that turn off the MM-ff of a region of interest and turn on theTorchForce
with someGlobalParameters
. I think it would also be very valuable to have a temperature-like scale factor that 'softens' the interactions between the MM/TorchForce
and MM-only region in aREST
-like capacity.I have a (complicated) working implementation of this (note that this functionality only modifies the existing MM-forces. the user needs to specify a list of atoms constituting a region for which the MM-energies should be scaled down. The
TorchForce
generator lives here ). The most complicated part is defining the MM-forces (namely softcoring the intra-region nb interactions so as to avoid singularities when the MM-energies are switched off).Would it be possible that we might integrate the linked code (or a variation of it) into
openmm-ml
and add some pytests? I'd be happy to help/troubleshoot.The text was updated successfully, but these errors were encountered: