File tree Expand file tree Collapse file tree
src/somd2/runner/_samplers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -455,9 +455,12 @@ def move(self, context):
455455 )
456456 e_old = state .getPotentialEnergy ().value_in_unit (_omm_unit .kilojoule_per_mole )
457457
458- # Random sign gives a symmetric proposal (detailed balance).
459- signed_angle = float (_np .random .choice ([- 1 , 1 ])) * angle
460- self ._rotate (context , group_idx , signed_angle )
458+ # Pick uniformly from the n-1 non-current states, where n = 360 / angle.
459+ # For 180° (n=2) this is equivalent to a random sign; for higher
460+ # symmetry orders it correctly samples any non-current state in one move.
461+ n = round (360.0 / angle )
462+ step = int (_np .random .randint (1 , n ))
463+ self ._rotate (context , group_idx , step * angle )
461464
462465 # Evaluate the energy of the proposed configuration.
463466 e_new = (
You can’t perform that action at this time.
0 commit comments