We now describe how the machinery introduced in Section
6.3.1 can be employed in SGE simulation
programs, such as ORAC. Suppose to deal with ensembles of a
generic
-space, be it a temperature-space, a
-space,
or even a multiple-parameter space. Without loss of generality, we
order the ensembles as
. Thus,
optimal weights,
, have
to be estimated adaptively.
(1) At the beginning of the simulation we assign the system, i.e. the replica, to a randomly chosen ensemble and start the phase
space sampling with the established simulation protocol (Monte Carlo
or molecular dynamics). Note that several simulations may run in the
generalized-ensemble space, each yielding an independent trajectory.
Analogously to REM, a single simulated system will be termed
``replica''. In the ORAC program, we have arbitrarily decided to use
the following criteria to distribute the replicas among the ensembles
at the beginning of the SGE simulations. In Hamiltonian tempering
simulations, if we deal with replicas, we assign them to different
ensembles with increasing order, from
to
. If
then the
th replica is assigned to
(as the
first replica), the
th replica to
(as the second
replica) and so on. In SGE simulations performed in the
-space all replicas are assigned to
(see Section
10.2.11 for the definition of the
sequence). For
the sake of simplicity, in the following presentation of the method we
will take into account one replica alone. A discussion regarding
multiple-replica simulations is reported in the final part of this
section.
(2) Every steps and for each ensemble
, we store into memory
the quantities
and
,
computed as described in Sec. 6.3.1. There is
no well-established recipe in choosing
, apart from the
requirement that it should ensure (as large as possible) decorrelation
between work values. During the simulation we must also record the
number of stored
elements,
and
.
(3) Every steps, such that
(three orders of
magnitude at least), we try a free energy update on the basis of
Eq. 6.25 or Eq. 6.27. The scheme we propose for
follows.
We point out that, if equilibrium is reached slowly (case of large
viscous systems, or systems with very complex free energy landscape),
then the replicas may tend to get trapped in limited regions of the
ensemble space at the early stages of the simulation. This is
basically due to initially inaccurate determination of
from Eq. 6.25 (point 3a). If such an
event occurs, then subsequent free energy estimates from
Eq. 6.25 may become very rare or even impossible. However
we can prevent this unwanted situation by passing to the updating
criteria of point 3b when the criteria of point 3a are not met for a
given (prior established) number of consecutive times (10 times in
ORAC). When equilibrium will be approached, the criteria of point 3b
will favor transitions of the replicas between neighboring ensembles
and eventually the conditions to apply again the criteria of point 3a.
(4) Every steps a transition
is attempted on the basis of the acceptance ratio of
Eq. 6.22 and of the current value of
(properly reweighted according to the
equations reported in Sec. 6.3.3). If the estimate of
is still not available from the
methods described at points 3a and 3b, then the transition is not
realized. The upward and downward transitions are chosen with equal
probability.
It is worthwhile stressing again that the procedures of point 3b are only aimed to furnish a reliable evaluation of optimal weights when such factors are still not available from the bidirectional algorithm (point 3a) or when the system is get trapped in one or few ensembles (point 3c). Moreover, we remark that the free energy differences estimated via Eq. 6.27 tend to give larger acceptance rates in comparison to the exact free energy differences, thus favoring the transitions toward the ensemble that has not been visited. This is a well-known (biasing) effect of exponential averaging[128], leading to a mean dissipated (dimensionless) work artificially low. As a matter of fact this is a positive effect since it makes easier ensemble transitions during the equilibration phase of the simulation.
In the above discussion, we do not have mentioned the number of
(independent) replicas that may run in the space of the
ensembles. In principle,
can vary from one to infinity on the
basis of our computer facilities. The best performance is obtainable
if a one-to-one correspondence exists between replicas and computing
processors. A rough parallelization could be obtained performing
independent simulations and then drawing the data from replicas at the
end of the simulation to get an augmented statistics. However, the
calculation of the optimal weights would be much improved if they were
periodically updated on the fly on the basis of the data drawn from
all replicas. This is just what ORAC does. In this respect we notice
that our version of multiple-replica SGE algorithm is prone to work
efficiently also in distributed computing environments. The phase of
the simulation where information is exchanged is that described at
point 3 (free energy calculation). It should be noted that, when a
free energy estimate is performed, the work arrays stored for each
replica/processor (see point 2) do not need to be communicated to all
other replicas/processors. Only the sums
(case of Eq. 6.25),
(case of
Eq. 6.26) and
(case of Eq. 6.27), together with
and
, must be exchanged for
all
ensemble transitions. Then each replica/processor ``will
think by itself'' to reassemble the global sums. Exchanging one
information implies to send
real/integer numbers
through the net (
kB of information using 20 replicas and
slightly less than 1 MB of information using 50 replicas). Only in the
case of the iterative procedure of Eq. 6.25, one
information has to be sent several times per free energy calculation
(i.e., the number of iterations needed for solving the
equation). The computational cost arising from computer communications
can however be reduced updating the free energy rarely. Furthermore,
in order to improve the first free energy estimate and hence to speed
up the convergence, the
simulations should be started by
distributing the replicas among neighboring ensembles, namely replica
1 to
, replica 2 to
and so on (see also the
discussion at the beginning of the current section).
procacci 2021-12-29