Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for tuning of parallel tempering temperature set #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DavidRamosSal
Copy link

What

Added a recursion that changes the distribution of temperatures defined by the user shrinking the temperature difference of replicas with low exchange acceptance rates and vice versa. Adapted from "Markov Chain Monte Carlo Simulations and Their Statistical Analysis", Section 6.3.

Why

The recursion allows one to simulate systems at lower temperature or with certain phase transitions using fewer replicas.

How

If parameter recursionIterations is greater than zero it creates a second MonteCarloStatistics() variable that tracks the replica exchange independently and it performs a recursion every recursionRate sweeps a total of recursionIterations. The recursion itself is done in the root process and then shared across processes.

Testing

I haven't implemented any tests yet, but it should be possible to create one which goes to lower temperatures and obtains the right values.

@fbuessen
Copy link
Owner

Hi David, Thanks for contributing and addressing the important issue of finding good (efficient) distributions of temperature points in parallel tempering. Your code is definitely a cool extension!

In my experience, optimizing the temperature distribution can be rather finicky, especially for difficult models with phase transitions at very low temperatures, and algorithms that automatically tune the temperature distribution tend to easily become unstable.
Such a specialized use case / algorithm would therefore probably need good documentation and test coverage to make it really useful to the general user.

The codebase currently is more or less frozen since in its current state it is difficult to systematically build extensions around it.
Yet, I have been thinking about making the entire project more modular and extendable in the future (which is probably more of a long-term goal).
Until that happens, I would leave the pull request open to give your extension visibility, and we can hopefully revisit a merge when the codebase has been restructured.

Some technical remarks:

  • You don't seem to have a control flow that checks whether measurements are occurring (i.e., sweeps > thermalizationSweeps). When you update beta while measurements are being sampled, you might end up mixing samples across different temperatures.
  • If you are interested to dig deeper in the optimization of temperature point distributions: Updating the temperature distribution based on replica acceptance rate can sometimes be misleading. The approach doesn't disriminate between replica exchanges within the same phase of matter (not very useful) and replica exchanges across phase transitions (very useful since they allow low-temperature configurations to effectively re-thermalize in the high-temperature phase and explore more local energy minima). A strategy to maximize the latter is outlined e.g. in J. Stat. Mech. P03018 (2006) [https://arxiv.org/abs/cond-mat/0602085v3].

@DavidRamosSal
Copy link
Author

Hello. Yeah, the algorithm certainly requires close monitoring. Thanks for your in depth response. I will have the technical comments in mind in the future, I will gladly improve the merge request after a restructure of the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants