pyemma.thermo.wham¶
-
pyemma.thermo.
wham
(ttrajs, dtrajs, bias, maxiter=100000, maxerr=1e-15, save_convergence_info=0, dt_traj='1 step')¶ Weighted histogram analysis method
Parameters: - ttrajs (ndarray(T) of int, or list of ndarray(T_i) of int) – A single discrete trajectory or a list of discrete trajectories. The integers are indexes in 1,...,K enumerating the thermodynamic states the trajectory is in at any time.
- dtrajs (ndarray(T) of int, or list of ndarray(T_i) of int) – A single discrete trajectory or a list of discrete trajectories. The integers are indexes in 1,...,n enumerating the n Markov states or the bins the trajectory is in at any time.
- bias (ndarray(K, n)) – bias[j,i] is the bias energy for each discrete state i at thermodynamic state j.
- maxiter (int, optional, default=10000) – The maximum number of dTRAM iterations before the estimator exits unsuccessfully.
- maxerr (float, optional, default=1e-15) – Convergence criterion based on the maximal free energy change in a self-consistent iteration step.
- save_convergence_info (int, optional, default=0) – Every save_convergence_info iteration steps, store the actual increment and the actual loglikelihood; 0 means no storage.
- dt_traj (str, optional, default='1 step') –
Description of the physical time corresponding to the lag. May be used by analysis algorithms such as plotting tools to pretty-print the axes. By default ‘1 step’, i.e. there is no physical time unit. Specify by a number, whitespace and unit. Permitted units are (* is an arbitrary string):
‘fs’, ‘femtosecond*’‘ps’, ‘picosecond*’‘ns’, ‘nanosecond*’‘us’, ‘microsecond*’‘ms’, ‘millisecond*’‘s’, ‘second*’
Returns: sm – A stationary model which consists of thermodynamic quantities at all temperatures/thermodynamic states.
Return type: Example
Example: Umbrella sampling. Suppose we simulate in K umbrellas, centered at positions \(y_1,...,y_K\) with bias energies
\[b_k(x) = 0.5 * c_k * (x - y_k)^2 / kT\]Suppose we have one simulation of length T in each umbrella, and they are ordered from 1 to K. We have discretized the x-coordinate into 100 bins. Then dtrajs and ttrajs should each be a list of \(K\) arrays. dtrajs would look for example like this:
[ (1, 2, 2, 3, 2, ...), (2, 4, 5, 4, 4, ...), ... ]
where each array has length T, and is the sequence of bins (in the range 0 to 99) visited along the trajectory. ttrajs would look like this: [ (0, 0, 0, 0, 0, ...), (1, 1, 1, 1, 1, ...), ... ] Because trajectory 1 stays in umbrella 1 (index 0), trajectory 2 stays in umbrella 2 (index 1), and so forth. bias is a \(K \times n\) matrix with all reduced bias energies evaluated at all centers:
[[b_0(y_0), b_0(y_1), ..., b_0(y_n)],
[b_1(y_0), b_1(y_1), ..., b_1(y_n)], ... [b_K(y_0), b_K(y_1), ..., b_K(y_n)]]