function energy2d¶
- deeptime.util.energy2d(x: ndarray, y: ndarray, bins=100, kbt: float = 1.0, weights=None, shift_energy=True)¶
Compute a two-dimensional energy landscape based on data arrays x and y.
(Source code, png, hires.png, pdf)
This function assumes that the sampled data follows a Boltzmann distribution
\[p(x) \propto e^{-E(x) / k_BT}, \]which is a probability distribution over states \(x\) of a system based on their energy \(E(x)\). Based on data we estimate \(p(x)\) as a normalized histogram and subsequently compute \(E(x)/k_BT = -\log p(x) + C\) where \(C\) is a constant depending on the partition function.
If possible it is strongly encouraged to set the weights according to a stationary distribution (see
MSM.compute_trajectory_weights
). Otherwise, the energy landscape may be biased due to finite sampling.- Parameters:
x (ndarray) – Sample x coordinates of shape (N,).
y (ndarray) – Sample y coordinates of shape (N,).
bins (int or [int, int], optional, default=100) – Number of histogram bins used in each dimension.
kbt (float, optional, default=1) – The value of \(k_BT\) in the desired energy unit. By default, energies are computed in \(k_BT\) (setting kbt=1.0). If you want to measure the energy in \(\mathrm{kJ}/\mathrm{mol}\) at \(298\;K\), use kbt=2.479.
weights (ndarray, optional, default=None) – Sample weights of shape (N,). By default, all samples have the same weight.
shift_energy (bool, optional, default=True) – Whether to shift the minimum energy to zero. Defaults to True.
- Returns:
energy_landscape – The estimated energy landscape.
- Return type: