Why is the DOS from Wang-Landau's algoritm non-flat?

  • Thread starter wbwb
  • Start date
  • Tags
    Dos
In summary, the conversation discusses the Wang-Landau algorithm and its purpose in calculating the density of states. The algorithm involves updating a histogram and entropy at each level until the histogram becomes flat, indicating that the density of states is being accurately estimated. However, there is some confusion about what exactly constitutes "flatness" in this context. It is clarified that the algorithm aims for "sufficient statistics" rather than a constant function, and that this is indicated by the visit counts histogram becoming flat. It is also mentioned that there are two histograms being tracked, one for the density of states and one for visit counts, and that the latter is the one used to determine when the algorithm should terminate.
  • #1
4
0
Hi,

I'm trying to understand(implement) Wang-Landau's algorithm to calculate the DOS. There are zillions of seemingly identical descriptions on the net, which I thought are straightforward to type into a machine - but when reading the papers(codes) I don't get the main point, i.e. for me it seems as if the procedure should not generate anything else than just a flat DOS independent of the model under consideration.

If I understand correctly, then, at level 'l', and independent of acceptance or rejection, after each update attempt, the algorithm will increment both, the histogram h(E) by 1 and the entropy ln(g(E)) by ln(f)_l, at identical E, where E is either the accepted (new) energy or the old energy (after rejection) ... until h(E) is 'sufficiently' flat. Then one nullifies h(E), sets ln(f)_{l+1} = ln(f)_l/2, and starts the preceding all over again ... until ln(f)_l is 'sufficiently' close to zero. (There is a proper way of how to reject/accept, but I don't see how that is of relevance for my problem.)

So, if h(E)_l is the number of entries in each bin of the histogram at level 'l', then
ln(g(E))_l = h(E)_1*ln(f) + h(E)_2*ln(2)/2 + ... + h(E)_l*ln(f)/l
and since the stopping criterion at each level k is that h(E)_k is flat i.e. independent of E, so must be ln(g(E))_l.
In turn the DOS g(E) will be 'as flat as the histogram'.

What I am getting wrong here?

Thx. for your comments.
wbwb
 
Physics news on Phys.org
  • #2
Ok., I got it.
Maybe I should have thought about the algorithm a little more by myself, and not so much looked at some of the codes one can find on the net. (By now I think some of them are just plain wrong.)
I know, it is bad style to answer your own questions ... but anyway, if someone shows up here having similar issues:

The 'flatness' criterion in the Wang-Landau algorithm means something totally different then a 'function h(E)' which has zero slope to some relative numerical error - even if that error is never strictly set to '0'. That was my complete misunderstanding of the method. Actually one can convince oneself by playing Gedanken-experiments with toy models, that in some steady state of the code at level 'l' the histogram must not be 'roughly' constant as a function of 'E'. In fact, forcing such a situation will most likely put you in rare configurations (if at all) in which the DOS will most likely be wrong.

The way, in which the algorithm (i.m.h.o.) is meant to work implies that 'flatness' simply means 'sufficient statistics' for the histogram. This is a rather vague criterion. E.g. one could check this by testing how well the law of large numbers is satisfied separately for each entry of the histogram at each energy 'E', but probably there are many more ways to do that.

In conclusion, it this wording of the histogram being 'flat' which can be really confusing to newbies of the method: it does not mean flatness as a function of 'E', but rather when one considers h(E,ts), where 'ts' is some measure of the simulation time, then these should be more or less flat as functions of 'ts' for each 'E'.

wbwb
 
Last edited:
  • #3
Not sure if that helps, but I have the feeling you are missing this point: In WL sampling you have two histograms: d(E) keeps track of the density of states in the respective energies. Then, there is a second histogram c(E) which counts how often the respective energies have been visited during the sampling run. If d(E) roughly represents the real density of states, all bins are, on average, visited equally often. Hence, the counting histogram c(E) becomes flat. Conversely, if c(E) becomes flat, you assume that your estimate d(E) is somewhat good/acceptable.

Bottom line: There are two histograms that are being tracked: The estimate for the density of states and the visit counts. It is the visit counts that are requested to become flat for the algorithm (or an iteration of it) to terminate, not the density of states. The criterion you suggested, looking after d(E) to become effectively stationary, should also work. But it sounds a bit harder to quantify.
 
  • Like
Likes IreneFerri

Suggested for: Why is the DOS from Wang-Landau's algoritm non-flat?

Replies
3
Views
424
Replies
1
Views
1K
Replies
8
Views
1K
Replies
2
Views
1K
Replies
4
Views
805
Replies
1
Views
757
Replies
4
Views
1K
Back
Top