-
Notifications
You must be signed in to change notification settings - Fork 19
Description
The current sMD implementation allows to use RMSD, Distance and Torsion collective variables. I had a case where I had to use a custom function as one of my CVs (plumed docs). I think this is quite a niche case, but it could be a powerful way to add more flexibility to sMD protocols.
I have added a new CollectiveVariable.Expression on branch feature-custom-smd and also modified Process._plumed to write out the PLUMED input file in a way that works with the custom expression. The key feature was defining the CVs that are part of the expression at the start of the PLUMED input file, but not adding them into the steering itself in the MOVINGRESTRAINT part. I tried to write CollectiveVariable.Expression to be consistent with BSS but of course make any changes that are needed. At the moment I have not modified the Metadynamics part (Process._plumed._createMetadynamicsConfig()) but I can make the same changes if you are happt with what I did to the sMD (or simply make a custom expression not supported for it)
As an example, here is a notebook and associated data to illustrate how the code would be used to run sMD with a custom expression.