# Example of a transformation that is not canonical

Can someone please give me an example of a transformation that is not a canonical transformation?

Hint: Canonical transformations are volume preserving in phase space according to Liouville's theorem. So e.g. a dilation $$Z^{I} = 2 z^I, \qquad I~\in~\{1,\ldots ,2n\},$$ is not a canonical transformation.
Consider the transformation $x \mapsto x, p \mapsto v = \frac 1 m [p - qA(x)]$ where $A$ is a vector potential. Then $\{v,v\} = \frac q {m^2} v\times B$ where $\{\cdot,\cdot\}$ is Poisson bracket and $B = dA$ is the magnetic field, so this transformation is not canonical.
More concretely: With the Hamiltonian $H = (p-qA)^2/2m$, you find $\dot v_i = \frac q m (v\times B)_i$. If the form of Hamilton's equations is preserved, then $\dot v_i = -\partial K/\partial x_i$ where $K$ is the new Hamiltonian, the "Kamiltonian". But then $\partial_j \dot v_i$ must be a symmetric tensor, but this is not the case for arbitrary $B$.