proteneer / timemachine

Differentiate all the things!
Other
138 stars 17 forks source link

Fix off-by-one misalignment of permutations and frames in HREX output #1321

Closed mcwitt closed 2 months ago

mcwitt commented 2 months ago

Currently, replica_idx_by_state_by_iter[i] gives the permutation of replicas corresponding to the i+1st frame. This leads to confusion and potential bugs in analyses that try to correlate permutations and frames, e.g. to extract replica trajectories. (This also means that we confusingly store a final permutation that wasn't actually sampled by MD).

This PR fixes the off-by-one misalignment so that replica_idx_by_state_by_iter[i] gives the permutation of replicas corresponding to frames[i].

Note, this does not affect the correctness of free energy calculations, or significantly affect existing diagnostic plots in timemachine.