1. While deriving Hamiltonian from Lagrangian density, we use the formula $$\mathcal{H} ~=~ \pi \dot{\phi} - \mathcal{L}.$$ But since we are considering space and time as parameters, why the formula $$\mathcal{H} ~=~ \pi_{\mu}\partial^{\mu} \phi - \mathcal{L}$$ is not used?

  2. Is there any particular book/lecture notes dealing with these kind of issues in theoretical physics, I would love to know them?


4 Answers 4


Vladimir's answer has the right essence but it is also misleading, so let me clarify.

The formula $$ H = \sum_i p_i\dot q_i - L $$ relating the Hamiltonian and the Lagrangian is completely general. It holds in all theories that admit both Lagrangians and Hamiltonians, whether they're relativistic or not, whether or not they have any other symmetry aside from the Lorentz symmetry.

When you have field theory, both the Hamiltonian and the Lagrangian may be written as spatial integrals of their densities. $$ H = \int d^3x \, {\mathcal H}, \quad L = \int d^3x\, {\mathcal L} $$ Combining that with the first formula, we get the relationship $$ \mathcal{H} = \sum_i\pi_i \dot{\phi_i} - \mathcal{L} $$ Now, you proposed a different formula and I guess that the reason why you proposed it is that it looks more Lorentz-invariant to you, as appropriate for Lorentz-invariant field theories. That's a nice motivation.

However, what's wrong about your reasoning is the assumption that both the Hamiltonian density and the Lagrangian density are Lorentz-invariant. While the Lagrangian density is a nice scalar, so it is Lorentz-invariant (the density at the origin, at least), and it's because the integral of it is the Lorentz-invariant action which should be stationary, the same is not true for the Hamiltonian and its density.

The Hamiltonian is intrinsically linked to the time direction: it is the generator of the translations in time (the spatial counterparts of the Hamiltonian are the spatial components of the momentum); it is the energy, the 0th component of a 4-vector, $H\equiv p^0$. So the argument that this formula should be Lorentz-covariant is invalid, your proposed formula is wrong, and the right formula was justified at the beginning of my comment.

  • 2
    $\begingroup$ Thank you for an elaborate answer. Can you tell more about the equations of motion? When we go to Lagrangian density, the equations of motion still remain the Euler Lagrange equations--just that they are now for the Lagrangian density instead of the Lagrangian. What would happen to the Hamilton's equations of motion when we go to Hamiltonian density? $\endgroup$
    – user87745
    Commented Mar 13, 2018 at 12:14
  • 2
    $\begingroup$ As I wrote, if there's the Hamiltonian density, the full Hamiltonian is an integral of its density over space. There are infinitely many coordinates and infinitely many momenta, one or several of them at each point in space. In other words, they're fields which is why they're called $\phi_i(x,y,z),\pi_i(x,y,z)$ instead of just $q_i,p_i$. The Hamiltonian equations of motion remain the same and use the same overall $H$. The Ham. density at the same point isn't enough for those equations. For more data and examples, see en.wikipedia.org/wiki/Hamiltonian_field_theory $\endgroup$ Commented Mar 16, 2018 at 6:56
  • 1
    $\begingroup$ "the spatial counterparts of the Hamiltonian are the spatial components of the momentum" Does this mean that: $$\partial_x \phi \frac{\partial \mathcal{L}}{\partial \partial_x \phi} - \mathcal{L} $$ is the x component of the momentum? $\endgroup$
    – Habouz
    Commented Jul 14, 2022 at 22:46
  • 1
    $\begingroup$ Hi, basically yes, but here you must understand that you deal with field theory (and Lagrangian density) so the energy and momentum are locally described by a tensor, the stress energy tensor, see en.wikipedia.org/wiki/… It is called $T_{\mu\nu}$ and has two indices, one is which component of the vector you consider, and the other tells you whether it is the density (0) or a current/flux component (x,y,z) of that conserved thing. But if the signs are correct, what you wrote is indeed $T_{xx}$, a component of the stress energy tensor. $\endgroup$ Commented Jul 16, 2022 at 4:01

Lubos Motl and Vladimir Kalitvianski have already provided correct conventional answers concerning the Legendre transformation from Lagrangian to Hamiltonian formalism.

Nevertheless, it seems appropriate to mention that OP's second equation(v2)

$$\mathcal{H} ~=~ \pi_{\mu}\partial^{\mu} \phi - \mathcal{L}$$

is precisely the starting point for De Donder–Weyl theory, which introduces polymomenta.

Concerning manifestly covariant Hamiltonian formalism, see also e.g. Ref. 1 and this Phys.SE post.


  1. C. Crnkovic and E. Witten, Covariant description of canonical formalism in geometrical theories. Published in Three hundred years of gravitation (Eds. S. W. Hawking and W. Israel), (1987) 676.
  • 4
    $\begingroup$ If we stay in the frame of a standard theory, any Heisenberg operator $F$ obeys the following equations including not only $H=P^0$, but also the other components of the four-vector of energy-momentum $P^\mu$: $\frac{\partial F}{\partial x_\mu}=i[F,P^\mu]$. $\endgroup$ Commented Sep 26, 2012 at 11:36

Time plays a particular role, even in relativity. Time and space coordinates ("lengths") are not interchangeable. In other words, there is no complete symmetry between them despite they may transform together. So we apply a usual formula for constructing a Hamiltonian if the corresponding Lagrangian is known.

By the way, the Hamiltonian formalism in QFT is as relativistic invariant as the Lagrangian formalism; the former is just not manifest invariant contrary to the latter.

  • $\begingroup$ This is correct but misleading to a beginner like the OP. $\endgroup$ Commented Dec 1, 2013 at 4:26

Another reference to such approach (a short paper):

Hamiltonian Mechanics of Fields R. H. Good, Jr. Department of Physics, University of California, Berkeley, California Link

from the abstract:

In relativistic field mechanics one ordinarily introduces the time derivative of a field component as its velocity and the partial derivative of the Lagrangian density with respect to the velocity as its canonically conjugate momentum. In order to treat the time and space equivalently, Born and Weyl once treated the four space-time derivatives of a field component as four velocities and introduced the four partial derivatives of the Lagrangian density with respect to the velocities as four momenta. In the present paper this idea is carried further in order to introduce the generalizations of the point-mechanics ideas of Hamiltonian equations, Lagrange brackets, Poisson brackets, and integrals of motion.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.