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

Fix spurious truncation of HREX swap stats #1140

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

mcwitt
Copy link
Collaborator

@mcwitt mcwitt commented Sep 6, 2023

When there is just a pair of states (K = 2), we add an identity move to the mixture of neighbor swap moves in HREX to prevent periodicity when the swap acceptance probability is close to 1.

Originally, the identity move was added regardless of the value of K, but we changed the logic in #1128 to only add it when K = 2, because the mechanism for periodicity that it's intended to work around can't occur for K > 2. But we neglected to wrap the corresponding truncation to remove the acceptance stats for the identity move in the same conditional, resulting in truncating acceptance stats for the first neighbor swap move when K > 2.

This PR fixes the issue and adds a test.

@mcwitt mcwitt marked this pull request as ready for review September 7, 2023 01:52
@mcwitt mcwitt requested a review from proteneer September 7, 2023 14:38
Copy link
Owner

@proteneer proteneer left a comment

Choose a reason for hiding this comment

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

lgtm - thanks for the hotfix

@mcwitt mcwitt merged commit 0628c0e into master Sep 7, 2023
@mcwitt mcwitt deleted the hrex-fix-truncated-acceptance-stats branch September 7, 2023 14:44
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