Replica exchange simulations
=============================

The i-PI implementation of replica exchange is very flexible, as it allows to exchange between replicas 
having arbitrary ensemble specifications - including varying temperature, pressure, as well as external
bias potentials. 

The different settings can be set up using a `<system_template>` mechanism, where labels in the template
are replaced (as strings) with a list of values. This generates a list of systems, whose sampling targets
are exchanged, with a Metropolis acceptance criterion, with the frequency specified in the `<remd>` section.
Note that ALL possible exchanges are attempted, because i-PI makes no assumptions on the presence of
a natural adjacency between replicas. 

An important implementation detail for i-PI is that exchanges occur by swapping the _ensemble_ information 
between systems, meaning that outputs generated by i-PI do not correspond to homogeneous sampling ensembles,
but to continuous trajectories. It is possible to post-process a simulation, obtaining ensemble-homogeneous
trajectory files, by running 

```
i-pi-remdsort input.xml
```

in the folder where the simulation has been run. 

Examples:
~~~~~~~~~

`remd_liquid_water`: classical molecular dynamics with replica-exchange spanning different temperatures and pressures
`pi_remd_liquid_water`: path integral molecular dynamics with replica-exchange spanning different temperatures and pressures.
