quantity.observables.init_relative_entropy_traj_fn

quantity.observables.init_relative_entropy_traj_fn#

init_relative_entropy_traj_fn(kT, reference_key='ref_energy')[source]#

Initializes the computation of the relative entropy difference between the current canonical distribution and reference distribution.

The relative entropy is given as

\[S_\text{rel} = -\int p(x)\log\frac{p(x)}{q(x)}dx.\]

For two canonical distributions defined by the potentials U_p and U_q, this relative entropy computes as

\[S_\text{rel} = \beta\left\langle\left(U_p - U_q\right)\right\rangle_{U_p} - \log\left\langle e^{-\beta(U_q - U_p)}\right\rangle_{U_p}.\]
Parameters:
  • kT (float) – Reference temperature.

  • reference_key – Key corresponding to the reference energy quantity.

Return type:

TrajFn

Returns:

Returns a function that computes the relative entropy given a dictionary of quantities along a trajectory.