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

Modified MC rotation moves #331

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kamran-haider
Copy link

Potential enhancement: Following up on discussion in #330, I modified the rotate_positions method of MCRotationMove to allow a subset of atom positions define the geometric center of rotation. The unit test for metropolized moves wouldn't test for this modification so when running tests locally, everything goes smoothly. I checked the output configurations, as shown in issue thread. Let me know if I should write a unit test for this.

Copy link
Contributor

@andrrizzi andrrizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! Sorry it took me so long to review. I was in time crunch.

Looks great so far! Just a comment about the docstring. Also, it would be great if you could add a simple unit test in test_mcmc.py. Something like this would be enough:

  1. If nothing is passed to rotation_center_indices all atom positions change.
  2. If the rotation is centered on a single atom, that position won't change.

"""Return the positions after applying a random rotation to them.

Parameters
----------
positions : nx3 numpy.ndarray simtk.unit.Quantity
The positions to rotate.
rotation_center_indices : list
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a , optional here? Also, it would be fantastic to document that the center of rotation is chosen to be the center of geometry of this set of atoms, and that the default behavior uses all the atoms in positions.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries at all and thanks so much for the comments. I agree and will get back with the unit test and updated docstring.

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