Paired coordinates of a symplectic basis (source code)

= Paired coordinates of a symplectic basis
{title2=$\omega(v,w)=q^TP-p^TQ$}

Write <vectors> in a <symplectic basis> as $v=\sum_i(q_i e_i+p_i f_i)$ and $w=\sum_i(Q_i e_i+P_i f_i)$. Their <coordinate vectors> and the <matrix of a bilinear form> are
$$
[v]_{\mathcal B}=\begin{pmatrix}q\\p\end{pmatrix},\qquad
J=\begin{pmatrix}0&I_n\\-I_n&0\end{pmatrix},\qquad
\omega(v,w)=[v]_{\mathcal B}^{T}J[w]_{\mathcal B}
=\sum_{i=1}^n(q_iP_i-p_iQ_i).
$$
Here $I_n$ is the <identity matrix>, and $T$ denotes <transpose>. The ordering matters: interleaving the <basis> as $(e_1,f_1,\ldots,e_n,f_n)$ instead gives a <block diagonal matrix> with $2\times2$ blocks $\begin{pmatrix}0&1\\-1&0\end{pmatrix}$. Some conventions reverse every $f_i$, giving $-J$ instead. Always check the displayed pairing convention.<Handbook of Differential Geometry, Volume II/Symplectic Geometry>[§1.1, p. 83: e-then-f basis and its block matrix; the coordinate formula follows by bilinearity]{ref}

Over the <real numbers>, each summand is the signed <area> of a <parallelogram> in the $(q_i,p_i)$ coordinate plane. For $a=(2,1,1,1)^T$ and $b=(1,1,0,2)^T$, the two signed <areas> are $-1$ and $1$, so $\omega(a,b)=0$ although the <vectors> are <linearly independent>. The cancellation concerns the <symplectic form>; it does not assert that their <dot product> vanishes. Over a general <field>, the same <determinant> formula is algebraic, without a signed geometric interpretation.

\Image[/symplectic-paired-coordinate-areas.png]
{title=Paired coordinate planes and the pairing matrix of a four-dimensional symplectic basis}
{description=The two projected parallelograms have signed areas minus one and plus one, which cancel. The matrix uses the e-then-f ordering; all self-pairings are zero.}