Function: mftwist
Section: modular_forms
C-Name: mftwist
Prototype: GG
Help: mftwist(F,D): returns the twist of the form F by the
 integer D, i.e., the form G such that mfcoef(G,n)=(D/n)mfcoef(F,n),
 where (D/n) is the Kronecker symbol.
Doc: $F$ being a generalized modular form, returns the twist of $F$ by the
 integer $D$, i.e., the form $G$ such that
 \kbd{mfcoef(G,n)=}$(D/n)$\kbd{mfcoef(F,n)}, where $(D/n)$ is the Kronecker
 symbol.
 \bprog
 ? mf = mfinit([11,2],0); F = mfbasis(mf)[1]; mfcoefs(F, 5)
 %1 = [0, 1, -2, -1, 2, 1]
 ? G = mftwist(F,-3); mfcoefs(G, 5)
 %2 = [0, 1, 2, 0, 2, -1]
 ? mf2 = mfinit([99,2],0); mftobasis(mf2, G)
 %3 = [1/3, 0, 1/3, 0]~
 @eprog\noindent Note that twisting multiplies the level by $D^{2}$. In
 particular it is not an involution:
 \bprog
 ? H = mftwist(G,-3); mfcoefs(H, 5)
 %4 = [0, 1, -2, 0, 2, 1]
 ? mfparams(G)
 %5 = [99, 2, 1, y, t - 1]
 @eprog
