Matrix root basis of the symplectic Lie algebra (source code)

= Matrix root basis of the symplectic Lie algebra
{title2=$\mathfrak{sp}_{2l}=H\oplus\bigoplus_{r\in C_l}\mathbb C e_r$}

Relative to $J=\begin{pmatrix}0&I\\-I&0\end{pmatrix}$, a <symplectic Lie algebra> matrix has blocks $\begin{pmatrix}P&Q\\R&-P^{\mathsf T}\end{pmatrix}$ with $Q,R$ symmetric. Its diagonal <Cartan subalgebra> has basis $E_{ii}-E_{l+i,l+i}$. Write $\varepsilon_i(h)=\lambda_i$. A <root-space decomposition> is obtained from
$$
\begin{aligned}
e_{\varepsilon_i-\varepsilon_j}&=E_{ij}-E_{l+j,l+i} &&(i\ne j),\\
e_{\varepsilon_i+\varepsilon_j}&=E_{i,l+j}+E_{j,l+i} &&(i<j),\\
e_{-\varepsilon_i-\varepsilon_j}&=E_{l+i,j}+E_{l+j,i} &&(i<j),\\
e_{2\varepsilon_i}&=E_{i,l+i},\qquad e_{-2\varepsilon_i}=E_{l+i,i}.&&
\end{aligned}
$$
The <matrix unit> rule $[h,E_{ab}]=(h_{aa}-h_{bb})E_{ab}$ proves $[h,e_r]=r(h)e_r$. These root vectors and the diagonal basis span all the permitted blocks and are independent. There are $2l^2$ roots and $l$ diagonal basis elements, giving <dimension> $l(2l+1)$.