Hamiltonian Field Theory
Introduction
In ordinary classical mechanics, the Hamiltonian formulation provides a powerful way to describe dynamics. Instead of working directly with Newton’s equations or even only with the Lagrangian, we reorganize the system in terms of canonical coordinates and canonical momenta. The result is a phase-space picture in which the evolution equations take a highly structured form. That structure is not just elegant. It is the bridge to quantization.
Field theory needs the same bridge.
A classical field is not a system with a small number of coordinates . It is a system with degrees of freedom distributed over space. At every point in space, the field can vary. So instead of finitely many coordinates, we now have a continuum of them. The field value plays the role of a generalized coordinate, and the corresponding conjugate momentum field plays the role of the canonical momentum.
This is the main conceptual shift of Hamiltonian field theory: the phase space of mechanics becomes an infinite-dimensional phase space of field configurations and their conjugate momenta.
That sounds abstract, but the logic is actually very direct. If ordinary mechanics tells us how to pass from a Lagrangian to a Hamiltonian , then field theory should tell us how to pass from a Lagrangian density to a Hamiltonian density . Once that is done, Hamilton’s equations must also have field versions, and those equations should reproduce the familiar field equations such as the Klein-Gordon equation.
This lesson develops that structure carefully. The goal is not just to write down formulas. The goal is to understand why Hamiltonian field theory is the natural classical starting point for canonical quantization. Later, when fields become operators, the canonical pair will become the foundation of the quantum theory. So if the Hamiltonian picture is unclear now, quantization will feel like magic later. If it is clear now, canonical quantization will feel like the natural next step.
Learning Objectives
- Explain how Hamiltonian mechanics generalizes from finitely many coordinates to fields.
- Define canonical field variables and conjugate momentum fields.
- Construct the Hamiltonian density from a Lagrangian density using a Legendre transform.
- Understand why the Hamiltonian of a field is an integral over space.
- Use functional derivatives in the field-theoretic form of Hamilton’s equations.
- Derive the classical equations of motion from the Hamiltonian formalism.
- Interpret a field as an infinite collection of coupled degrees of freedom.
Prerequisite Knowledge
- Basic calculus and partial derivatives
- Introductory variational principles
- Classical mechanics with generalized coordinates and momenta
- Basic Lagrangian and Hamiltonian mechanics
- Familiarity with derivatives of functions of several variables
- Basic understanding of what a field is as a quantity defined over space and time
1. From ordinary Hamiltonian mechanics to fields
The cleanest way to understand Hamiltonian field theory is to start from ordinary Hamiltonian mechanics and then generalize carefully.
In classical mechanics with finitely many degrees of freedom, a system is described by generalized coordinates and velocities . The Lagrangian is a function
and the conjugate momenta are defined by
One then performs a Legendre transform to define the Hamiltonian
Hamilton’s equations take the form
This formulation is powerful because it puts coordinates and momenta on symmetric footing and rewrites dynamics as flow in phase space.
Field theory keeps the same architecture but changes the meaning of the indices. Instead of a finite label , we now have a continuous spatial label . Instead of coordinates , we have field values . Instead of a finite set of momenta , we have a momentum field .
So the replacement is conceptually this:
This does not mean fields are just ordinary mechanics with more indices in a trivial sense. It means that the canonical structure of mechanics survives in an infinite-dimensional setting. The field configuration at one instant of time plays the role of a point in an infinite-dimensional configuration space, and the pair specifies a point in phase space.
That phase-space viewpoint is the classical backbone of canonical field theory.
2. The field as a continuum of degrees of freedom
A useful physical picture is to imagine space as divided into many tiny cells. In each cell, the field has a value. If there are finitely many cells, then the system is like a large set of coupled oscillators. As the cell size becomes smaller and the number of cells becomes larger, the discrete label becomes continuous, and the field becomes a function of position.
This is why one often says that a field is like an infinite collection of coupled degrees of freedom.
That phrase is not just intuition. It explains why field theory inherits so much from classical mechanics. Each point in space behaves like it carries a local dynamical variable. But because neighboring points are related through spatial derivatives in the Lagrangian, the degrees of freedom are coupled.
For example, if a scalar field Lagrangian contains a term such as
then the energy depends on how the field varies from point to point. That means the value of the field at one point is not dynamically isolated from the value nearby.
This is one of the main reasons the Hamiltonian in field theory becomes an integral over space. The total energy is obtained by summing the energy density of all local degrees of freedom.
So the field-theory viewpoint is:
- the field value at each point acts like a generalized coordinate,
- the momentum field acts like its canonically conjugate momentum,
- and the full dynamics couples these local variables across space.
3. Lagrangian density and action for a field
In mechanics, the action is
In field theory, the analogous object is built from a Lagrangian density , and the action becomes
Here is usually a function of:
- the field ,
- its time derivative ,
- and its spatial derivatives .
So one writes schematically
The distinction between and is important:
- is a density defined locally in space,
- is the spatial integral of that density:
This is not a cosmetic change. Locality in field theory is naturally expressed at the level of the density , not only at the level of the total Lagrangian. The theory is built locally, point by point, and then integrated over space.
That local viewpoint will later be essential for symmetry arguments, conserved currents, and quantization. For now, it tells us how to define conjugate momenta and Hamiltonians in a way that respects the field structure.
4. Canonical field variable and conjugate momentum
Once the Lagrangian density is given, the next step is to define the canonical momentum field.
For an ordinary coordinate , the conjugate momentum is
For a field, the analogous definition is
This equation should be read locally. At every point in space, the momentum field is obtained by differentiating the Lagrangian density with respect to the time derivative of the field at that same point.
That is why is a field, not a single number.
This definition already contains an important lesson: the conjugate momentum depends on the chosen Lagrangian density. It is not determined by the field alone. Different Lagrangians can lead to different canonical momenta even for the same field variable. So is not something universal attached permanently to . It is defined through the dynamical structure of the theory.
For a single real scalar field, this process is usually straightforward. For more complicated systems, especially constrained systems such as gauge theories, defining canonical momenta can become subtler. But the basic idea starts here.
The canonical pair
is the field-theory analogue of in mechanics.
5. The Legendre transform in field theory
Now we pass from the Lagrangian to the Hamiltonian description.
In mechanics, the Hamiltonian is obtained by a Legendre transform:
In field theory, the local version of this transform defines the Hamiltonian density
Then the total Hamiltonian is
This is one of the core formulas of the whole lesson.
The structure is the same as in mechanics, but now everything is local. The density gives the energy content per unit volume, and integrating over space gives the total Hamiltonian.
A few comments matter here.
First, is initially written in terms of , , and . But the goal of the Legendre transform is to eliminate in favor of . So the final Hamiltonian density should be expressed as a function of
and possibly explicit time dependence if present.
Second, spatial derivatives usually remain in the Hamiltonian density. This is different from the finite-dimensional mechanics case, where there is no analogue of . In field theory, spatial structure remains part of the energy.
Third, the Hamiltonian is a functional of the fields. That means it takes an entire field configuration and momentum configuration as input and returns a number. This is why ordinary partial derivatives are no longer enough when deriving equations of motion. We will need functional derivatives.
6. Why the Hamiltonian is a functional
Students often say “the Hamiltonian is a function of and .” That is not fully wrong, but it is not precise enough.
For finitely many variables, is an ordinary function on phase space. In field theory, depends on the entire shapes of the fields across space. So it is more accurate to say that is a functional.
Schematically,
This expression shows why is not determined by the value of and at one point. To compute the Hamiltonian, you need the field values everywhere.
That is also why variations of are written using functional derivatives such as
A functional derivative tells us how the Hamiltonian changes when we vary the field locally at the point , while keeping track of the fact that the object depends on the whole field configuration.
This is one of the technical upgrades from mechanics to field theory:
- ordinary derivatives for finite-dimensional phase space,
- functional derivatives for field phase space.
7. Hamilton’s equations for fields
Once the Hamiltonian has been constructed, the equations of motion can be written in field-theoretic Hamiltonian form:
These are the direct analogues of
The replacement is exactly what you would expect:
- discrete index becomes continuous label ,
- ordinary derivatives become functional derivatives.
This is one of the most satisfying points in classical field theory. The elegant canonical structure of mechanics survives almost unchanged.
Of course, the real test is whether these equations reproduce the correct field equations obtained from the Euler-Lagrange formalism. For ordinary non-singular systems, they do. That is what makes the Hamiltonian formulation equivalent to the Lagrangian one, while organizing the theory in a form better suited for quantization.
8. Example: the real scalar field
The standard example is the real scalar field with Lagrangian density
This is the classical Lagrangian density for the free Klein-Gordon field.
Step 1: Find the conjugate momentum
By definition,
Since only the term depends on , we get
This is a simple case in which the conjugate momentum is numerically equal to the time derivative of the field.
Step 2: Compute the Hamiltonian density
The Hamiltonian density is
Using , this becomes
Since , we find
So the total Hamiltonian is
This is exactly what one expects physically: the total energy is the integral over space of kinetic energy density, gradient energy density, and mass energy density.
9. Recovering the field equation from Hamilton’s equations
Now let us verify that the Hamiltonian formalism reproduces the Klein-Gordon equation.
We already have
The first Hamilton equation gives
So the momentum field is indeed the time derivative of the scalar field.
The second Hamilton equation gives
Now we compute the functional derivative of with respect to . The mass term contributes straightforwardly:
The gradient term requires an integration by parts and gives
assuming boundary terms vanish suitably.
So altogether,
Therefore,
But since , we have
Rearranging,
This is the Klein-Gordon equation.
That result is important because it shows that the Hamiltonian field formalism is not introducing new physics. It is reorganizing the same physics in a canonical structure that later becomes the basis for quantization.
10. Functional derivatives and why they appear
For many students, the first real technical stumbling block in Hamiltonian field theory is the appearance of functional derivatives. They look unfamiliar, but conceptually they are not mysterious.
An ordinary derivative tells you how a function changes when you vary one variable. A functional derivative tells you how a functional changes when you vary the function it depends on.
If
then the variation of can be written schematically as
This is the field-theory analogue of
for finitely many variables.
So the functional derivative is not some exotic object invented only for QFT. It is exactly what you need when the “variables” are whole functions rather than finitely many coordinates.
In practice, computing functional derivatives often looks like the calculus of variations:
- vary the field,
- integrate by parts if derivatives of appear,
- drop boundary terms under appropriate assumptions,
- read off the coefficient of .
That procedure is standard and will appear repeatedly in the rest of the course.
11. Energy density and physical interpretation
The Hamiltonian density is often interpreted as the energy density of the field, especially in simple theories such as the free scalar field.
For the real scalar field,
Each term has a natural interpretation:
- : kinetic contribution from time variation,
- : gradient contribution from spatial variation,
- : mass or potential-like contribution.
This is helpful because it makes the field feel less abstract. Just as a vibrating string stores energy in motion and in deformation, a field stores energy in time dependence and in spatial structure.
That analogy is not exact in every detail, but it is a good guide. A field is something extended through space, and the Hamiltonian measures the total energy stored in that extended system.
12. Why Hamiltonian field theory matters for quantization
At this point, it is fair to ask why we are spending so much time building the Hamiltonian formalism when the Euler-Lagrange equations already describe the dynamics.
The answer is simple: canonical quantization needs canonical variables.
Later, when the field becomes a quantum operator, the pair
will be promoted to operator-valued quantities satisfying canonical commutation relations. That step only makes sense once the classical canonical structure has been identified clearly.
So Hamiltonian field theory is the classical stage-setting for QFT.
Without it, quantization would look like an arbitrary rule. With it, quantization looks like the natural extension of the canonical mechanics you already know.
This is why the current lesson is foundational even if it feels technical. It is preparing the exact variables that the quantum theory will need.
Worked Examples
Example 1: Real scalar field
Consider the Lagrangian density
The conjugate momentum is
The Hamiltonian density is therefore
This is the canonical Hamiltonian density of the free real scalar field.
Example 2: Hamilton equations
Using
Hamilton’s equations are
For the free scalar field this gives
Combining them yields
which is the Klein-Gordon equation.
Intuition
Hamiltonian field theory tells you to stop thinking of a field as one mysterious object and instead think of it as a continuum of local dynamical variables. Every point in space carries a degree of freedom, and the whole field is the collective system formed by all of them. The conjugate momentum field records how the field changes in time, while the Hamiltonian tells you how energy is distributed over the entire spatial configuration.
A good mental image is an infinite network of coupled oscillators. Each oscillator is local, but none of them is completely isolated because the spatial derivative terms couple neighboring points. The Hamiltonian then acts like the total energy of this enormous distributed system.
That picture is exactly what makes later quantization believable. If an ordinary harmonic oscillator can be quantized, then a field can be viewed as a vast collection of oscillator-like modes waiting to be quantized.
Common Mistakes
- Forgetting that the Hamiltonian is an integral over space, not just the density by itself.
- Confusing the Lagrangian density with the full Lagrangian .
- Treating as if it were always equal to . That happens for the free scalar field, but not in every theory.
- Using ordinary partial derivatives where functional derivatives are required.
- Forgetting that the gradient term contributes with an integration by parts when computing .
- Thinking that the Hamiltonian formalism changes the physical content of the theory. It does not; it reorganizes it.
- Missing the point that the canonical formalism is needed because it prepares the theory for quantization.
Short Summary
Hamiltonian field theory generalizes the canonical structure of classical mechanics to systems with infinitely many degrees of freedom distributed over space. The field plays the role of a generalized coordinate, and the conjugate momentum field is defined from the Lagrangian density by differentiation with respect to . The Hamiltonian density is obtained through a local Legendre transform,
and the total Hamiltonian is the spatial integral of this density. Because the Hamiltonian depends on whole field configurations, it is a functional, and Hamilton’s equations are written using functional derivatives. Applied to the free real scalar field, this formalism reproduces the Klein-Gordon equation and provides the canonical framework needed for later quantization.
Practice Problems
-
Explain in your own words why a field can be thought of as an infinite collection of coupled degrees of freedom.
-
Starting from
compute the conjugate momentum field and the Hamiltonian density.
-
For the free scalar field, derive the Hamiltonian density step by step from the Lagrangian density.
-
Why is the Hamiltonian in field theory a functional rather than an ordinary function?
-
Write the field-theoretic Hamilton equations and explain how they generalize the ordinary Hamilton equations of mechanics.
-
Show explicitly how the first Hamilton equation for the free scalar field gives .
-
Compute the contribution of the mass term
to the functional derivative .
-
Explain why the spatial gradient term in the Hamiltonian density leads to a Laplacian in the equation of motion.
-
A student says: “The Hamiltonian density is the Hamiltonian.” Explain precisely why that statement is incomplete.
-
Why is Hamiltonian field theory the natural starting point for canonical quantization?
Related Exercise Sheets
Use these sheets to reinforce the ideas from this lesson with guided practice.
A full conceptual introduction to quantum field theory, following the opening lecture and explaining why modern physics moves from particles in space to quantum fields defined over spacetime.
A full introduction to canonical quantization for fields, showing how classical field variables become operators, why equal-time commutators are imposed, and how Fourier modes turn a free field into a continuum of quantum harmonic oscillators.