# .

In Hamiltonian mechanics, a canonical transformation is a change of canonical coordinates (q,p,t) → (Q,P,t) that preserves the form of Hamilton's equations (that is, the new Hamilton equations that result from the new Hamiltonian constructed by transformation may be simply obtained by substituting the old variables by the new ones), although it might not preserve the Hamiltonian itself. This is sometimes known as form invariance. Canonical transformations are useful in their own right, and also form the basis for the Hamilton–Jacobi equations (a useful method for calculating conserved quantities) and Liouville's theorem (itself the basis for classical statistical mechanics).

Since Lagrangian mechanics is based on generalized coordinates, transformations of the coordinates q → Q do not affect the form of Lagrange's equations and, hence, do not affect the form of Hamilton's equations if we simultaneously change the momentum by a Legendre transform into

$$P_i=\frac{\partial L}{\partial \dot{Q}_i}.$$

Therefore, coordinate transformations (also called point transformations) are a type of canonical transformation. However, the class of canonical transformations is much broader, since the old generalized coordinates, momenta and even time may be combined to form the new generalized coordinates and momenta. Canonical transformations that do not include the time explicitly are called restricted canonical transformations (many textbooks consider only this type).

For clarity, we restrict the presentation here to calculus and classical mechanics. Readers familiar with more advanced mathematics such as cotangent bundles, exterior derivatives and symplectic manifolds should read the related symplectomorphism article. (Canonical transformations are a special case of a symplectomorphism.) However, a brief introduction to the modern mathematical description is included at the end of this article.

Notation

Boldface variables such as \mathbf{q} represent a list of N generalized coordinates, e.g.,

$$\mathbf{q} \equiv (q_{1}, q_{2}, \ldots, q_{N-1}, q_{N})$$

that need not transform like a vector under rotation. As usual, a dot over a variable or list signifies the time derivative, e.g., \dot{\mathbf{q}} \equiv \frac{d\mathbf{q}}{dt}. The dot product notation between two lists of the same number of coordinates is a shorthand for the sum of the products of corresponding components, e.g.,

$$\mathbf{p} \cdot \mathbf{q} \equiv \sum_{k=1}^{N} p_{k} q_{k}.$$

The dot product (also known as an "inner product") maps the two coordinate lists into one variable representing a single numerical value.
Direct approach

The functional form of Hamilton's equations is

$$\dot{\mathbf{p}} = -\frac{\partial H}{\partial \mathbf{q}}$$
$$\dot{\mathbf{q}} =~~\frac{\partial H}{\partial \mathbf{p}}$$

By definition, the transformed coordinates have analogous dynamics

$$\dot{\mathbf{P}} = -\frac{\partial K}{\partial \mathbf{Q}}$$
$$\dot{\mathbf{Q}} =~~\frac{\partial K}{\partial \mathbf{P}}$$

where K(Q,P) is a new Hamiltonian that must be determined.

In general, a transformation (q,p,t) → (Q,P,t) does not preserve the form of Hamilton's equations. For time independent transformations between (q,p) and (Q,P) we may check if the transformation is restricted canonical, as follows. Since restricted transformations have no explicit time dependence (by construction), the time derivative of a new generalized coordinate Qm is

$$\dot{Q}_{m} = \frac{\partial Q_{m}}{\partial \mathbf{q}} \cdot \dot{\mathbf{q}} + \frac{\partial Q_{m}}{\partial \mathbf{p}} \cdot \dot{\mathbf{p}} = \frac{\partial Q_{m}}{\partial \mathbf{q}} \cdot \frac{\partial H}{\partial \mathbf{p}} - \frac{\partial Q_{m}}{\partial \mathbf{p}} \cdot \frac{\partial H}{\partial \mathbf{q}} = \lbrace Q_m , H \rbrace$$

where \lbrace . , . \rbrace is the Poisson bracket.

We also have the identity for the conjugate momentum Pm

$$\frac{\partial H}{\partial P_{m}} = \frac{\partial H}{\partial \mathbf{q}} \cdot \frac{\partial \mathbf{q}}{\partial P_{m}} + \frac{\partial H}{\partial \mathbf{p}} \cdot \frac{\partial \mathbf{p}}{\partial P_{m}}$$

If the transformation is canonical, these two must be equal, resulting in the equations

$$\left( \frac{\partial Q_{m}}{\partial p_{n}}\right)_{\mathbf{q}, \mathbf{p}} = -\left( \frac{\partial q_{n}}{\partial P_{m}}\right)_{\mathbf{Q}, \mathbf{P}}$$

