Implemented in Stan language.
Transform unormalized posterior into a Hamiltonian/Energy by .
For each iteration:
As explained here, the symmetric proposal distribution is ensured by using a time-reversible (approximate) Hamiltonian dynamics.
As said here, if the Hamiltonian dynamics simulation is perfect, the acceptance rule always accept because is conserved. Therefore, we use approximate Hamiltonian dynamics (like Leapfrog algorithm) to explore more.
Note that the symmetry of the proposal distribution means that it is not the Boltzmann distribution (as it would be if we simulated Langevin dynamics). In fact, if using a deterministic algo like the leapfrog algo, our proposal is deterministic. However, perhaps it still has, over many iterations, properties like the Boltzmann dist (like a derandomized Langevin dynamics), or at least it "tends" to go downhill, and that's why it's useful?
Hamiltonian Monte Carlo explained
Leapfrog algorithm is a common way of solving the Hamiltonian dynamics (e.g. http://diffsharp.github.io/DiffSharp/examples-hamiltonianmontecarlo.html)
Scalable Bayesian Inference with Hamiltonian Monte Carlo
Efficient Bayesian inference with Hamiltonian Monte Carlo -- Michael Betancourt (Part 1)