evanberkowitz / two-dimensional-gasses

Let's crush it
0 stars 0 forks source link

HMC integration jacobian is in the wrong spot #73

Closed evanberkowitz closed 1 year ago

evanberkowitz commented 1 year ago

The Jacobian in the HMC MCMC that we fix to 1 by (leapfrog, omelyan) being symplectic is a property of the integrator, not of the Markov chain. But, as it stands, the jacobian is returned by tdg.HMC.MarkovChain.step. This is wrong! Just get the jacobian from the integrator and incorporate it into the accept/reject inside step.

evanberkowitz commented 1 year ago

There's actually two issues. One is that the integrator's Jacobian was not incorporated correctly. The other is that the accept/reject is done according to (what else?) the real part of dH. The imaginary part of dH ought to be incorporated via reweighting; that's the point of the other return value. It's not a Jacobian; it's a reweighting factor.