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

  • Context: Graduate 
  • Thread starter Thread starter wbwb
  • Start date Start date
  • Tags Tags
    Dos
Click For Summary
SUMMARY

The discussion focuses on the Wang-Landau algorithm for calculating the density of states (DOS) and clarifies misconceptions regarding the concept of 'flatness' in histograms. The user initially believed that the algorithm should yield a flat DOS independent of the model, but later realized that 'flatness' refers to the distribution of visit counts rather than the DOS itself. The conversation highlights the importance of understanding that the algorithm tracks two histograms: the density of states d(E) and the visit counts c(E), with the latter needing to be flat for the algorithm to converge effectively.

PREREQUISITES
  • Understanding of Wang-Landau algorithm mechanics
  • Familiarity with statistical mechanics concepts
  • Knowledge of histogram analysis in computational simulations
  • Basic programming skills for implementing algorithms
NEXT STEPS
  • Study the implementation details of the Wang-Landau algorithm in Python or C++
  • Learn about histogram techniques in Monte Carlo simulations
  • Explore the law of large numbers and its application in statistical sampling
  • Investigate methods for assessing convergence in density of states calculations
USEFUL FOR

Researchers and practitioners in computational physics, particularly those working with Monte Carlo methods and density of states calculations, will benefit from this discussion. Additionally, students learning about statistical mechanics and algorithm implementation will find valuable insights.

wbwb
Messages
4
Reaction score
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
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:
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   Reactions: IreneFerri

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 54 ·
2
Replies
54
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 62 ·
3
Replies
62
Views
12K
  • · Replies 125 ·
5
Replies
125
Views
20K
  • · Replies 35 ·
2
Replies
35
Views
30K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K