Canonical transformation

In Hamiltonian mechanics, a canonical transformation is a change of canonical coordinates $(q, p) → (Q, P)$ that preserves the form of Hamilton's equations. This is sometimes known as form invariance. Although Hamilton's equations are preserved, it need not preserve the explicit form of the Hamiltonian itself. 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 the momentum is simultaneously changed by a Legendre transformation into $$ P_i = \frac{ \partial L }{ \partial \dot{Q}_i }\ ,$$ where $$\left\{\ (P_1, Q_1),\ (P_2, Q_2),\ (P_3, Q_3),\ \ldots\ \right\} $$ are the new co‑ordinates, grouped in canonical conjugate pairs of momenta $$P_i $$ and corresponding positions $$Q_i,$$ for $$i = 1, 2, \ldots\ N,$$ with $$N $$ being the number of degrees of freedom in both co‑ordinate systems.

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).

Modern mathematical descriptions of canonical transformations are considered under the broader topic of symplectomorphism which covers the subject with advanced mathematical prerequisites such as cotangent bundles, exterior derivatives and symplectic manifolds.

Notation
Boldface variables such as $q$ represent a list of $N$ generalized coordinates that need not transform like a vector under rotation and similarly $p$ represents the corresponding generalized momentum, e.g., $$\begin{align} \mathbf{q} &\equiv \left (q_{1}, q_{2}, \ldots, q_{N-1}, q_{N} \right )\\ \mathbf{p} &\equiv \left (p_{1}, p_{2}, \ldots, p_{N-1}, p_{N} \right ). \end{align}$$

A dot over a variable or list signifies the time derivative, e.g., $$\dot{\mathbf{q}} \equiv \frac{d\mathbf{q}}{dt}$$and the equalities are read to be satisfied for all coordinates, for example:$$\dot{\mathbf{p}} = -\frac{\partial f}{\partial \mathbf{q}}\quad \Longleftrightarrow \quad  \dot = -\frac{\partial f}{\partial {q_i}}\quad (\forall  i). $$

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. The coordinates after transformation are similarly labelled with $Q$ for transformed generalized coordinates and $P$ for transformed generalized momentum.

Conditions for restricted canonical transformation
Restricted canonical transformations are coordinate transformations where transformed coordinates $Q$ and $P$ do not have explicit time dependence, ie. $\mathbf Q=\mathbf Q(\mathbf q,\mathbf p)$  and $\mathbf  P=\mathbf P(\mathbf q,\mathbf p) $. The functional form of Hamilton's equations is$$\begin{align} \dot{\mathbf{p}} &= -\frac{\partial H}{\partial \mathbf{q}} \\ \dot{\mathbf{q}} &= \frac{\partial H}{\partial \mathbf{p}} \end{align}$$ In general, a transformation $(q, p) → (Q, P)$ does not preserve the form of Hamilton's equations but in the absence of time dependence in transformation, some simplifications are possible. Following the formal definition for a canonical transformation, it can be shown that for this type of transformation, the new Hamiltonian (sometimes called the Kamiltonian ) can be expressed as:$$K(\mathbf Q, \mathbf P, t)= H(q(\mathbf Q,\mathbf P),p(\mathbf Q,\mathbf P),t) + \frac{\partial G}{\partial t}(t)$$where it differs by a partial time derivative of a function known as generator, which reduces to being only a function of time for restricted canonical transformations.

In addition to leaving the form of the Hamiltonian unchanged, it is also permits the use of the unchanged Hamiltonian in the Hamilton's equations of motion due to the above form as:

$$\begin{alignat}{3} \dot{\mathbf{P}} &= -\frac{\partial K}{\partial \mathbf{Q}} &&= -\left(\frac{\partial H}{\partial \mathbf{Q}}\right)_{\mathbf Q,\mathbf P,t}\\ \dot{\mathbf{Q}} &= \,\,\,\, \frac{\partial K}{\partial \mathbf{P}} &&= \,\,\,\, \, \left(\frac{\partial H}{\partial \mathbf{P}}\right)_{\mathbf Q,\mathbf P ,t}\\ \end{alignat}$$

Although canonical transformations refers to a more general set of transformations of phase space corresponding with less permissive transformations of the Hamiltonian, it provides simpler conditions to obtain results that can be further generalized. All of the following conditions, with the exception of bilinear invariance condition, can be generalized for canonical transformations, including time dependance.

Indirect conditions
Since restricted transformations have no explicit time dependence (by definition), the time derivative of a new generalized coordinate $Q_{m}$ is

$$\begin{align} \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 \end{align}$$

where ${⋅, ⋅}$ is the Poisson bracket.

Similarly for the identity for the conjugate momentum, Pm using the form of the Kamiltonian it follows that:

