Determinant-n matrix representatives for Hecke operators (source code)

= Determinant-n matrix representatives for Hecke operators
{title2=$\Pi_n$}

Left $SL_2(\mathbb Z)$-orbits of integral matrices of positive determinant $n$ have unique representatives $\begin{pmatrix}a&b\\0&d\end{pmatrix}$ with $a,d>0$, $ad=n$ and $0\leq b<d$. Bezout's identity reduces the first column to $(a,0)$; a row shear reduces $b$ modulo $d$.