Fricke transform of a primitive coprime twist (source code)

= Fricke transform of a primitive coprime twist
{c}
{title2=$f_\chi|W_{ND^2}=\psi(D)\chi(N)\frac{\tau(\chi)^2}{D}\,g_{\overline\chi},\quad g=f|W_N$}

Use the <determinant-normalized slash operator> and $W_M=\begin{pmatrix}0&-1\\M&0\end{pmatrix}$. For units $u,v$ with $Nuv\equiv-1\pmod D$, the <matrix> identity $U_uW_{ND^2}=D\gamma_uW_NU_v$ has $\gamma_u=\begin{pmatrix}(1+Nuv)/D&u\\Nv&D\end{pmatrix}\in\Gamma_0(N)$. A positive scalar <matrix> acts trivially. The <nebentypus> supplies $\psi(D)$; reindexing gives $\overline\chi(u)=\chi(-N)\chi(v)$. Thus the factor is initially $\psi(D)\chi(-N)\tau(\chi)/\tau(\overline\chi)$. The primitive <Gauss sum of a Dirichlet character> identity $\tau(\chi)\tau(\overline\chi)=\chi(-1)D$ gives the displayed equivalent factor. No assumption that $f$ itself is a Fricke eigenform is needed.