1: % ****** Start of file apssamp.tex ******
2: %
3: % This file is part of the APS files in the REVTeX 4 distribution.
4: % Version 4.0 of REVTeX, August 2001
5: %
6: % Copyright (c) 2001 The American Physical Society.
7: %
8: % See the REVTeX 4 README file for restrictions and more information.
9: %
10: % TeX'ing this file requires that you have AMS-LaTeX 2.0 installed
11: % as well as the rest of the prerequisites for REVTeX 4.0
12: %
13: % See the REVTeX 4 README file
14: % It also requires running BibTeX. The commands are as follows:
15: %
16: % 1) latex apssamp.tex
17: % 2) bibtex apssamp
18: % 3) latex apssamp.tex
19: % 4) latex apssamp.tex
20: %
21: \documentclass[prl,twocolumn,showpacs,preprintnumbers,amsmath,amssymb]{revtex4}
22: %\documentclass[preprint,showpacs,preprintnumbers,amsmath,amssymb]{revtex4}
23:
24: % Some other (several out of many) possibilities
25: %\documentclass[preprint,aps]{revtex4}
26: %\documentclass[preprint,aps,draft]{revtex4}
27: %\documentclass[prb]{revtex4}% Physical Review B
28:
29: \usepackage{graphicx}% Include figure files
30: \usepackage{dcolumn}% Align table columns on decimal point
31: \usepackage{bm}% bold math
32: \usepackage{amsmath}
33: \usepackage{epsfig}
34: \usepackage{ae}
35:
36: %\nofiles
37:
38: \begin{document}
39:
40: \preprint{June 2003}
41:
42: \title{Successive Umbrella Sampling}% Force line breaks with \\
43:
44: \author{Peter Virnau}
45: \email{peter.virnau@uni-mainz.de}
46: % \homepage{http://www.cond-mat.phys.uni-mainz.de}
47: \author{Marcus M\"uller}
48: \affiliation{%
49: Institut f\"ur Physik, WA331, Universit\"at Mainz, Staudinger Weg 7, 55099 Mainz, Germany
50: }%
51:
52: \date{\today}% It is always \today, today,
53: % but any date may be explicitly specified
54:
55: \begin{abstract}
56: We propose an extension of umbrella sampling in which the pertinent range of
57: states is subdivided in windows that are sampled consecutively and linked
58: together. Extrapolating results from one window we estimate a weight function
59: for the neighboring window. We present a detailed analysis and demonstrate
60: that the error is controlled and independent from the window sizes. The analysis also
61: allows us to detect sampling difficulties. The efficiency of the algorithm is
62: comparable to a multicanonical simulation with an ideal weight function. We
63: exemplify the computational scheme by simulating the liquid-vapor coexistence
64: in a Lennard--Jones system.
65: %
66: %
67: % Valid PACS numbers may be entered using the \verb+\pacs{#1}+ command.
68: \end{abstract}
69: %
70: \pacs{02.70.Tt, 05.10.Ln, 05.70.Fh, 64.70.Fx}% PACS, the Physics and Astronomy
71: % Classification Scheme.
72: %\keywords{Suggested keywords}%Use showkeys class option if keyword
73: %display desired
74: \maketitle
75: %
76: %
77: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78: %
79: %\section{Introduction}
80: %
81:
82: Calculating and overcoming free energy barriers remains a considerable challenge in computational
83: condensed and soft matter physics. Applications are manyfold and range from
84: protein folding \cite{Hansmann} over quantum systems \cite{TROYER} to the study of first
85: order phase transitions \cite{Gibbs}, nucleation or glassy systems \cite{MARINARI}.
86:
87: Various sophisticated sampling techniques have been devised to estimate free
88: energy differences. Though methods are general we shall use the language of a
89: liquid-vapor transition, where the number of particles $n$ is the order
90: parameter of the transition. In this case the Helmholtz free energy $A$ can be
91: computed from the probability distribution $P[n]$: $A[n]=-k_{\rm B}T\ln P[n]+{\rm const.}$,
92: where $k_{\rm B}$ stands for Boltzmann's constant and $T$ for temperature. Free energy
93: barriers correspond to regions of extremely low probability, which make efficient
94: sampling difficult.
95:
96: Multicanonical methods \cite{multican1} modify the Hamiltonian in order
97: to sample a range of densities uniformly. To this end, one adds
98: a weight function $w[n]$ to the original Hamiltonian such that the
99: simulated distribution $P_{\rm sim}[n]=P[n]\exp(-w[n])$ becomes flat
100: for the choice of $w[n]\approx\ln P[n]$. Unfortunately, $P[n]$ is {\em a
101: priori} unknown, and several methods have been explored to estimate $w[n]$:
102: %
103: (i) Histogram-reweighting techniques \cite{histo_rew} alleviate this problem by performing a
104: sequence of weighted simulations and extrapolations starting at a point where barriers
105: are small and the system explores a broad range of $n$.
106: More sophisticated methods combine results of multiple histograms \cite{Swendsen}.
107: %
108: (ii) Multicanonical Recursion \cite{multiRec} conducts a series of short trial
109: runs. After each run $w[n]$ is adjusted until the simulation can access all
110: relevant states. The weight factors can also be self-adjusted during the
111: simulation \cite{WangLandau,dePablo,Hansmann,jesko}. However, detailed balance \cite{Frenkel} is
112: violated in this process and separation of statistical and systematic errors
113: becomes difficult.
114: (iii) Weight factors can also be obtained from the transition probabilities
115: between macrostates \cite{TMMC, ADB,Shell}.
116:
117: In umbrella sampling \cite{umbrella} the pertinent
118: range of macrostates, defined by the number of particles $n$, is subdivided
119: into $m$ overlapping windows of length $\omega$. In this work we propose an
120: extension in which adjacent windows are sampled consecutively. Successive
121: umbrella sampling offers substantial advantages: It allows us to generate weight factors
122: for subsequent windows by means of extrapolation. In contrast to histogram-reweighting,
123: simulations can be performed anywhere in the phase diagram without prior
124: knowledge of a weight function. In contrast to self-adjusting methods
125: \cite{WangLandau,dePablo,Hansmann,jesko}, $w[n]$ stays fixed during the run and
126: detailed balance is not violated. Although these powerful schemes are suitable
127: for generating weight functions, they require in principle an additional
128: multicanonical production run whenever errors need to be determined exactly.
129: In our approach, every run contributes uniformly to statistics. Additionally,
130: it does not involve any adjustable parameters (e.g., the modification factor
131: $f$ in Ref.~\cite{WangLandau}).
132:
133: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134: %
135: %
136: %\section{Model}
137: %
138: In the following sections we demonstrate
139: the method by simulating the liquid-vapor coexistence in the $\mu VT$-ensemble.
140: Beads interact via a truncated and shifted Lennard--Jones
141: potential with parameters $\epsilon$ and $\sigma$:
142: \begin{equation}
143: V_\text{LJ}=\begin{cases}4\epsilon\cdot\left[\left(\frac{\sigma}{r}\right)^{12}-\left(\frac{\sigma}{r}\right)^{6}+\frac{127}{16384}\right], & \text{if} \hspace{0.2cm} r\leq 2\cdot 2^{1/6}\sigma , \\
144: 0, & \text{else}.
145: \end{cases}
146: \label{LJ_pot}
147: \end{equation}
148: The box length of our reference system is $6.74~\sigma$,
149: temperature $T=0.85437~\frac{\epsilon}{k}$.
150: Fig.~\ref{fig:prob} shows the probability distribution
151: as a function of particle number $n$ at coexistence.
152: The peak at low density corresponds to the gas phase, the peak at high density
153: to the liquid phase.
154: Both are separated by a free energy barrier (here: $15.2~k_{\rm B}T$).
155: \begin{figure}[htp]
156: \begin{center}
157: \epsfig{file=fig1.eps,width=0.85\linewidth,clip=}
158: \caption{P[n] for a LJ system at T=0.85437~$\frac{\epsilon}{k}=0.85~T_{\rm c}$,
159: $L=6.74~\sigma$. The system is at coexistence because the area below both
160: peaks is equal \cite{EWR}. Else, coexistence can be established by:
161: P$_{\rm coex}[n]=P[n]\cdot\exp((\mu_{\rm coex}-\mu)nk_{\rm B}T)$.
162: Dashed lines: $P_{\rm sim}[n]$ from a multicanonical simulation with a very
163: good weight function $w[n]$.
164: Inset: free energy barrier.}
165: \label{fig:prob}
166: \end{center}
167: \end{figure}
168: %
169: \noindent
170:
171: %
172: %
173: %
174: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
175: %
176: %\section{Methods and error analysis}
177: The guiding idea of successive umbrella sampling is to investigate one small
178: window after the other, starting at zero density. A histogram $H_k[n]$ monitors how often each state is
179: visited in the $k$th window $[k\omega,(k+1)\omega]$. Let $H_{kl}\equiv H_k[k\omega]$ and
180: $H_{kr}\equiv H_k[(k+1)\omega]$ denote the values of the $k$th histogram at its left
181: and right boundary, respectively, and $r_k \equiv H_{kr}/H_{kl}$ characterize their
182: ratio. After a predetermined number of insertion/deletion Monte Carlo (MC) moves per window,
183: the (unnormalized) probability distribution can be estimated recursively:
184: \begin{equation}
185: \frac{P[n]}{P[0]}=\frac{H_{0r}}{H_{0l}}\cdot\frac{H_{1r}}{H_{1l}}\cdots\frac{H_k[n]}{H_{kl}}
186: = \Pi_{i=1}^{k-1}r_i \cdot \frac{H_k[n]}{H_{kl}}
187: \label{prob_eq}
188: \end{equation}
189: when $n \in [k\omega,(k+1)\omega]$. Probability ratios in Eq.~(\ref{prob_eq}) correspond to free energy differences.
190: Care has to be taken at the boundaries of a window to fulfill detailed balance
191: \cite{footnote}.
192:
193: As we are sampling one window after the other, efficiency can be increased by
194: combining the algorithm with the multicanonical concept.
195: In a weighted simulation we replace $H[n]$ in Eq.~\eqref{prob_eq} by $H[n]\exp(w[n])$.
196: A good estimate for the weight function may be obtained by extrapolation: After
197: $P[n]$ is determined according to Eq.~\eqref{prob_eq}, $w[n]=\ln(P[n])$ is
198: extrapolated quadratically into the next window.
199: The first window is usually unweighted. If in this case states are not accessible,
200: $w[n]$ might be altered by a
201: fixed number of $k_{\rm B}T$ in each iteration step.
202:
203: %
204: \begin{figure}[thb]
205: \begin{center}
206: \epsfig{file=fig2.eps,width=0.85\linewidth,clip=}
207: \caption{Comparison of (normalized) weighted umbrella sampling runs with
208: different window sizes and an average number of 2 million MC steps per state \cite{footnote}:
209: (a) one section runs with window size $\omega=218$, (b) $m=11$ section runs with
210: window size $\omega=20$, (c) $\omega=1$ (i.e., two states per window).
211: The precision of the factors $\exp (w(n))$, which have been used to generate the data, is better than $2\%$ for (a) and (b) and $30\%$ for (c).
212: Errors correspond to single runs and were determined as the
213: standard deviation over 400 runs.}
214: \label{fig:mc}
215: \end{center}
216: \end{figure}
217: %
218: Let us investigate how the computational effort depends on the choice
219: of the window size. It has been suggested in the literature \cite{Chandler,Frenkel}
220: that small windows reduce computational effort by a factor of $m$: if $\tau$
221: is the time to obtain a predetermined statistical error $\Delta_1$ in
222: a single window, then $\tau\propto\omega^{2}/\Delta_1$ and computation time
223: $t_{\rm cpu}\propto m\omega^2/\Delta_1$. In the limit of a single large window, m'=1, this yields
224: $t_{\rm cpu}'=(m\omega)^{2}=mt_{\rm cpu}$. In Fig.~\ref{fig:mc} we compare the error
225: which was obtained from multicanonical runs with different window sizes but an equal total number of Monte Carlo steps \cite{footnote}.
226: All distributions were normalized to unity before the error
227: was calculated. As expected, errors are evenly distributed for low and intermediate densities.
228: For large densities deviations occur and the relative error becomes larger.
229: The absolute value of $P[n]$, however, is small in this region (cf.\ Fig.~\ref{fig:prob})
230: such that the error does not influence normalization. Contrary to the
231: simple argument above the error is roughly independent of the window size
232: $\omega$. To simplify the discussion, one
233: can also set $P[0] \equiv 1$ and let errors accumulate from low to high densities (cf.\ Fig.~\ref{fig:corr}).
234: Using Eq.~\eqref{prob_eq} and assuming
235: that there are no correlations between neighboring intervals we obtain
236: \begin{equation}
237: \Delta\left( \frac{P[n]}{P[0]}\right) =\sqrt{\sum_{i=0}^{k-1}\Delta r_i^{2} + \Delta \left(\frac{H_k[n]}{H_{kl}}\right)^{2}} \sim {\cal O}(\Delta_1\sqrt{k}).
238: \label{stat_tot}
239: \end{equation}
240: If errors are comparable for all windows, the overall error for $m$ windows is of order
241: {\cal O}($\sqrt{m}$) bigger as for $m=1$.
242: To compensate this, sampling time in each window
243: has to be increased by a factor of $m$. Hence, computational effort for a given
244: error is always of order $(m\omega)^{2}=N^{2}$ and does not depend on the
245: number of windows into which the sampling range is subdivided.
246: We conclude that successive umbrella sampling is as fast as a
247: multicanonical simulation with a very good weight function.
248: Note further that a rather inaccurate estimate for $w[n]$ leads only to a
249: slight increase in the error (see figure caption in Fig.~\ref{fig:mc}).
250: In the following we focus on the smallest window size $\omega=1$.
251: One should keep in mind, however, that weighting in a single variable might not always be
252: sufficient when free energy landscapes become more complex \cite{EX}.
253:
254:
255: \begin{figure}[thb]
256: \begin{center}
257: \epsfig{file=fig3.eps,width=0.85\linewidth,clip=}
258: \caption{Comparison of accumulated statistical error (Eq.~\eqref{stat_tot}) and independently
259: measured error for ($\omega$=1):
260: (a) 4000 runs with 0.5 million MC steps per state \protect\cite{footnote},
261: (b) 400 runs with 2 million MC steps per state. Measured and accumulated error cannot be distinguished.
262: Inset: acceptance rate of insertion/deletion attempts.
263: }
264: \label{fig:corr}
265: \end{center}
266: \end{figure}
267: %
268: Subsequently, we present a detailed error analysis of our method.
269: Eq.~\eqref{stat_tot} only accounts for statistical errors within an interval and neglects
270: correlations between adjacent windows and possible systematic errors when estimating probability ratios.
271: %
272: The former may occur, because we use the ending
273: configuration of the $k$th window as the starting configuration of the $(k+1)$th
274: window. Accumulating the relative statistical errors of individual ratios $\Delta r_i$ in Eq.~\eqref{stat_tot},
275: and comparing the result with the independently measured statistical error,
276: we can gauge the importance of correlations between neighboring windows.
277: %
278: In Fig.~\ref{fig:corr} two features can be
279: identified. First, large errors are obtained for high densities because it becomes
280: more and more difficult to insert particles (cf.\ Fig.~\ref{fig:corr} inset).
281: Secondly, we find good agreement between both curves if the number
282: of Monte Carlo steps per state is large. If the computational effort is reduced, curves only match for
283: low and medium densities because in these regions correlations decay fast.
284: Although this test is not crucial as
285: errors can be measured directly, it enables us to check if high
286: density configurations are well equilibrated.
287: If one is only interested in a rough estimate, the total error of a simulation can be
288: preset before sampling starts. For this purpose,
289: the termination condition is changed from a given number of Monte Carlo steps to a predefined error $\Delta_1$
290: in each window. Then, the total error adds up to $\sqrt{m}\cdot \Delta_1$ according to Eq.~\eqref{stat_tot}
291: \cite{footnote2}.
292:
293: %
294: \begin{figure}[htp]
295: \begin{center}
296: \epsfig{file=error1.eps,width=0.85\linewidth,clip=}
297: \caption{
298: Relative systematic errors for a run with 0.5 million MC steps per state (compare with Fig.~\eqref{fig:corr}).
299: Inset: Relation between relative systematic and statistical error. Line
300: corresponds to Eq.~\eqref{Delta_eq}, $\circ$ denotes the relations determined by simulation.
301: }
302: \label{fig:error}
303: \end{center}
304: \end{figure}
305: %
306: In addition to the statistical error, the use of Eq.~\eqref{prob_eq} imparts a
307: small systematic error onto the probability distribution because the average of a probability
308: ratio is larger than the ratio over two probability averages. An expansion of the former leads to
309: %
310: \begin{equation}
311: \langle r_i \rangle \equiv \left\langle \frac{H_{ir}}{H_{il}}\right\rangle
312: = \frac{\langle H_{ir}\rangle}{\langle H_{il} \rangle}
313: \left( 1 +\frac{\langle \delta H_{il}^2\rangle}{\langle H_{il}\rangle^2}
314: -\frac{\langle \delta H_{il} \delta H_{ir}\rangle}{\langle H_{il}\rangle\langle H_{ir}\rangle}
315: \cdots \right)
316: \label{H_eq}
317: \end{equation}
318: %
319: where $\delta H_{il} \equiv H_{il} - \langle H_{il} \rangle$ and similarly
320: $\delta H_{ir}\equiv H_{ir} - \langle H_{ir}\rangle$.
321: $\langle H_{ir}/H_{ir}\rangle$ corresponds to the
322: probability ratio as it is measured in simulation whereas
323: $\langle H_{ir} \rangle/\langle H_{ir}\rangle$ is equal to $P$[(i+1)$\omega$]/$P$[i$\omega$].
324: It is therefore advantageous to determine the probability ratio as the ratio of the sums
325: of $H_{ir}$ and $H_{il}$ over all runs
326: (and not as the sums over the ratios).
327: The last factor is typically larger than unity because fluctuations
328: of $H_{il}$ and $H_{ir}$ are anticorrelated.
329:
330: For the special case $\omega=1$, $H_{il}+H_{ir}=H$ where $H$ denotes the
331: total number of entries in the $i$th histogram. In this case, the last factor in Eq.~(\ref{H_eq}) takes the form
332: $1+\Delta_{\rm sys}^{\omega=1}r_i$ with a relative systematic error
333: \begin{equation}
334: \Delta_{\rm sys}^{\omega=1}r_i = \frac{H}{\langle H_{il}\rangle \langle H_{ir}\rangle} \frac{\langle \delta H_{il}^2\rangle}{\langle H_{il}\rangle}.
335: \label{eq:sys_err}
336: \end{equation}
337: In the context of a grandcanonical simulation, the systematic error corresponds to a shift of the
338: chemical potential of the order $k_BT\Delta_{\rm sys}^{\omega=1}r_i$. Comparing this value with
339: the relative statistical error $\Delta r_i$ of the ratio, we obtain
340: \begin{equation}
341: \Delta_{\rm sys}^{\omega=1}r_i \approx \Delta r_i^2 \frac{\langle H_{ir}\rangle}{H}.
342: \label{Delta_eq}
343: \end{equation}
344: Relation \eqref{Delta_eq} allows us to compute the systematic error from the known statistical error.
345: To test the approximation we determined an accurate
346: weight function for $P$(n=14)/$P$(n=13) (gas peak) by a long run. $\langle$$H$(14)/$H$(13)$\rangle$
347: was computed by averaging over a large number of short runs with $H$=30, 50, 80, 200, 800 and 2400 MC
348: steps, respectively. The true
349: systematic offset is the deviation of this ratio from 1.
350: From the results in the inset of Fig.~\ref{fig:error} we conclude that
351: Eqs.~(\ref{eq:sys_err}, \ref{Delta_eq}) yield an excellent approximation for the systematic error,
352: even when errors become large. For $\omega>1$ we expect that the systematic error of a single ratio
353: is also of the order of $\Delta r_i^2$.
354:
355: In analogy to Eq.~\eqref{stat_tot} we obtain the total relative systematic error of $P[n]/P[0]$:
356: \begin{eqnarray}
357: \Delta_{\rm sys}&&\left( \frac{P[n]}{P[0]}\right) = \sum_{i=1}^{k-1}\Delta_{\rm sys}r_i + \Delta_{\rm sys} \left( \frac{H_k[n]}{H_{kl}}\right) \\
358: && \sim {\cal O}(\Delta_{\rm sys,1}k) \sim {\cal O}(\Delta_1^2k) \sim {\cal O}\left(\Delta\left( \frac{P[n]}{P[0]}\right)\right)^2.
359: \nonumber
360: \label{sys_tot}
361: \end{eqnarray}
362: where $\Delta_{\rm sys,1}$ denotes the systematic relative error of a single ratio.
363: Both, the total and the individual systematic errors scale like the square of the statistical errors. Hence, if the
364: statistical error is small the systematical error is negligible. By the same token, however, the method is not suitable
365: for quickly generating a rough estimate of weight factors (to be used in a subsequent multicanonical simulation).
366: %\footnote{
367: %Using Eq.~\protect\eqref{H_eq} we could correct for the systematic error or replace Eq.~\protect\eqref{prob_eq} by
368: %$P[n] \sim \sqrt{\Pi_{i=1}^{k-1}r_i \cdot \frac{H_k[n]}{H_{kl}} \frac{H_k[n]}{H_{kr}} \cdot \Pi_{i=k+1}^{m-1}r_i^{-1}}$.
369: %In the latter case the systematic error does not depend strongly on $n$ and is partially removed by normalization.
370: %}
371: If the statistical error becomes comparable to unity the systematic error will be of the same order.
372:
373: In Fig.~\eqref{fig:error} we analyze the systematic error propagation for the runs with $\omega=1$ and 500,000 MC steps
374: per state, which exhibit rather large statistical errors (cf.\ Fig.~3).
375: Firstly, we regard the deviation between the probability distribution obtained from those short runs and an estimate for
376: the true distribution obtained from a very long multicanonical run over the entire range. At small particle numbers the systematic
377: deviation agrees with the values calculated from Eq.~\eqref{eq:sys_err} within the accuracy of the true estimate ($0.5\%-2\%$).
378: At large particle number, however, the calculated value is larger than the deviation from the true distribution. In this region,
379: we systematically underestimate the ratios $r_i$ upon increasing the number of particles, because we fail
380: to equilibrate the configurations on the time scale of the short simulation runs. Therefore configurations with lower
381: particle number (contributing to $H_{il}$) are favored. These correlation effects are not included
382: in Eq.~\eqref{eq:sys_err}. Since both systematical errors have opposite signs Eq.~\eqref{eq:sys_err} constitutes an upper bound.
383:
384: In summary, we propose an extension to umbrella sampling in which simulation
385: windows are sampled successively. This allows us to generate weight factors
386: by extrapolating results from previous windows. Hence, the scheme is able to calculate free energy
387: barriers without prior knowledge of weight factors. The computational
388: efficiency is competitive to alternative approaches which adjust
389: weight factors on the fly and in principle independent from the choice of the
390: window size. The algorithm is straightforward to implement and to parallelize.
391: It involves neither fine-tuning of simulation parameters, nor violation of
392: detailed balance. Errors can be calculated exactly and are controlled. A
393: detailed analysis revealed the existence of a small systematic error which is,
394: however, irrelevant in practice. We also provided a scheme to check if configurations are
395: well equilibrated. Our algorithm can be readily applied to a large variety of
396: problems which involve the computation of free energy barriers. Possible
397: applications include protein folding, the study
398: of interfaces, nucleation barriers, and first order phase transitions.
399:
400: %\begin{acknowledgments}
401: It is a great pleasure to thank K. Binder and L.G. MacDowell for stimulating discussions.
402: Financial support by BASF AG and DFG under grant Bi314/17 is gratefully
403: acknowledged. CPU time was provided by the NIC J\"ulich and the HLRZ Stuttgart.
404: %\dots.
405: %\end{acknowledgments}
406:
407:
408: %\newpage % Just because of unusual number of tables stacked at end
409: \bibliography{ref}% Produces the bibliography via BibTeX.
410:
411: \end{document}
412: %
413: % ****** End of file apssamp.tex ******
414:
415:
416:
417:
418:
419:
420:
421: