The Hamiltonian for a system of discrete particles is a function of their generalized coordinates and conjugate momenta, and possibly, time. For continua and fields, Hamiltonian mechanics is unsuitable but can be extended by considering a large number of point masses, and taking the continuous limit, that is, infinitely many particles forming a continuum or field. Since each point mass has one or more degrees of freedom, the field formulation has infinitely many degrees of freedom.
The Hamiltonian density is the continuous analogue for fields; it is a function of the fields, the conjugate "momentum" fields, and possibly the space and time coordinates themselves. For one scalar field, the Hamiltonian density is defined from the Lagrangian density by with the "del" or "nabla" operator, is the position vector of some point in space, and is time. The Lagrangian density is a function of the fields in the system, their space and time derivatives, and possibly the space and time coordinates themselves. It is the field analogue to the Lagrangian function for a system of discrete particles described by generalized coordinates. As in Hamiltonian mechanics where every generalized coordinate has a corresponding generalized momentum, the field has a conjugate momentum field, defined as the partial derivative of the Lagrangian density with respect to the time derivative of the field, in which the overdot denotes a partial time derivative, not a total time derivative.
For many fields and their conjugates the Hamiltonian density is a function of them all: where each conjugate field is defined with respect to its field, In general, for any number of fields, the volume integral of the Hamiltonian density gives the Hamiltonian, in three spatial dimensions: The Hamiltonian density is the Hamiltonian per unit spatial volume. The corresponding dimension is −3, in SI units Joules per metre cubed, J m−3.
Tensor and spinor fields
The above equations and definitions can be extended to vector fields and more generally tensor fields and spinor fields. In physics, tensor fields describe bosons and spinor fields describe fermions.
For two functions which depend on the fields and, their spatial derivatives, and the space and time coordinates, and the fields are zero on the boundary of the volume the integrals are taken over, the field theoretic Poisson bracket is defined as. where is the variational derivative Under the same conditions of vanishing fields on the surface, the following result holds for the time evolution of : which can be found from the total time derivative of, integration by parts, and using the above Poisson bracket.
Explicit time-independence
The following results are true if the Lagrangian and Hamiltonian densities are explicitly time-independent,
The Hamiltonian density is the total energy density, the sum of the kinetic energy density and the potential energy density,
Continuity equation
Taking the partial time derivative of the definition of the Hamiltonian density above, and using the chain rule for implicit differentiation and the definition of the conjugate momentum field, gives the continuity equation: in which the Hamiltonian density can be interpreted as the energy density, and the energy flux, or flow of energy per unit time per unit surface area.
Relativistic field theory
Covariant Hamiltonian field theory is the relativistic formulation of Hamiltonian field theory. Hamiltonian field theory usually means the symplectic Hamiltonian formalism when applied to classical field theory, that takes the form of the instantaneous Hamiltonian formalism on an infinite-dimensional phase space, and where canonical coordinates are field functions at some instant of time. This Hamiltonian formalism is applied to quantization of fields, e.g., in quantum gauge theory. In Covariant Hamiltonian field theory, canonical momentapμi corresponds to derivatives of fields with respect to all world coordinates xμ. Covariant Hamilton equations are equivalent to the Euler-Lagrange equations in the case of hyperregular Lagrangians. Covariant Hamiltonian field theory is developed in the Hamilton–De Donder, polysymplectic, multisymplectic and k-symplectic variants. A phase space of covariant Hamiltonian field theory is a finite-dimensional polysymplectic or multisymplectic manifold. Hamiltonian non-autonomous mechanics is formulated as covariant Hamiltonian field theory on fiber bundles over the time axis, i.e. the real line ℝ.