Canonical transformations and generating functions
Build transformations with a type-2 generating function and verify both the bracket structure and time-dependent Hamiltonian shift.
On this page
The question for today
What you’ll understand
- Check whether a variable change preserves canonical brackets.
- Use the type-2 convention p = ∂F₂/∂q and Q = ∂F₂/∂P.
- Include the explicit time derivative in the transformed Hamiltonian.
A useful change of variables can turn a difficult motion into a simple one, but a random coordinate substitution generally changes the form of Hamilton's equations. A canonical transformation preserves their structure. Generating functions provide a controlled way to construct such transformations rather than guessing them. Their signs and arguments are linked, so the safest method is to state one convention, differentiate it consistently, and check the resulting fundamental brackets.
Preserve the pairing, not just a picture
New variables Q and P are canonical when their mutual Poisson brackets have the same elementary structure as those of q and p. The transformation must also be locally invertible. For one pair, an orientation-preserving area-preserving map satisfies the local symplectic condition, but for several pairs the preservation of total volume alone is weaker. Mixing one position with the wrong momentum can preserve an ordinary determinant while destroying the specific pairings needed for canonical dynamics.
Scaling illustrates why a reciprocal change matters. If Q equals aq with a constant nonzero scale factor, the matching canonical momentum is P equal to p divided by a. Scaling both variables by a would multiply their bracket by the square of a instead. In physical applications the units assigned to the new coordinates may differ from the old units; the canonical product retains action units even though the axes acquire different individual meanings.
Choose the type-2 convention explicitly
A type-2 generating function uses old positions q, new momenta P, and time as independent arguments. Its q derivative gives old momentum; its P derivative gives new position. The transformed Hamiltonian K equals old H expressed in the new variables plus the explicit time derivative of the generating function. That last derivative is taken before substituting the old-to-new relations, holding q and P fixed. Interchanging the argument types without changing the rules is a common source of incorrect signs.
The construction follows by comparing the old and new phase-space action one-forms up to a total differential. For a type-2 function, the relevant boundary expression is F₂ minus the product QP. Boundary terms change endpoint bookkeeping without changing the interior equations under appropriate variations. A single generating-function type need not cover every canonical map globally: its chosen mixed coordinates must form a valid local chart, and another type may be needed where that chart degenerates.
A moving coordinate changes the generator
Take for constant v. The new position is the old position measured from a uniformly moving origin, and the canonical momentum remains p. The extra time derivative contributes minus vP to K. For a free particle this term makes the new position rate equal to laboratory velocity minus v, exactly as a moving-origin description requires. Merely substituting q in H without adding the time term would predict the wrong relative velocity.
This transformation has not yet redefined momentum as mass times relative velocity. That would require an additional momentum shift and a different generating function, with an associated constant energy term. Both descriptions can be canonical, but their variables have different meanings. The example is therefore a reminder to distinguish a change of spatial origin from a complete Galilean boost convention. Verify the equations and the variable definitions together instead of deciding correctness by whether K resembles a familiar kinetic energy expression.
Work it through
Transform a free particle into moving coordinates
Use , , and . At , , , find Q, P, K, and the new position rate.
Differentiate: and . Therefore P = 8 and Q = 4. The fundamental bracket is at fixed time.
The old Hamiltonian is . The explicit time derivative is , so the new Hamiltonian is . A negative K is allowed here.
Differentiate the transformed expression : . Laboratory velocity is 4 and the coordinate origin moves at 3, so direct relative-motion reasoning also gives 1.
Q = 4, P = 8, K = −8, and Q̇ = 1. The changed numerical Hamiltonian correctly generates motion relative to the moving origin.
The living notebook
Explore the model
Interactive lab · vectors
Check a simple canonical rotation
Interpret the vector's two components as dimensionless q and p. Predict the result of rotating the unit vector by 90°, then adjust angle and check the components. The full rotation matrix has determinant one and preserves the canonical bracket for one pair. The actual lab has angle and magnitude controls only; it does not generate type-2 functions, transform a Hamiltonian, or test the several-pair symplectic condition.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA transformation's canonical character is an algebraic pairing condition, even when a simple rotation supplies an intuitive example.
Pause & reason
Check your understanding
Your turn
Try it yourself
Take with constant b and old Hamiltonian . Find Q, p, and K, keeping the type-2 time derivative explicit.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Differentiate while q and P are independent. Then replace q by Q in the final expression.
Compare with the solution
The relations are and . The explicit time derivative is , giving . Hence , while as the free-particle motion requires. The new momentum changes because the coordinate definition depends on time, not because a laboratory force has appeared.
Keep the idea
Take it with you
- Canonical maps preserve the full fundamental bracket structure.
- Type-2 derivatives use old positions and new momenta as independent arguments.
- Explicit time dependence adds ∂F₂/∂t to the new Hamiltonian.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.