Available online at www.sciencedirect.com ScienceDirect Physics Procedia 57 (2014 ) 82 86 27th Annual CSP Workshops on Recent Developments in Computer Simulation Studies in Condensed Matter Physics, CSP 2014 Wang-Landau and stochastic approximation Monte Carlo for semi-flexible polymer chains B. Werlich a, M. P. Taylor b,w.paul a a Martin Luther University, Institute of Physics, 06099 Halle (Saale), Germany b Hiram College, Department of Physics, Hiram, Ohio 44234, USA Abstract We present a comparison of the performance, relative strengths and relative weaknesses of standard Wang-Landau Monte Carlo simulations and Stochastic Approximation Monte Carlo simulations applied to semi-flexible single polymer chains. c 2014 Published The Authors. by Elsevier Published B.V. by This Elsevier is an open B.V. access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/). Peer-review under responsibility of the Organizing Committee of CSP 2014 conference. Peer-review under responsibility of The Organizing Committee of CSP 2014 conference Keywords: Wang-Landau MC, Stochastic Approximation MC PACS: 05.10.Ln, 02.70.Tt, 02.50.Ng 1. Introduction Ever since Wang and Landau suggested a new type of flat histogram Monte Carlo method, the now so-called Wang-Landau Monte Carlo (WLMC) method Wang and Landau (2001a,b), to determine the density of states of a given system, the method has found widespread applications and undergone significant practical development in its implementations. Important for our purposes here are applications to determine the density of states of single polymer chains Wüst el al. (2011); Rampf et al. (2005); Rampf el al. (2006); Paul et al. (2007); Taylor el al. (2009, 2013a,b); Seaton et al. (2013) for which the method is now an alternative to Multicanonical simulations Bachmann and Janke (2003, 2004), and sometimes both methods are used in conjunction. Having the density of states, g(e), available, one can obtain the microcanonical entropy, S (E) = ln g(e) or the canonical partition function, Z(T) = E g(e)exp{ βe} with β = 1/k B T. Both, g(e), and its Laplace transform, Z(T), contain the complete information on the thermodynamics of the system. The WLMC method starts from the observation, that if one knew the density of states, one could generate a random walk over the possible energy values by a Monte Carlo simulation of an unbiased stochastic process in configuration space, where starting from a micro-state, x, a new state, x, is accepted with a probability min[1, g(e(x))/g(e(x ))]. As the correct g(e) is to be determined, the idea is to start from an unbiased guess, g(e, t = 0) = 1, and update this E-mail address: Wolfgang.Paul@physik.uni-halle.de 1875-3892 2014 Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/3.0/). Peer-review under responsibility of The Organizing Committee of CSP 2014 conference doi:10.1016/j.phpro.2014.08.137
B. Werlich et al. / Physics Procedia 57 ( 2014 ) 82 86 83 guess by some modification factor g(e(x ), t) = f (t)g(e(x ), t) when a state x occurs in the generated time series. The modification factor is set to f (0) = e at the start. For each fixed value of f one samples a visitation histogram, h(e), to the possible energies, and when this histogram is flat enough at some time t n, f is reduced in an exponential fashion, f (t n ) = f (t n + 1) 1/2 and h(e) is reset to zero for all energy values. This is iterated until ln( f (t)) <εwith ε = 10 8 in many applications of the method to polymer systems. While the method has shown enormous practical applicability, it was found early on Lee et al. (2006); Belardinelli and Pereira (2007a,b); Swetnam and Allen (2010) and analyzed in detail Belardinelli and Pereira (2007b) that the error in the resulting g(e) actually did not go to zero with increased simulation effort, but was actually bounded and of order f final. In Belardinelli and Pereira (2007b) it was shown that in order for the error to go to zero, the following quantity ln[g(e, t)] = t [H(E, i) H(E, i 1)] f i (1) i=1 where H(E, i) is the cumulative histogram up to refinement level i of the modification factor has to diverge. If f is reduced in an exponential way like in the original WLMC method, this sum converges and thus the achievable error is bounded from below. The authors of Belardinelli and Pereira (2007a,b) suggested to use a variation of f which asymptotically goes like 1/t to create an algorithm which does not suffer from this problem. In an initial phase, f is modified according to the original WLMC idea until f < 1/t and from then on it is reduced as 1/t, where t is Monte Carlo time. Fig. 1. CPU times for WLMC runs (8 runs per chain length) blue circles and WLMC runs with increased energy minimum (red squares). The lines are times for SAMC runs using the parameters indicated in the legend. All results are for flexible chains. One objection often raised against WLMC that is not resolved by this change of f -update is the fact, that the Monte Carlo simulation does not fulfill detailed balance, as long as g(e) keeps being modified and attempts have been made to prove convergence of the method as a Markov Chain Monte Carlo (MCMC) method in some larger configuration/parameter space Zhou and Batt (2005). However, Liang et al. Liang (2006); Liang et al. (2007) proved convergence of the method from a completely different perspective. Consider the task to find a function u(x) which generates a random walk over the possible energy values when used as the acceptance probability in the master equation p(x, t + 1) = p(x, t) + x ( ) w 0 min 1, u(x ) p(x, t) u(x) x ( w 0 min 1, u(x) ) u(x p(x, t), (2) )
84 B. Werlich et al. / Physics Procedia 57 ( 2014 ) 82 86 where w 0 is an unbiased proposal probability. Within the mathematical theory underlying stochastic approximation Liang et al. (2007), one can show that this optimization problem is solved by the true g(e), and that this g(e) can be determined in an iterative procedure, where in each step (or after a predefined number of steps) the complete vector of all ln[g(e i )] is updated as ln[g(e i, t + 1)] = ln[g(e i, t] + γ t (δ Ei,E k k(e i )) i. (3) Here E k is the energy of the configuration at time t + 1, the modification factor follows the 1/t variation ( γ t = γ 0 min 1, t ) 0, t and k(e i ) can be used to introduce some bias to seldom visited states. Thus, convergence can not be judged by criteria used in MCMC methods, but can be proven as the solution to an optimization problem. This method is called Stochastic Approximation Monte Carlo (SAMC). Through its construction, SAMC also avoids two other practical problems of WLMC: i) the energy range over which g(e) is to be found does not need to be fixed (as one needs for the flat visit histogram in WLMC) and ii) the runtime of the method is fixed by the choices of the parameters whereas in WLMC it depends on the stochastic times when the flatness criterion is fulfilled, which in practice leads to runs which have to be aborted because they do not converge in a given time frame Wüst and Landau (2008). However, nothing is known about the rate of convergence of the SAMC method which will depend on the model under study and the parameters used for γ t. It is an evaluation of this method in comparison to WLMC for the determination of the density of states of semi-flexible continuum chains which we present in the following. (4) Fig. 2. Comparison of the density of state determined from two WLMC runs (black curves) and from eight SAMC runs (colored curves) for a chain of length N = 20 and bond length L = 0.6, choosing γ 0 = 1 and t 0 = 100. Two SAMC runs go off the scale of the figure to the top. 2. Model We study a model derived from the tangent hard sphere chains used in Taylor el al. (2009). The repeat units in the chain have a non-bonded attractive interaction of square-well type r ij <σ U(r ij ) = ε 1 < r ij <λσ. (5) 0 r ij >λσ
B. Werlich et al. / Physics Procedia 57 ( 2014 ) 82 86 85 The hard sphere diameter, σ = 1, sets the length scale, and the well depth, ε = 1 sets the energy (temperature) scale. Bonded neighbors are excluded from interaction. This model has a discrete set of possible energies E = n where n is the number of pairs with a distance falling into the well range. The parameter λ allows to tune the width of the well and will be chosen as λ = 1.1 for the following results. When we choose the bond length L < 1, we can increase the stiffness of the model compared to the flexible case, L = 1. The model is simulated with a Monte Carlo scheme employing local rotations, reptation moves, pivot moves, end-bridging and double bridging Taylor el al. (2013a) as the move set. We choose an unbiased k(e i ) = 1/N E in Eq.(4), where N E is the width of our energy window which is wider than the range of possible energies of the model. 3. Results In Fig.1 we show the CPU time for the determination of the density of states of flexible chains (L = 1) for various chain lengths N. The WLMC was run to f final = 6 10 8 and 8 runs are shown for each chain length, the SAMC to γ final = 10 6. Obviously, there exists the already mentioned large run-time scatter of the WLMC method, and obviously the run-time increases strongly with increasing chain length for the WLMC. The SAMC is shown for two choices of t 0, and for both the CPU time increases roughly as the third power of N. For the longest chains, the CPU time for the WLMC would be too large to converge on the complete energy range, so the lowest energy was increased by 5%. This leads to a tremendous reduction of the CPU time the WLMC needs. Fig. 3. Comparison of the density of state determined from two WLMC runs and from eight SAMC runs with γ 0 = 0.1 and choices of t 0 and γ final indicated in the legend. The chain length is N = 20 and the bond length L = 0.6. For the flexible chain (L=1) simulations summarized in Fig. 1, all of the SAMC runs converged to the same density of states as the WLMC runs. However, this changed dramatically for the stiff chains with L = 0.6 (Fig. 2). Now the SAMC runs lead to a varying and sometimes dramatic disagreement with the density of states known from the WLMC runs, similar the findings reported in Swetnam and Allen (2010). The reason for this failure to converge lies in the fact, that the runs are not able to generate a sufficiently uniform sampling of the energy interval within the time period t 0 of constant and large (γ 0 = 1) modification factor, leading to steps in the density of states which trap the walks on random sides of the steps. Obviously, choosing a smaller starting modification factor γ 0, increasing the time of a constant γ t given by t 0, and decreasing the final γ final restore the convergence properties of the SAMC for this choice of stiffness (Fig. 3). The shortest CPU time needed for convergence in this case turned out to be 10 hours, needed for t 0 = 10 3 and γ final = 10 7.
86 B. Werlich et al. / Physics Procedia 57 ( 2014 ) 82 86 4. Conclusions We have discussed SAMC as a foundation for the reason the Wang-Landau approach works and as an algorithmic alternative to the standard WLMC simulations. The SAMC has the advantage of not needing prior knowledge about the possible energy range of the model (unvisited states just develop a density of states converging to zero) and of having a fixed and given runtime determined by the choice of parameters in the algorithm. This is due to the fact that the method does not use a visitation histogram, which, however, in turn makes it necessary to carefully check for convergence. This is best done by performing several SAMC runs and comparing them, and by changing the control parameters (especially the γ final ) to make sure that and increased run length brings no more improvement in the resulting density of states. With a careful choice of the algorithms parameters, the SAMC is a powerful algorithm for Wang-Landau type simulations, with a proven convergence. Acknowledgements The authors are grateful for funding from the German Science Foundation through project A7 in the SFB TRR102. References Bachmann, M., Janke, W., 2003. Phys. Rev. Lett. 91, 208105. Bachmann, M., Janke, W., 2004. J. Chem. Phys. 120, 6779. Belardinelli, R.A., Pereyra, V.D., 2007. Phys. Rev. E 75, 046701. Belardinelli, R.A., Pereyra, V.D., 2007. J. Chem. Phys. 127, 184105. Lee, K.H., Okabe, Y., Landau, D.P., 2006. Comput. Phys. Commun. 175, 36. Liang, F., 2006. J. Stat. Phys. 122, 511. Liang, F., Liu, C., Carroll, R.J., 2007. J. Amer. Stat. Ass. 102, 305. Paul, W., Strauch, T., Rampf, W., Binder, K., 2007. Phys. Rev. E 75, 060801R. Rampf, F., Paul, W., Binder, K., 2005. Europhys. Lett. 70, 628. Rampf, F., Binder, K., Paul, W., 2006. J. Pol. Sci. B Pol. Phys. 44, 2542. Seaton, D.T., Schnabel, S., Landau, D.P., Bachmann, M., 2013. Phys. Rev. Lett. 110, 028103. Swetnam, A.D., Allen, M.P., 2010. J. Comput. Chem. 32, 816. Taylor, M.P., Paul, W., Binder, K., 2009. J. Chem. Phys. 131, 114907. Taylor, M.P., Paul, W., Binder, K., 2013. Polym. Sci. Ser. C 55, 23. Taylor, M.P., Aung, P.P., Paul, W., 2013. Phys. Rev. E 88, 012604. Wang, F., Landau, D.P., 2001. Phys. Rev. Lett. 86, 2050. Wang, F., Landau, D.P., 2001. Phys. Rev. E 56, 056101. Wüst, T., Li, Y.W., Landau, D.P., 2011. J. Stat, Phys. 144, 638. Wüst, T., Landau, D.P., 2008. Comput. Phys. Commun. 179, 124. Zhou, C., Batt, R.N., 2005. Phys. Rev. E 72, 025701(R).