Minor bugs/Implementation improvements#772
Merged
dwhswenson merged 6 commits intoJun 10, 2018
Merged
Conversation
Member
Author
|
Ready for review/merge. If not reviewed by 20 May, I'll assume it is okay to merge. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a few minor (and long-standing) bugs that would only cause problems at edge cases, but which became apparent while finishing up the OPS papers.
Bugs fixed:
TISEnsembleOther stuff:
Volumes should only include bounds on one side
Previously,
CVDefinedVolumeswere inclusive on both sides; i.e., they returnedlambda_min <= cv(x) <= lambda_max. This meant that a single point could still be assigned to two ostensibly non-overlapping volumes.It also meant that there was an inconsistency, thanks to the range logic factories. Consider the volume
Afrom (-1, 0) andX(-1, 1). Previously,A(0) == True, because0is the upper bound. Using range logic, the volume(X - A)covers (0, 1). Therefore(X - A)(0) == True, because0is the lower bound. ButX - AmeansX & ~A;~A(0)should beFalse, so(X & ~A)(0)should beFalse.I fixed this by defining CVs such that they give
lambda_min <= cv(x) < lambda_max. This fixes the above example becauseA(0) == False, and~A(0) == True. This involves a lot of changes of the tests, because I frequently used the test case that we hit the border. Note that this is not likely to be a bug that has caused any trouble, since it only matters if you land exactly on the border and if you're using combinations that use range logic and if you're using a logical not somewhere.I came across this problem when I was cleaning up the implementation of the
MinusInterfaceEnsembleto make it look more like the description in the OPS 2 paper (which is better than the original implementation).Corrected implementation of
TISEnsembleThe previous implementation of the
TISEnsembleput the check for a frame that crosses the interface in the middle subensemble. This meant that if the only frame that crossed the interface was the last frame (ending in the other state) we wouldnt catch it, and reject the trajectory. This is a small bug that only matters if the interface is very close to state B. In addition, it's worth noting that several mathematical descriptions of the TIS ensemble in the literature make the same mistake (using a < instead of a <=), so this is something that really requires careful attention.