$$\begin{align} &\frac{\partial K(\mathbf{Q}, \mathbf{P}, t)}{\partial P_{m}} \\ &= \frac{\partial K(\mathbf{Q}(\mathbf{q}, \mathbf{p}), \mathbf{P}(\mathbf{q}, \mathbf{p}), t)}{\partial \mathbf{q}} \cdot \frac{\partial \mathbf{q}}{\partial P_{m}} + \frac{\partial K(\mathbf{Q}(\mathbf{q}, \mathbf{p}), \mathbf{P}(\mathbf{q}, \mathbf{p}), t)}{\partial \mathbf{p}} \cdot \frac{\partial \mathbf{p}}{\partial P_{m}} \\ &= \frac{\partial H(\mathbf{q}, \mathbf{p}, t)}{\partial \mathbf{q}} \cdot \frac{\partial \mathbf{q}}{\partial P_{m}} + \frac{\partial H(\mathbf{q}, \mathbf{p}, t)}{\partial \mathbf{p}} \cdot \frac{\partial \mathbf{p}}{\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}} \end{align}$$

Due to the form of the Hamiltonian equations of motion,

$$\begin{align} \dot{\mathbf{P}} &= -\frac{\partial K}{\partial \mathbf{Q}}\\ \dot{\mathbf{Q}} &= \,\,\,\, \frac{\partial K}{\partial \mathbf{P}} \end{align}$$

if the transformation is canonical, the two derived results must be equal, resulting in the equations: $$\begin{align} \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}} \end{align}$$

The analogous argument for the generalized momenta Pm leads to two other sets of equations: $$\begin{align} \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}} \end{align}$$

These are the indirect conditions to check whether a given transformation is canonical.

Symplectic condition
Sometimes the Hamiltonian relations are represented as:

$$\dot{\eta}= J \nabla_\eta H $$

Where $J := \begin{pmatrix} 0 & I_n \\ -I_n & 0 \\ \end{pmatrix},$

and $\mathbf{\eta} = \begin{bmatrix} q_1\\ \vdots \\ q_n\\ p_1\\ \vdots\\ p_n\\ \end{bmatrix} $ . Similarly, let $\mathbf{\varepsilon} = \begin{bmatrix} Q_1\\ \vdots \\ Q_n\\ P_1\\ \vdots\\ P_n\\ \end{bmatrix} $.

From the relation of partial derivatives, converting the $$\dot{\eta}= J \nabla_\eta H $$ relation in terms of partial derivatives with new variables gives $$\dot{\eta}=J ( M^T \nabla_\varepsilon H) $$ where $M := \frac{\partial (\mathbf{Q}, \mathbf{P})}{\partial (\mathbf{q}, \mathbf{p})}$. Similarly for $\dot{\varepsilon} $ ,

$$\dot{\varepsilon}=M\dot{\eta} =M J M^T \nabla_\varepsilon H $$

Due to form of the Hamiltonian equations for $\dot{\varepsilon} $ ,

$$\dot{\varepsilon}=J \nabla_\varepsilon K =  J \nabla_\varepsilon H $$

where $\nabla_\varepsilon K =  \nabla_\varepsilon H $  can be used due to the form of Kamiltonian. Equating the two equations gives the symplectic condition as:

$$M J M^T = J $$The left hand side of the above is called the Poisson matrix of $$\varepsilon $$, denoted as $\mathcal P(\varepsilon) = MJM^T $ . Similarly, a Lagrange matrix of $$\eta $$ can be constructed as $\mathcal L(\eta) = M^TJM $ . It can be shown that the symplectic condition is also equivalent to $M^T J M = J $  by using the $J^{-1}=-J $ property. The set of all matrices $M $ which satisfy symplectic conditions form a symplectic group. The symplectic conditions are equivalent with indirect conditions as they both lead to the equation $\dot{\varepsilon}= J \nabla_\varepsilon H $, which is used in both of the derivations.

Invariance of Poisson Bracket
The Poisson bracket which is defined as:$$\{u, v\}_\eta := \sum_{i=1}^{n} \left( \frac{\partial u}{\partial q_{i}} \frac{\partial v}{\partial p_{i}} - \frac{\partial u}{\partial p_i} \frac{\partial v}{\partial q_i}\right)$$can be represented in matrix form as:$$\{u, v\}_\eta := (\nabla_\eta u)^T J (\nabla_\eta v)$$Hence using partial derivative relations and symplectic condition gives: $$\{u, v\}_\eta = (\nabla_\eta u)^T J (\nabla_\eta v) = (M^T \nabla_\varepsilon u)^T J (M^T \nabla_\varepsilon v) = (\nabla_\varepsilon u)^T M J M^T (\nabla_\varepsilon v) = (\nabla_\varepsilon u)^T J (\nabla_\varepsilon v) = \{u, v\}_\varepsilon$$

The symplectic condition can also be recovered by taking $u=\varepsilon_i $ and $v=\varepsilon_j $ which shows that $(M J M^T )_{ij}= J_{i j} $. Thus these conditions are equivalent to symplectic conditions. Furthermore, it can be seen that $\mathcal P_{ij}(\varepsilon) = \{ \varepsilon_i,\varepsilon_j\}_\eta =(M J M^T )_{ij} $, which is also the result of explicitly calculating the matrix element by expanding it.

Invariance of Lagrange Bracket
The Lagrange bracket which is defined as:

