multicanonical_equilibrate#
- graph_tool.inference.multicanonical_equilibrate(m_state, f_range=(1.0, 1e-06), r=2, flatness=0.95, allow_gaps=True, callback=None, multicanonical_args={}, verbose=False)[source]#
Equilibrate a multicanonical Monte Carlo sampling using the Wang-Landau algorithm.
- Parameters:
- m_state
MulticanonicalState
Initial multicanonical state, where the state density will be stored.
- f_range
tuple
of two floats (optional, default:(1., 1e-6)
) Range of density updates.
- r
float
(optional, default:2.
) Greediness of convergence. At each iteration, the density updates will be reduced by a factor
r
.- flatness
float
(optional, default:.95
) Sufficient histogram flatness threshold used to continue the algorithm.
- allow_gaps
bool
(optional, default:True
) If
True
, gaps in the histogram (regions with zero count) will be ignored when computing the flatness.- callback
function
(optional, default:None
) If given, this function will be called after each iteration. The function must accept the current
state
andm_state
as arguments.- multicanonical_args
dict
(optional, default:{}
) Arguments to be passed to
state.multicanonical_sweep
(e.g.graph_tool.inference.BlockState.multicanonical_sweep()
).- verbose
bool
ortuple
(optional, default:False
) If
True
, progress information will be shown. Optionally, this accepts arguments of the typetuple
of the form(level, prefix)
wherelevel
is a positive integer that specifies the level of detail, andprefix
is a string that is prepended to the all output messages.
- m_state
- Returns:
- niter
int
Number of iterations required for convergence.
- niter
References
[wang-efficient-2001]Fugao Wang, D. P. Landau, “An efficient, multiple range random walk algorithm to calculate the density of states”, Phys. Rev. Lett. 86, 2050 (2001), DOI: 10.1103/PhysRevLett.86.2050 [sci-hub, @tor], arXiv: cond-mat/0011174
[belardinelli-wang-2007]R. E. Belardinelli, V. D. Pereyra, “Wang-Landau algorithm: A theoretical analysis of the saturation of the error”, J. Chem. Phys. 127, 184105 (2007), DOI: 10.1063/1.2803061 [sci-hub, @tor], arXiv: cond-mat/0702414