REWEIGHT_TEMP_PRESS
This is part of the bias module

Calculate weights for ensemble averages at temperatures and/or pressures different than those used in your original simulation.

We can use our knowledge of the probability distribution in the canonical (N \(\mathcal{V}\)T) or the isothermal-isobaric ensemble (NPT) to reweight the data contained in trajectories and obtain ensemble averages at different temperatures and/or pressures.

Consider the ensemble average of an observable \(O(\mathbf{R},\mathcal{V})\) that depends on the atomic coordinates \(\mathbf{R}\) and the volume \(\mathcal{V}\). This observable is in practice any collective variable (CV) calculated by Plumed. The ensemble average of the observable in an ensemble \( \xi' \) can be calculated from a simulation performed in an ensemble \( \xi \) using:

\[ \langle O(\mathbf{R},\mathcal{V}) \rangle_{\xi'} = \frac{\langle O(\mathbf{R},\mathcal{V}) w(\mathbf{R},\mathcal{V}) \rangle_{\xi}} {\langle w(\mathbf{R},\mathcal{V}) \rangle_{\xi}} \]

where \(\langle \cdot \rangle_{\xi}\) and \(\langle \cdot \rangle_{\xi'}\) are mean values in the simulated and targeted ensemble, respectively, \( E(\mathbf{R}) \) is the potential energy of the system, and \( w (\mathbf{R},\mathcal{V}) \) are the appropriate weights to take from \( \xi \) to \( \xi' \). This action calculates the weights \( w (\mathbf{R},\mathcal{V}) \) and handles 4 different cases:

  1. Change of temperature from T to T' at constant volume. That is to say, from a simulation performed in the N \(\mathcal{V}\)T (canonical) ensemble, obtain an ensemble average in the N \(\mathcal{V}\)T' ensemble. The weights in this case are \( w(\mathbf{R},\mathcal{V}) = e^{(\beta-\beta')E(\mathbf{R})} \) with \( \beta \) and \( \beta' \) the inverse temperatures.
  2. Change of temperature from T to T' at constant pressure. That is to say, from a simulation performed in the NPT (isothermal-isobaric) ensemble, obtain an ensemble average in the NPT' ensemble. The weights in this case are \( w(\mathbf{R},\mathcal{V}) = e^{(\beta-\beta')(E(\mathbf{R}) + P\mathcal{V}) } \).
  3. Change of pressure from P to P' at constant temperature. That is to say, from a simulation performed in the NPT (isothermal-isobaric) ensemble, obtain an ensemble average in the NP'T ensemble. The weights in this case are \( w(\mathbf{R},\mathcal{V}) = e^{\beta (P - P') \mathcal{V}} \).
  4. Change of temperature and pressure from T,P to T',P'. That is to say, from a simulation performed in the NPT (isothermal-isobaric) ensemble, obtain an ensemble average in the NP'T' ensemble. The weights in this case are \( w(\mathbf{R},\mathcal{V}) = e^{(\beta-\beta')E(\mathbf{R}) + (\beta P - \beta' P') \mathcal{V}} \).

These weights can be used in any action that computes ensemble averages. For example this action can be used in tandem with HISTOGRAM or AVERAGE.

The above equation is often impractical since the overlap between the distributions of energy and volume at different temperatures and pressures is only significant for neighboring temperatures and pressures. For this reason an unbiased simulation is of little use to reweight at different temperatures and/or pressures. A successful approach has been altering the probability of observing a configuration in order to increase this overlap [111]. This is done through a bias potential \( V(\mathbf{s}) \) where \( \mathbf{s} \) is a set of CVs, that often is the energy (and possibly the volume). In order to calculate ensemble averages, also the effect of this bias must be taken into account. The ensemble average of the observable in the ensemble \( \xi' \) can be calculated from a biased simulation performed in the ensemble \(\xi\) with bias \( V(\mathbf{s}) \) using:

\[ \langle O(\mathbf{R},\mathcal{V}) \rangle_{\xi'} = \frac{\langle O(\mathbf{R},\mathcal{V}) w (\mathbf{R},\mathcal{V}) e^{\beta V(\mathbf{s})} \rangle_{\xi,V}} {\langle w (\mathbf{R},\mathcal{V}) e^{\beta V(\mathbf{s})} \rangle_{\xi,V}} \]

where \(\langle \cdot \rangle_{\xi,V}\) is a mean value in the biased ensemble with static bias \( V(\mathbf{s}) \). Therefore in order to reweight the trajectory at different temperatures and/or pressures one must use the weights calculated by this action \( w (\mathbf{R},\mathcal{V}) \) together with the weights of REWEIGHT_BIAS (see the examples below).

The bias potential \( V(\mathbf{s}) \) can be constructed with METAD using ENERGY as a CV [75]. More specialized tools are available, for instance using bespoke target distributions such as TD_MULTICANONICAL and TD_MULTITHERMAL_MULTIBARIC [86] [87] within Variationally Enhanced Sampling (VES code). In the latter algorithms the interval of temperatures and pressures in which the trajectory can be reweighted is chosen explicitly.

Examples

We consider the 4 cases described above.

The following input can be used to postprocess a molecular dynamics trajectory of a system of 1000 particles run at 500 K and constant volume using a static bias potential.

Click on the labels of the actions for more information on what each action computes
tested on master