Derive the matrix condition from Hamilton's equations
Collect \(n\) canonical positions and momenta into \(z=(q_1,\ldots,q_n,p_1,\ldots,p_n)^T\). Write Hamilton's equations as \(\dot z=J\nabla_z H\), where \(J\) has zero diagonal blocks, identity upper right and minus identity lower left. For a time-independent change \(Z=f(z)\) with Jacobian \(S=\partial Z/\partial z\), the chain rule gives
To preserve the canonical form for every differentiable Hamiltonian require
For an invertible square matrix this is equivalent to \(S^TJS=J\). In geometric terms the bilinear antisymmetric form \(\omega(u,v)=u^TJv\) has the same value on any transported pair of tangent vectors.
Taking determinants gives \((\det S)^2=1\), and symplectic maps have positive determinant equal to one. One way to see the sign is to take the top exterior power of the preserved two-form: \(\omega^n\) fixes an oriented volume. In one canonical pair the identity \(S^TJS=(\det S)J\) makes determinant one sufficient. In two or more pairs a single volume condition cannot enforce every entry of the matrix condition. For example in ordering \((q_1,q_2,p_1,p_2)\), scaling by diagonal entries \((2,1,1,1/2)\) preserves four-dimensional volume. But \(\{Q_1,P_1\}=2\) and \(\{Q_2,P_2\}=1/2\), so neither conjugate pair has the required bracket. A volume-preserving histogram test alone would miss this failure.
Identify brackets of observables and what they measure
Define \(\{A,B\}=(\nabla A)^T J\nabla B=\sum_i(A_{q_i}B_{p_i}-A_{p_i}B_{q_i})\). For any explicitly time-dependent observable \(A(z,t)\), differentiation along Hamiltonian trajectories gives
The bracket is antisymmetric and obeys the product rule. Computing it with the chain rule in the new variables proves that canonical transformations preserve brackets, even between nonlinear observables. Conversely the fundamental brackets \(\{Q_i,P_j\}=\delta_{ij}\), \(\{Q_i,Q_j\}=\{P_i,P_j\}=0\) are precisely the entries of \(SJS^T=J\).
For a particle set \(L_z=xp_y-yp_x\). Its Hamiltonian flow as a generator sends \(x\) to \(x-\varepsilon y\), \(y\) to \(y+\varepsilon x\) and rotates momenta by the same infinitesimal angle. The angular momentum components satisfy \(\{L_x,L_y\}=L_z\) with cyclic permutations. Derive one entry directly for \(L_x=yp_z-zp_y\) and \(L_y=zp_x-xp_z\). The \(z,p_z\) pair contributes \(xp_y-yp_x\), with the other terms zero. Rotations about two different axes generally fail to commute. The resulting commutator has the form of a rotation about the third axis even though each underlying infinitesimal motion preserves every canonical bracket.
Jacobi's identity \(\{A,\{B,C\}\}+\{B,\{C,A\}\}+\{C,\{A,B\}\}=0\) implies that the bracket of two time-independent conserved quantities is conserved under the same Hamiltonian. If the Hamiltonian is invariant under rotations about \(x\) and \(y\), its invariance about \(z\) follows from this relation and \(\{L_x,L_y\}=L_z\). Conservation alone need not make two observables commute. A central force can conserve all three angular momentum components, but their mutual brackets remain nonzero. For independent commuting integrals in an integrability argument one must check the involution condition explicitly.
Construct a canonical map for any smooth point transformation
Suppose new coordinates depend only on old coordinates, \(Q=f(q)\). Preserve the canonical one-form exactly,
Thus \(p=(Df)^TP\) and \(P=(Df)^{-T}p\). Applying the same coordinate matrix to momenta works only for a restricted case such as an orthogonal change of coordinates. An extension of position must be accompanied by a reciprocal rescaling of its conjugate momentum. For \(Q=q^2\) on \(q>0\), for example, \(P=p/(2q)\). The free Hamiltonian becomes \(2QP^2/m\); even a physically free particle can acquire a coordinate-dependent expression for its kinetic energy.
Polar coordinates demonstrate why a momentum variable need not equal a measured tangential component. In the plane \(x=r\cos\varphi,y=r\sin\varphi\). Substituting into \(p_xdx+p_ydy\) gives
The physical tangential momentum is \(p_\varphi/r\). At radius \(0.40\,{\rm m}\) and transverse momentum \(0.60\,{\rm kg\,m/s}\), the canonical angular momentum is \(0.24\,{\rm kg\,m^2/s}\). Treating the transverse component itself as conjugate to angle would make \(\{\varphi,p_\varphi^{\rm wrong}\}=1/r\). The coordinate singularity at \(r=0\) also prevents these canonical polar variables from covering the entire original phase space with one chart.
Generate shears and test a numerical map
A type-two generating function \(F_2(q,P,t)\) defines \(p=\partial_qF_2\), \(Q=\partial_P F_2\), and \(K=H+\partial_tF_2\) where the transformation can be locally inverted. The differential \(d(F_2-QP)\) equals \(p\,dq-P\,dQ+(K-H)\,dt\). Thus the actions differ only by an endpoint term; taking another exterior derivative at fixed time gives the symplectic form condition. For \(F_2=qP+sP^2/(2m)\), the map is \(p=P,Q=q+sp/m\), free drift over time \(s\). For \(F_2=qP+sV(q)\), the map is \(P=p-sV'(q),Q=q\), a potential kick. Their composition is canonical for any step size even though an alternating drift and kick need not give the exact trajectory.
Take a unit-mass, unit-frequency oscillator with \(h=0.5\). A kick followed by drift gives \(P=p-hq\), \(Q=q+hP=(1-h^2)q+hp\). Its amplification matrix has determinant one and trace \(2-h^2=1.75\), so its eigenvalues form a unit-modulus conjugate pair. The numerical phase per step is \(\arccos(1-h^2/2)=0.50536\), slightly ahead of the exact phase \(0.50000\). Starting at \(q=1,p=0\), the first step gives \(Q=0.75,P=-0.50\), and physical energy becomes \(0.40625\) instead of \(0.5\). Exact bracket preservation does not imply exact conservation of the original energy at every point. If \(h>2\) the same matrix remains symplectic but has a real expanding and contracting eigenvalue; geometric preservation is compatible with numerical instability.
For a numerical implementation with analytic equations unavailable, approximate the Jacobian of a one-step map at selected states by perturbing one canonical component at a time. Compute \(S^TJS-J\) after nondimensionalising coordinates and momenta in conjugate pairs. Repeat with smaller perturbations and at different integration tolerances. A determinant close to one in four dimensions is insufficient. Testing the transported brackets of one position–momentum pair and one cross-pair can reveal a swapped column or misplaced mass factor before a long simulation exhibits visible energy drift.
Track canonical area for a transported experimental ensemble
A narrow group of trajectories lets an experimenter estimate a tangent map without applying a separate perturbation to each coordinate at the same time. Prepare a small covariance ellipse in one canonical pair \(z=(q,p)\), propagate each member through a known linear Hamiltonian device, and compute \(\Sigma_{\rm out}=S\Sigma_{\rm in}S^T\). The ellipse area is proportional to \(\sqrt{\det\Sigma}\), and a symplectic map in one pair preserves that area. Its projections can grow or contract individually: a focusing device can reduce position spread while increasing momentum spread or correlation. Measuring only the two marginal widths ignores their covariance and can falsely suggest area growth.
For a free unit-mass drift of duration two in scaled units,
Start with \(\Sigma=\mathrm{diag}(1,1)\). The outgoing covariance has entries \(\Sigma_{qq}=5,\Sigma_{pp}=1,\Sigma_{qp}=2\). The apparent rectangle of marginal standard deviations grows by \(\sqrt5\), yet the determinant remains \(5-4=1\). A plot that suppresses the correlation has discarded exactly the information needed for the area test. Noise in the two channels also contributes to observed covariance, so calibrate sensor variances independently before attributing a small apparent growth to physical dissipation or numerical smoothing.
For two pairs it is possible for a perfectly canonical coupling to exchange projected emittances. Take a uniform rotation of the two positions and the same rotation of their conjugate momenta. It is canonical by construction. If the two incoming pairs have different covariance areas, a ninety-degree rotation swaps them completely; at forty-five degrees each outgoing projected pair contains a mixture. The full four-dimensional symplectic structure remains intact. An experimentally available two-dimensional marginal then tests only part of the dynamics. Counting phase-space points in a volume and measuring cross-pair brackets answer different questions about a strongly coupled system.
The eigenvalues of \(J\Sigma\) are invariant under the linear canonical covariance transport. Indeed \(J S=S^{-T}J\) for symplectic \(S\), so \(J\Sigma_{\rm out}=S^{-T}(J\Sigma_{\rm in})S^T\), a similarity transformation. For a positive covariance these eigenvalues occur as conjugate imaginary pairs, and their positive magnitudes give symplectic covariance scales. This algebraic test can distinguish loss of correlations in a fitted transfer matrix from actual exchange between pairs. It assumes linear propagation of the ensemble. A nonlinear canonical map can stretch a finite ellipse into a curved shape whose covariance determinant changes while its exact enclosed area remains preserved.
Use generating functions to find a moving normal-mode basis
Consider a two-dimensional isotropic oscillator and rotate its coordinate axes by a prescribed time-dependent angle \(\alpha(t)\). Let \(Q=R(\alpha)^Tq\), \(P=R(\alpha)^Tp\) for a proper planar rotation. At any fixed time the map is orthogonal and symplectic. To derive the Hamiltonian in these moving variables, use \(F_2(q,P,t)=q^TR(\alpha)P\). Its time derivative at fixed old \(q\) and new \(P\) is \(-\dot\alpha(Q_xP_y-Q_yP_x)\), with the sign corresponding to axes rotating counterclockwise in the laboratory. The transformed Hamiltonian is therefore
For constant rotation rate and an isotropic potential the new Hamiltonian has no explicit time dependence. Its value is the combination energy minus rotation rate times angular momentum encountered in the Noether argument. Hamilton's equations now include \(-\dot\alpha\,\hat z\times Q\) in \(\dot Q\) relative to the rotated physical velocity. Thus the transformed canonical momentum \(P\) equals the rotated laboratory momentum rather than \(m\dot Q\). Confusing the two yields incorrect initial conditions for a rotating-frame simulation even if the transformation matrix at the starting instant is the identity.
Take \(m=1.0\,{\rm kg}\), a laboratory point initially at \(q=(0.20,0)\,{\rm m}\) with \(p=(0,0.30)\,{\rm kg\,m/s}\), and axes initially aligned but rotating at \(2.0\,{\rm rad/s}\). The canonical \(P_y\) is \(0.30\,{\rm kg\,m/s}\). The derivative of the rotating-frame coordinate is
It moves in the negative rotating-frame \(y\) direction while its laboratory velocity points positive \(y\). The angular momentum is \(0.060\,{\rm kg\,m^2/s}\), so \(K\) lies \(0.120\,{\rm J}\) below the laboratory Hamiltonian. Both position–momentum transformations preserve brackets; the extra term derives from the moving basis, not a failure of canonical geometry.
An oscillator with two nearly equal natural frequencies provides another reason to track the generating function. If one diagonalises a slowly changing stiffness matrix at each time and keeps only the instantaneous diagonal frequencies, the omitted rotation of the eigenvectors couples the nominal modes through a term of this type. When the eigendirections turn rapidly near a degeneracy, the coupling can be appreciable even if both eigenvalues change little. Measuring the orientation as well as the eigenfrequencies allows the size of this effect to be estimated before fitting amplitude transfer to a spurious dissipation term.
Compare exact phase transport with a dissipative fit
A damped oscillator with \(m\ddot q+c\dot q+kq=0\) has equations \(\dot q=p/m\), \(\dot p=-kq-cp/m\). In the physical \((q,p)\) plane their divergence is \(-c/m\). A small material phase-space area therefore contracts as \(A(t)=A(0)e^{-ct/m}\). No time-independent canonical coordinate change on the same two-dimensional isolated phase space can turn that physical contraction into a Hamiltonian flow preserving area. This conclusion concerns the reduced dissipative description. An expanded system including the degrees of freedom that absorb energy can still be Hamiltonian.
For \(c/m=0.40\,{\rm s^{-1}}\), a pair of independent initial perturbations spanning area one in calibrated coordinates spans only \(0.449\) after two seconds. A numerical step of \(0.10\,{\rm s}\) fitted to that exact map should have determinant \(e^{-0.04}=0.9608\). Forcing its determinant to one during system identification would remove a real dissipative measurement. Conversely a conservative oscillator propagated by forward Euler at matched units and \(h=0.10\) has amplification determinant \(1+h^2=1.01\), corresponding to a spurious area growth. A geometric diagnostic is interpretable only after deciding what physical system and coordinate pair were actually observed.
The pair \(q,v\) differs from canonical \(q,p\) by a constant mass scaling for an ordinary single particle. In one pair with constant mass that scaling does not change a measured same-coordinate before-and-after determinant. For a position-dependent mass, constrained coordinates with a varying metric, or explicit time-dependent changes of measurement scale, volume in raw position–velocity coordinates need not equal canonical volume. For example a free particle expressed in \(Q=q^2\) has canonical momentum \(P=m\dot Q/(4Q)\). A detector estimating phase area in \((Q,\dot Q)\) without the \(Q\)-dependent factor can infer contraction or expansion even when canonical phase area is exactly conserved.
Compute a bracket of mechanical momenta and recover the Lorentz force
For a charge \(e\) in a prescribed vector potential write mechanical momentum \(\boldsymbol\pi=\mathbf p-e\mathbf A(\mathbf q,t)\). The canonical brackets are \(\{q_i,p_j\}=\delta_{ij}\), but the measured mechanical components satisfy
At nonzero magnetic field they are not simultaneously canonical momenta conjugate to the Cartesian positions. This result is gauge invariant because it involves only the curl of the vector potential. It offers a physical example where replacing canonical by measured momenta in a software interface changes the matrix of fundamental brackets.
With \(H=\pi^2/(2m)+e\phi\), the time derivative is
The kinetic-energy bracket contributes \((e/m)(\boldsymbol\pi\times\mathbf B)_i\); the scalar potential contributes \(-e\partial_i\phi\); and the explicit derivative supplies \(-e\partial_t A_i\). Their sum is \(e[\mathbf E+(\boldsymbol\pi/m)\times\mathbf B]_i\). Dropping the last term would make time-dependent electric acceleration depend on gauge. In a static uniform \(B_z\), the transverse mechanical momenta rotate although their energy is constant. Canonical bracket structure therefore contains observable information about the force even before integrating a trajectory.
A useful finite-difference test sets \(A_y=B x\) and samples the map from canonical to mechanical variables around one state. The measured bracket \(\{\pi_x,\pi_y\}=eB\) should be constant in space. A code that insists on zero will attribute the entire magnetic response to an erroneous Hamiltonian gradient. A code using mechanical variables legitimately can instead use their noncanonical bracket matrix; its equations must then preserve the correct transformed structure, not the original constant \(J\). Testing the resulting acceleration at zero velocity and at a transverse velocity distinguishes electric and magnetic terms and catches sign errors in the antisymmetric entries.
Derive a reversible drift–kick–drift scheme and its measured phase
For \(H=p^2/(2m)+V(q)\), exact kinetic flow for a duration \(t\) is \(D_t:(q,p)\mapsto(q+tp/m,p)\). Exact potential flow is \(K_t:(q,p)\mapsto(q,p-tV'(q))\). Each is canonical. Compose \(D_{h/2}K_hD_{h/2}\) in chronological order. Applying the same construction with \(-h\) undoes each substep in reverse order, so the full map is time reversible. Symmetry eliminates the even local-error powers in the effective generator, giving a second-order method for smooth \(V\). The individual Hamiltonian pieces need not commute; if they did, the split map would be exact at any step.
For a unit oscillator, carrying out the algebra gives
Verify directly that the determinant is one. The trace gives the same step angle \(2\arcsin(h/2)\) as the first-order kick–drift matrix in its stable range, but the new off-diagonal coefficients make the amplitude errors and time reversal different. Starting from \(q=1,p=0\) at \(h=0.50\), one gets \(Q=0.875,P=-0.50\), energy \(0.5078125\). A negative step returns to the initial values apart from roundoff. Passing this one reversal test says nothing about absolute phase accumulated over hundreds of periods.
The map preserves \(q^2+(1-h^2/4)p^2\) exactly for the harmonic test. At \(h=0.5\) the coefficient of \(p^2\) is \(0.9375\), so the preserved ellipses differ slightly from the circles of physical energy. Their reversible oscillation in physical energy is bounded for \(|h|<2\). The per-step phase is about \(0.50536\) at this step, giving a phase gain \(0.536\) radians after one hundred steps. As \(h\) is halved while physical integration time stays fixed, the overall phase error falls approximately by four. Measuring an energy oscillation, a reversal residual and a return time therefore probes three different properties of one apparently simple map.
Compare a symplectic map with the phase of a physical orbit
Change the step of the midpoint update. Distinguish preservation of phase-space structure from agreement of the measured oscillation frequency.
Relate the order of two pulses to their Poisson bracket
A canonical transformation close to identity can be built by applying two brief Hamiltonian operations in different orders. Take one free drift and one potential kick, each of short duration \(s\). A drift then a kick gives
A kick then a drift gives
To second order their coordinate difference is \(q'-q''=s^2V'(q)/m\); their momentum difference is \(p'-p''=-s^2pV''(q)/m+O(s^3)\). The difference vector equals the Hamiltonian vector generated by \(G=pV'(q)/m=\{V,T\}\), multiplied by \(s^2\). The bracket sets the leading effect of reversing the operation order.
For the harmonic oscillator at \(q=1,p=0,m=k=1\) with \(s=0.10\), a drift then kick gives \((1,-0.10)\); kick then drift gives \((0.99,-0.10)\). The coordinate difference \(0.01\) equals \(s^2V'/m\), and the leading momentum difference is zero for this initial condition. At \(q=0,p=1\), the complementary experiment gives a momentum difference of \(-0.01\) and no coordinate difference. Running both initial states tests the two components of the bracket-generated perturbation. A single apparently correct coordinate update would not detect a sign swap in the other component.
An experimental implementation might use a short force pulse as a kick and free propagation between pulses. The pulse must be short enough that motion during the kick is negligible; otherwise its own kinetic drift enters the comparison at the same order as the desired bracket. Extrapolate the measured difference divided by \(s^2\) to small \(s\), and separately measure acquisition noise, which grows in relative importance under that division. Alternating the pulse order cancels many static calibration shifts but does not magically remove timing offsets correlated with the order. Treat the small bracket signal as a physical difference between two specified protocols.
A transformation preserves all coordinate–momentum brackets but a time integration on the transformed variables produces the wrong laboratory trajectory. Can the bracket check alone identify the error?
Work through the solution
Canonical coordinates guarantee the form of Hamilton's equations. Their actual trajectories still require the correct transformed Hamiltonian, including explicit time dependence of the generating function, consistent initial momenta and a sufficiently accurate integrator. Transform an independently known initial state, compare the initial velocity and acceleration of a measurable coordinate, and follow both descriptions back to the same laboratory frame. A bracket test can establish that a change of variables is admissible without establishing that the correct energy function or physical input was attached to it.
Set compatible units before inspecting a symplectic residual
Suppose position is recorded in millimetres and momentum in kilogram metres per second. Scaling each numerical coordinate to unit variance is convenient for fitting a matrix, but independent scaling of each coordinate and momentum can change the bracket matrix from its textbook form. If \(z'=Dz\) with diagonal \(D\), then \(J'=DJD^T\). For one pair this multiplies its bracket by the product of the position and momentum scale factors. In two pairs these factors can differ. A residual computed against the original \(J\) can flag a harmless unit change or, conversely, mask an error if scales happen to compensate.
Choose a characteristic length \(q_0\), momentum \(p_0\), and common action scale \(q_0p_0\) for each pair if the dimensionless chart is to have a common symplectic scale. Otherwise carry the transformed bracket explicitly through the test. With two oscillators of different physical units, a canonical nondimensionalisation may balance the dynamics better than using the same numerical length scale for both. Report the dimensional transformation along with any determinant or defect norm so another calculation can reconstruct which tangent vectors and measurement units were actually compared.
Tutorial on canonical tests
In two degrees of freedom try \(Q_1=q_1,\ Q_2=q_2,\ P_1=p_1+\alpha q_2,\ P_2=p_2\). Is this map canonical? What is the simplest modification that restores the condition?
Work through the solution
The fundamental mixed momentum bracket is \(\{P_1,P_2\}=\alpha\). Restore zero by also taking \(P_2=p_2+\alpha q_1\), since then the extra term \(\{p_1,\alpha q_1\}=-\alpha\) cancels. The added momentum vector is now the gradient of the scalar \(\alpha q_1q_2\), whose derivative matrix is symmetric. Both candidate maps preserve volume, reinforcing why volume alone cannot decide.
For the unit oscillator kick–drift map find a quadratic quantity it preserves exactly while its physical energy changes.
Work through the solution
Direct substitution gives \(Q^2+P^2-hQP=q^2+p^2-hqp\) for the kick–drift convention above. Multiplying by one half gives a positive modified quadratic invariant when \(|h|<2\). The first step at \(h=0.5\) gives \(0.75^2+(-0.50)^2-0.5(0.75)(-0.50)=1.0\), equal to its initial value. At \(h=2\) the quadratic becomes degenerate and beyond it no longer bounds the motion.
A time-dependent momentum shift is generated by \(F_2=qP-a(t)q\). For a free physical particle find the transformed Hamiltonian and verify constant physical momentum.
Work through the solution
The transformation gives
Hamilton's equation gives \(\dot P=+\dot a\), hence \(\dot p=0\). Omitting the explicit \(\partial_tF_2\) term would predict constant \(P\) and a spurious acceleration of the original free particle. This test uses an observable whose physical behaviour is already fixed independently.
Compare generated canonical changes and numerical determinant tests.
David Tong develops canonical transformations and Poisson brackets in Hamiltonian dynamics.