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

Implement reflecting boundary conditions for metadynamics bias #525

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

fabsugar
Copy link
Contributor

Dear All,
the branch meta_reflection includes important modifications of the metadynamics code (colvarbias_meta.*) which allow to correct known artifacts of metadynamics at the boundaries of the collective variables (either natural boundaries or added through flat bottom potentials).
Namely, I implemented the reflection of the metadynamics Gaussians through the boundaries and an additional feature that removes the biasing forces beyond the boundaries (so that those forces smoothly go to zero beyond the boundaries). The implementation is specifically designed to be general and applicable to any dimensionality. The output pmf and bias energy includes those corrections (e.g. it remains flat beyond the border of a given collective variable while keeping the same shape across the others).
This feature also solves the need to add explicit Gaussians beyond the boundaries, which is computationally inefficient (and currently might need some fix).
The new feature is simple to use, it only requires the keyword "hills_reflection on" and automatically works on the default boundaries. Upon activating it the users will be able to run long metadynamics simulations of any dimensionality without developing the large errors at the boundaries that are currently present and that become larger and larger as the simulation goes on.
The new feature is fully tested on different systems up to a dimensionality of four.
The meta_reflection branch was merging fine with the master branch up to mid January, right now there is some minor conflict.
All the best,
Fabrizio

@giacomofiorin
Copy link
Member

Looking at the state of the history a squash-merge (i.e. merging all commits into one commit) may be appropriate when this PR is ready.

The conflict is near the function where the hills are added in the multiple walkers case. Have you been able to test that combination of features before the conflicts became worse?

@giacomofiorin
Copy link
Member

P.S. I tried resolving the conflicts in the meta_reflection_squash branch.

@fabsugar
Copy link
Contributor Author

fabsugar commented Apr 18, 2023 via email

@giacomofiorin
Copy link
Member

Sounds good. You could also start from meta_reflection_squash

@fabsugar
Copy link
Contributor Author

fabsugar commented Apr 18, 2023 via email

…e grid the default limits of reflection

plus a few simplifications
fabsugar and others added 26 commits December 15, 2023 09:43
… hills refletions,

to be continued for interval
introduced use_reflection as a general variable to be use to call
associated function to add refleted hills
accounting for binning at the border which was leading to following bin
which is out of the grid
checkval-getsum>=0 required to make things work
must be put back at the border when coordinates go out of the reflection border
…mit of reflection is in the boundary

before correction was handling most of cases but now should be fine in every case
by using get_colvar_index_bound to treat vaules out of the boundary (which are projected inside the closest boundary).
Additionally curr_values are now defined as a general variable to avoid define a new variable every time
functions are called
…xes the seg fault when using

multiple replicas
@giacomofiorin giacomofiorin changed the title Meta reflection Implement reflecting boundary conditions for metadynamics bias Oct 24, 2024
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

Successfully merging this pull request may close these issues.

2 participants