-
Notifications
You must be signed in to change notification settings - Fork 27
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
Barycenter Calculation in OpenMM #287
Comments
I added this CV to my PySAGES
|
Thanks for reporting this @svarner9! Just for completeness, can you share an example of the original CV you used that was problematic? |
Any CV that utilizes the barycenter will be incorrect I think. I also think even for the CVs that I wrote, there are some edge cases where the center of mass will be incorrect, because OpenMM will not wrap the particle coordinates of any atom in a given molecule unless all of the atoms are outside the box. So you can have atoms that are beyond the boundary, but not yet wrapped. In this case, I think one needs to do the wrapping within the CV, before transforming to the unit circle (I haven't fully thought this out though). The original CVs before changing them were:
and
I made new CVs for both of these that calculate the correct COM but also calculate the distance correctly with the minimum image convention. User beware, I am not an expert nor a PySAGES dev, please check these for yourself before you implement or use them:
and
Note that these CVs require you to pass the cell dimension up front, so these will not work for NPT simulations. |
I am not sure if this is a known issue, but I noticed that CVs which rely on the barycenter has a small issue in OpenMM.
To my knowledge, OpenMM wraps particle coordinates internally when using PBCs. As a result, when an atom group sits directly on the boundary, the barycenter is calculated to be in the center of the box, rather than on the edge. (See the attached image).
I think a way to remedy this would be to use the angular method mentioned in this Wikipedia article: https://en.wikipedia.org/wiki/Center_of_mass. I am going to implement this for myself, but would recommend looking into it for the package.
Thank you! :)
The text was updated successfully, but these errors were encountered: