Hamiltonian Mechanics#
Introduction#
Recall that we can write the Euler-Lagrange equations as
where
and
and \(L(q^I, \dot{q}^I,t)\) is the Lagrangian.
We can, in general, solve for (76) to get \(\dot{q}^I(q^I,p_I)\). Now the state of the system can be described by specifying \((q^I, p_I)\); these are coordinates in phase space. We will demonstrate below that if we start with
then we can rewrite the equations of motion as
Note that when the Lagrangian is time-independent, the quantity (78) is exactly the quantity which we showed, via Noether’s theorem, is conserved. \(H\), called the Hamiltonian is the energy of this system. The equations {eq}`he_intro_ are known as Hamilton’s Equations and they are completely equivalent to the Euler-Lagrange equations.
Why would we daopt this formalism?
If \(I \in (1,\ldots, D)\), Hamilton’s equations are \(2D\) first order differential equations. If we specify the data \((q^I,p_I)\) at any initial time \(t_0\), these equations have a unique solution for all future times. Thus the state of the system at any time is copmpletely described by \((q^I, p_I)\). The set of all states so specified is known as phase space. Thus, the space of states is given by \(2D\) independent variables, and we can formulate mechanics as an initial value problem.
Because Hamilton’s equations are first order in time derivatives, they are particularly amenable to numerical integration.
Phase space has a geometric structure (it is a symplectic manifold) that gives powerful insights into the dynamics; Hamilton’s equations are formulated nicely using this structure.
The description and consequence of symmetries emerges very naturally.
This structure emerges naturally from quantum mechanics.
Derivation from Lagrangian dynamics#
We start with the definition of generalized momentum in Lagrangian mechanics:
Assume this can be uniquely solved for \(\dot{q}^I = \dot{q}^I(q^I,p_I)\). We can then performa a Legendre transformation to define the Hamiltonian \(H(p,q)\):
The Legendre transform appears in both classical mechanics and, in various ways, in statistical mechanics. I will have to put aside the beautiful geometric interpretation of the transform, but I highly recommend [Zia et al., 2009], whih you can find on the arXiv.org website.
Given this we can compute
where the final term comes from using the chain rul to compute \(\del L/\del p_I\). Using (80), this last term becomes equivalent to the second term on the right hand side, and we have one set of Hamilton’s equations:
Similarly,
where in the first term on the right hand side, we have used the fact that we are keepig all \(P_J\) fixed in the partial derivative; the second two terms are the derivative of \(L(q,\dot{q}(q,p))\) using the chain rule. Using (80), the first and last terms on the right hand side cancel. Finally, we can use the EUler-Lagrange equation for the middle term to set
so we have the remaining set of Hamilton’s equations,
Examples#
Particle in a conservative force field.
Start with the Lagrangian
The generalized momentum is
so that \(\dot{\vec{x}} = \frac{\vec p}{m}\).
The Hamiltonian is thus
which is indeed the total energy (kinetic plus potential). We can write Hamilton’s equations as
The first is the known relation between momentum and velocity; the second is then Newton’s laws written in terms of the momentum. If we take the time derivative of the first equation, multiply by \(m\), and use the second to solve for \(\dot{p}_i\) we have the classic second law:
Note that this gives three second order differential equation; Hamilton’s equations give a natural unpacking of this equation into six first-order differential equations which are often easier to integrate (analytically or numerically).
Free particle in polar coordinates
Here we start with
The generalzied momenta are:
Thus the Hamiltonian is:
Hamilton’s equations become:
Note that this last equation is a re-statement of the conservaton of angular momentum, following from \(\phi\) being a cyclic coordinate.
Charged prrticle in a magnetic field.
As we stated before, if \(\vec{B} = \vec{\nabla}\times\vec{A}\) for the vector potential \(\vec{A}\),the Lagrangian is:
The conjugate momentum is
With a little work we find:
Poisson brackets#
Poisson brackets will seem like a simple rewriting of Hamilton’s equations, but they are an important part of the geometry of classical mechanics; yield Noether’s theorem as a near-tautology; and have an important quantum-mechanical analog.
We can see them emerge as follows, and along the way introduce another important concept. Any observable quantity \(A\) in classical mechanics should be a function of the state of the system, and thus of phase space: \(A = A(q^I, p_I)\). (It could be constant in which case classical mechanics has nothing to say about it.). Two examples are the \(i\)th component of angular momentum \(L_i = \half \eps_{ijk} x^j p_k\); and the energy which is the Hamiltonian itself \(H(q, p)\).
How does this observable change along classical trajectories?
The first line is just the chain rule; the second uses Hamilton’s equations; the last introduces the Poisson bracket. More generally, for two observables \(A, B\), the Poisson bracket is defined as:
and satisfies two important properties:
Antisymmetry: \(\{A,B\} = - \{B,A\}\).
Jacobi identity: \(\{A,\{B,C\}\} + \{C,\{A,B\}\} + \{B, \{C,A\}\} = 0\).
Finally, the phase space variables we have written so far satisfy simple, “canonical” Poisson bracket relations:
Note that given what we drivaed at the top, \(\frac{dA}{dt} = \{A, H\}\), the Hamiltonian generates flows in phase space of all observable quantities. These include the positions and momenta themselves; Hamilton’s equations can be compactly written as
The minus sign in the second part of Hamilton’s equations is taken care of by the sign in the definition of the bracket, needed for the antisymmetry property.
The Poisson bracket is a central object in classical mechanics in defining the geometry of phase space and deriving consequences of teh dynamics. One consequence we will not derive here is Liouville’s theorem, which states that if we take a small volume of phase space and evolve each point forward using Hamilton’s equations, the volume does not change.
Canonical transformations#
As we discussed, one advantage of the Lagrangian formulation is that you can perform point cordinate transformations \(q' = q'(q,t)\) at the level of the Lagrangian; that is, we apply the Euler-Lagrange equations for \(q'\) to the transformed Lagrangian \({\tilde L}(q',\dot{q}',t) = L(q(q'), \frac{d}{dt}q(q',t), t)\).
In Hamiltonian mechanics we can work with more generat canonical transformations, which are a class of coordinate transformations on phase space that preserve the structure of the Poisson brackets and of Hamilton’s equations. That is, we consider \(Q^A = Q^A(p_I, q^I)\), \(P_A = P_a(q^I, p_I)\) (with \(A = 1,\ldots,D)\)) such that Hamilton’s equations retain their form
for some \(K(Q,P,t)\). One can show that canonical transformations also preserve the Poisson bracket structure, that is, that
The subject of canonical transformations is of deep importance in Hamiltonian mechanics. We will have to give it short shrift, but I recommend consulting one or more textbooks which cover this, such as [Goldstein et al., 2002], [Landau and Lifshitz, 1982].
We will focus here on infinitesimal canonical transformations. I will state without justification that these can be described by a single generating function \(g(q^I,p_J,t)\), with the transformations being
for \(\eps \ll 1\), where we only consider effects of these transformations to \({\cal O}(\eps)\).
Under this canonical transformation any observable \(A(p,q)\) transforms to order \({\cal O}(\eps)\) as:
we cal \(f\) the generator or generating function of this transformation.
Note that such canonical transformations include time evolution, for which the generator is the Hamiltonian. You can also show that translations \(q^I \to q^I + \eps a^I\) are generated by \(f = \eps a^I p_I\); and in 2 dimensions, rotations about the origin \(\phi to \phi + \eps \Delta\) are generated by \(f = \eps \Delta L_z\), where \(L_z\) is the angular momentum.: for the latter, using \(L_z = x p_y - y -Px\), we can show
which describes the rotation of \((x,y)\) as a vector by the infinitesimal angle \(\eps \Delta\). Similarly, we can show that \(p_x, p_y\) rotate as a vector.
Symmetries#
In Hamiltonian mechanics, a symmetry is a canonical transformation that preserves the form of the Hamiltonian. Under infitesimal transformations, this means that:
But we also know that if we consider \(f\) as an observable, Hamilton’s equations imply that for trajectories satisfying the equations of motion, if \(f\) is time-independent, then:
So \(f\) is a conserved quantity. The Hamiltonian version of Noether’s theorem falls out almost automatically (though a lot went into the setup). For example, we have shown that translations by \(\eps a^I\) are generated by \(f = a^I p_I\). If this translation is an (infinitesimal) symmetry, then \(\delta H = \eps \{H, f\} = \eps a^I \frac{\del H}{\del q^I}\), so \(H\) is independent of the direction pointing along \(a^I\), and the conjugate momentum \(a^I p_I\) is conserved.
Note that time evolution itself is a canonical transformation, generated by \(H\). The conservation of energy itself follows from time translation invariance from the following argument:
where we have used Hamiltono’s equations to get to the second line, and used the antisymmetry of the bracket which implies that \(\{A,A\} = 0\) for any \(A\). Thus energy is conserved if the Hamiltonian lacks any explicit time dependence.