/histogram_reweighting

tools for reweighting histograms from parallel tempering computations

Primary LanguagePython

this repository will contain modules related to histogram reweighting.  

Examples:
combining energy histograms from parallel tempering runs to calculate heat
capacity plots

combining 2d histograms (energy + order parameter. Q) from parallel tempering runs
to calculate free enegy plots F(Q), or average order parameter <Q(T)>

combining and reweighting histograms from biased sampling runs (not implemented)


#############################################################################
The idea behind how histogram reweighting can be viewed as a minimization
procedure is as follows
#############################################################################

from a simulation at temperature T you find the probability of finding energy
E is P(E,T).  We know this can be compared to the density of states n(E) as

P(E,T) = n(E) exp(-E/T)

the density of states is independent of temperature, so we can use it to find
P(E) at any other temperature, or Z(T), etc.  But our estimate of n(E) from
one temperature is not very good.  So we combine P(E,T) multiple simulations
at different temperatures to get a better estimate of n(E).  The true density
of states, n_T(E) is the weighted average of n_i(E) at all temperatures T_i

n_F(E) = sum_i w_i*n_i(E) = sum_i w_i*P(E,T_i)*exp(E/T_i)

where w_i are unknown. The best estimate for n_F(E) will be when the equality
is satisfied as much as possible term by term.  Define exp(R) the deviation from
the term-by-term agreement

R(E,T_i) = log(n_F(E)) - log(w_i) - log( P(E,T_i)*exp(E/T_i) )

we want to make each R(E,T_i) as small as possible.  Define an "energy" function

CHI2 = sum_E sum_i P(E,T_i)*|R(E,T_i)|^2

Where each R(E,T_i) contributes weight proportional to P(E,T_i) to the sum to
make sure those with better statistics are more heavily weighted.  To solve
the problem we find the set of {n_F(E), w_i} which minimize CHI2