WindowWise

Plan, check and repair umbrella-sampling simulations. Design windows from first principles, diagnose finished runs, and get the exact windows to add, with Gaussian-process active learning.

How is the design derived?

On a locally flat profile a harmonic window samples a Gaussian, and two neighbours a distance dd apart overlap by

σ=kBT/k,O=2 Φ ⁣(−d2σ).\sigma = \sqrt{k_B T / k}, \qquad O = 2\,\Phi\!\left(-\frac{d}{2\sigma}\right).

A slope F′F' shifts every window by F′/kF'/k. Keeping that below half a spacing gives the force constant

k  ≥  1kBT(∣F′∣max⁡z)2,z=−Φ−1 ⁣(O2).k \;\geq\; \frac{1}{k_B T}\left(\frac{|F'|_{\max}}{z}\right)^{2}, \qquad z = -\Phi^{-1}\!\left(\tfrac{O}{2}\right).

Why WindowWise?

Umbrella sampling fails quietly. Windows that are too far apart, or springs too soft for a steep wall, leave holes in the free-energy profile that WHAM smooths over. Usually you only find out after the compute is spent. WindowWise brings design, post-mortem and repair into one place.

Python package and CLI: pip install git+https://github.com/siba-p/windowwise. Validated against an analytic Morse-type PMF: WHAM RMSE 0.19 kJ/mol; GP 0.18–0.86 kJ/mol with 41 to 11 windows.

Method

Bias (GROMACS pull code) and WHAM self-consistency

Ui(ξ)=12ki(ξ−ξi)2U_i(\xi) = \tfrac{1}{2} k_i (\xi - \xi_i)^2 P(ξ)=∑ini(ξ)∑iNi eβfi−βUi(ξ)P(\xi) = \frac{\sum_i n_i(\xi)}{\sum_i N_i\, e^{\beta f_i - \beta U_i(\xi)}} e−βfi=∑ξP(ξ) e−βUi(ξ),F(ξ)=−kBTln⁡P(ξ)e^{-\beta f_i} = \sum_{\xi} P(\xi)\, e^{-\beta U_i(\xi)}, \qquad F(\xi) = -k_B T \ln P(\xi)

Errors: block bootstrap of each window, block length 2g2g. Diagnostics: neighbour overlap, drift ∣⟨ξ⟩i−ξi∣|\langle\xi\rangle_i - \xi_i|, and NeffN_{\mathrm{eff}} per window.

GP umbrella integration (ML): each window gives an exact estimate of its mean force

⟨∂A∂ξ⟩i=ki(ξi−⟨ξ⟩i),Var⁡=ki2 gi σi2Ni\left\langle \frac{\partial A}{\partial \xi} \right\rangle_i = k_i \left(\xi_i - \langle \xi \rangle_i\right), \qquad \operatorname{Var} = k_i^2\, \frac{g_i\, \sigma_i^2}{N_i}

used as derivative observations of a Gaussian-process prior A∼GP(0, s2e−(ξ−ξ′)2/2ℓ2)A \sim \mathcal{GP}\big(0,\, s^2 e^{-(\xi-\xi')^2/2\ell^2}\big), with s,ℓs, \ell from the marginal likelihood. Active learning places the next window where the posterior variance of ∂A/∂ξ\partial A/\partial \xi is largest.

  1. S. Kumar et al., J. Comput. Chem. 13, 1011 (1992) (WHAM).
  2. J. Kästner & W. Thiel, J. Chem. Phys. 123, 144104 (2005) (umbrella integration).
  3. T. Stecher, N. Bernstein & G. Csányi, J. Chem. Theory Comput. 10, 4079 (2014) (GP free energies).