MulticanonicalMCMCState#

class graph_tool.inference.MulticanonicalMCMCState(entropy_args={})[source]#

Bases: EntropyState

Base state that implements multicanonical MCMC sweeps

Methods

get_entropy_args()

Return the current default values for the parameters of the function entropy(), together with other operations that depend on them.

multicanonical_sweep(m_state[, multiflip])

Perform niter sweeps of a non-Markovian multicanonical sampling using the Wang-Landau algorithm.

reset_entropy_args()

Reset the current default values for the parameters of the function entropy(), together with other operations that depend on them.

update_entropy_args(**kwargs)

Update the default values for the parameters of the function entropy() from the keyword arguments, in a stateful way, together with other operations that depend on them.

get_entropy_args()#

Return the current default values for the parameters of the function entropy(), together with other operations that depend on them.

multicanonical_sweep(m_state, multiflip=False, **kwargs)[source]#

Perform niter sweeps of a non-Markovian multicanonical sampling using the Wang-Landau algorithm.

Parameters:
m_stateMulticanonicalState

MulticanonicalState instance containing the current state of the Wang-Landau run.

multiflipbool (optional, default: False)

If True, multiflip_mcmc_sweep() will be used, otherwise mcmc_sweep().

**kwargsKeyword parameter list

The remaining parameters will be passed to multiflip_mcmc_sweep() or mcmc_sweep().

Returns:
dSfloat

Entropy difference after the sweeps.

nattemptsint

Number of vertex moves attempted.

nmovesint

Number of vertices moved.

Notes

This algorithm has an \(O(E)\) complexity, where \(E\) is the number of edges (independent of the number of groups).

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

reset_entropy_args()#

Reset the current default values for the parameters of the function entropy(), together with other operations that depend on them.

update_entropy_args(**kwargs)#

Update the default values for the parameters of the function entropy() from the keyword arguments, in a stateful way, together with other operations that depend on them.

Values updated in this manner are preserved by the copying or pickling of the state.