$$ [ u, v ]_{\eta} := \sum_{i=1}^n \left(\frac{\partial q_i}{\partial u} \frac{\partial p_i}{\partial v} - \frac{\partial p_i}{\partial u} \frac{\partial q_i}{\partial v }  \right) $$

can be represented in matrix form as:

$$ [ u, v ]_{\eta} := \left(\frac {\partial \eta}{\partial u}\right)^T J \left(\frac {\partial \eta}{\partial v}\right) $$

Using similar derivation, gives:

$$[u, v]_\varepsilon = (\partial_u \varepsilon )^T \,J\, (\partial_v \varepsilon) = (M \, \partial_u  \eta )^T \,J \, ( M \,\partial_v \eta) = (\partial_u \eta )^T\, M^TJ M\, (\partial_v \eta) = (\partial_u \eta )^T\, J\,(\partial_v \eta) = [u, v]_\eta$$The symplectic condition can also be recovered by taking $u=\eta_i $ and $v=\eta_j $ which shows that $(M^T J M )_{ij}= J_{i j} $. Thus these conditions are equivalent to symplectic conditions. Furthermore, it can be seen that $\mathcal L_{ij}(\eta) =[\eta_i,\eta_j]_\varepsilon=(M^T J M )_{ij} $, which is also the result of explicitly calculating the matrix element by expanding it.

Bilinear invariance conditions
These set of conditions only apply to restricted canonical transformations or canonical transformations that are independent of time variable.

Consider arbitrary variations of two kinds, in a single pair of generalized coordinate and the corresponding momentum:

$ d \varepsilon=( dq_1, dp_{1},0,0,\ldots),\quad\delta \varepsilon=(\delta q_{1},\delta p_{1},0,0,\ldots). $

The area of the infinitesimal parallelogram is given by:

$ \delta a(12)=d q_{1}\delta p_{1}-\delta q_{1} d p_{1}={(\delta\varepsilon)}^T\,J \, d \varepsilon. $

It follows from the $M^T J M = J $  symplectic condition that the infinitesimal area is conserved under canonical transformation:

$ \delta a(12)={(\delta\varepsilon)}^T\,J \,d \varepsilon={(M\delta\eta)}^T\,J \,Md \eta= {(\delta\eta)}^T\,M^TJM \,d \eta = {(\delta\eta)}^T\,J \,d\eta = \delta A(12). $

Note that the new coordinates need not be completely oriented in one coordinate momentum plane.

Hence, the condition is more generally stated as an invariance of the form $ {(d\varepsilon)}^T\,J \, \delta \varepsilon $ under canonical transformation, expanded as:$$ \sum \delta q \cdot dp - \delta p \cdot dq = \sum \delta Q \cdot dP - \delta P \cdot dQ $$If the above is obeyed for any arbitrary variations, it would be only possible if the indirect conditions are met. The form of the equation, $ {v}^T\,J \, w $ is also known as a symplectic product of the vectors $ {v} $  and $ w $  and the bilinear invariance condition can be stated as a local conservation of the symplectic product.

Liouville's theorem
The indirect conditions allow us to prove Liouville's theorem, which states that the volume in phase space is conserved under canonical transformations, i.e., $$ \int \mathrm{d}\mathbf{q}\, \mathrm{d}\mathbf{p} = \int \mathrm{d}\mathbf{Q}\, \mathrm{d}\mathbf{P}$$

By calculus, the latter integral must equal the former times the determinant of Jacobian $M$$$\int \mathrm{d}\mathbf{Q}\, \mathrm{d}\mathbf{P} = \int \det (M) \, \mathrm{d}\mathbf{q}\, \mathrm{d}\mathbf{p}$$Where $M := \frac{\partial (\mathbf{Q}, \mathbf{P})}{\partial (\mathbf{q}, \mathbf{p})}$

Exploiting the "division" property of Jacobians yields$$ M \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$$M \equiv \frac{\partial (\mathbf{Q})}{\partial (\mathbf{q})} \left/ \frac{\partial (\mathbf{p})}{\partial (\mathbf{P})} \right.$$

Application of the indirect conditions above yields $$\operatorname{det}(M)=1$$.

Generating function approach
To guarantee a valid transformation between $(q, p, H)$ and $(Q, P, K)$, we may resort to a direct generating function approach. Both sets of variables must obey Hamilton's principle. That is the action integral over the Lagrangians $$\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)$$, obtained from the respective Hamiltonian via an "inverse" Legendre transformation, must be stationary in both cases (so that one can use the Euler–Lagrange equations to arrive at Hamiltonian equations of motion of the designated form; as it is shown for example here): $$\begin{align} \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 \end{align}$$

One way for both variational integral equalities to be satisfied is to 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} $$

Lagrangians are not unique: one can always multiply by a constant $λ$ and add a total time derivative $dG⁄dt$ and yield the same equations of motion (as discussed on Wikibooks). In general, the scaling factor $λ$ is set equal to one; canonical transformations for which $λ ≠ 1$ are called extended canonical transformations. $dG⁄dt$ is kept, otherwise the problem would 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 ($q$ or $p$), one new canonical coordinate ($Q$ or $P$) and (possibly) the time $t$. Thus, there are four basic types of generating functions (although mixtures of these four types can exist), 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 $(q, p) → (Q, P)$ is guaranteed to be canonical.

