# Simple Hamiltonian in curved space-time

Consider the theory of a free massless scalar field with a non-trivial background metric: $$\mathcal{L} = -\sqrt{-g} \left( \frac{1}{2}\partial_\mu \phi \partial^\mu\phi\right) .$$ (I prefer the 'mostly +' metric signature). I want to find the Hamiltonian density. Intuitively, I would have $$\Pi = \frac{\partial \mathcal{L}}{\partial(\partial_0\phi)} = -\sqrt{-g}\;\frac{1}{2}\partial^0 \phi.$$ The Hamiltonian density should therefore be $$\mathcal{H} = \Pi \dot{\phi} - \mathcal{L} = \Pi \frac{2\Pi}{\sqrt{-g}} + \sqrt{-g}\; (-\Pi^2 + \partial_i \phi \partial^i \phi)$$ $$= \sqrt{-g}\;\left[ \left(\frac{2}{-g} -1 \right)\Pi^2 + \partial_i \phi \partial^i \phi \right].$$ The factor in front of $$\Pi^2$$ just looks wrong to me. I therefore suspect I'm defining things wrongly and wished to know what was the standard formalism to obtain the Hamiltonian density with curved background?

First of all, notice that $$\partial_\mu \phi \partial^\mu\phi = g^{00}(\partial_0 \phi)^2 + 2 g^{0i} \partial_0 \phi \partial_i \phi + g^{ij}\partial_i \phi \partial_j \phi$$ Then $$\Pi \equiv \frac{\partial \cal L}{\partial(\partial_0 \phi)} = \sqrt{-g} \partial^0\phi = \sqrt{-g}(g^{00} \partial_0\phi + g^{0i} \partial_i \phi)$$ You will then have $$\partial_0\phi = \frac{\Pi}{g^{00}\sqrt{-g}} - \frac{g^{0i}}{g^{00}} \partial_i \phi$$ If you substitute this consistently in the Legendre transform, you get something much more complicated than what you have in the OP and that will be the correct result for the Hamiltonian ;)
• Sorry, I guess I was thinking of a diagonal metric, but even then forgot the $g^{00}$ terms. So the point I should take is that it's normal for the Hamiltonian density to be very complicated even when corresponding to the simplest covariantly written Lagrangians. – Rudyard Feb 21 at 17:44