$$\left( \frac{\partial Q_{m}}{\partial q_{n}}\right)_{\mathbf{q}, \mathbf{p}} = \left( \frac{\partial p_{n}}{\partial P_{m}}\right)_{\mathbf{Q}, \mathbf{P}}$$

The analogous argument for the generalized momenta Pm leads to two other sets of equations

$$\left( \frac{\partial P_{m}}{\partial p_{n}}\right)_{\mathbf{q}, \mathbf{p}} = \left( \frac{\partial q_{n}}{\partial Q_{m}}\right)_{\mathbf{Q}, \mathbf{P}}$$

$$\left( \frac{\partial P_{m}}{\partial q_{n}}\right)_{\mathbf{q}, \mathbf{p}} = -\left( \frac{\partial p_{n}}{\partial Q_{m}}\right)_{\mathbf{Q}, \mathbf{P}}$$

These are the direct conditions to check whether a given transformation is canonical.
Liouville's theorem

The direct conditions allow us to prove Liouville's theorem, which states that the volume in phase space is conserved under canonical transformations, i.e.,

$$\int d\mathbf{q} d\mathbf{p} = \int d\mathbf{Q} d\mathbf{P}$$

By calculus, the latter integral must equal the former times the Jacobian J

$$\int d\mathbf{Q} d\mathbf{P} = \int J d\mathbf{q} d\mathbf{p}$$

where the Jacobian is the determinant of the matrix of partial derivatives, which we write as

$$J \equiv \frac{\partial (\mathbf{Q}, \mathbf{P})}{\partial (\mathbf{q}, \mathbf{p})}$$

Exploiting the "division" property of Jacobians yields

$$J \equiv \frac{\partial (\mathbf{Q}, \mathbf{P})}{\partial (\mathbf{q}, \mathbf{P})} \left/ \frac{\partial (\mathbf{q}, \mathbf{p})}{\partial (\mathbf{q}, \mathbf{P})} \right.$$

Eliminating the repeated variables gives

$$J \equiv \frac{\partial (\mathbf{Q})}{\partial (\mathbf{q})} \left/ \frac{\partial (\mathbf{p})}{\partial (\mathbf{P})} \right.$$

Application of the direct conditions above yields J=1.
Generating function approach
Main article: Generating function (physics)

To guarantee a valid transformation between $$(\mathbf{q}, \mathbf{p}, H)$$ and $$(\mathbf{Q}, \mathbf{P}, K)$$, we may resort to an indirect generating function approach. Both sets of variables must obey Hamilton's principle. That is the Action Integral over the Lagrangian $$\mathcal{L}_{qp}=\mathbf{p} \cdot \dot{\mathbf{q}} - H(\mathbf{q}, \mathbf{p}, t)$$ and \mathcal{L}_{QP}=\mathbf{P} \cdot \dot{\mathbf{Q}} - K(\mathbf{Q}, \mathbf{P}, t) respectively, obtained by the Hamiltonian via ("inverse") Legendre transformation, both must be stationary (so that one can use the Euler-Lagrange equations to arrive at equations of the above-mentioned and designated form; as it is shown for example here):

$$\delta \int_{t_{1}}^{t_{2}} \left[ \mathbf{p} \cdot \dot{\mathbf{q}} - H(\mathbf{q}, \mathbf{p}, t) \right] dt = 0$$

$$\delta \int_{t_{1}}^{t_{2}} \left[ \mathbf{P} \cdot \dot{\mathbf{Q}} - K(\mathbf{Q}, \mathbf{P}, t) \right] dt = 0$$

To satisfy both variational integrals, we must have

$$\lambda \left[ \mathbf{p} \cdot \dot{\mathbf{q}} - H(\mathbf{q}, \mathbf{p}, t) \right] = \mathbf{P} \cdot \dot{\mathbf{Q}} - K(\mathbf{Q}, \mathbf{P}, t) + \frac{dG}{dt}$$

