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

METAD bias potential updated by Context.getState(getEnergy=True) #64

Open
sefalkner opened this issue Nov 10, 2022 · 0 comments
Open

METAD bias potential updated by Context.getState(getEnergy=True) #64

sefalkner opened this issue Nov 10, 2022 · 0 comments

Comments

@sefalkner
Copy link

sefalkner commented Nov 10, 2022

Hi!
first of all, thank you for maintaining this amazing plugin. I've encountered a problem when running metadynamics with openmm-plumed. The core of the program is the following:

  • A Gaussian is placed every 100 steps in the protocol
  • Integration for 100 steps is performed, the system is in configuration x1
  • The positions in the context are set to another configuration, lets say x2
  • The energy of that configuration x2 is evaluated
  • The simulation is reset to the configuration x1
  • Repeat the process

Strangely, plumed updates the HILLS file based on x2, not on x1. But an energy evaluation should not be counted as a step, am I right? Shouldn't this be prevented from happening by this check?

Here is a small example of a simulation script for an Na+Cl- ion pair together with the resulting (wrong) HILLS file: metad_test.zip. A workaround is to set the system's StepCount to something that is not a multiple of the bias deposition stride, and set it back after the calculation.

Thanks for your help!

Edit:
Could it be linked to the way openmm increments the step counter, essentially doing:
step=0
CalculateForces()
step+= 1
...
So that here the step counter is 100 after one round of the above protocol, but the force calculation was last performed when the step counter was 99, therefore the energy request triggers the update?

@sefalkner sefalkner changed the title METAD bias potential updated by Context.getState(getEnergies=True) METAD bias potential updated by Context.getState(getEnergy=True) Nov 11, 2022
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

1 participant