The various generating functions and its properties tabulated below is discussed in detail:

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 $$\begin{align} \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} \end{align}$$

These equations define the transformation $(q, p) → (Q, 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 $Q$ and the old canonical coordinates $(q, 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 $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 $P$ in terms of the old canonical coordinates $(q, p)$. We then invert both sets of formulae to obtain the old canonical coordinates $(q, p)$ as functions of the new canonical coordinates $(Q, 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 $(Q, 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 $$\begin{align} \mathbf{p} &= \frac{\partial G_{1}}{\partial \mathbf{q}} = \mathbf{Q} \\ \mathbf{P} &= -\frac{\partial G_{1}}{\partial \mathbf{Q}} = -\mathbf{q} \end{align}$$ and $K = H$. This example illustrates how independent the coordinates and momenta are in the Hamiltonian formulation; they are equivalent variables.

Type 2 generating function
The type 2 generating function $$G_{2}(\mathbf{q}, \mathbf{P}, t)$$ depends only on the old generalized coordinates and the new generalized momenta $$G \equiv G_{2}(\mathbf{q}, \mathbf{P}, t)-\mathbf{Q} \cdot \mathbf{P}$$ 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 $$\begin{align} \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} \end{align}$$

These equations define the transformation $(q, p) → (Q, 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 $P$ and the old canonical coordinates $(q, 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 $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 $Q$ in terms of the old canonical coordinates $(q, p)$. We then invert both sets of formulae to obtain the old canonical coordinates $(q, p)$ as functions of the new canonical coordinates $(Q, 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 $(Q, 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 $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}(\mathbf{p}, \mathbf{Q}, t)$$ depends only on the old generalized momenta and the new generalized coordinates $$G \equiv G_{3}(\mathbf{p}, \mathbf{Q}, t)+ \mathbf{q} \cdot \mathbf{p}$$ 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 $$\begin{align} \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} \end{align}$$

These equations define the transformation $(q, p) → (Q, 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 $Q$ and the old canonical coordinates $(q, 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 $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 $P$ in terms of the old canonical coordinates $(q, p)$. We then invert both sets of formulae to obtain the old canonical coordinates $(q, p)$ as functions of the new canonical coordinates $(Q, 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 $(Q, 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 G_{4}(\mathbf{p}, \mathbf{P}, t) +\mathbf{q} \cdot \mathbf{p} - \mathbf{Q} \cdot \mathbf{P} $$ 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 $$\begin{align} \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} \end{align}$$

These equations define the transformation $(q, p) → (Q, 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 $P$ and the old canonical coordinates $(q, 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 $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 $Q$ in terms of the old canonical coordinates $(q, p)$. We then invert both sets of formulae to obtain the old canonical coordinates $(q, p)$ as functions of the new canonical coordinates $(Q, 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 $(Q, P)$.

Restrictions on generating functions
For example, using generating function of second kind: ${p}_i = \frac{\partial G_{2}}{\partial {q}_i} $ and ${Q}_i = \frac{\partial G_{2}}{\partial {P}_i} $, the first set of equations consisting of variables $\mathbf{p} $ , $\mathbf{q} $  and $\mathbf{P} $  has to be inverted to get $\mathbf{P}(\mathbf q, \mathbf p) $. This process is possible when the matrix defined by $a_{ij}=\frac{\partial {p}_i(\mathbf q,\mathbf P)}{\partial P_j} $ is non-singular.

$$\left|\begin{array}{l l l}&&\\ {\quad \vdots} & {\ddots}&{\quad \vdots}\\&&\end{array}\right|{\neq0}$$

Hence, restrictions are placed on generating functions to have the matrices: $\left[\frac{\partial^2 G_1}{\partial Q_j\partial q_i} \right] $, $\left[\frac{\partial^2 G_2}{\partial P_j\partial q_i} \right] $ , $\left[\frac{\partial^2 G_3}{\partial p_j\partial Q_i} \right]  $  and $\left[\frac{\partial^2 G_4}{\partial p_j\partial P_i} \right]  $ , being non-singular.

Limitations of generating functions
Since $\left[\frac{\partial^2 G_2}{\partial P_j\partial q_i} \right] $  is non-singular, it implies that $\left[\frac{\partial {p}_i(\mathbf q,\mathbf P)}{\partial P_j}\right]  $  is also non-singular. Since the matrix $\left[\frac{\partial P_i(\mathbf q,\mathbf p)}{\partial p_j} \right] $  is inverse of $\left[\frac{\partial {p}_i(\mathbf q,\mathbf P)}{\partial P_j}\right]  $, the transformations of type 2 generating functions always have a non-singular $\left[\frac{\partial P_i(\mathbf q,\mathbf p)}{\partial p_j} \right]  $  matrix. Similarly, it can be stated that type 1 and type 4 generating functions always have a non-singular $\left[\frac{\partial Q_i(\mathbf q,\mathbf p)}{\partial p_j} \right] $  matrix whereas type 2 and type 3 generating functions always have a non-singular $\left[\frac{\partial P_i(\mathbf q,\mathbf p)}{\partial p_j} \right]  $  matrix. Hence, the canonical transformations resulting from these generating functions are not completely general.

In other words, since $(Q, P)$ and $(q, p)$ are each $2N$ independent functions, it follows that to have generating function of the form $G_{1}(\mathbf{q}, \mathbf{Q}, t) $ and $$G_{4}(\mathbf{p}, \mathbf{P}, t)$$ or $$G_{2}(\mathbf{q}, \mathbf{P}, t)$$ and $$G_{3}(\mathbf{p}, \mathbf{Q}, t)$$, the corresponding Jacobian matrices $\left[\frac{\partial Q_i}{\partial p_j} \right]  $  and $\left[\frac{\partial P_i}{\partial p_j} \right]  $  are restricted to be non singular, ensuring that the generating function is a function of $2N + 1$ independent variables. However, as a feature of canonical transformations, it is always possible to choose $2N$ such independent functions from sets $(q, p)$ or $(Q, P)$, to form a generating function representation of canonical transformations, including the time variable. Hence, it can be proved that every finite canonical transformation can be given as a closed but implicit form that is a variant of the given four simple forms.

Canonical transformation relations
From: $$K = H + \frac{\partial G}{\partial t} $$, calculate $\frac{\partial (K-H)}{\partial P} $ :

$$\begin{align} \left( \frac{\partial (K-H)}{\partial P}\right)_{Q,P,t}= \frac{\partial K}{\partial P} - \frac{\partial H}{\partial p}\frac{\partial p}{\partial P} - \frac{\partial H}{\partial q}\frac{\partial q}{\partial P} - \frac{\partial H}{\partial t}\left( \frac{\partial t}{\partial P}\right)_{Q,P,t} = \dot{Q} + \dot{p} \frac{\partial q}{\partial P} - \dot{q}\frac{\partial p}{\partial P} \\ = \frac{\partial Q}{\partial t} + \frac{\partial Q}{\partial q} \cdot \dot{q} + \frac{\partial Q}{\partial p} \cdot \dot{p} + \dot{p} \frac{\partial q}{\partial P} - \dot{q}\frac{\partial p}{\partial P} \\ =\dot{q}\left(\frac{\partial Q}{\partial q} - \frac{\partial p}{\partial P}\right)+\dot{p}\left(\frac{\partial q}{\partial P} +\frac{\partial Q}{\partial p} \right) + \frac{\partial Q}{\partial t} \end{align}       $$Since the left hand side is $\frac{\partial (K-H)}{\partial P} = \frac \partial {\partial P}\left( \frac{\partial G}{\partial t} \right) \bigg |_{Q,P,t} $   which is independent of dynamics of the particles, equating coefficients of $\dot q $  and $\dot p $  to zero, canonical transformation rules are obtained. This step is equivalent to equating the left hand side as $\frac{\partial (K-H)}{\partial P} = \frac{\partial Q}{\partial t}  $.

Similarly:

$$\begin{align} \left(\frac{\partial (K-H)}{\partial Q}\right)_{Q,P,t}= \frac{\partial K}{\partial Q} - \frac{\partial H}{\partial p}\frac{\partial p}{\partial Q} - \frac{\partial H}{\partial q}\frac{\partial q}{\partial Q} - \frac{\partial H}{\partial t}\left(\frac{\partial t}{\partial Q}\right)_{Q,P,t} = -\dot{P} + \dot{p} \frac{\partial q}{\partial Q} - \dot{q}\frac{\partial p}{\partial Q} \\ = -\frac{\partial P}{\partial t} -\frac{\partial P}{\partial q} \cdot \dot{q} - \frac{\partial P}{\partial p} \cdot \dot{p} + \dot{p} \frac{\partial q}{\partial Q} - \dot{q}\frac{\partial p}{\partial Q} \\ =-\left(\dot{q}\left(\frac{\partial P}{\partial q} + \frac{\partial p}{\partial Q}\right)+\dot{p}\left(\frac{\partial P}{\partial p} -\frac{\partial q}{\partial Q} \right) + \frac{\partial P}{\partial t} \right) \end{align}       $$Similarly the canonical transformation rules are obtained by equating the left hand side as $\frac{\partial (K-H)}{\partial Q} = - \frac{\partial P}{\partial t}   $.

The above two relations can be combined in matrix form as: $J \left(\nabla_\varepsilon \frac{\partial G}{\partial t} \right) = \frac{\partial \varepsilon}{\partial t} $  (which will also retain same form for extended canonical transformation) where the result $\frac{\partial G}{\partial t} = K-H $, has been used. The canonical transformation relations are hence said to be equivalent to $J \left(\nabla_\varepsilon \frac{\partial G}{\partial t} \right) = \frac{\partial \varepsilon}{\partial t} $  in this context.

The canonical transformation relations can now be restated to include time dependance:$$\begin{align} \left( \frac{\partial Q_{m}}{\partial p_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= - \left( \frac{\partial q_{n}}{\partial P_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \\ \left( \frac{\partial Q_{m}}{\partial q_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= \left( \frac{\partial p_{n}}{\partial P_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \end{align} $$$$\begin{align} \left( \frac{\partial P_{m}}{\partial p_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= \left( \frac{\partial q_{n}}{\partial Q_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \\ \left( \frac{\partial P_{m}}{\partial q_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= - \left( \frac{\partial p_{n}}{\partial Q_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \end{align}$$Since $\frac{\partial (K-H)}{\partial P} = \frac{\partial Q}{\partial t}  $  and $\frac{\partial (K-H)}{\partial Q} = - \frac{\partial P}{\partial t}   $, if $Q$ and $P$ do not explicitly depend on time, $K= H + \frac{\partial G}{\partial t}(t)$  can be taken. The analysis of restricted canonical transformations is hence consistent with this generalization.

Symplectic Condition
Applying transformation of co-ordinates formula for $$ \nabla_\eta H = M^T \nabla_\varepsilon H  $$, in Hamiltonian's equations gives:$$\dot{\eta}=J\nabla_\eta H =J ( M^T \nabla_\varepsilon H) $$

Similarly for $\dot{\varepsilon} $ :$$\dot{\varepsilon}=M\dot{\eta} + \frac{\partial \varepsilon}{\partial t} =M J M^T \nabla_\varepsilon H + \frac{\partial \varepsilon}{\partial t} $$or:$$\dot{\varepsilon}=J \nabla_\varepsilon K =  J \nabla_\varepsilon H + J \nabla_\varepsilon \left( \frac{\partial G}{\partial t}\right) $$Where the last terms of each equation cancel due to $J \left(\nabla_\varepsilon \frac{\partial G}{\partial t} \right) = \frac{\partial \varepsilon}{\partial t} $  condition from canonical transformations. Hence leaving the symplectic relation: $M J M^T = J $ which is also equivalent with the condition $M^T J M = J $. It follows from the above two equations that the symplectic condition implies the equation $J \left(\nabla_\varepsilon \frac{\partial G}{\partial t} \right) = \frac{\partial \varepsilon}{\partial t} $, from which the indirect conditions can be recovered. Thus, symplectic conditions and indirect conditions can be said to be equivalent in the context of using generating functions.

Invariance of Poisson and Lagrange Bracket
Since $\mathcal P_{ij}(\varepsilon) = \{ \varepsilon_i,\varepsilon_j\}_\eta =(M J M^T )_{ij} = J_{ij} $ and $\mathcal L_{ij}(\eta) =[\eta_i,\eta_j]_\varepsilon=(M^T J M )_{ij} = J_{ij} $ where the symplectic condition is used in the last equalities. Using $\{\varepsilon_i,\varepsilon_j\}_\varepsilon=[\eta_i,\eta_j]_\eta = J_{ij} $, the equalities $\{ \varepsilon_i,\varepsilon_j\}_\eta= \{ \varepsilon_i,\varepsilon_j\}_\varepsilon $ and $[\eta_i,\eta_j]_\varepsilon= [\eta_i,\eta_j]_\eta $ are obtained which imply the invariance of Poisson and Lagrange brackets.

Canonical transformation relations
By solving for:$$\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} $$with various forms of generating function, the relation between K and H goes as $\frac{\partial G}{\partial t} = K-\lambda H $ instead, which also applies for $\lambda = 1 $  case.

All results presented below can also be obtained by replacing $q \rightarrow \sqrt{\lambda}q $, $p \rightarrow \sqrt{\lambda}p $ and $H \rightarrow {\lambda}H $  from known solutions, since it retains the form of Hamilton's equations. The extended canonical transformations are hence said to be result of a canonical transformation ($\lambda = 1 $ ) and a trivial canonical transformation ($\lambda \neq 1 $ ) which has $M J M^T = \lambda J $ (for the given example, $M = \sqrt{\lambda} I $  which satisfies the condition).

Using same steps previously used in previous generalization, with $\frac{\partial G}{\partial t} = K-\lambda H $ in the general case, and retaining the equation $J \left(\nabla_\varepsilon \frac{\partial g}{\partial t} \right) = \frac{\partial \varepsilon}{\partial t}  $, extended canonical transformation partial differential relations are obtained as:$$\begin{align} \left( \frac{\partial Q_{m}}{\partial p_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= -\lambda \left( \frac{\partial q_{n}}{\partial P_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \\ \left( \frac{\partial Q_{m}}{\partial q_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= \lambda \left( \frac{\partial p_{n}}{\partial P_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \end{align}$$$$\begin{align} \left( \frac{\partial P_{m}}{\partial p_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= \lambda \left( \frac{\partial q_{n}}{\partial Q_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \\ \left( \frac{\partial P_{m}}{\partial q_{n}}\right)_{\mathbf{q}, \mathbf{p},t} &= -\lambda \left( \frac{\partial p_{n}}{\partial Q_{m}}\right)_{\mathbf{Q}, \mathbf{P},t} \end{align}$$

Symplectic condition
Following the same steps to derive the symplectic conditions, as: $$\dot{\eta}=J\nabla_\eta H =J ( M^T \nabla_\varepsilon H) $$and $$\dot{\varepsilon}=M\dot{\eta} + \frac{\partial \varepsilon}{\partial t} =M J M^T \nabla_\varepsilon H + \frac{\partial \varepsilon}{\partial t} $$

where using $\frac{\partial G}{\partial t} = K-\lambda H $ instead gives:$$\dot{\varepsilon}=J \nabla_\varepsilon K  = \lambda J \nabla_\varepsilon H + J \nabla_\varepsilon \left( \frac{\partial G}{\partial t}\right) $$The second part of each equation cancel. Hence the condition for extended canonical transformation instead becomes: $M J M^T = \lambda J $.

Poisson and Lagrange Brackets
The Poisson brackets are changed as follows:$$\{u, v\}_\eta = (\nabla_\eta u)^T J (\nabla_\eta v) = (M^T \nabla_\varepsilon u)^T J (M^T \nabla_\varepsilon v) = (\nabla_\varepsilon u)^T M J M^T (\nabla_\varepsilon v) = \lambda (\nabla_\varepsilon u)^T J (\nabla_\varepsilon v) = \lambda \{u, v\}_\varepsilon$$whereas, the Lagrange brackets are changed as:

$$[u, v]_\varepsilon = (\partial_u \varepsilon )^T \,J\, (\partial_v \varepsilon) = (M \, \partial_u  \eta )^T \,J \, ( M \,\partial_v \eta) = (\partial_u \eta )^T\, M^TJ M\, (\partial_v \eta) = \lambda (\partial_u  \eta )^T\, J\,(\partial_v \eta) = \lambda [u, v]_\eta$$ Hence, the Poisson bracket scales by the inverse of $\lambda $ whereas the Lagrange bracket scales by a factor of $\lambda $.

Infinitesimal canonical transformation
Consider the canonical transformation that depends on a continuous parameter $$\alpha $$, as follows:

$$\begin{align} & Q(q,p,t;\alpha) \quad \quad \quad & Q(q,p,t;0)=q \\ & P(q,p,t;\alpha) \quad \quad \text{with} \quad & P(q,p,t;0)=p   \\ \end{align} $$

For infinitesimal values of $$\alpha $$, the corresponding transformations are called as infinitesimal canonical transformations which are also known as differential canonical transformations.

Consider the following generating function:

$$G_2(q,P,t)= qP + \alpha G(q,P,t) $$

Since for $$\alpha=0 $$, $$G_2 = qP $$ has the resulting canonical transformation, $$Q = q $$ and $$P = p $$, this type of generating function can be used for infinitesimal canonical transformation by restricting $$\alpha $$ to an infinitesimal value. From the conditions of generators of second type:$$\begin{align} {p} &= \frac{\partial G_{2}}{\partial {q}} = P + \alpha \frac{\partial G}{\partial {q}} (q,P,t) \\ {Q} &= \frac{\partial G_{2}}{\partial {P}} = q + \alpha \frac{\partial G}{\partial {P}}  (q,P,t) \\ \end{align}$$Since $$P = P(q,p,t;\alpha) $$, changing the variables of the function $$G $$ to $$G(q,p,t) $$ and neglecting terms of higher order of $$\alpha $$, gives: $$\begin{align} {p} &= P + \alpha \frac{\partial G}{\partial {q}} (q,p,t) \\ {Q} &= q + \alpha \frac{\partial G}{\partial p}  (q,p,t) \\ \end{align}$$Infinitesimal canonical transformations can also be derived using the matrix form of the symplectic condition.

Active canonical transformations
In the passive view of transformations, the coordinate system is changed without the physical system changing, whereas in the active view of transformation, the coordinate system is retained and the physical system is said to undergo transformations. Thus, using the relations from infinitesimal canonical transformations, the change in the system states under active view of the canonical transformation is said to be:

$$\begin{align} & \delta q = \alpha \frac{\partial G}{\partial p} (q,p,t)   \quad \text{and} \quad \delta p = - \alpha  \frac{\partial G}{\partial q}  (q,p,t), \\ \end{align} $$

or as $$\delta \eta = \alpha J \nabla_\eta G $$ in matrix form.

For any function $$u(\eta)  $$, it changes under active view of the transformation according to:

$$\delta u = u(\eta +\delta \eta)-u(\eta) = (\nabla_\eta u)^T\delta\eta=\alpha (\nabla_\eta u)^T J (\nabla_\eta G) = \alpha \{ u,G \}. $$

Considering the change of Hamiltonians in the active view, ie. for a fixed point,$$K(Q=q_0,P=p_0,t) - H(q=q_0,p=p_0,t) = \left(H(q_0',p_0',t) + \frac{\partial G_{2}}{\partial t}\right) - H(q_0,p_0,t) = - \delta H +\alpha \frac{\partial G}{\partial t} = \alpha\left(\{ G,H\}+\frac{\partial G}{\partial t} \right)=\alpha\frac{dG}{dt}   $$where $(q=q_0',p=p_0') $  are mapped to the point, $(Q=q_0,P=p_0) $  by the infinitesimal canonical transformation, and similar change of variables for $$G(q,P,t) $$ to $$G(q,p,t) $$ is considered up-to first order of $$\alpha $$. Hence, if the Hamiltonian is invariant for infinitesimal canonical transformations, its generator is a constant of motion.

Time evolution
Taking $$G(q,p,t)=H(q,p,t) $$ and $$\alpha = dt $$, then $$\delta \eta = (J \nabla_\eta H) dt = \dot{\eta} dt = d\eta $$. Thus the continuous application of such a transformation maps the coordinates $$\eta(\tau) $$ to $$\eta(\tau+t)  $$. Hence if the Hamiltonian is time translation invariant, i.e. does not have explicit time dependance, its value is conserved for the motion.

Translation
Taking $$G(q,p,t)=p_k $$, $$ \delta p_i = 0 $$ and $$ \delta q_i = \alpha \delta_{ik} $$. Hence, the canonical momentum generates a shift in the corresponding generalized coordinate and if the Hamiltonian is invariant of translation, the momentum is a constant of motion.

Rotation
Consider an orthogonal system for an N-particle system:

$$\begin{array}{l}\\ \end{array}$$

Choosing the generator to be: $$G=L_{z}=\sum_{i=1}^{n}\left(x_{i}p_{i y}-y_{i}p_{i x}\right) $$ and the infinitesimal value of $$ \alpha = \delta \phi $$, then the change in the coordinates is given for x by:

$$\begin{array}{c} {\delta x_{i}=\{x_{i},G\}\delta\phi=\displaystyle\sum_{j} \{x_{i},x_{j}p_{j y}-y_{j}p_{j x}\}\delta\phi=\displaystyle\sum_{j}(\underbrace{\{x_{i},x_{j}p_{j y}\}}_{=0} -{ \{x_{i},y_{j}p_{j x}\}}})\delta\phi\\ \end{array} $$

and similarly for y:

$$\begin{array}{c}

\delta y_{i}=\{y_{i},G\}\delta\phi=\displaystyle\sum_{j}\{y_{i},x_{j}p_{j y}-y_{j}p_{j x}\}\delta\phi=\displaystyle\sum_{j}(\{y_{i},x_{j}p_{j y}\}-\underbrace{ \{y_{i},y_{j}p_{j x}\}}_{=0})\delta \phi\\ {=\displaystyle\sum_{j}x_{j}\underbrace{\{y_i,p_{jy}\}}_{=\delta_{ij}} \delta\phi=x_{i}\delta\phi\,,} \end{array} $$

whereas the z component of all particles is unchanged: $$ \delta z_{ i }=\left\{z_{i},G\right\}\delta\phi=\sum_{j}\left\{z_{i},x_{j}p_{j y}-y_{j}p_{j x}\right\}\delta \phi =0$$.

These transformations correspond to rotation about the z axis by angle $$\delta \phi $$ in its first order approximation. Hence, repeated application of the infinitesimal canonical transformation generates a rotation of system of particles about the z axis. If the Hamiltonian is invariant under rotation about the z axis, the generator, the component of angular momentum along the axis of rotation, is an invariant of motion.

Motion as 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.

Examples

 * The translation $$\mathbf{Q}(\mathbf{q}, \mathbf{p})= \mathbf{q} + \mathbf{a}, \mathbf{P}(\mathbf{q}, \mathbf{p})= \mathbf{p} + \mathbf{b}$$ where $$\mathbf{a}, \mathbf{b}$$ are two constant vectors is a canonical transformation. Indeed, the Jacobian matrix is the identity, which is symplectic: $$I^\text{T}JI=J$$.
 * Set $$\mathbf{x}=(q,p)$$ and $$\mathbf{X}=(Q,P)$$, the transformation $$\mathbf{X}(\mathbf{x})=R \mathbf{x}$$ where $$R \in SO(2)$$ is a rotation matrix of order 2 is canonical. Keeping in mind that special orthogonal matrices obey $$R^\text{T}R=I$$ it's easy to see that the Jacobian is symplectic. However, this example only works in dimension 2: $$SO(2)$$ is the only special orthogonal group in which every matrix is symplectic. Note that the rotation here acts on $$(q,p)$$ and not on $$q$$ and $$p$$ independently, so these are not the same as a physical rotation of an orthogonal spatial coordinate system.
 * The transformation $$(Q(q,p), P(q,p))=(q+f(p), p)$$, where $$f(p)$$ is an arbitrary function of $$p$$, is canonical. Jacobian matrix is indeed given by $$\frac{\partial X}{\partial x} = \begin{bmatrix} 1 & f'(p) \\ 0 & 1 \end{bmatrix}$$ which is symplectic.

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 $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.