This equation holds because the Lagrangian is not unique, one can always multiply by a constant \lambda and add a total time derivative $$\frac{dG}{dt}$$ and yield the same equations of motion (see for reference: http://en.wikibooks.org/wiki/Classical_Mechanics/Lagrange_Theory#Is_the_Lagrangian_unique.3F).

In general, the scaling factor \lambda is set equal to one; canonical transformations for which \lambda \neq 1 are called extended canonical transformations. $$\frac{dG}{dt}$$ is kept, otherwise the problem whould be rendered trivial and there would be not much freedom for the new canonical variables to differ from the old ones.

Here G is a generating function of one old canonical coordinate (\mathbf{q} or \mathbf{p}), one new canonical coordinate (\mathbf{Q} or \mathbf{P}) and (possibly) the time t. Thus, there are four basic types of generating functions, depending on the choice of variables. As will be shown below, the generating function will define a transformation from old to new canonical coordinates, and any such transformation $$(\mathbf{q}, \mathbf{p}) \rightarrow (\mathbf{Q}, \mathbf{P})$$ is guaranteed to be canonical.
Type 1 generating function

The type 1 generating function G_{1} depends only on the old and new generalized coordinates

$$G \equiv G_{1}(\mathbf{q}, \mathbf{Q}, t)$$

To derive the implicit transformation, we expand the defining equation above

$$\mathbf{p} \cdot \dot{\mathbf{q}} - H(\mathbf{q}, \mathbf{p}, t) = \mathbf{P} \cdot \dot{\mathbf{Q}} - K(\mathbf{Q}, \mathbf{P}, t) + \frac{\partial G_{1}}{\partial t} + \frac{\partial G_{1}}{\partial \mathbf{q}} \cdot \dot{\mathbf{q}} + \frac{\partial G_{1}}{\partial \mathbf{Q}} \cdot \dot{\mathbf{Q}}$$

Since the new and old coordinates are each independent, the following 2N+1 equations must hold

$$\mathbf{p} = ~~\frac{\partial G_{1}}{\partial \mathbf{q}}$$
$$\mathbf{P} = -\frac{\partial G_{1}}{\partial \mathbf{Q}}$$
$$K = H + \frac{\partial G_{1}}{\partial t}$$

These equations define the transformation $$(\mathbf{q}, \mathbf{p}) \rightarrow (\mathbf{Q}, \mathbf{P})$$ as follows. The first set of N equations

$$\mathbf{p} = ~~\frac{\partial G_{1}}{\partial \mathbf{q}}$$

define relations between the new generalized coordinates \mathbf{Q} and the old canonical coordinates $$(\mathbf{q},\mathbf{p}) \( . Ideally, one can invert these relations to obtain formulae for each Q_{k} as a function of the old canonical coordinates. Substitution of these formulae for the \mathbf{Q} coordinates into the second set of N equations \( \mathbf{P} = -\frac{\partial G_{1}}{\partial \mathbf{Q}}$$

yields analogous formulae for the new generalized momenta \mathbf{P} in terms of the old canonical coordinates (\mathbf{q},\mathbf{p}). We then invert both sets of formulae to obtain the old canonical coordinates (\mathbf{q},\mathbf{p}) as functions of the new canonical coordinates (\mathbf{Q},\mathbf{P}). Substitution of the inverted formulae into the final equation

$$K = H + \frac{\partial G_{1}}{\partial t}$$

yields a formula for K as a function of the new canonical coordinates (\mathbf{Q},\mathbf{P}).

In practice, this procedure is easier than it sounds, because the generating function is usually simple. For example, let

$$G_{1} \equiv \mathbf{q} \cdot \mathbf{Q}$$

This results in swapping the generalized coordinates for the momenta and vice versa

$$\mathbf{p} = ~~\frac{\partial G_{1}}{\partial \mathbf{q}} = \mathbf{Q}$$
$$\mathbf{P} = -\frac{\partial G_{1}}{\partial \mathbf{Q}} = -\mathbf{q}$$

and K=H. This example illustrates how independent the coordinates and momenta are in the Hamiltonian formulation; they're equivalent variables.
Type 2 generating function

The type 2 generating function $$G_{2}$$ depends only on the old generalized coordinates and the new generalized momenta

$$G \equiv -\mathbf{Q} \cdot \mathbf{P} + G_{2}(\mathbf{q}, \mathbf{P}, t)$$

where the $$-\mathbf{Q} \cdot \mathbf{P}$$ terms represent a Legendre transformation to change the right-hand side of the equation below. To derive the implicit transformation, we expand the defining equation above

$$\mathbf{p} \cdot \dot{\mathbf{q}} - H(\mathbf{q}, \mathbf{p}, t) = -\mathbf{Q} \cdot \dot{\mathbf{P}} - K(\mathbf{Q}, \mathbf{P}, t) + \frac{\partial G_{2}}{\partial t} + \frac{\partial G_{2}}{\partial \mathbf{q}} \cdot \dot{\mathbf{q}} + \frac{\partial G_{2}}{\partial \mathbf{P}} \cdot \dot{\mathbf{P}}$$

Since the old coordinates and new momenta are each independent, the following 2N+1 equations must hold

$$\mathbf{p} = \frac{\partial G_{2}}{\partial \mathbf{q}}$$
$$\mathbf{Q} = \frac{\partial G_{2}}{\partial \mathbf{P}}$$
$$K = H + \frac{\partial G_{2}}{\partial t}$$

These equations define the transformation $$(\mathbf{q}, \mathbf{p}) \rightarrow (\mathbf{Q}, \mathbf{P})$$ as follows. The first set of N equations

$$\mathbf{p} = \frac{\partial G_{2}}{\partial \mathbf{q}}$$

define relations between the new generalized momenta $$\mathbf{P}$$ and the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$. Ideally, one can invert these relations to obtain formulae for each $$P_{k}$$ as a function of the old canonical coordinates. Substitution of these formulae for the $$\mathbf{P}]) coordinates into the second set of N equations \( \mathbf{Q} = \frac{\partial G_{2}}{\partial \mathbf{P}}$$

yields analogous formulae for the new generalized coordinates \mathbf{Q} in terms of the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$. We then invert both sets of formulae to obtain the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$ as functions of the new canonical coordinates $$(\mathbf{Q},\mathbf{P})$$. Substitution of the inverted formulae into the final equation

$$K = H + \frac{\partial G_{2}}{\partial t}$$

yields a formula for K as a function of the new canonical coordinates (\mathbf{Q},\mathbf{P}).

In practice, this procedure is easier than it sounds, because the generating function is usually simple. For example, let

$$G_{2} \equiv \mathbf{g}(\mathbf{q}; t) \cdot \mathbf{P}$$

where $$\mathbf{g}$$ is a set of N functions. This results in a point transformation of the generalized coordinates

$$\mathbf{Q} = \frac{\partial G_{2}}{\partial \mathbf{P}} = \mathbf{g}(\mathbf{q}; t)$$

Type 3 generating function

The type 3 generating function G_{3} depends only on the old generalized momenta and the new generalized coordinates

$$G \equiv \mathbf{q} \cdot \mathbf{p} + G_{3}(\mathbf{p}, \mathbf{Q}, t)$$

where the $$\mathbf{q} \cdot \mathbf{p}$$ terms represent a Legendre transformation to change the left-hand side of the equation below. To derive the implicit transformation, we expand the defining equation above

$$-\mathbf{q} \cdot \dot{\mathbf{p}} - H(\mathbf{q}, \mathbf{p}, t) = \mathbf{P} \cdot \dot{\mathbf{Q}} - K(\mathbf{Q}, \mathbf{P}, t) + \frac{\partial G_{3}}{\partial t} + \frac{\partial G_{3}}{\partial \mathbf{p}} \cdot \dot{\mathbf{p}} + \frac{\partial G_{3}}{\partial \mathbf{Q}} \cdot \dot{\mathbf{Q}}$$

Since the new and old coordinates are each independent, the following 2N+1 equations must hold

$$\mathbf{q} = -\frac{\partial G_{3}}{\partial \mathbf{p}}$$
$$\mathbf{P} = -\frac{\partial G_{3}}{\partial \mathbf{Q}}$$
$$K = H + \frac{\partial G_{3}}{\partial t}$$

These equations define the transformation $$(\mathbf{q}, \mathbf{p}) \rightarrow (\mathbf{Q}, \mathbf{P})$$ as follows. The first set of N equations

$$\mathbf{q} = -\frac{\partial G_{3}}{\partial \mathbf{p}}$$

define relations between the new generalized coordinates $$\mathbf{Q}$$ and the old canonical coordinates $$(\mathbf{q},\mathbf{p}$$ \) . Ideally, one can invert these relations to obtain formulae for each Q_{k} as a function of the old canonical coordinates. Substitution of these formulae for the \mathbf{Q} coordinates into the second set of N equations

\mathbf{P} = -\frac{\partial G_{3}}{\partial \mathbf{Q}}

yields analogous formulae for the new generalized momenta \mathbf{P} in terms of the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$. We then invert both sets of formulae to obtain the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$ as functions of the new canonical coordinates $$(\mathbf{Q},\mathbf{P})$$. Substitution of the inverted formulae into the final equation

$$K = H + \frac{\partial G_{3}}{\partial t}$$

yields a formula for K as a function of the new canonical coordinates (\mathbf{Q},\mathbf{P}).

In practice, this procedure is easier than it sounds, because the generating function is usually simple.
Type 4 generating function

The type 4 generating function $$G_{4}(\mathbf{p}, \mathbf{P}, t)$$ depends only on the old and new generalized momenta

$$G \equiv \mathbf{q} \cdot \mathbf{p} - \mathbf{Q} \cdot \mathbf{P} + G_{4}(\mathbf{p}, \mathbf{P}, t)$$

where the \mathbf{q} \cdot \mathbf{p} - \mathbf{Q} \cdot \mathbf{P} terms represent a Legendre transformation to change both sides of the equation below. To derive the implicit transformation, we expand the defining equation above

$$-\mathbf{q} \cdot \dot{\mathbf{p}} - H(\mathbf{q}, \mathbf{p}, t) = -\mathbf{Q} \cdot \dot{\mathbf{P}} - K(\mathbf{Q}, \mathbf{P}, t) + \frac{\partial G_{4}}{\partial t} + \frac{\partial G_{4}}{\partial \mathbf{p}} \cdot \dot{\mathbf{p}} + \frac{\partial G_{4}}{\partial \mathbf{P}} \cdot \dot{\mathbf{P}}$$

Since the new and old coordinates are each independent, the following 2N+1 equations must hold

$$\mathbf{q} = -\frac{\partial G_{4}}{\partial \mathbf{p}}$$
$$\mathbf{Q} = ~~\frac{\partial G_{4}}{\partial \mathbf{P}} K = H + \frac{\partial G_{4}}{\partial t} These equations define the transformation \( (\mathbf{q}, \mathbf{p}) \rightarrow (\mathbf{Q}, \mathbf{P})$$ as follows. The first set of N equations

$$\mathbf{q} = -\frac{\partial G_{4}}{\partial \mathbf{p}}$$

define relations between the new generalized momenta $$\mathbf{P}$$ and the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$. Ideally, one can invert these relations to obtain formulae for each P_{k} as a function of the old canonical coordinates. Substitution of these formulae for the $$\mathbf{P}$$ coordinates into the second set of N equations

$$\mathbf{Q} = \frac{\partial G_{4}}{\partial \mathbf{P}}$$

yields analogous formulae for the new generalized coordinates $$\mathbf{Q}$$ in terms of the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$. We then invert both sets of formulae to obtain the old canonical coordinates $$(\mathbf{q},\mathbf{p})$$ as functions of the new canonical coordinates $$(\mathbf{Q},\mathbf{P})$$. Substitution of the inverted formulae into the final equation

$$K = H + \frac{\partial G_{4}}{\partial t}$$

yields a formula for K as a function of the new canonical coordinates (\mathbf{Q},\mathbf{P}).
Motion as a canonical transformation

Motion itself (or, equivalently, a shift in the time origin) is a canonical transformation. If $$\mathbf{Q}(t) \equiv \mathbf{q}(t+\tau)$$ and $$\mathbf{P}(t) \equiv \mathbf{p}(t+\tau)$$, then Hamilton's principle is automatically satisfied

$$\delta \int_{t_{1}}^{t_{2}} \left[ \mathbf{P} \cdot \dot{\mathbf{Q}} - K(\mathbf{Q}, \mathbf{P}, t) \right] dt = \delta \int_{t_{1}+\tau}^{t_{2}+\tau} \left[ \mathbf{p} \cdot \dot{\mathbf{q}} - H(\mathbf{q}, \mathbf{p}, t+\tau) \right] dt = 0$$

since a valid trajectory $$(\mathbf{q}(t), \mathbf{p}(t))$$ should always satisfy Hamilton's principle, regardless of the endpoints.
Modern mathematical description

In mathematical terms, canonical coordinates are any coordinates on the phase space (cotangent bundle) of the system that allow the canonical one-form to be written as

$$\sum_i p_i\,dq^i$$

up to a total differential (exact form). The change of variable between one set of canonical coordinates and another is a canonical transformation. The index of the generalized coordinates \mathbf{q} is written here as a superscript $$(q^{i})$$, not as a subscript as done above (q_{i}). The superscript conveys the contravariant transformation properties of the generalized coordinates, and does not mean that the coordinate is being raised to a power. Further details may be found at the symplectomorphism article.
History

The first major application of the canonical transformation was in 1846, by Charles Delaunay, in the study of the Earth-Moon-Sun system. This work resulted in the publication of a pair of large volumes as Mémoires by the French Academy of Sciences, in 1860 and 1867.

Symplectomorphism
Hamilton–Jacobi equation
Liouville's theorem (Hamiltonian)
Mathieu transformation
Linear canonical transformation

References

Landau LD and Lifshitz EM (1976) Mechanics, 3rd. ed., Pergamon Press. ISBN 0-08-021022-8 (hardcover) and ISBN 0-08-029141-4 (softcover).

Goldstein H. (1980) Classical Mechanics, 2nd. ed., Addison-Wesley. ISBN 0-201-02918-9