请输入您要查询的百科知识:

 

词条 Wang and Landau algorithm
释义

  1. Overview

  2. Algorithm

  3. Test system

  4. Sample code

  5. Wang and Landau molecular dynamics

  6. References

The Wang and Landau algorithm, proposed by Fugao Wang and David P. Landau, is a Monte Carlo method designed to estimate the density of states of a system. The method performs a non-Markovian random walk to build the density of states by quickly visiting all the available energy spectrum. The Wang and Landau algorithm is an important method to obtain the density of states required to perform a multicanonical simulation.

The Wang–Landau algorithm can be applied to any system which is characterized by a cost (or energy) function. For instance,

it has been applied to the solution of numerical integrals[2] and the folding of proteins.[3][4]

The Wang–Landau sampling is related to the metadynamics algorithm.[1]

Overview

The Wang and Landau algorithm is used to obtain an estimate for the density of states of a system characterized by a cost function. It uses a non-Markovian stochastic process which asymptotically converges to a multicanonical ensemble. (I.e. to a Metropolis–Hastings algorithm with sampling distribution inverse to the density of states.) The major consequence is that this sampling distribution leads to a simulation where the energy barriers are invisible. This means that the algorithm visits all the accessible states (favorable and less favorable) much faster than a Metropolis algorithm.[7]

Algorithm

Consider a system defined on a phase space , and a cost function, E, (e.g. the energy), bounded on a spectrum , which has an associated density of states , which is to be estimated. The estimator is . Because Wang and Landau algorithm works in discrete spectra, the spectrum is divided in N discrete values with a difference between them of , such that

.

Given this discrete spectrum, the algorithm is initialized by:

  • setting all entries of the microcanonical entropy to zero,
  • initializing and
  • initializing the system randomly, by putting in a random configuration .

The algorithm then performs a multicanonical ensemble simulation: a Metropolis–Hastings random walk in the phase space of the system with a probability distribution given by and a probability of proposing a new state given by a probability distribution . A histogram of visited energies is stored. Like in the Metropolis–Hastings algorithm, a proposal-acceptance step is performed, and consists in (see Metropolis–Hastings algorithm overview):

  1. proposing a state according to the arbitrary proposal distribution
  2. accept/refuse the proposed state according to

where and .

After each proposal-acceptance step, the system transits to some value , is incremented by one and the following update is performed:

.

