Valuation (measure theory)

From formulasearchengine
Revision as of 00:36, 12 October 2013 by en>LokiClock (Dirac valuation: Forgot to remove disambiguation tag)
Jump to navigation Jump to search

The Wang and Landau algorithm, proposed by Fugao Wang and David P. Landau,[1] is a Monte Carlo method designed to calculate 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]

Overview

The Wang and Landau algorithm is used to obtain 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.[1] (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.[5]

Algorithm

Consider a system defined on a phase space Ω, and a cost function, E, (e.g. the energy), bounded on a spectrum EΓ=[Emin,Emax], which has an associated density of states ρ(E)exp(S(E)), which is to be computed. Because Wang and Landau algorithm works in discrete spectra,[1] the spectrum Γ is divided in N discrete values with a difference between then of Δ, such that

N=EmaxEminΔ,.

Given this discrete spectrum, the algorithm is initialized by:

  • setting all entries of the entropy to zero, S(Ei)=0i=1,2,...,N
  • initializing f=1 and
  • initializing the system randomly, by putting in a random configuration rΩ.

The algorithm then performs a multicanonical ensemble like simulation:[1] a Metropolis-Hastings random walk in the phase space of the system with a probability distribution given by P(r)=1/ρ(E(r))=exp(S(E(r))) and a probability of proposing a new state given by a probability distribution g(rr). A histogram H(E) 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 rΩ according to g(rr)
  2. accept/refusing the proposed state according to
A(xx)=min(1,eSSg(xx)g(xx))
where S=S(E(r)) and S=S(E(r)).

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

S(Ei)S(Ei)+f.

This is the crucial step of the algorithm, and it is what make this Wang and Landau algorithm non-markovian: the stochastic process now depends on the history of the process. Nevertheless, the next time there is a proposal to a state with that particular energy Ei, that proposal is now more likely refused; in this sense, the algorithm forces the system to visit all the spectrum equally.[1] The consequence is that the histogram H(E) 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.[6] To better and better approximate the exact entropy (and thus histogram's flatness), f is decreased after M proposal-acceptance steps:

ff/2.

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

Test system

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

E(x)=x2,

The analytical DOS is given by,

g(E)=δ(E(x)E0)dx=δ(x2E0)dx,

by performing the last integral we obtain,

g(E)E1/2,

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.

Sample code

The following is a sample code of the Wang–Landau algorithm in Python, considering that the proposal is such that

g(xx)g(xx)=1

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:

T(E)(S(E)/E)T(E),

where S(E) is the entropy of the system, T(E) the micro-canonical temperature and T(E) is the "scaled" temperature used in the simulation.

References

43 year old Petroleum Engineer Harry from Deep River, usually spends time with hobbies and interests like renting movies, property developers in singapore new condominium and vehicle racing. Constantly enjoys going to destinations like Camino Real de Tierra Adentro.

  1. 1.0 1.1 1.2 1.3 1.4 Cite error: Invalid <ref> tag; no text was provided for refs named WangLandau
  2. Cite error: Invalid <ref> tag; no text was provided for refs named Belardinelli_Integrals
  3. Cite error: Invalid <ref> tag; no text was provided for refs named Ojeda1
  4. Cite error: Invalid <ref> tag; no text was provided for refs named Ojeda2
  5. Cite error: Invalid <ref> tag; no text was provided for refs named Berg
  6. 6.0 6.1 6.2 Cite error: Invalid <ref> tag; no text was provided for refs named Belardinelli_Saturation