Hamiltonian Mechanics
Lagrangian mechanics uses position and velocity: $(q, \dot{q})$. Hamiltonian mechanics uses position and momentum: $(q, p)$. This seemingly small change opens up a completely different view of physics — one that leads directly to quantum mechanics.
From Lagrangian to Hamiltonian
The Legendre Transform
We want to switch from $\dot{q}$ to $p$ as our variable. This is done via the Legendre transform.
The conjugate momentum is defined as:
For $L = \frac{1}{2}m\dot{q}^2 - V(q)$, this gives $p = m\dot{q}$, the familiar momentum.
The Hamiltonian is defined as:
where we express $\dot{q}$ in terms of $p$ (by inverting $p = \frac{\partial L}{\partial \dot{q}}$).
Example: Free Particle
For $L = \frac{1}{2}m\dot{q}^2$:
- $p = m\dot{q}$ → $\dot{q} = p/m$
- $H = p \cdot \frac{p}{m} - \frac{1}{2}m\left(\frac{p}{m}\right)^2 = \frac{p^2}{m} - \frac{p^2}{2m} = \frac{p^2}{2m}$
For a particle in a potential:
The Hamiltonian is the total energy (when there's no explicit time dependence).
Hamilton's Equations
The Euler-Lagrange equation (one second-order equation) becomes two first-order equations:
These are Hamilton's equations — the equations of motion in Hamiltonian form.
Start from $H = p\dot{q} - L$. Take the total differential:
$$ dH = \dot{q}\,dp + p\,d\dot{q} - \frac{\partial L}{\partial q}dq - \frac{\partial L}{\partial \dot{q}}d\dot{q} $$Since $p = \frac{\partial L}{\partial \dot{q}}$, the $d\dot{q}$ terms cancel:
$$ dH = \dot{q}\,dp - \frac{\partial L}{\partial q}dq $$But also, since $H = H(q, p)$:
$$ dH = \frac{\partial H}{\partial q}dq + \frac{\partial H}{\partial p}dp $$Comparing coefficients:
$$ \frac{\partial H}{\partial p} = \dot{q} \qquad \frac{\partial H}{\partial q} = -\frac{\partial L}{\partial q} = -\dot{p} $$(using Euler-Lagrange: $\dot{p} = \frac{d}{dt}\frac{\partial L}{\partial \dot{q}} = \frac{\partial L}{\partial q}$)
Phase Space
In Lagrangian mechanics, the state of a system is a point in configuration space: the space of all positions $q$.
In Hamiltonian mechanics, the state is a point in phase space: the space of all $(q, p)$ pairs.
Why Phase Space Matters
Phase space is where physics really lives. Every point represents a complete state — enough to determine the entire future (and past) of the system. Trajectories never cross (determinism). The "flow" of points through phase space encodes all dynamics.
Poisson Brackets
Hamilton's equations have an elegant algebraic structure. Define the Poisson bracket of two functions $f(q,p)$ and $g(q,p)$:
Then Hamilton's equations become:
In fact, for any function $f(q, p, t)$:
Fundamental Poisson Brackets
These are the canonical commutation relations in classical mechanics.
Connection: The Road to Quantum Mechanics
In quantum mechanics, Poisson brackets become commutators:
$$ \{q, p\} = 1 \quad \longrightarrow \quad [\hat{q}, \hat{p}] = i\hbar $$This is the canonical quantization procedure. The entire structure of quantum mechanics follows from replacing $\{,\} \to \frac{1}{i\hbar}[,]$.
Conservation Laws Revisited
A quantity $f(q, p)$ is conserved if $\frac{df}{dt} = 0$. Using our formula:
If $f$ has no explicit time dependence, conservation means $\{f, H\} = 0$.
This is Noether's theorem in Hamiltonian language: conserved quantities are those that Poisson-commute with the Hamiltonian.
Liouville's Theorem
Consider a cloud of initial conditions in phase space — an ensemble of systems. As time evolves, each point moves according to Hamilton's equations.
Liouville's Theorem
The phase space volume occupied by an ensemble is constant in time. The cloud can stretch and twist, but its volume is preserved.
Mathematically, the phase space "fluid" is incompressible:
This has profound consequences:
- Statistical mechanics: Liouville's theorem underlies the microcanonical ensemble
- Information: Phase space volume measures the "information" in a state — it's conserved, so information is conserved
- Chaos: In chaotic systems, volumes are preserved but stretched exponentially in some directions (and compressed in others)
Canonical Transformations
In Lagrangian mechanics, we can change coordinates freely. In Hamiltonian mechanics, we can do even more: we can mix positions and momenta.
A canonical transformation is a change of variables $(q, p) \to (Q, P)$ that preserves the form of Hamilton's equations.
The key requirement: the new variables must satisfy the same Poisson brackets:
This is a much larger group of transformations than just coordinate changes — it's the symplectic group.
Hamilton-Jacobi Theory (Preview)
The deepest formulation of classical mechanics. The idea: find a canonical transformation that makes the new Hamiltonian zero (or trivially simple).
This leads to the Hamilton-Jacobi equation:
where $S(q, t)$ is Hamilton's principal function.
Connection: Hamilton-Jacobi and Quantum Mechanics
The Hamilton-Jacobi equation is the classical limit of the Schrödinger equation. If $\psi = e^{iS/\hbar}$, then in the limit $\hbar \to 0$, the Schrödinger equation becomes Hamilton-Jacobi. This is the deepest link between classical and quantum mechanics.
Comparison: Lagrangian vs Hamiltonian
| Lagrangian | Hamiltonian |
|---|---|
| Variables: $(q, \dot{q})$ | Variables: $(q, p)$ |
| One 2nd-order equation | Two 1st-order equations |
| Configuration space | Phase space |
| Action principle | Symplectic geometry |
| Natural for relativity | Natural for quantum mechanics |
Exercises
- Harmonic oscillator: For $H = \frac{p^2}{2m} + \frac{1}{2}kq^2$, write Hamilton's equations and verify they give $m\ddot{q} = -kq$.
- Poisson brackets: Show that $\{L_x, L_y\} = L_z$ for angular momentum components $L_i = \epsilon_{ijk} q_j p_k$.
- Canonical transformation: Show that the transformation $Q = p$, $P = -q$ is canonical (preserves Poisson brackets).
- Phase portrait: Sketch the phase space trajectories for a pendulum: $H = \frac{p^2}{2mL^2} - mgL\cos\theta$. Identify the equilibria and separatrix.
Key Takeaways
- Hamiltonian mechanics uses $(q, p)$ instead of $(q, \dot{q})$
- Hamilton's equations: $\dot{q} = \partial H/\partial p$, $\dot{p} = -\partial H/\partial q$
- Phase space encodes the complete state; trajectories never cross
- Poisson brackets give dynamics: $\dot{f} = \{f, H\}$
- $\{q, p\} = 1$ becomes $[\hat{q}, \hat{p}] = i\hbar$ in quantum mechanics
- Liouville: phase space volume is conserved