This is the crucial step of the algorithm, and it is what makes the Wang and Landau algorithm non-Markovian: the stochastic process now depends on the history of the process. Hence the next time there is a proposal to a state with that particular energy , that proposal is now more likely refused; in this sense, the algorithm forces the system to visit all of the spectrum equally. The consequence is that the histogram is more and more flat. However, this flatness depends on how well-approximated the calculated entropy is to the exact entropy, which naturally depends on the value of f.[11] To better and better approximate the exact entropy (and thus histogram's flatness), f is decreased after M proposal-acceptance steps:

.

It was later shown that updating the f by constantly dividing by two can lead to saturation errors.[11] A small modification to the Wang and Landau method to avoid this problem is to use the f factor proportional to , where is proportional to the number of steps of the simulation.[11]

Test system

We want to obtain the DOS for the harmonic oscillator potential.

The analytical DOS is given by,

by performing the last integral we obtain

In general, the DOS for a multidimensional harmonic oscillator will be given by some power of E, the exponent will be a function of the dimension of the system.

Hence, we can use a simple harmonic oscillator potential to test the accuracy of Wang–Landau algorithm because we know already the analytic form of the density of states. Therefore, we compare the estimated density of states obtained by the Wang–Landau algorithm with .

Sample code

The following is a sample code of the Wang–Landau algorithm in Python, where we assume that a symmetric proposal distribution g is used:

The code considers a "system" which is the underlying system being studied.

currentEnergy = system.randomConfiguration() # a random initial configuration

while (f > epsilon):

    system.proposeConfiguration() # a proposed configuration is proposed    proposedEnergy = system.proposedEnergy() # the energy of the proposed configuration computed
    if (random() < exp(entropy[currentEnergy]-entropy[proposedEnergy])):        # if accepted, update the energy and the system:        currentEnergy = proposedEnergy        system.acceptProposedConfiguration()    else:        # if rejected        system.rejectProposedConfiguration()        H[currentEnergy] += 1    entropy[currentEnergy] += f        if (isFlat(H)): # isFlat tests whether the histogram is flat (e.g. 95% flatness)        H[:] = 0        f *= 0.5 # refine the f parameter

Wang and Landau molecular dynamics

It should be noted that the Wang and Landau algorithm can be implemented not only in a Monte Carlo simulation but also in a molecular dynamics simulation. To do this would require an escalation of the temperature of the system as follows:

where is the entropy of the system, the micro-canonical temperature and is the "scaled" temperature used in the simulation.

References

1. ^Christoph Junghans, Danny Perez, and Thomas Vogel. "Molecular Dynamics in the Multicanonical Ensemble: Equivalence of Wang–Landau Sampling, Statistical Temperature Molecular Dynamics, and Metadynamics." Journal of Chemical Theory and Computation 10.5 (2014): 1843-1847. doi:[https://dx.doi.org/10.1021/ct500077d 10.1021/ct500077d]
2. ^{{cite journal| title = Analysis of the convergence of the 1∕t and Wang–Landau algorithms in the calculation of multidimensional integrals| author = R. E. Belardinelli and S. Manzi and V. D. Pereyra| journal = Phys. Rev. E| volume = 78| page = 067701|date=Dec 2008| doi = 10.1103/PhysRevE.78.067701| pmid = 19256982| issue = 6|arxiv = 0806.0268 |bibcode = 2008PhRvE..78f7701B }}
3. ^{{cite journal| title = Monte Carlo Simulations of Proteins in Cages: Influence of Confinement on the Stability of Intermediate States| author = P. Ojeda and M. Garcia and A. Londono and N.Y. Chen| journal = Biophys. J.| volume = 96| issue = 3| pages = 1076–1082|date=Feb 2009| doi = 10.1529/biophysj.107.125369| bibcode=2009BpJ....96.1076O}}
4. ^{{cite journal| title = Electric Field-Driven Disruption of a Native beta-Sheet Protein Conformation and Generation of alpha-Helix-Structure|author1=P. Ojeda |author2=M. Garcia |lastauthoramp=yes | journal = Biophys. J.| volume = 99| issue = 2| pages = 595–599|date=Jul 2010| doi = 10.1016/j.bpj.2010.04.040| bibcode=2009BpJ....96.1076O| pmid=20643079| pmc=2905109}}
5. ^{{Cite journal | last1 = Berg | first1 = B. | last2 = Neuhaus | first2 = T. | doi = 10.1103/PhysRevLett.68.9 | title = Multicanonical ensemble: A new approach to simulate first-order phase transitions | journal = Physical Review Letters | volume = 68 | issue = 1 | pages = 9–12 | year = 1992 | pmid = 10045099| pmc = |arxiv = hep-lat/9202004 |bibcode = 1992PhRvL..68....9B }}
6. ^{{cite journal| title = Wang–Landau algorithm: A theoretical analysis of the saturation of the error|author1=Belardinelli, R. E. |author2=Pereyra, V. D. |lastauthoramp=yes | journal = Jour. Chem. Phys.| volume = 127| issue = 18| page = 184105 | year = 2007| doi = 10.1063/1.2803061 |pmid=18020628 |arxiv = cond-mat/0702414 |bibcode = 2007JChPh.127r4105B }}
[2][3][4][5][6]
}}

4 : Markov chain Monte Carlo|Statistical algorithms|Computational physics|Articles with example Python code

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 14:00:59