TRIQS / cthyb

A fast and generic hybridization-expansion solver
https://triqs.github.io/cthyb
Other
21 stars 23 forks source link

User provided proposal distribution for insert and remove moves #176

Open ec147 opened 2 months ago

ec147 commented 2 months ago

The user provides two dictionaries hist_insert and hist_remove, with a key for each block name. For each key, the value is a list of size nbins_histo, corresponding to a proposal probability for the insertion/remove of two operators for each bin of $\Delta \tau$. (For the definition of the bins, I follow the same conventions as the histograms of the performance_analysis feature, so the first and last bins are half-sized).

An usage example to build these proposal distributions, using the knowledge of a previous run, would be:

nbins = 100
S.solve(...,performance_analysis=True, nbins_histo=nbins)
hist = S.performance_analysis
hist_insert = {}
hist_remove = {} 
for block_name in list_of_block_names:
    hist_insert[block_name] = hist["insert_length_accepted_" + block_name].data / hist["insert_length_proposed_" + block_name].data   
    hist_remove[block_name] = hist["remove_length_accepted_" + block_name].data / hist["remove_length_proposed_" + block_name].data  
S.solve(...,hist_insert=hist_insert, hist_remove=hist_remove, nbins_histo=nbins) 
Wentzell commented 2 months ago

Thank you @ec147 for this Pull Request!

Please add a description of the Feature and the changes to this PR.

Also, can you please adjust the git history to group the changes into logical chunks with useful commit messages, instead of generic messages like Add files via upload