First, the python import in the ipython notebook:
As usual, we define the Müller potential as the sampled potential:
2D plot of the sampled potential:
Now, we search for the 3 local minima of the potential defined:
And now the standard MCMC sampler:
The sampling:
And the distribution obtained:
Now, we define a Gaussian for the sampling by metadynamics:
And the MCMC sampler is modified to add a Gaussian at each point visited during
the sampling:
Now we sample with the same parameters beta
and nstep
but with the ‘Gaussian
flooding’
Now we’ll use the JSAnimation module
to generate an animation of the sampling:
Below, just some snapshots of the metadynamics and standard sampling for
comparison:
If you want to ask me a question or leave me a message add @bougui505 in your comment.