# Hamiltonian Monte Carlo (or Langevin Monte Carlo) on a Sphere

I want to perform Hamiltonian Monte Carlo (HMC) or Langevin Monte Carlo (LMC) on a spherical domain $$\mathbb{S}^{D-1}$$ embedded in a Euclidean space $$\mathbb{R}^D$$. My energy function is a deep neural network, and its gradient is computed using automatic differentiation.

I have looked up a few materials.

• Brubaker et al., AISTATS 2012 seems to tackle my problem, but their proposed algorithm using RATTLE, an integrator that involves nonlinear optimization. Solving such optimization is not tractable in my case.
• Lan et al., ICML 2014 also addresses MCMC on a spherical domain, as a part of another problem. Their algorithm seems to work in the spherical coordinate rather than the Euclidean coordinate.

Can I perform LMC on a sphere in a simpler manner?

For example, I want to

• a) use Euclidean coordinates without transformation to spherical coordinate
• b) exploit the simple projection operation onto a sphere, i.e., $$x\leftarrow x/||x||$$.

In my preliminary experiment, simply projecting samples from each LMC step onto a sphere seems to work. It is not very clear how to perform Metropolis-Hastings adjustment, though.