Skip to content

Commit

Permalink
Replica exchange now has the correct signs
Browse files Browse the repository at this point in the history
  • Loading branch information
mb2055 committed Sep 30, 2024
1 parent 2a0c15d commit 9982932
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/sire/morph/_repex.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,18 @@ def replica_exchange(
beta1 = 1.0 / (k_boltz * temperature1)

if not ensemble0.is_constant_pressure():
delta = beta1 * (nrgs1[0] - nrgs1[1]) + beta0 * (nrgs0[0] - nrgs0[1])
delta = beta1 * (nrgs1[1] - nrgs1[0]) + beta0 * (nrgs0[0] - nrgs0[1])
else:
volume0 = replica0.current_space().volume()
volume1 = replica1.current_space().volume()

pressure0 = ensemble0.pressure()
pressure1 = ensemble1.pressure()

delta = beta1 * (
nrgs1[0] - nrgs1[1] + (pressure1 * (volume1 - volume0) * N_A)
) + beta0 * (nrgs0[0] - nrgs0[1] + (pressure0 * (volume0 - volume1) * N_A))
delta = -1.0 * (
beta1 * (nrgs1[0] - nrgs1[1] + (pressure1 * (volume1 - volume0) * N_A))
+ beta0 * (nrgs0[1] - nrgs0[0] + (pressure0 * (volume0 - volume1) * N_A))
)

from math import exp

Expand Down

0 comments on commit 9982932

Please sign in to comment.