openmm / openmm-ml

High level API for using machine learning models in OpenMM simulations
Other
76 stars 25 forks source link

`createMixedSystem` can yield unstable dynamics due to CVForce's `mmForce1` (HarmonicBondForce) #36

Closed dominicrufa closed 1 year ago

dominicrufa commented 1 year ago

I've been playing around with CustomCVForce-equipped openmm.System object returned by openmm_ml.mlpotential.MLPotential.createMixedSystem with ani2x and I'm seeing some nans in my simulations; I dug through the offending force objects that were contributing to unusually large forces (>1e5 kJ/nm*mol). I found that the ML-treated subsystem has atoms with some of these unusually large forces. specifically, I found that the mmForce1 (HarmonicBondForce) see here is contributing to the large forces when lambda_interpolate=0.88888888. since this is a harmonic bond, it suggests that the stiff spring constant is to blame for some reason?

given this, would it make sense to add another global lambda parameter that allows for the softening of these spring constants?

The serialized state of the nanned simulations is attached; however, I cannot attach the TorchForce.pt since it is too large for github xml.tar.gz

cc: @jchodera @peastman

peastman commented 1 year ago

That's an ancient version, from March 15. You can identify a revision by typing git log <revision hash>.

jchodera commented 1 year ago

@dominicrufa : Is it possible you have a cached version you haven't cleaned out? If installing the omnia-dev version, you need to force clean out the old cached package versions:

conda clean -tipsy

should clean everything.

dominicrufa commented 1 year ago

closing as this is fixed with the lastest nightly build.