The problem

A long runcan still be stuck

Doubling the length of a simulation does not help if the system is sitting in a basin it cannot climb out of.

Rough landscapes

Folding, binding and conformational change all involve barriers far above thermal energy.

Time you do not have

A transition that happens once a millisecond will not appear in a microsecond of simulation.

A confident wrong answer

A trapped run looks perfectly converged. Nothing in the output says you only saw one basin.

The trick

Run many copies,then swap them

Replica exchange runs the same system at a ladder of temperatures and periodically trades configurations between neighbours.

Hot replicas cross barriers easily but sample a distribution you do not care about. Cold replicas sample the right distribution but get trapped. An exchange lets a configuration that a hot replica found walk down the ladder into the cold one, and a stuck cold configuration walk up and escape.

Swaps are accepted or rejected by a Metropolis criterion built from the two potential energies and the two temperatures, which is what keeps each replica's statistics correct. Only neighbouring temperatures are tried, because the energy distributions of distant replicas barely overlap and the swap would almost always be rejected.

A temperature ladderReplicas spaced so that neighbouring energy distributions overlap enough for swaps to be accepted.
Neighbour swaps onlyExchanges are attempted between adjacent rungs, which keeps the acceptance rate usable.
Velocities rescaledA configuration arriving at a new temperature has its velocities scaled to match it.
Setting it up

Three numbersdecide everything

Replica exchange has few knobs, and getting them wrong wastes the entire run rather than degrading it gently.

How many replicas

Roughly proportional to the square root of the number of degrees of freedom. Bigger systems need more.

The temperature range

The top rung must be hot enough to cross the barrier, and the bottom is the one you analyse.

How often to try

Every one or two picoseconds is typical — long enough to decorrelate, short enough to mix.

Aim for an acceptance rate around 20 to 30 per cent. Much lower and the replicas never mix, so you have paid for many independent simulations. Much higher and your ladder is too dense, so you are paying for replicas that are barely distinguishable.

What it costs

Every replicais a whole simulation

This is the honest part. Replica exchange does not make sampling cheap — it makes it possible.

8 – 64Replicaseach one a full simulation
TogetherRun themmdrun -multidir, one job
20 – 30%Aim forswap acceptance between rungs

Sixteen replicas is sixteen times the compute of one run, and mdrun wants them running together with -multidir so the exchanges can happen. Size the machine for the whole ladder, not for one replica, and decide before you start whether the barrier you are trying to cross is worth that bill.

On a machine

GROMACS isalready built

Nothing here needs compiling. Pick a machine, and these two commands put it on there.

hub://gromacs

$ dxflow workflow create --identity gromacs hub://gromacs

$ dxflow workflow start gromacs

Read it, then run itPrepaid and by the hour, on a machine that is yours about a minute after you ask.