Because the free energy of a system is not simply a function of the phase space coordinates of the system, but is instead a function of the Boltzmann-weighted integral over phase space (i.e. partition function), the free energy difference between two states cannot be calculated directly from the potential energy of just two coordinate sets (for state A and B respectively).
In thermodynamic integration, the free energy difference is calculated by defining a thermodynamic path between the states and integrating over ensemble-averaged enthalpy changes along the path.
An example alchemical process is the Kirkwood's coupling parameter method.
The potential energy in either system can be calculated as an ensemble average over configurations sampled from a molecular dynamics or Monte Carlo simulation with proper Boltzmann weighting.
is defined as a coupling parameter with a value between 0 and 1, and thus the potential energy as a function of
In the canonical ensemble, the partition function of the system can be written as: In this notation,
The free energy of this system is defined as: If we take the derivative of F with respect to λ, we will get that it equals the ensemble average of the derivative of potential energy with respect to λ.
The change in free energy between states A and B can thus be computed from the integral of the ensemble averaged derivatives of potential energy over the coupling parameter
[2] In practice, this is performed by defining a potential energy function
value, and finally computing the integral over the ensemble-averaged derivatives.
Umbrella sampling is a related free energy method.
In the limit of an infinite strong bias it is equivalent to thermodynamic integration.