Testing latest pari + WASM + node.js... and it works?! Wow.
License: GPL3
ubuntu2004
\documentclass[11pt]{article}1%\overfullrule=5pt2\usepackage{amsmath}3\usepackage{amsfonts}4\usepackage{amssymb}56\DeclareMathOperator{\Tr}{Tr}7\DeclareMathOperator{\PSL}{PSL}8\DeclareMathOperator{\SL}{SL}9\DeclareMathOperator{\GL}{GL}10\newcommand{\Q}{{\mathbb Q}}11\newcommand{\Z}{{\mathbb Z}}12\newcommand{\R}{{\mathbb R}}13\newcommand{\C}{{\mathbb C}}14\newcommand{\z}{\zeta}15\newcommand{\al}{\alpha}16\newcommand{\be}{\beta}17\newcommand{\ga}{\gamma}18\renewcommand{\z}{\zeta}19\renewcommand{\th}{\theta}20\newcommand{\G}{\Gamma}21\newcommand{\new}{\text{new}}2223\def\kbd#1{{\tt #1}}2425\begin{document}26\pagestyle{plain}2728\title{Tutorial for Modular Forms in Pari/GP}29\author{Henri Cohen}3031\maketitle3233\smallskip3435\section{Introduction}3637Three packages are available to work with modular forms and related functions38in \kbd{Pari/GP}. The first one is the $L$-function package, which has been39available since 2.9.0 (2015), and computes with general motivic40$L$-functions, and in particular with $L$-functions attached to Dirichlet41characters, Hecke characters, Artin representations, and modular forms. The42name of most functions in this package begins with \kbd{lfun}, such as43\kbd{lfuninit}.4445The second is the modular symbol package, whose primary aim46is not so much to compute modular form spaces and modular forms, but to47compute $p$-adic $L$-functions attached to modular forms. The name of most48functions in this package begins with \kbd{ms}, such as \kbd{msinit}.4950The third package is the modular forms package, whose aim is to compute in51the standard spaces $M_k(\G_0(N),\chi)$ with $k$ integral or half-integral,52both with modular form \emph{spaces} and individual modular \emph{forms}. The53name of most functions in this package begins with \kbd{mf}, such as54\kbd{mfinit}. The goal of the present manual is to describe this package in55view of a guide for a new user, so will essentially be a tutorial,56although we include a reference guide at the end.5758\medskip5960We can work on five subspaces of $M_k(\G_0(N),\chi)$, through a61corresponding \emph{space flag} in the commands: the cuspidal \emph{new62space} $S_k^{\new}(\G_0(N),\chi)$ (flag = 0), the full cuspidal space63$S_k(\G_0(N),\chi)$ (flag = 1), the old space $S_k^{\text{old}}(\G_0(N),\chi)$64(flag = 2, probably of little use), the space generated by all Eisenstein65series ${\cal E}_k(\G_0(N),\chi)$ (flag = 3), and finally the full space66including the Eisenstein part $M_k(\G_0(N),\chi)$ (flag = 4, which can be67omitted since it is the default). Note that although it can be defined, we have68not included the space $M_k^{\new}$, nor the ``certain space'' of69Zagier--Skoruppa. In the half-integral weight case, we have included70only the full cuspidal space and the full space (flags $1$ and $4$), as71well as the Kohnen's $+$-space and the corresponding newspace and eigenforms72when $N$ is squarefree.7374Note in particular that the package includes the computation of modular75forms of weight $k=1$ and of half-integral weight.7677\medskip7879The modular forms themselves are represented in a special internal format80which the user need not worry about and which basically is a recipe to81compute successive Fourier coefficients at infinity: if $F$ is a GP modular82form, \kbd{mfcoefs}$(F, 10)$ will give you the Fourier coefficients at infinity83from $a(0)$ to $a(10)$ of the modular form corresponding to $F$ as a row84\emph{vector} (if you want a power series expansion, use the GP function85\kbd{Ser}, see below). Many operations are available on such objects, but the86most important thing the user needs to know is that the number of Fourier87coefficients need not be specified in advance: the command88\kbd{mfcoefs}$(F,n)$ is valid for any integer $n$. We will of course explain89the details of this below.9091\medskip9293Finally, note that we may roughly divide the complexity of available functions94into three levels:9596\begin{enumerate}97\item The first level includes all the basic modular form and modular spaces98creation and operations. Many functions are very fast, but some are quite99time-consuming for very different reasons; first those dealing with forms and100spaces involving Dirichlet characters of large order; second finding eigenforms101when the splitting using the Hecke algebra is difficult; and third modular102spaces of weight $1$ when there exist ``exotic'' forms. Reasonable levels103(for low weight) can go up to a few thousands. The critical parameter is104actually the dimension of the underlying modular form space where linear105algebra needs to be performed, so the time complexity is at least106proportional to $(N\times k)^3$, and in fact more than that due to107coefficient explosion in the base field $\Q(\chi)$.108109\item The second level needs technical information about spaces generated by110products of two Eisenstein series, and is quite expensive. But it allows to111perform computations which would be almost impossible otherwise, such as112Fourier expansions of $f|_k\gamma$ (hence at any cusp), numerical113evaluation of modular forms at any point in the upper half-plane (even close114to the real axis) or $L$-functions attached to an arbitrary form. We have115included a caching method, so that once a single such computation is116performed in a given space, the needed technical data is stored and117no longer needs to be computed so that all subsequent calls are much faster.118Reasonable levels (for low weight) can go up to one thousand, say.119Again, the critical parameter is the space dimension but this time the120linear algebra is performed in large degree cyclotomic fields, even when the121Nebentypus is trivial. Compared to the first level, we lose at least122a factor $\Lambda(N)$ (the exponent of the multiplicative group $(\Z/N\Z)^*$)123in the time complexity, which gets as large as $N-1$ if $N$ is prime.124125\item The third level, which uses the second level functions, allows more126numerical computations such as period polynomials, modular symbols,127Petersson products, etc\dots The time complexity does not increase much128since it is dominated by the second level.129\end{enumerate}130131\section{Creation of Modular Forms}132133In \kbd{Pari/GP} modular forms can be created in three different ways:134135\begin{itemize}\item As \emph{basic modular forms}, i.e., forms attached (or136not) to different mathematical objects, and which are of so frequent use137that we have implemented them so that the user has them at his disposal.138Examples: \kbd{mfDelta} (Ramanujan's delta), \kbd{mfEk}139(Eisenstein series of weight $k$ on the full modular group; of course140we also have more general Eisenstein series), \kbd{mffrometaquo}141(eta quotients), \kbd{mffromell} (modular form attached to an elliptic142curve over $\Q$), \kbd{mffromqf} (modular form attached143to a lattice).144\item From existing forms by applying \emph{operations}.145Examples: multiplication/division, linear combination,146derivation and integration, Serre derivative, RC-brackets, Hecke and147Atkin--Lehner operations, expansion and diamond operators, etc\dots148\item Through the creation of the modular form \emph{spaces}:149typically, if only \kbd{mf=mfinit} is applied, then a150basis of forms is obtained by the command \kbd{mfbasis(mf)}.151The command \kbd{mfeigenbasis(mf)} produces the canonical basis of152eigenforms.\end{itemize}153154\section{A First Session: working with Leaves}155156This is now a tutorial session. We will see sample commands as we go along.157158\begin{verbatim}159? D = mfDelta(); V = mfcoefs(D, 8)160% = [0, 1, -24, 252, -1472, 4830, -6048, -16744, 84480]161\end{verbatim}162163The command \kbd{mfcoefs(D,n)} gives the vector of Fourier coefficients (at164infinity) $[a(0),a(1),\dots,a(n)]$ (note that there are $n+1$ coefficients).165This is a compact representation, but if you prefer power series you166can use \kbd{Ser(V,q)} (convert a vector into a power series).167168\begin{verbatim}169% = q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6\170- 16744*q^7 + 84480*q^8 + O(q^9)171\end{verbatim}172(This simple-minded recipe only works when the form has rational173coefficients. Make sure to use \kbd{q = varhigher("q")} first if the form has174nonrational algebraic coefficients to avoid problems with variable priorities.)175Similarly176177\begin{verbatim}178? E4 = mfEk(4); E6 = mfEk(6); apply(f->mfcoefs(f,3),[E4,E6])179% = [[1, 240, 2160, 6720], [1, -504, -16632, -122976]]180? E43 = mfpow(E4, 3); E62 = mfpow(E6, 2);181? DP = mflinear([E43, E62], [1, -1]/1728);182? mfcoefs(DP, 6)183% = [0, 1, -24, 252, -1472, 4830, -6048]184? mfisequal(D, DP)185% = 1186\end{verbatim}187188Self-explanatory. Note that there is a command \kbd{mfcoef(F, n)} (without189the final ``s'') which simply outputs the coefficient $a(n)$.190A final example of the same type:191192\begin{verbatim}193? F = mffrometaquo([1,2; 11,2]); mfcoefs(F,10)194% = [0, 1, -2, -1, 2, 1, 2, -2, 0, -2, -2]195? G = mffromell(ellinit("11a1"))[2];196? mfisequal(F, G)197% = 1198\end{verbatim}199200Here, \kbd{mffrometaquo} takes as argument a matrix representing an201\emph{eta quotient}, here $\eta(1\times\tau)^2\eta(11\times\tau)^2$.202203The second component of the \kbd{mffromell} output is the modular form204associated to the elliptic curve by modularity.205206\section{A Second Session: Modular Form Spaces}207208In the first session, we have seen a few preinstalled modular forms (that209we can call \emph{leaves}), and a number of operations on them. All reasonable210operations have been implemented (if some are missing, please tell us). We are211now going to work with \emph{spaces} of modular forms.212213\begin{verbatim}214? mf = mfinit([1,12]); L = mfbasis(mf); #L215% = 2216? mfdim(mf)217% = 2218\end{verbatim}219220This creates the full space of modular forms of level $1$ and weight $12$.221This space is created thanks to an almost random basis that one can obtain222using \kbd{mfbasis}, and we see either by asking for the number of elements223of \kbd{L} or by using the command \kbd{mfdim}, that it has dimension $2$,224not surprising. We can see it better by writing:225226\begin{verbatim}227? mfcoefs(L[1],6)228% = [691/65520, 1, 2049, 177148, 4196353, 48828126, 362976252]229? mfcoefs(L[2],6)230% = [0, 1, -24, 252, -1472, 4830, -6048]231\end{verbatim}232or simply233\begin{verbatim}234? mfcoefs(mf,6) \\ apply mfcoefs to mfbasis elements235% =236[691/65520 0]237[ 1 1]238[ 2049 -24]239[ 177148 252]240[ 4196353 -1472]241[ 48828126 4830]242[362976252 -6048]243\end{verbatim}244245Note two things: first, the Eisenstein series are given before the cusp forms246(this may change, but for now this is the case), and second, the Eisenstein247series is normalized so that it is the coefficient $a(1)$ which is equal to248$1$, and not $a(0)$. In particular, here at least, it is a normalized249Hecke eigenform.250251If we want to work only in the cuspidal space $S_{12}(\G)$, we simply use252the flag $1$, such as:253254\begin{verbatim}255? mf = mfinit([1,12], 1); L = mfbasis(mf); #L256% = 1257? mfcoefs(L[1],6)258% = [0, 1, -24, 252, -1472, 4830, -6048]259\end{verbatim}260261Let us now look at higher dimensional cases. In the following example, we262consider the \emph{new space} (flag = $0$), although in the present case263this is the same as the cuspidal space:264265\begin{verbatim}266? mf = mfinit([35,2], 0); L = mfbasis(mf); #L267% = 3268? for (i = 1, 3, print(mfcoefs(L[i], 10)))269[0, 3, -1, 0, 3, 1, -8, -1, -9, 1, -1]270[0, -1, 9, -8, -11, -1, 4, 1, 13, 7, 9]271[0, 0, -8, 10, 4, -2, 4, 2, -4, -12, -8]272\end{verbatim}273274These are essentially random cusp forms. Usually, you want the eigenforms:275this is obtained by the function \kbd{mfeigenbasis} (note in passing that276\kbd{B=mfeigenbasis(mf)} adds components to \kbd{mf}, so that the next277call is instantaneous). You can ask for the defining number fields with the278command \kbd{mffields}. Note that these commands act only on the new space,279but the package also accepts the spaces that contain it (such as the cuspidal280space or the full space, but not the old space), although the result is only281about the new space.282283\begin{verbatim}284? mffields(mf)285% = [y, y^2 - y - 4]286? L = mfeigenbasis(mf); #L287% = 2288? mfcoefs(L[1],10)289% = [0, 1, 0, 1, -2, -1, 0, 1, 0, -2, 0]290? mfcoefs(L[2],4)291% = [Mod(0, y^2 - y - 4), Mod(1, y^2 - y - 4),\292Mod(-y, y^2 - y - 4),Mod(y - 1, y^2 - y - 4),\293Mod(y + 2, y^2 - y - 4)]294? lift(mfcoefs(L[2],10))295% = [0, 1, -y, y - 1, y + 2, 1, -4, -1, -y - 4, -y + 2, -y]296\end{verbatim}297298The command \kbd{mffields} gives the polynomials in the variable $y$ defining299the number field extensions on which the eigenforms are defined. Here, one of300the fields is $\Q$, the other is $\Q(\sqrt{17})$. To obtain the eigenforms,301we use \kbd{mfeigenbasis}, and there are only two and not three, since the302one defined on $\Q(\sqrt{17})$ goes together with its conjugate. Asking303directly \kbd{mfcoefs(L[2],4)} gives the coefficients as \kbd{polmods}, not304easy to read, so it is usually preferable to \emph{lift} them, giving the305last command, where in the output we must of course remember that $y$ stands306for \emph{one} of the two roots of $y^2-y-4=0$, i.e., $(1\pm\sqrt{17})/2$.307308In fact, for some numerical computations, we really need the309coefficients of the eigenform embedded in $\C$, and not just as abstract310algebraic numbers (in our case of trivial character, they will be in $\R$).311This is why a few functions (most notably \kbd{mfeval} and \kbd{lfunmf})312will return a \emph{vector} of results and not a scalar when called on such313a form.314315For instance, here is a little GP script which computes the numerical316expansion of a modular form instead of the expansion in \kbd{polmods}:317318\begin{verbatim}319mfcoefsembed(F,n) = mfembed(F, mfcoefs(F,n));320\end{verbatim}321322Note that this produces a vector of expansions when the eigenforms323are defined over an extension, i.e. $[\Q(F):\Q(\chi)] > 1$, one per conjugate324form.325\begin{verbatim}326? mfcoefsembed(L[2],5) \\ two conjugate forms327%4 = [[0, 1, 1.5615..., -2.5615..., 0.43844..., 1],328[0, 1, -2.561...,, 1.5615...,, 4.5615..., 1]]329\end{verbatim}330331The first eigenform found above is \emph{rational}, hence by the modularity332theorem there exists up to isogeny a unique elliptic curve to which it333corresponds. We check this by writing334335\begin{verbatim}336? [mf,F] = mffromell(ellinit("35a1")); mfcoefs(F, 10)337% = [0, 1, 0, 1, -2, -1, 0, 1, 0, -2, 0]338? mfisequal(F, L[1])339% = 1340\end{verbatim}341342For a more typical example (still with no character):343344\begin{verbatim}345? [ mfdim([96,2], flag) | flag <- [0..4] ]346% = [2, 9, 7, 15, 24]347\end{verbatim}348349This gives us the dimensions of the new space, the cuspidal space,350the old space, the space of Eisenstein series, and the whole space of351modular forms.352353Just for fun, we write (recall that the default is the full space):354\begin{verbatim}355? mf = mfinit([96,2]); L = mfbasis(mf);356? for (i = 12, 15, print(mfcoefs(L[i], 15)))357[23/24, 1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24]358[31/24, 1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24]359[47/24, 1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24]360[95/24, 1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24]361\end{verbatim}362363Apparently, these four Eisenstein series differ only by their constant364term, which is of course not possible. Indeed:365366\begin{verbatim}367? F = mflinear([L[14],L[12]],[1,-1]); mfcoefs(F, 50)368% = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\3690, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\3700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0]371? G = mfhecke(mf, F, 24); mfcoefs(G, 12)372% = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96]373? mftobasis(mf, G)374% = [0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\3750, 0, 0, 0, 0, 0]~376? 24*mfcoefs(L[5], 12)377% = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96]378\end{verbatim}379380The first command shows that the Eisenstein series differ on their $n$-th381Fourier coefficient for $n=0$, $24$, and $48$, and the second command applies382the Hecke operator $T_{24}$ (sometimes denoted $U_{24}$) to the difference,383whose effect is to replace $a(n)$ by $a(24n)$, giving the much more384compact output of $G$. The last commands show that $G$ is equal to385$24$ times the fifth Eisenstein series \kbd{L[5]}.386387\begin{verbatim}388? mf=mfinit([96,2],0); mffields(mf)389% = [y, y]390? L = mfeigenbasis(mf); for(i=1, 2, print(mfcoefs(L[i], 16)))391[0, 1, 0, 1, 0, 2, 0, -4, 0, 1, 0, 4, 0, -2, 0, 2, 0]392[0, 1, 0, -1, 0, 2, 0, 4, 0, 1, 0, -4, 0, -2, 0, -2, 0]393? Fa = mffromell(ellinit("96a1"))[2]; mfcoefs(Fa, 16)394% = [0, 1, 0, 1, 0, 2, 0, -4, 0, 1, 0, 4, 0, -2, 0, 2, 0]395? Fb = mffromell(ellinit("96b1"))[2]; mfcoefs(Fb, 16)396% = [0, 1, 0, -1, 0, 2, 0, 4, 0, 1, 0, -4, 0, -2, 0, -2, 0]397\end{verbatim}398399The \kbd{mffromell} function returns a triple \kbd{[mf,F,C]},400where \kbd{mf} is the modular form cuspidal space to which \kbd{F} belongs,401\kbd{F} is the rational eigenform corresponding to the elliptic curve by402modularity, and \kbd{C} is the vector of coefficients of \kbd{F} on the403basis in \kbd{mf}, which we recall is usually not a basis of eigenforms404(otherwise \kbd{F} would belong to this basis).405406Note also that \kbd{Fa} and \kbd{Fb} are twists of one another:407408\begin{verbatim}409? mfisequal(mftwist(Fa, -4), Fb)410% = 1411\end{verbatim}412413\section{Interlude: Dirichlet characters}414415There are many ways to represent multiplicative characters on $(\Z/N\Z)^*$ in416\kbd{Pari/Gp}, we will list them by increasing order of sophistication,417restricting to characters with complex values:418419\begin{itemize}420421\item A quadratic character $(D/.)$ (Kronecker symbol) is described by422the integer $D$. For instance $1$ is the trivial character.423424\item There is a (noncanonical but fixed) bijection between $(\Z/N\Z)^\times$425and its character group, via \emph{Conrey labels}. So \kbd{Mod}$(a,N)$426represents a character whenever $a$ is coprime to $N$. This makes it easy427to loop on all characters without worrying too much about which is which.428In this labeling, \kbd{Mod(1,N)} is the trivial character, and characters429are multiplied/divided by performing the corresponding operation on their430Conrey labels.431432\item The finite abelian group $G = (\Z/N\Z)^*$ is written433$$G = \bigoplus_{i\leq n}\; (\Z/d_i\Z) \cdot g_i,$$434with $d_n \mid \dots \mid d_2 \mid d_1$ (SNF condition), all $d_i > 0$, and435$\prod_i d_i = \phi(N)$. The SNF condition makes the $d_i$ unique, but the436generators $g_i$, of respective order $d_i$, are definitely not unique. The437$\oplus$ notation means that all elements of $G$ can be written uniquely as438$\prod_i g_i^{n_i}$ where $n_i \in \Z/d_i\Z$. The $g_i$ are the so-called439\emph{SNF generators} of $G$. The command \kbd{znstar}$(N)$ outputs the SNF440structure (group order, $d_i$ and $g_i$), but $G = \kbd{znstar}(N, 1)$ is441needed to initialize a group we can work with: most importantly we can now442solve discrete logarithm problems and decompose elements on the $g_i$.443444A character on the abelian group $\oplus (\Z/d_j\Z) g_j$ is given by a row445vector $\chi = [a_1,\ldots,a_n]$ of integers $0\leq a_i < d_i$ such that446$\chi(g_j) = e(a_j / d_j)$ for all $j$, with the standard notation $e(x) :=447\exp(2i\pi x)$. In other words, $\chi(\prod g_j^{n_j}) = e(\sum a_j n_j /448d_j)$. In this encoding $[0,\dots,0]$ is the trivial character. Of course449a character $\chi$ must always be given as a \emph{pair} $[G,\chi]$,450since $\chi$ is meaningless without knowledge of the $(g_i)$ or the $(d_i)$.451\end{itemize}452453The command \kbd{znchar}$(S)$ converts a datum describing a character to the454third form $[G,\chi]$. The command \kbd{znchartokronecker} converts a455character of order $\leq 2$ to the first form $(D/.)$, and functions such456as \kbd{zncharconductor}, \kbd{znchartoprimitive}, and \kbd{zncharinduce}457allow to restrict or extend characters between different $(\Z/M\Z)^*$.458459Note the important fact that it is necessary to give the two arguments $G$ and460$\chi$ separately to these functions, for instance \kbd{zncharconductor(G,chi)}461(and not \kbd{zncharconductor([G,chi])}).462463Functions such as \kbd{charmul}, \kbd{chardiv}, \kbd{charpow},464\kbd{charorder} or \kbd{chareval} apply to more general abelian characters465than characters on $(\Z/N\Z)^\times$, whence the prefix \kbd{char} instead of466\kbd{znchar}.467468\section{A Third Session: Nontrivial Characters}469470Recall that a nontrivial character can be represented either by a discriminant471$D$ (not necessarily fundamental), the character being the Legendre--Kronecker472symbol $(D/n)$, or by its \emph{Conrey label} in $(\Z/N\Z)^\times$, for473instance \kbd{Mod(161,633)} (which has order 42, as \kbd{znorder} tells us).474475Defining modular form spaces with character is as simple as without:476we replace the parameters $[N,k]$ by $[N,k,\chi]$.477Instead of \kbd{mf=mfinit([35,2])}, one can write478\kbd{mf=mfinit([35,2,5], 0)}, where 5 is the quadratic character $(5/.)$. Thus:479480\begin{verbatim}481? mf = mfinit([35,2,5],0); mffields(mf)482% = [y^2 + 1]483? F = mfeigenbasis(mf)[1]; lift(mfcoefs(F, 10))484% = [0, 1, 2*y, -y, -2, -y - 2, 2, -y, 0, 2, -4*y + 2]485\end{verbatim}486where in the last output $y$ is equal to one of the two roots of $y^2+1=0$,487i.e., $\pm i$.488489Working with nontrivial characters allows us in particular to work with odd490weights, and in particular in weight $1$:491492\begin{verbatim}493? mf = mfinit([23,1,-23], 0); mfdim(mf)494% = 1495? F = mfbasis(mf)[1]; mfcoefs(F, 16)496% = [0, 1, -1, -1, 0, 0, 1, 0, 1, 0, 0, 0, 0, -1, 0, 0, -1]497? mfgaloistype(mf,F)498% = 6499\end{verbatim}500501The last output means that the image in $\PSL_2(\C)$ of the projective502representation associated to $F$ is of type $D_3$. Note that an ''exotic''503representation is given by a negative number, opposite of the cardinality504of the projective image.505506Since this form is of dihedral type, it can be obtained via theta functions.507Indeed:508509\begin{verbatim}510? F1 = mffromqf([2,1; 1,12])[2]; V1 = mfcoefs(F1, 16)511% = [1, 2, 0, 0, 2, 0, 4, 0, 4, 2, 0, 0, 4, 0, 0, 0, 2]512? F2 = mffromqf([4,1; 1,6])[2]; V2 = mfcoefs(F2, 16)513% = [1, 0, 2, 2, 2, 0, 2, 0, 2, 2, 0, 0, 4, 2, 0, 0, 4]514? (V1 - V2)/2515% = [0, 1, -1, -1, 0, 0, 1, 0, 1, 0, 0, 0, 0, -1, 0, 0, -1]516? mfisequal(F, mflinear([F1, F2], [1, -1]/2))517% = 1518\end{verbatim}519520Here we were lucky in that we ``knew'' that the correct character was521$(-23/n)$. But what if we did not know this ? The first observation is522that modular form spaces corresponding to Galois conjugate characters523are isomorphic ($\chi$ is Galois conjugate to $\chi'$ if $\chi'=\chi^m$524for some $m$ coprime to the order of $\chi$). Thus, it is sufficient525to find a representative of each equivalence class, and this is given by526the \kbd{GP} commands \kbd{G=znstar(N,1); chargalois(G)}, where $N$ is the527level of the desired character (note that $N$ will not necessarily be528the conductor of the characters). This exactly outputs a list of representative529of each equivalence class (do not for now try to understand the details of530this command, nor the fact that \kbd{chargalois} and \kbd{znstar} have531optional parameters). However, this is not quite yet what we want.532Although only for efficiency, we want characters with the same parity533as the weight, otherwise the corresponding modular form spaces will be $0$.534This is achieved by the \kbd{GP} command \kbd{zncharisodd(G,chi)} which535does what you think it does. Let us first do this for $N=23$: we write536\begin{verbatim}537? G = znstar(23, 1);538? L = [chi | chi<-chargalois(G), zncharisodd(G,chi)]; #L539% = 2540? [mfdim([23,1,[G,chi]], 0) | chi <- L ]541% = [0, 1]542? [charorder(G,chi) | chi <- L]543% = [22, 2]544\end{verbatim}545546This tells us that (up to Galois conjugation) there are two possible odd547characters, one, of order $22$, giving a $0$-dimensional space, the other548being the quadratic character given above. Note that \kbd{chargalois}549returns (orbits of) characters attached to an arbitrary abelian finite group550$G$ while \kbd{mfinit} expects a \emph{pair} \kbd{[G,chi]} for some551\kbd{znstar} $G$, as written above.552553When doing long explorations with all characters of a certain level, it554is preferable to use \emph{wildcards}. For instance, instead of the above555one can write:556557\begin{verbatim}558? mfall = mfinit([23,1,0], 0); #mfall559% = 1560? mf = mfall[1]; mfdim(mf)561% = 1562? mfparams(mf)563% = [23, 1, -23, 0]564\end{verbatim}565566This does not exactly give us the same information: the third parameter $0$567in the first command asks for \emph{all} nonempty spaces of level $23$ and568weight $1$, and the program tells us that there is only one, of dimension $1$.569The last command \kbd{mfparams} outputs \kbd{[N,k,CHI,space]}, so here tells570us that the corresponding character is the Kronecker--Legendre symbol $(-23/n)$.571572Using wildcards, let us explore levels in certain ranges: we write573\begin{verbatim}574wt1exp(lim1,lim2)=575{ my(mfall,mf,chi,v);576for (N = lim1, lim2,577mfall = mfinit([N,1,0], 0); /* use wildcard */578for (i=1, #mfall,579mf = mfall[i];580chi = mfparams(mf)[3]; /* nice format: D or Mod(a,N) */581[ print([N,chi,-t]) | t<-mfgaloistype(mf), t < 0 ]582)583);584}585\end{verbatim}586587For instance, \kbd{wt1exp(1,230)} outputs in 4 seconds588589\begin{verbatim}590[124, Mod(87, 124), 12]591[133, Mod(83, 133), 12]592[148, Mod(105, 148), 24]593[171, Mod(94, 171), 12]594[201, Mod(104, 201), 12]595[209, Mod(197, 209), 12]596[219, Mod(8, 219), 12]597[224, Mod(95, 224), 12]598[229, Mod(122, 229), 24]599[229, Mod(122, 229), 24]600\end{verbatim}601602Thus, the smallest exotic $A_4$ form is in level $124$ and the smallest $S_4$603form is in level $148$. Note that in level $229$, we have two (non Galois604conjugate) eigenforms of type $S_4$.605606If we type \kbd{wt1exp(633,633)}, in 6 seconds we obtain \kbd{[633, Mod(107,607633), 60]}, and this level is indeed the lowest level for which there exists608a type $A_5$ form. The character orders are obtained either as609\kbd{znorder(chi)} (since all the \kbd{chi} are \kbd{intmods}), or610using the general construction611\begin{verbatim}612[G,v] = znstar(chi);613ord = charorder(G,v)614\end{verbatim}615where we first convert \kbd{chi} to a general abelian character in616$[G,\chi]$ format.617618\section{Leaf Functions}619620Although we have already seen most of these functions in the first session,621we repeat some of examples here.622623\subsection{Functions Created from Scratch}624625We now start a slightly more systematic exploration of the available functions.626We begin by \emph{leaf functions}, i.e., functions created from scratch or627from a given mathematical object.628629\begin{verbatim}630? D = mfDelta(); mfcoefs(D, 5)631% = [0, 1, -24, 252, -1472, 4830]632? E4 = mfEk(4); mfcoefs(E4, 5)633% = [1, 240, 2160, 6720, 17520, 30240]634? E6 = mfEk(6);635? D2 = mflinear([mfpow(E4, 3), mfpow(E6, 2)], [1, -1]/1728);636? mfisequal(D, D2)637% = 1638\end{verbatim}639640Self-explanatory. More complicated Eisenstein series:641642\begin{verbatim}643? E3 = mfeisenstein(1, 1, -3); mfcoefs(E3, 10)644% = [1/6, 1, 0, 1, 1, 0, 0, 2, 0, 1, 0]645? E4 = mfeisenstein(5, -4, 1); mfcoefs(E4, 10)646% = [5/4, 1, 1, -80, 1, 626, -80, -2400, 1, 6481, 626]647? H2 = mfEH(5/2); mfcoefs(H2,10)648% = [1/120, -1/12, 0, 0, -7/12, -2/5, 0, 0, -1, -25/12, 0]649\end{verbatim}650651The \kbd{mfeisenstein(k,c1,c2)} command generates the Eisenstein series of weight652$k$ and characters \kbd{c1} and \kbd{c2}. The \kbd{mfEH(k)} command is specific653to half-integral weight $k$ and generates the Cohen--Eisenstein series of654weight $k$.655656\begin{verbatim}657? T = mfTheta(); mfcoefs(T,16)658% = [1, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2]659? mf = mfinit([4, 5, -4]); mftobasis(mf, mfpow(T, 10))660% = [64/5, 4/5, 32/5]661? B = mfbasis(mf); apply(mfdescribe, B)662% = ["F_5(1, -4)", "F_5(-4, 1)", "TR^new([4, 5, -4, y])"]663? mfisCM(B[3])664% = -4665\end{verbatim}666667Here, we compute the coefficients of $\th^{10}$ on the basis of \kbd{mf}668(we know of course the level, weight, and character). We then apply669the \kbd{mfdescribe} function, which tells us that the first two forms in670the basis are Eisenstein series, and the third one is some trace form671on the cuspidal new space. However, the last command says that this third672basis element is a \emph{CM form}, so that its coefficients can be computed673just as fast as those of Eisenstein series, so that there does exist674an explicit formula for the number of representations as a sum of ten675squares.676677Keeping the above sessions, we can also write:678679\begin{verbatim}680? mftobasis(mf, mfpow(H2, 2))681% = [1/18000, 1/18000, -3/2000]~682\end{verbatim}683684\subsection{Functions Created from Mathematical Objects}685686\begin{verbatim}687? [mf,F,co] = mffromell(ellinit("26b1")); co688% = [1/2, 1/2]~689? mfcoefs(F,10)690% = [0, 1, 1, -3, 1, -1, -3, 1, 1, 6, -1]691\end{verbatim}692693This creates the modular form attached by modularity to the second isogeny694class of elliptic curves over $\Q$ for conductor $26$. The result is a6953-component vector: \kbd{mf} is the modular form space, $F$ the modular form,696and \kbd{co} are the coefficients of $F$ on the basis of \kbd{mf}.697698Similarly, there are functions \kbd{mffromlfun} (from $L$-functions attached699to eigenforms), \kbd{mffromqf} (from quadratic forms) and \kbd{mffrometaquo}:700701\begin{verbatim}702? F = mffrometaquo([1, 2; 11, 2]); mfcoefs(F, 10)703% = [0, 1, -2, -1, 2, 1, 2, -2, 0, -2, -2]704? F = mffrometaquo([1, 2; 2, -1]); mfparams(F)705% = [16, 1/2, 1, y]706? mfcoefs(F, 10)707% = [1, -2, 0, 0, 2, 0, 0, 0, 0, -2, 0]708\end{verbatim}709710The \kbd{mfparams} command tells us that $F\in M_{1/2}(\G_0(16))$.711712\section{Atkin, Hecke and Expanding Operators}713714\begin{verbatim}715? mf = mfinit([96,4], 0); mfdim(mf)716% = 6717? M = mfheckemat(mf, 7)718% =719[0 0 0 372 696 0]720721[0 0 36 0 0 -96]722723[0 27/5 0 -276/5 -276/5 0]724725[1 0 -12 0 0 62]726727[0 0 1 0 0 -16]728729[0 -3/5 0 14/5 -16/5 0]730? P = charpoly(M)731% = x^6 - 1456*x^4 + 209664*x^2 - 2985984732? factor(P)733% =734[x - 36 1]735736[x - 12 1]737738[ x - 4 1]739740[ x + 4 1]741742[x + 12 1]743744[x + 36 1]745\end{verbatim}746747Note a few things: first, the matrix of the Hecke operator $T(7)$ does not748have integral coefficients. Indeed, recall that the basis of modular forms749in \kbd{mf} is mostly random, so there is no reason for the matrix to be750integral. On the other hand, since the eigenvalues of Hecke operators are751algebraic integers, the characteristic polynomial of $T(7)$ must be monic752with integer coefficients. As it happens, it factors completely into753linear factors to the power $1$, so all the eigenvalues of $T(7)$ are in754fact in $\Z$: this immediately shows that the splitting will be entirely755rational and the eigenforms with integer coefficients. Let's check:756757\begin{verbatim}758? mffields(mf)759% = [y, y, y, y, y, y]760? L = mfeigenbasis(mf); for(i=1,6,print(mfcoefs(L[i],16)))761[0, 1, 0, 3, 0, 10, 0, 4, 0, 9, 0, -20, 0, 70, 0, 30, 0]762[0, 1, 0, 3, 0, 2, 0, 12, 0, 9, 0, 60, 0, -42, 0, 6, 0]763[0, 1, 0, 3, 0, -14, 0, -36, 0, 9, 0, -36, 0, 54, 0, -42, 0]764[0, 1, 0, -3, 0, 10, 0, -4, 0, 9, 0, 20, 0, 70, 0, -30, 0]765[0, 1, 0, -3, 0, 2, 0, -12, 0, 9, 0, -60, 0, -42, 0, -6, 0]766[0, 1, 0, -3, 0, -14, 0, 36, 0, 9, 0, 36, 0, 54, 0, 42, 0]767\end{verbatim}768769We see that of the six eigenforms, the last three are twists of the first770three.771772There also exists the command \kbd{G=mfhecke(mf,F,n)}, which given a modular773form $F$ in \kbd{mf}, outputs the modular form $T(n)F$.774775\begin{verbatim}776? mf=mfinit([96,6],0); mffields(mf)777% = [y, y, y, y, y, y, y^2 - 31, y^2 - 31]778? mfatk = mfatkininit(mf,3);779% factor(charpoly(mfatk[2]/mfatk[3]))780% =781[x - 1 5]782783[x + 1 5]784\end{verbatim}785786This requires a little explanation: the command \kbd{mfatkininit(mf,3)}787computes a number of quantities necessary to work with the Atkin--Lehner788operator $W_3$ in the space \kbd{mf}. The main part of the result is789the second component, which is essentially the matrix of $W_3$ on the790basis of \kbd{mf}, and which is guaranteed to have exact coefficients791(here rational). However in the general case, the matrix of $W_3$792is equal to \kbd{mfatk[2]/mfatk[3]}, where \kbd{mfatk[3]} may be an793inexact complex number. For now you need not worry about the first component.794795Thus, the eigenvalues (or possibly the pseudo-eigenvalues) must be of modulus796$1$, and in the case of a quadratic character defined modulo $N/Q$, they797are equal to $\pm1$ in even weight, to $\pm i$ in odd weight. Here,798$1$ and $-1$ both occur $5$ times. However, this does not tell us which799eigenvalues correspond to each eigenspace. For this, we do the following:800801\begin{verbatim}802? mfatkineigenvalues(mf,3)803% = [[-1], [-1], [-1], [1], [1], [1], [-1, -1], [1, 1]]804? mf=minit([96,3,-3],0); mffields(mf)805% = [y^4 + 8*y^2 + 9, y^4 + 4*y^2 + 1]806? mfatkineigenvalues(mf,32)807% = [[I, -I, -I, I], [-I, I, I, -I]]808? mfatkineigenvalues(mf,3)809% = [[a, -conj(a), -a, conj(a)], [b, -conj(b), conj(b), -b]]810\end{verbatim}811812The first command tells us that in the six rational eigenspaces, the first813three have eigenvalue $-1$, the other three $+1$, and in the eigenspaces814of dimension $2$, the first eigenspace has both eigenvalues $-1$, the815second both $+1$. As is seen from the next lines, it is of course not816necessary for the eigenvalues of $W_Q$ in the same eigenspace to be equal.817818In the next two commands, we are now in a case where the character is819non trivial and the weight odd. The eigenvalues are now $\pm i$, and not820equal in the same eigenspace.821822Finally, the last command is a case where the character is not defined modulo823$N/Q=96/3=32$, so we only have pseudoeigenvalues, which are simply of824absolute value $1$ by Atkin--Lehner theory. Here, $a$ and $b$ are825complicated complex numbers and \kbd{conj} denotes the complex conjugate826(using the \kbd{algdep} command, one can check that $a$ is a root of827$9x^4+10x^2+9=0$ and $b$ is a root of $3x^4-2x^2+3=0$.828829Note that when the character is (trivial or) quadratic and defined modulo830$N/Q$ the output is always rounded, but otherwise, the eigenvalues are given831as approximate complex numbers.832833As for the Hecke operators, there exists an \kbd{mfatkin} command, whose834syntax is \kbd{mfatkin(mfatk, F)}, where \kbd{mfatk} is the output of835an \kbd{mfatkininit} command and $F$ is in the space \kbd{mfatk}, and which836outputs the modular form $F|_kW_Q$, where $Q$ is implicit in \kbd{mfatk}.837838Finally note the \kbd{mfbd} expanding command which computes $B(d)F$:839840\begin{verbatim}841? E4 = mfEk(4); mfcoefs(E4,6)842% = [1, 240, 2160, 6720, 17520, 30240, 60480]843? F = mfbd(E4,2); mfcoefs(F,6)844% = [1, 0, 240, 0, 2160, 0, 6720]845\end{verbatim}846847\section{Algebraic Functions on Modular Forms}848849Here we give examples of functions on modular forms which do not involve850any approximate numerical computation. We have already mentioned the most851important ones: \kbd{mfhecke}, \kbd{mfatkin}, and \kbd{mfbd}.852853\begin{verbatim}854? E4 = mfEk(4); F = mfderivE2(E4); mfcoefs(F,5)855% = [-1/3, 168, 5544, 40992, 177576, 525168]856? E6 = mfEk(6); mfisequal(F, mflinear([E6], [-1/3]))857% = 1858? G = mfbracket(E4, E6, 1); mfcoefs(G,5)859% = [0, -3456, 82944, -870912, 5087232, -16692480]860? mfisequal(G, mflinear([mfDelta()], [-3456]))861% = 1862\end{verbatim}863864\medskip865866In the first commands, we compute the Serre derivative of $E_4$, and867check that it is equal to $-E_6/3$. The name \kbd{mfderivE2} of course868comes from the fact that the Serre derivative involves the quasi-modular869Eisenstein series $E_2$. Note that there exists the function \kbd{mfderiv}870(including to negative order, corresponding to integration), which is871provided for the user's convenience for certain computations, but whose872output is outside the range of modular forms.873874The second computation checks that the first Rankin--Cohen bracket of875$E_4$ and $E_6$ is a multiple of $\Delta$.876877You may complain that it is heavy to write an \kbd{mflinear} command as above878simply to compute a scalar multiple of a form. But nothing prevents you from879defining in a script that you read at the beginning of your session:880881\begin{verbatim}882mfscalmul(F,s)=mflinear([F],[s]);883mfadd(F,G)=mflinear([F,G],[1,1]);884mfsub(F,G)=mflinear([F,G],[1,-1]);885\end{verbatim}886887There also exist the natural operations on modular forms \kbd{mfmul},888\kbd{mfdiv} (which may result in modular functions, i.e., with poles),889and \kbd{mfpow}. There is also a function \kbd{mfshift} (multiply or divide890by a power of $q$), but which again takes us outside the range of modular891forms.892893\begin{verbatim}894? E4 = mfEk(4); F = mftwist(E4, -3); mfcoefs(F, 7)895% = [0, 240, -2160, 0, 17520, -30240, 0, 82560]896? mfparams(F)897% = [9, 4, 1, y]898? mf = mfinit([4,5,-4], 1); F = mfbasis(mf)[1]; mfcoefs(F, 10)899% = [0, 1, -4, 0, 16, -14, 0, 0, -64, 81, 56]900? mfisCM(F)901% = -4902? G = mftwist(F, -4); mfcoefs(G, 10)903% = [0, 1, 0, 0, 0, -14, 0, 0, 0, 81, 0]904? mfparams(G)905% = [16, 5, -4, y]906? mfconductor(mfinit(G, 1), G)907% = 8908\end{verbatim}909910This session illustrates a number of important issues concerning911\emph{twisting}. In the first commands, we twist $E_4$ by the quadratic912character $-3$ (in the present implementation, only twisting by quadratic913characters is allowed), and we see that the resulting form has level914$9=(-3)^2$. Fine. In the next command, we compute the unique form915in $S_4(\G_0(5),\chi_{-4})$, and see that it has CM by $\Q(\sqrt{-4})$.916917However, note that the form is not equal to the form twisted by the918character $\chi_{-4}$ (only the coefficients of $q^n$ with $n$ prime to $4$919are equal, the others vanish). The \kbd{mfparams} command tells us that920the twisted form has level $16=(-4)^2$. However, the final command tells921us that in fact it has level $8$: \kbd{mfconductor} gives the smallest922level on which the form is defined.923924\begin{verbatim}925? mf = mfinit([96,2], 1); L = mfbasis(mf);926? apply(x->mfconductor(mf,x), L)927% = [24, 48, 96, 32, 96, 48, 96, 96, 96]928? apply(x->mftonew(mf,x)[1][1..2], L)929% = [[24, 1], [24, 2], [24, 4], [32, 1], [32, 3],\930[48, 1], [48, 2], [96, 1], [96, 1]]931\end{verbatim}932933Here we compute the full cuspidal space $S_2(\G_0(96))$, of dimension $9$,934and we ask which is the lowest level on which each form in the basis935is defined. This list shows that there is one form $F_1$ in level $24$936which, by applying $B(d)$ with $d=2$ and $d=4$ gives a form of level $48$937and one of level $96$. Then a form $F_2$ in level $32$, by applying $B(3)$938gives a form of level $96$, a form $F_3$ in level $48$, by applying $B(2)$939gives a form of level $96$, and finally two genuine forms of level $96$940(so that the dimension of the newspace is equal to $2$, which we can check941by typing \kbd{mfdim([96,2],0)}).942943The last command \kbd{mftonew} checks all this; look at the precise description944of the command.945946\section{Cusps and Cosets}947948Recall that in the present version of the package, the only congruence949subgroup that is considered is $\G_0(N)$, so when we consider cusps in950the geometrical sense, they are cusps of $\G_0(N)$, and cosets are951right cosets of $\G_0(N)$ in $\G$, so that $\G=\bigsqcup_j\G_0(N)\ga_j$.952953The function \kbd{mfcusps(N)} gives the list of all (equivalence classes of)954cusps of $\G_0(N)$, \kbd{mfcuspwidth(N,cusp)} gives the width of the cusp;955these are linked to the \emph{geometry}. On the other hand, the notion956of \emph{regularity} of a cusp is linked to the specific modular form space,957and the function \kbd{mfcuspisregular([N,k,CHI],cusp)} determines if the cusp958is regular or not:959960\begin{verbatim}961? C = mfcusps(108)962% = [0, 1/2, 1/3, 2/3, 1/4, 1/6, 5/6, 1/9, 2/9, 1/12,\9635/12, 1/18, 5/18, 1/27, 1/36, 5/36, 1/54, 1/108]964? [mfcuspwidth(108,c) | c<-C]965% = [108, 27, 12, 12, 27, 3, 3, 4, 4, 3, 3, 1, 1, 4,\9661, 1, 1, 1]967? NK = [108,3,-4];968? [mfcuspisregular(NK,c) | c<-C]969% = [1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1]970? [c | c<-C, !mfcuspisregular(NK,c)]971% = [1/2, 1/6, 5/6, 1/18, 5/18, 1/54]972\end{verbatim}973974The first command list the $18$ cusps of $\G_0(108)$ (\kbd{mfnumcusps(108)}975gives this directly, useful if there are thousands of cusps and you do not976want them explicitly), the second command prints their widths, and the last977commands show that the cusps $1/2$, $1/6$, $5/6$, $1/18$, $5/18$, and $1/54$978are irregular in the space $M_3(\G_0(108),\chi_{-4})$, and the others are979regular.980981There is another command \kbd{mfcuspval} having to do with cusps, but this982will be mentioned later.983984\medskip985986\begin{verbatim}987? C = mfcosets(4)988% = [[0, -1; 1, 0], [1, 0; 1, 1], [0, -1; 1, 2],\989[0, -1; 1, 3], [1, 0; 2, 1], [1, 0; 4, 1]]990? mftocoset(4, [1, 1; 2, 3], C)991% = [[-1, 1; -4, 3], 5]992\end{verbatim}993994The \kbd{mfcosets(N)} command lists all right cosets of $\G_0(N)$ in $\G$.995Note that in the present implementation the trivial coset is always the996last one, and is represented by the matrix $[1,0;N,1]$, but since this997may change one must be careful.998999The \kbd{mftocoset(N,M,C)} command gives a two-component1000vector $[\ga,i]$, where $\ga\in\G_0(N)$ is such that $M=\ga\cdot C[i]$.10011002\section{The mfslashexpansion command}10031004We now give examples of the use of advanced features of the package, which1005use inexact complex arithmetic. However in many cases the results are known1006algebraic numbers and, if asked to do so, the function gives them exactly.10071008This command returns the Fourier expansion at infinity of $f |_k \gamma$,1009for $\gamma\in \GL_2(\Q)^+$. It returns a vector $v$ of coefficients, which1010can only be interpreted together with three extra parameters1011$\al\in \Q_{\geq 0}$, $w \in \Z_{\geq 1}$ and a1012$2\times 2$ upper triangular matrix $A=[a,b;0,d]$1013(equal to the identity if $\gamma\in\PSL_2(\Z)$). We have1014$f |_k \gamma = F |_k A $, with1015$$F(\tau) = q^\al \sum_{n\geq 0} v[n] q^{n/w}$$1016and $q = e(\tau)$. Of course, $F |_k A = (a/d)^{k/2} F(\tau + b/d)$ so the1017exact expansion is easily inferred from the returned one, whereas the chosen1018encoding allows to compute the coefficients $v[n]$ in a smaller number field1019than if we had included all the constants into $v$. It is important to note1020that the three parameters $\al, w, A$ only depend on the modular form1021space and $\gamma$, but not on the form $f$.10221023\begin{verbatim}1024? mf = mfinit([4,6]); B = mfbasis(mf);1025? for (i=1, #B, \1026print( mfslashexpansion(mf,B[i],[1,0;2,1],5,1,&P) ))1027\\ we don't print P which is [0, 1, [1,0;0,1]] in all cases1028[-1/504, 1, 33, 244, 1057, 3126]1029[-1/504, 0, 1, 0, 33, 0]1030[-1/32256, -1/64, 33/64, -61/16, 1057/64, -1563/32]1031[0, -1, 0, 12, 0, -54]1032? R = mfslashexpansion(mf,B[1],[0,-1;4,0],5,1,&P); [P,R]1033% = [[0, 1, [1,0;0,1]], [-8/63, 0, 0, 0, 64, 0]]1034? R = mfslashexpansion(mf,B[1],[0,-1;1,0],5,1,&P); [P,R]1035% = [[0, 4, [1,0;0,1]], [-1/504, 0, 0, 0, 1, 0]]10361037? mf=mfinit([4,7,-4]); B=mfbasis(mf);1038? for (i=1, #B, \1039print( mfslashexpansion(mf,B[i],[1,0;2,1],5,1,&P) ))1040\\ we don't print P which is [1/2, 1, [1,0;0,1]] in all cases1041[1/64, 91/8, 7813/32, 7353/4, 530713/64, 221445/8]1042[1, -728, 15626, -117648, 530713, -1771560]1043[1/16, -15/2, 5/8, 75, -231/16, -465/2]1044[2, 0, 20, 0, -462, 0]1045? mfslashexpansion(mf,B[1],[0,-1;4,0],5,1,&P)1046% = [Mod(61/256*t, t^2 + 1), Mod(-1/64*t, t^2 + 1),1047Mod(-1/64*t, t^2 + 1), Mod(91/8*t, t^2 + 1),1048Mod(-1/64*t, t^2 + 1), Mod(-7813/32*t, t^2 + 1)]1049? P1050% = [0, 1, [1, 0; 0, 1]]1051? R=mfslashexpansion(mf,B[1],[0,-1;4,0],5,0)1052% = [0.23828125000000000000000000000000000000*I,\1053-0.015625000000000000000000000000000000000*I,\1054-0.015625000000000000000000000000000000000*I,\105511.375000000000000000000000000000000000*I,\1056-0.015625000000000000000000000000000000000*I,\1057-244.15625000000000000000000000000000000*I]1058? bestappr(R)1059% = [61/256*I, -1/64*I, -1/64*I, 91/8*I, -1/64*I, -7813/32*I]1060\end{verbatim}10611062Here are some detailed explanations. The first space is $M_6(\G_0(4))$,1063of dimension $4$. We ask for $1+5$ terms of the Fourier expansion of1064$F|_6\ga$ for all $F$ in the given basis, and $\ga=[1,0;2,1]$, which is one1065of the possible Fourier expansions at the cusp $1/2$. The last parameter1066$P$ contains $[\al,w,A]$ after the call and the $1$ means we want an exact1067algebraic expression (a $0$ as used in the last example means we expect1068floating point complex numbers).10691070We obtain the $4$ desired expansions. In the next commands, we do the same1071for the first basis element and $\ga=[0,-1;4,0]$, which is the1072\emph{Fricke involution}, and corresponds to the cusp $0$. The next1073command, which does essentially the same computation, uses $\ga=[0,-1;1,0]$,1074and now $P=[0,4, [1,0;0,1]]$ which tells us that the expansion is in powers of1075$q^{1/4}$.10761077The next example is the space $M_7(\G_0(4),\chi_{-4})$, also of1078dimension $4$, and we ask the same thing. Now $P$ tells us that $\al = 1/2$1079and $w = 1$ so we now have for instance1080$$B[1]|_7\ga = (1/64)q^{1/2} + (91/8)q^{3/2}+\cdots$$10811082In the next command, we expand $B[1]|_7\ga$ with $\ga$ equal to the Fricke1083involution; and finally we check numerically by setting the one-to-last1084parameter to $0$ and obtain the expansion as raw complex numbers. We1085recognize them immediately using the \kbd{bestappr} command.10861087Note that in the special case (like here) where $\ga$ is a Fricke (or more1088generally an Atkin--Lehner) involution, we can proceed otherwise to obtain1089the expansion:10901091\begin{verbatim}1092? mfatk = mfatkininit(mf,4); C = mfatk[3]1093% = -1.000000000000000000000000000*I1094? F = mfatkin(mfatk, B[1]); mfcoefs(F, 6)1095% = [61/256, -1/64, -1/64, 91/8, -1/64, -7813/32, 91/8]1096\end{verbatim}10971098This tells us that the true expansion of $F|_7W_4$ is the expansion that1099is output divided by the constant $C$, so we recover the previous1100expansion.11011102\smallskip11031104It is important to see what affects the timing and correctness of the1105\kbd{mfslashexpansion} command. The following session gives typical examples:11061107\begin{verbatim}1108? mf = mfinit([496,4],0); F = mfbasis(mf)[1]; mfdim(mf)1109time = 329 ms.1110% = 451111? mfslashexpansion(mf,F,[1,0;3,1],5,0,&P);1112time = 1,316 ms.1113? mfslashexpansion(mf,F,[1,0;3,1],5,1,&P);1114time = 51,136 ms.11151116? mf = mfinit([503,4],0); F = mfbasis(mf)[1]; mfdim(mf)1117time = 1,505 ms.1118% = 1251119? sizebyte(mf)1120% = 51233521121? mfslashexpansion(mf,F,[1,0;3,1],5,0,&P);1122time = 32,640 ms.1123? sizebyte(mf)1124% = 182164001125? mfslashexpansion(mf,F,[1,0;3,1],5,0,&P);1126time = 6,504 ms.1127\end{verbatim}11281129We omit the numerical outputs since they have no significance for the present1130discussion. We notice several things:1131\begin{itemize}1132\item First, the time for rationalization (flag $1$) in the first example1133is extremely large: $51$ seconds instead of $1.3$. The reason for this is1134that the width of the corresponding cusp (here $1/3$) is equal to $P[2]=496$,1135and the program must recognize algebraic numbers in the large cyclotomic1136field $\Q(\zeta_{496})$ which takes a huge amount of time. In fact, at the1137default accuracy of $38D$, the result is certainly wrong.1138\item Second, the time depends enormously on the dimension: the expansion1139for dimension $125$ is $25$ times slower than for dimension $45$, of course1140not surprising, but it must be taken into account.1141\item Third, and most importantly, the last command shows the cache effect:1142exactly the same instruction now requires only $6.5$ seconds instead of1143$32.6$. This is because, behind the scenes, the first \kbd{mfslashexpansion}1144precomputed a number of quantities which it stored in your variable \kbd{mf}:1145in fact, the \kbd{sizebyte} commands show that, after the first expansion,1146the size of \kbd{mf} has more than tripled.1147\end{itemize}11481149\section{Analytic Commands}11501151The existence of the \kbd{mfslashexpansion} command allows us to do many1152useful things. In fact, already the \kbd{mfatkininit} and \kbd{mfatkin}1153commands would not be possible without it. Immediate applications are the1154\kbd{mfcuspval} command which computes the valuation at cusps, and the1155\kbd{mfeval} command, which in addition to computing values in the upper-half1156plane (see below), also computes values at the cusps:11571158\begin{verbatim}1159? T = mfTheta(); mf=mfinit(T);C=mfcusps(mf)1160% = [0, 1/2, 1/4]1161? [ mfcuspval(mf,T,c) | c<-C ]1162% = [0, 1/4, 0]1163? mfeval(mf, T, C) \\ or [mfeval(mf,T,c) | c<-C]1164% = [1/2 - 1/2*I, 0, 1]1165\end{verbatim}11661167More sophisticated is the computation of numerical periods, and more1168generally of \emph{symbols}1169$$\int_{s_1}^{s_2}(X-\tau)^{k-2}F|_k\ga(\tau)\,d\tau\;,$$1170where $s_1$ and $s_2$ are two cusps (e.g., $s_1=0$, $s_2=\infty$):11711172\begin{verbatim}1173? mf = mfinit([96,4],0); [F1] = mfbasis(mf);1174? FS1 = mfsymbol(mf,F1);1175time = 2,272 ms1176? mfsymboleval(FS1,[0,oo])1177% = 2.0968669678226579060336519703627002478*I*x^2\1178+ 0.36368580656317635568444277442842940073*x\1179- 0.049315736834713109138297211986510643780*I1180? mfsymboleval(FS1,[1,5/2])1181% = 4.1937339356453158120673039407254004956*I*x^2\1182+ (0.72737161312635271136888554885685880147\1183- 14.678068774758605342235563792538901735*I)*x\1184+ (-1.2729003229711172448955497104995029026\1185+ 15.103654043044843600467382361156555509*I)1186? mfsymboleval(FS1,[1,2],[0,-1;1,0])1187% = (0.54552870984476453352666416164264410111\1188+ 2.5224522361088961642654705389803540222*I)*x^2\1189+ (-0.72737161312635271136888554885685880148\1190- 6.2906009034679737181009559110881007434*I)*x\1191+ 4.1937339356453158120673039407254004956*I1192\end{verbatim}11931194The general strategy for computing these quantities is first to do a1195precomputation which only involves \kbd{mf} and the form $F$ using1196\kbd{mfsymbol}, which can take a few seconds, but afterwards all the1197computations are instantaneous.11981199Note that if you only want the period polynomial from $0$ to $\infty$ use1200\kbd{mfperiodpol(mf,F1)} which gives the same answer as before but in only1201$20$ ms.12021203You may also use \kbd{mfsymboleval} in two other ways, but note that in1204this case the precomputation is not used so the computation may be slow:12051206\begin{verbatim}1207? mf=mfinit([96,6],0);F=mfbasis(mf)[1];1208? FS=mfsymbol(mf,F);1209time = 9,761 ms.1210? mfsymboleval(FS,[I,oo])1211% = 0.0029721...*I*x^4 + 0.0137806...*x^3 + ... + 0.0061009...1212? mfsymboleval(FS,[I,2*I])1213% = 0.0029665...*I*x^4 + 0.0137326...*x^3 + ... + 0.0059760...1214? mfsymboleval(FS,[I/10000,I])1215% = 46.363730...*I*x^4 + 3.8815894...*x^3 + ... + 0.0183869...1216? -x^4*subst(mfsymboleval(FS,[I,10000*I],[0,-1;1,0]),x,-1/x)1217% = 46.363730...*I*x^4 + 3.8815894...*x^3 + ... + 0.0183869...1218? mfsymboleval([mf,F],[I,oo])1219% = 0.0029721...*I*x^4 + 0.0137806...*x^3 + ... + 0.0061009...1220? mfsymboleval([mf,F],[I,2*I])1221% = 0.0029665...*I*x^4 + 0.0137326...*x^3 + ... + 0.0059760...1222\end{verbatim}12231224These examples illustrate four points:1225\begin{enumerate}\item Computing an \kbd{mfsymbol}1226may be rather long ($9.8$ seconds in this example), although as already1227mentioned, subsequent computations of symbols \emph{between cusps} will then1228be instantaneous.1229\item As the next three commands show, \kbd{mfsymboleval}1230also accepts paths with endpoints in the upper half-plane. Although we1231have tried to optimize the computation, in certain cases (but not in1232the above example) when one of the endpoints is close to the real line1233the computation may be slow.1234\item The next command shows the use of the extra parameter $\ga$ which1235asks to integrate $F|_k\ga$ instead of $F$, here with \kbd{ga=[0,-1;1,0]}.1236This allows to perform the same computation with endpoints which are away1237from the real line. This is essentially what is done \emph{automatically} by1238\kbd{mfsymboleval}.1239\item The last two commands show a special format which avoids doing the1240longish \kbd{mfsymbol} computation: the results are obtained almost1241instantaneously \emph{without} using symbols. The price to pay in using this1242``cheaper'' format is that the endpoints of the path cannot be cusps other1243than \kbd{oo}.1244\end{enumerate}12451246\begin{verbatim}1247? mf = mfinit([96,4],0); [F1,F2] = mfbasis(mf);1248? FS1 = mfsymbol(mf,F1); FS2 = mfsymbol(mf,F2);1249? mfpetersson(FS1)1250% = 0.000614716841498177889240915163025173918261251? mfpetersson(FS2)1252% = 0.00553245157348360100316823646722656526471253? mfpetersson(FS1, FS2)1254% = 1.5879887877319313665 E-40 + 7.652958013165934297 E-42*I1255\end{verbatim}12561257Same remark: once the \kbd{mfsymbols} \kbd{FS1} and \kbd{FS2} initialized,1258all the Petersson product computations (as well as others) are essentially1259immediate. Note that since neither \kbd{F1} nor \kbd{F2} are eigenforms,1260there is no reason for their Petersson product to vanish. To prove it does1261we do as follows:12621263\begin{verbatim}1264? BE = mfeigenbasis(mf);1265? M = Mat([mftobasis(mf,f) | f<-BE]); M^(-1)1266% =1267[1 3 10 4 -20 70]12681269[1 3 2 12 60 -42]12701271[1 3 -14 -36 -36 54]12721273[1 -3 10 -4 20 70]12741275[1 -3 2 -12 -60 -42]12761277[1 -3 -14 36 36 54]1278\end{verbatim}12791280On the other hand, it is immediate to see that \kbd{BE[i+3]} is a twist of1281\kbd{BE[i]} and that as a consequence their Petersson square are equal. It1282follows from the shape of the above matrix that the Petersson scalar product1283of $B[i]$ with $B[j]$ will vanish when the corresponding scalar product of1284the corresponding columns vanish, hence for $(i,j)=(1,2)$, $(1,4)$, $(1,5)$,1285$(2,3)$, $(2,6)$, $(3,4)$, $(3,5)$, $(4,6)$, and $(5,6)$.12861287\smallskip12881289Note that \kbd{mfpetersson} can also be used for two noncuspidal forms, as1290long as the Petersson product converges. Consider the following example:12911292\begin{verbatim}1293? mf = mfinit([12,5,-3]); cusps = mfcusps(mf);1294? E1 = mfeisenstein(5,1,-3); [mfcuspval(mf,E1,c) | c<-cusps]1295% = [0, 0, 1, 0, 1, 1]1296? E2 = mfeisenstein(5,-3,1); [mfcuspval(mf,E2,c) | c<-cusps]1297% = [1/3, 1/3, 0, 1/3, 0, 0]1298? P(mf) =1299{ my(E1S = mfsymbol(mf,E1));1300my(E2S = mfsymbol(mf,E2));1301mfpetersson(E1S,E2S); }1302? P(mf)1303% = -1.8848216716468969562647734582232071466 E-5\1304- 1.9057659114817512165 E-43*I1305? mf3 = mfinit([3,5,-3]); P(mf3)1306time = 16 ms.1307? mf96 = mfinit([96,5,-3]); P(mf96)1308time = 3,521 ms.1309\end{verbatim}13101311The first commands create two Eisenstein series of weight $5$,1312$E_5(1,\chi_{-3})$ and $E_5(\chi_{-3},1)$, which belong to1313$M_5(\G_0(3),\chi_{-3})$. In the next commands, we look at the larger space of1314level $12$ and compute the valuations of $E_1$ and $E_2$ at the six cusps of1315$\G_0(12)$. We see that at these six cusps one of the two Eisenstein series1316vanishes, so the Petersson product will converge, and is computed in the1317next command. In the last commands we compute the same product but in level1318$3$ and level $96$; because of the normalization, we obtain essentially the1319same result (not given), but of course the times are very different: $0.016$1320seconds in level $3$ and $3.5$ seconds in level $96$.13211322\medskip13231324There are two more important numerical functions: evaluating a modular form1325at a point in the upper half plane, and evaluating the corresponding1326$L$-function. We begin by a trivial example:13271328\begin{verbatim}1329? E4 = mfEk(4); mf = mfinit(E4); mfeval(mf,E4,I)1330% = 1.45576289226870932246242200359886928741331? 3*gamma(1/4)^8/(2*Pi)^61332% = 1.45576289226870932246242200359886928741333\end{verbatim}13341335This is of course a trivial computation, simply sum the $q$-expansion. The1336fact that the value of a modular form with rational coefficients such as1337$E_4$ at a \emph{CM point} such as $i$ has an explicit expression is a1338consequence of complex multiplication.13391340\begin{verbatim}1341? mf = mfinit([12,4],1); F = mfbasis(mf)[1];1342? mfeval(mf, F, 1/Pi + 10^(-6)*I)1343% = -89811.049350396250531782882568405506024\1344- 58409.940965200894541585402642924371696*I1345? mfeval(mf, F, 1/Pi + 10^(-7)*I)1346% = 4.8212468504661113183253396691813292261 E-52\1347+ 6.7885262281520647908871247541561415340 E-52*I1348\end{verbatim}13491350Several remarks are in order.13511352\begin{enumerate}1353\item We are evaluating a modular form very near the1354real axis. If the form was in level $1$ such as $E_4$ above, we could use a1355modular transformation to reduce to the evaluation in the fundamental domain1356of $\G$, which would be very fast. Here we do something similar but1357more sophisticated.1358\item Contrary to most examples, the result at height $10^{-7}$ is not a1359numerical approximation of $0$, the exact value is indeed as printed to1360the given accuracy.1361\item It is amusing to see the large oscillations of the value: at height1362$10^{-6}$ the value is still in the $10^5$ range, and at $10^{-7}$ it is1363in the $10^{-52}$ range. Of course it must eventually tend to $0$ since1364$F$ is a cusp form (for $E_4$ it would tend to infinity).1365\item When applying \kbd{mfeval} at a \emph{cusp} (as above for1366\kbd{mfTheta()}), the result is1367the value at the cusp, but is in general \emph{not} equal1368to the limit of the value of the modular form when the argument tends to1369the cusp, since this limit is often infinite for a noncuspidal form.1370\end{enumerate}13711372Note that when dealing with \emph{eigenforms}, which may have several1373embeddings into $\C$, the result will have several components, one for each1374embedding:13751376\begin{verbatim}1377? mf = mfinit([23,2],0); F=mfeigenbasis(mf)[1];1378? mfeval(mf,F,I)1379% = [0.0018695834459685012330841605500720163964,\13800.0018618146628840767703527958851699552194]1381\end{verbatim}13821383More generally, this embedding problem affects all numerical functions.1384Continuing the above example:13851386\begin{verbatim}1387? mfparams(F)1388% = [23, 2, 1, y^2 - y - 1]1389? mfslashexpansion(mf,F,[0,-1;1,0],5,1)1390% = [0, -1/23, 1/23*y, -2/23*y + 1/23, -1/23*y + 1/23, 2/23*y]1391? FS = mfsymbol(mf,F); mfpetersson(FS,FS)1392% =1393[0.00394889657400250316885... -1.0827196147167250830 E-40]13941395[-1.2120247024777595243 E-40 0.00564425429876478351015...]1396\end{verbatim}13971398The $y$ in the second result is thus understood to be \emph{one} of1399the roots of the polynomial $y^2-y-1$, and the result of \kbd{mfpetersson}1400is a $2\times 2$ \emph{diagonal} matrix because of the two embeddings of $F$.14011402\smallskip14031404The other important evaluation function is that of the $L$-function1405attached to a modular form. In fact, the modular form package only1406creates (in a clever way) the $L$-function, all the rest of the work1407is done by the $L$-function package. Note the important fact that1408the modular form need not be an eigenform or even stable under the1409Fricke involution.14101411\begin{verbatim}1412? E4 = mfEk(4); mf=mfinit(E4); LE = lfunmf(mf,E4);1413? lfun(LE, 2) / Pi^21414% = -3.33333333333333333333333333333333333331415? lfun(LE, 0)1416% -11417? D = mfDelta(); mf=mfinit(D); LD = lfunmf(mf,D);1418? lfunlambda(LD, 3)/lfunlambda(LD, 5)1419% = 1.55555555555555555555555555555555555561420? lfunlambda(LD, 1)/lfunlambda(LD, 3)1421% = 2.34442836468885672937771345875542691751422? bestappr(%)1423% = 1620/6911424? mf = mfinit([23,2],0); F = mfbasis(mf)[1]; L = lfunmf(mf,F);1425? lfun(L, 2)1426% = 1.59599837534502725809764134374801718321427? G = mfeigenbasis(mf)[1]; M = lfunmf(mf,G);1428? apply(x->lfun(x,I),M)1429% = [-0.15856033373254740657327844579672155664\1430+ 0.79671369922504818377602680344686311969*I,\1431-0.10230278816509023908993775663030712037\1432+ 0.65954223983092583287784522268295299513*I]1433\end{verbatim}14341435Note that the constant term $a(0)$ is ignored by the $L$-function, but1436can be recovered thanks to the formula $a(0)=-L(F,0)$.14371438The last commands illustrate first the fact that the $L$-functions can be1439computed for non-eigenforms ($F$ is not an eigenform), and second that1440if there are several embeddings, the \kbd{lfunmf} function returns a1441vector of \kbd{lfunmf}, one for each embedding.14421443Another illustration of the $L$-function package:14441445\begin{verbatim}1446? LIN = lfuninit(LD, [6, 6, 50]);1447? ploth(t = 0, 50, lfunhardy(LIN, t))1448\end{verbatim}14491450%\includegraphics[width=\textwidth]{pari3.pdf}14511452\medskip14531454\section{The mfeigensearch and mfsearch commands}14551456The last commands that we want to illustrate are \emph{searching} commands,1457The idea is simple: you believe that you have a modular form, but you do not1458know its level, weight, character, or field of definition of its1459coefficients, but only a number of its Fourier coefficients, perhaps only1460modulo $p$, and you would like to find forms which ``match'' your given form.14611462In this degree of generality, the search space is too wide. We have therefore1463decided to reduce the generality, so as to make the search more reasonable.1464Note that this will probably vary with the different versions of the program,1465so what is described here may be more restrictive than future versions. In1466the present implementation, we assume that the form we are looking for has1467rational coefficients, so that its character is (trivial or) quadratic.14681469The \kbd{mfsearch} command does this naively but is likely to be more1470efficient than taylor-made scripts:1471\begin{verbatim}1472? V = mfsearch([60,2],[0,1,2,3,4,5,6], 1); #V1473time = 5 ms.1474% = 31475? V = mfsearch([[1..60],2],[0,1,2,3,4,5,6], 1); #V1476time = 40 ms.1477% = 51478? [ mfparams(f) | f<-V ]1479% = [[56, 2, 8, y], [58, 2, 1, y],1480[60, 2, 1, y], [60, 2, 12, y], [60, 2, 60, y]]1481? [ print(mfcoefs(f,10)) | f<-V ]1482[0, 1, 2, 3, 4, 5, 6, -6, -4, -7, -20]1483[0, 1, 2, 3, 4, 5, 6, -34, 37, 22, 7]1484[0, 1, 2, 3, 4, 5, 6, 20, 0, -27, -6]1485[0, 1, 2, 3, 4, 5, 6, -170/9, -272/9, -11/3, -134/9]1486[0, 1, 2, 3, 4, 5, 6, 200/13, -304/13, -435/13, -278/13]1487\end{verbatim}1488This command looks for all forms, first in level $60$ then in level $1$ to $60$1489and weight $2$ whose first coefficients are $[0,1,2,3,4,5,6]$, the final $1$1490is optional and specifies the \emph{space} (in \kbd{mfinit} sense) where the1491search is performed, here the cuspidal space (by default the full space). It1492returns a list of $3$ forms in level $60$ and $5$ in total.14931494The \kbd{mfeigensearch} command is more interesting. We look for is a1495cuspidal \emph{eigenform} whose field of definition is $\Q$, so that its1496Fourier coefficients are integers, and its character is (trivial or)1497quadratic. An example is as follows:1498\begin{verbatim}1499? AP = [[2,2], [3,-1]] \\ a(2) = 2 and a(3) = -11500? L = mfeigensearch([[1..120],4], AP); #L1501% = 21502? [f,g] = L; [mfparams(f), mfparams(g)]1503% = [[26, 4, 1, y], [118, 4, 1, y]]1504? mfcoefs(f, 10)1505% = [0, 1, 2, -1, 4, 17, -2, -35, 8, -26, 34]1506? mfcoefs(g, 10)1507% = [0, 1, 2, -1, 4, -13, -2, -27, 8, -26, -26]1508\end{verbatim}15091510The first command asks for all forms as above in weight $4$ and level from1511$1$ up to $120$, such that $a(2)=2$ and $a(3)=-1$. The answer is that there1512are two forms, which we call $f$ and $g$. We compute their levels ($26$ and1513$118$ respectively), notice they have trivial character, and list their1514Fourier coefficients up to $10$ and we see that indeed $a(2)=2$ and $a(3)=-1$1515in both cases.15161517To specify the coefficients that we want there are a number of ways. The1518simplest, as above, is to give the list of pairs of integers $[p,a(p)]$.1519For instance:1520\begin{verbatim}1521? L = mfeigensearch([[1..80],2], [[2,2], [7,-3]]); #L1522% = 11523? F = L[1]; mfparams(F)1524% = [75, 2, 1, y]1525? mfcoefs(F, 12)1526% = [0, 1, 2, -1, 2, 0, -2, -3, 0, 1, 0, 2, -2]1527\end{verbatim}15281529The coefficient $a(p)$ may also be given as an \kbd{intmod} \kbd{Mod}$(a,m)$1530then one looks for a match for $a(p)$ modulo $m$. For instance, we come1531back to our first example:1532\begin{verbatim}1533? AP5 = [[2,Mod(2,5)], [3,Mod(-1,5)]]; \\ now modulo 51534? L=mfeigensearch([[1..120], 4], AP); #L1535% = 31536? [ mfparams(f)[1] | f <- L ]1537% = [26, 26, 118]1538? [F1,F2] = L; \\ let's consider the first two1539? mfcoefs(F1, 10)1540% = [0, 1, 2, -1, 4, 17, -2, -35, 8, -26, 34]1541? mfcoefs(F2, 10)1542% = [0, 1, 2, 4, 4, -18, 8, 20, 8, -11, -36]1543? F = mflinear([F1, F2], [-1, 1]);1544? content(mfcoefs(F, mfsturm([26,4])+1))1545% = 51546\end{verbatim}1547Working modulo $5$, we now find that there is an extra eigenform satisfying1548our criteria, and perhaps surprisingly, again in level $26$. The first,1549\kbd{F1}, is the one found above, with $a(2)=2$ and $a(3)=-1$. The second,1550\kbd{F2}, has $a(2)=2$ but $a(3)=4\equiv-1\pmod5$.15511552But we can go further and see that this is not a simple coincidence:1553the next command shows that both eigenforms seem to be congruent modulo $5$,1554at least up to $a(10)$. In fact they are indeed congruent modulo $5$:1555to prove this, we use the fact that the basic Sturm bound (the one obtained1556using \kbd{mfsturm([N,k])}, not \kbd{mfsturm(mf)}) is also valid modulo $p$.1557Since all coefficients are congruent up to the Sturm bound, they are1558congruent for all $n$.15591560\section{Half-Integral Weight Functions}15611562\subsection{General Functions}15631564Many of the commands that we have seen, and most importantly the1565\kbd{mfinit} and \kbd{mfdim} command, can be used verbatim in the case1566of modular forms of half-integral weight, sometimes with small differences.1567\begin{itemize}1568\item Two functions created from mathematical objects can give forms1569of half-integral weight, \kbd{mfetaquo} and \kbd{mffromqf}.15701571\item Leaf functions created from scratch are \kbd{mfTheta}, which gives the1572standard Jacobi theta function of weight $1/2$, and \kbd{mfEH}, which gives1573the Cohen--Hurwitz Eisenstein series of half-integral weight.15741575\end{itemize}15761577\begin{verbatim}1578? F = mffrometaquo([2,5;1,-2;4,-2]); Ser(mfcoefs(F,10),q)1579% = 1 + 2*q + 2*q^4 + 2*q^9 + O(q^11)1580? T = mfTheta(); mfisequal(F,T)1581% = 11582? F = mffromqf(2*matid(3))[2]; Ser(mfcoefs(F,5),q)1583% = 1 + 6*q + 12*q^2 + 8*q^3 + 6*q^4 + 24*q^5 + O(q^6)1584? mfisequal(F, mfpow(T,3))1585% = 11586\end{verbatim}15871588\begin{itemize}\item The only spaces which are \emph{directly} available1589by \kbd{mfinit} and \kbd{mfdim} are the full cuspidal space and the full1590modular form space. The new space can be defined in some cases but indirectly,1591using Kohnen's theory, see below.1592\item The only Hecke operators $T(n)$ which are nonzero are those where1593$n$ is a square (we have not programmed the $T(p)$ with $p$ dividing the1594level).1595\end{itemize}15961597\subsection{Specific Functions}15981599The most important specific function in half-integral weight is1600\kbd{mfshimura}, which computes the Shimura lift corresponding to a1601discriminant $D$ (1 by default) and also returns an \kbd{mf} space1602containing the lift:16031604\begin{verbatim}1605? mf=mfinit([60,5/2],1); F=mfbasis(mf)[1];1606? D = [1,5,8,12,13,17,21];1607? for (i=1, #D, \1608[mf2,G] = mfshimura(mf,F,D[i]); print(mfcoefs(G,10)))1609[0, 1, 2, 0, 2, -1, -2, 6, 6, -3, -10]1610[0, 0, 0, -1, 0, 0, 20, 0, 0, -2, 0]1611[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]1612[0, 0, 0, 0, 0, 24, 0, 0, 0, 0, -48]1613[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]1614[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]1615[0, 1, 0, 3, 52, -5, -120, 14, -156, 3, 0]1616? mfdescribe(mf)1617% = "S_5/2(G_0(60, 1))"1618? mfdescribe(mf2)1619% = "S_4(G_0(30, 1))"1620\end{verbatim}16211622Two things to notice: first the image can be identically $0$.1623Second, the program takes some time (20 seconds for the above), because1624computing a Shimura image takes time proportional to $D^4$.16251626\smallskip16271628The other specific functions are related to the Kohnen $+$-space. Continuing1629the above example:16301631\begin{verbatim}1632? K=mfkohnenbasis(mf); matsize(K)1633% = [14, 4]1634? K[,1]1635% = [-1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]~1636? F=mflinear(mf,K[,1]);1637? Ser(mfcoefs(F,35),q)1638% = -q + 2*q^4 - 4*q^16 + 3*q^21 - 6*q^24 + 5*q^25 + O(q^36)1639\end{verbatim}16401641The first command shows that although the dimension of the cuspidal space1642is $14$, that of the Kohnen $+$-space is $4$; if desired, the corresponding1643modular forms can be obtained by \kbd{mflinear(mf,K[,j])} for each $j$ as1644done in the next command. The Fourier expansion of $F$ given1645on the last line shows that the only nonzero coefficients of $q^n$ occur1646when $n\equiv0,1\pmod4$. Continuing:16471648\begin{verbatim}1649? [mf2,FS]=mfshimura(mf,F); mfparams(FS)1650% = [15, 4, 1, y]1651? [mf2,FS]=mfshimura(mf,mfbasis(mf)[1]); mfparams(FS)1652% = [30, 4, 1, y]1653\end{verbatim}16541655These commmands show that the image of an element of the Kohnen $+$-space has1656level $15=60/4$, while the second shows that the image of a random form has1657level $30=60/2$.16581659\smallskip16601661A final command related to the Kohnen $+$-space is \kbd{mfkohnenbijection}.1662This allows, in half-integral weight, to compute the new space, its1663splitting, and the eigenforms:16641665\begin{verbatim}1666? [mf3,M,K,shi] = mfkohnenbijection(mf);1667? M * mfheckemat(mf3,11) * M^(-1)1668% =1669[ 48 24 24 24]16701671[ 0 32 0 -20]16721673[-48 -72 -40 -72]16741675[ 0 0 0 52]1676? mf30 = mfinit(mf3,0); B0 = mfbasis(mf30); #B01677% = 21678? BNEW = [mflinear(mf, K * M * mftobasis(mf3,f)) | f<-B0];1679? BE = mfeigenbasis(mf30);1680? BEIGEN = [mflinear(mf, K * M * mftobasis(mf3,f)) | f<-BE ];1681? Ser(mfcoefs(BEIGEN[1],24),q)1682% = q + q^4 - 3*q^9 - 5*q^16 + 6*q^21 + 3*q^24 + O(q^25)1683? Ser(mfcoefs(BEIGEN[2],24),q)1684% = q^5 + q^8 - 3*q^12 - 4*q^17 + 3*q^20 + O(q^25)1685? mfcoefs(BEIGEN[1],10^4);1686time = 7,532 ms.1687\end{verbatim}16881689The \kbd{mfkohnenbijection} command computes a square matrix $M$ giving1690a Hecke-module isomorphism from the space $S_{2k-1}(\G_0(N),\chi^2)$ to the1691Kohnen $+$-space $S_k^+(\G_0(4N,\chi))$. Note that this1692makes sense only when $N$ is squarefree.16931694Thus, $M$ allows to transport all problems from the ``difficult'' space1695$S=S_k^+(\G_0(4N),\chi)$ to the ``easy'' space $S_{2k-1}(\G_0(N),\chi^2)$.1696For instance, the next command (essentially instantaneous) gives the matrix of1697the Hecke operator $T(121)$ on $S$; a direct implementation using the action1698of $T(121)$ would take $10.6$ seconds.16991700The vector \kbd{BNEW} computed afterwards gives a basis of the Kohnen new1701space $S_k^{+,\text{new}}(\G_0(4N),\chi)$, here of dimension $2$.17021703The vector \kbd{BEIGEN} computed in a similar way contains the eigenfunctions1704of this new space. The example of \kbd{BEIGEN[2]} shows that, contrary to1705the integral weight case, these eigenfunctions can have vanishing coefficient1706of $q^1$. Note that we \emph{know} by construction that the image of1707\kbd{BEIGEN[j]} by any Shimura lift is a multiple of \kbd{BE[j]} (with the1708same index $j$).1709\smallskip17101711The above construction of the new space and the eigenforms being so useful,1712a specific function exists for this purpose: instead of all the above,1713simply write \kbd{[mf30,BNEW,BEIGEN]=mfkohneneigenbasis(mf,bij)}. Here1714\kbd{BNEW} and \kbd{BEIGEN} will be matrices whose columns are the1715coefficients of a basis of the Kohnen new space and of the eigenforms1716respectively, and \kbd{mf30} the corresponding new space of integral weight.17171718\section{Reference Manual for the Package}17191720We give a brief description in alphabetical order of all the functions1721specific to the package. To use the package, it is sometimes necessary to1722use functions on characters or functions of the \kbd{lfun} package, but1723those will not be described here.17241725Note that when a modular form $F$ can be embedded in $\C$ in several ways1726(typically for eigenforms), some functions give a vector (or even a matrix1727for bilinear operations) of results, one for each embedding: this occurs1728specifically for \kbd{lfunmf}, \kbd{mfeval}, \kbd{mfmanin}, \kbd{mfpetersson},1729\kbd{mfsymboleval}. This will not always be specified.17301731\def\f{\medskip\noindent}17321733\noindent\kbd{getcache()}: returns technical information about auto-growing1734caches.17351736\f\kbd{lfunmf(mf,$\{F\}$)}: creates the $L$-function associated to $F$, for use1737in the \kbd{lfun} package, where $F$ need not be an eigenform. If $F$ is1738omitted, output all $L$-functions associated to the eigenforms. If $F$ (or1739the eigenforms) have several embeddings in $\C$, output the vector of the1740corresponding \kbd{lfunmf}.17411742\f\kbd{mfatkin(mfatk, F)}: computes $F|_k W_Q$, where $Q\Vert N$, where1743\kbd{mfatk} must have been initialized by \kbd{mfatk=mfatkininit(mf,Q)}.17441745\f\kbd{mfatkineigenvalues(mf, Q)}: \kbd{mf} being a cuspidal or new space and1746$Q$ a primitive divisor of $N$, output the vector of Atkin--Lehner1747eigenvalues or pseudo-eigenvalues for each Galois eigenspace.17481749\f\kbd{mfatkininit(mf,Q)}: initialization function for the \kbd{mfatkin}1750function. The output is \kbd{[mfb,M,C,mf]}, where $C$ is a complex constant,1751$M/C$ is the matrix of the Atkin--Lehner operator $W_Q$ from the space1752\kbd{mf} to the space \kbd{mfb} (set equal to $0$ if equal to \kbd{mf}). The1753matrix $M$ is guaranteed to be with exact coefficients (rational or1754\kbd{polmods}).17551756\f\kbd{mfbasis(mf,$\{\text{space}=4\}$)}: gives a basis of the space of1757modular forms \kbd{mf}, either output by an \kbd{mfinit} command, in which1758case \kbd{space} is ignored, or \kbd{mf=[N,k,CHI]} (use \kbd{mfeigenbasis}1759for the eigenforms).17601761\f\kbd{mfbd(F,d)}: gives $B(d)(F)$, $B(d)$ expanding operator.17621763\f\kbd{mfbracket(F,G,$\{m=0\}$)}: $m$th Rankin--Cohen bracket of $F$ and $G$.17641765\f\kbd{mfcoef(F,n)}: $n$th Fourier coefficient $a(n)$ of $F$.17661767\f\kbd{mfcoefs(F,n)}: vector $[a(0),a(1),...,a(n)]$ of the Fourier coefficients1768of $F$ up to $n$. If $F$ is a modular form \emph{space}, give the matrix1769whose columns are the vectors of the Fourier coefficients of the basis.17701771\f\kbd{mfconductor(mf,F)}: smallest $M$ such that $F$ belongs to1772$M_k(\G_0(M),\chi)$.17731774\f\kbd{mfcosets(N)}: list of right cosets of $\G$ modulo $\G_0(N)$. In the1775present implementation, the trivial coset is the last and represented by1776the matrix $[1,0;N,1]$. $N$ can also be an \kbd{mf}.17771778\f\kbd{mfcuspisregular(NK,cusp)}: \kbd{NK} being $[N,k,\chi]$ or an \kbd{mf},1779determine if the cusp is regular or not.17801781\f\kbd{mfcusps(N)}: list of cusps of $\G_0(N)$. $N$ can also be an \kbd{mf}.17821783\f\kbd{mfcuspval(mf,F,cusp)}: valuation of modular form $F$ at \kbd{cusp}, which1784can be a rational number or \kbd{oo}.17851786\f\kbd{mfcuspwidth(N,cusp)}: width of \kbd{cusp} in $\G_0(N)$. $N$ can also be1787an \kbd{mf}.17881789\f\kbd{mfDelta()}: Ramanujan's Delta function of weight $12$.17901791\f\kbd{mfderiv(F,$\{m=1\}$)}: $m$th derivative $q.d/dq$ of $F$, where1792$m$ can be negative, corresponding to integration (the constant term1793is then set to $0$ by convention). The result is only quasi-modular.17941795\f\kbd{mfderivE2(F,$\{m=1\}$)}: $m$th Serre derivative $q.d/dq F-kE_2F/12$.17961797\f\kbd{mfdescribe(F,$\{\&G\}$)}: $F$ being a modular form or a modular form1798space, gives a human-readable description of $F$. If the address of $G$ is1799given, put in it the vector of parameters of the outmost operator defining1800$F$ (empty vector if $F$ is a leaf or a modular form space).18011802\f\kbd{mfdim(mf,$\{\text{space}=4\}$)}: dimension of the space \kbd{mf},1803where \kbd{mf} can also be of the form $[N,k,\chi]$ in which case \kbd{space}1804is taken into account. \kbd{mf} can also be of the form $[N,k,0]$, where $0$1805is a wildcard, in which case it gives detailed information for each character1806$\chi$ for which the corresponding space of level $N$, weight $k$ and given1807character is nonzero: each result is of the form1808\kbd{[order,Conrey,dim,dimdih]}, where \kbd{Conrey} is the Conrey label for1809the character, \kbd{order} is its order, \kbd{dim} is the dimension of the1810corresponding space, and \kbd{dimdih}, which is computed only in weight $1$,1811is the dimension of the subspace of dihedral forms.18121813\f\kbd{mfdiv(F,G)}: division of \kbd{F} by \kbd{G}.18141815\f\kbd{mfEH(k)}: $k$ being half-integral, gives the Cohen--Eisenstein series1816of weight $k$ on $\G_0(4)$.18171818\f\kbd{mfeigenbasis(mf)}: \kbd{mf} containing the new space, gives1819(in some order) the basis of normalized eigenforms.18201821\f\kbd{mfeigensearch(NK,AP)}: search for normalized eigenforms with1822integer coefficients in spaces specified by \kbd{NK}, satisfying conditions1823satisfied by \kbd{AP}. \kbd{NK} is a pair $[N,k]$, the search being in1824level $N$ and weight $k$ with trivial or quadratic character; the parameter1825$N$ may be replaced by a vector of allowed levels. \kbd{AP} is a list of pairs1826$[[p_1,a(p_1)],...,[p_n,a(p_n)]]$, where $a(p)$ is either an integer or an1827\kbd{intmod} (match modulo $a(p)\kbd{.mod}$).18281829\f\kbd{mfeisenstein(k,$\{\chi_1\}$,$\{\chi_2\}$)}: Eisenstein series1830$E_k(\chi_1)$ or1831$E_k(\chi_1,\chi_2)$, normalized so that $a(1)=1$ (so \kbd{mfeisenstein(k)}1832without any character argument is equal to \kbd{mfEk(k)} multiplied by1833$-B_k/(2k)$).18341835\f\kbd{mfEk(k)}: Eisenstein series $E_k$ for the full modular group normalized1836so that $a(0)=1$, including for $k=2$.18371838\f\kbd{mfeval(mf,F,vtau)}: evaluation of $F$ at the point \kbd{vtau} (or a1839vector of points) in the completed upper half-plane. If $F$ is an eigenform1840with several embeddings in $\C$, evaluate at each embedding.18411842\f\kbd{mffields(mf)}: \kbd{mf} containing the new space, gives the list of1843relative polynomials defining the number field extensions for all the Galois1844orbits of the eigenforms. \kbd{mf} can also be a modular form, in which case1845the result is the number field extension of $\Q(\chi)$ in which the Fourier1846coefficients of \kbd{mf} lie.18471848\f\kbd{mffromell(e)}: \kbd{e} being an elliptic curve defined over $\Q$ in1849\kbd{ellinit} format, gives \kbd{[mf,F,coe]}, where \kbd{F} is the eigenform1850corresponding to \kbd{e} by modularity, \kbd{mf} the corresponding new space,1851and \kbd{coe} the coefficients of \kbd{F} on the basis of \kbd{mf}.18521853\f\kbd{mffrometaquo(eta,$\{\text{flag}=0\}$)}: \kbd{eta} being a matrix1854representing an eta quotient, gives the corresponding modular form or1855function. If the result is not a modular form or function, return an error if1856\kbd{flag=0}, or $0$ otherwise. If the result has negative valuation,1857normalize to valuation $0$.18581859\f\kbd{mffromlfun(L)}: \kbd{L} being the $L$-function of a self-dual modular1860form with rational coefficients, for instance a rational eigenform, retun1861\kbd{[NK,space,v]}, where \kbd{mf = mfinit(NK,space)} is a modular form space1862containing the form and \kbd{mftobasis(mf,v)} yields the coefficients of1863\kbd{F} on the basis of \kbd{mf}.18641865\f\kbd{mffromqf(Q,$\{P\}$)}: \kbd{Q} being an even integral quadratic form of1866even dimension and \kbd{P} an optional homogeneous spherical polynomial with1867respect to \kbd{Q}, gives \kbd{[mf,F,coe]}, where \kbd{F} is the theta1868function associated to \kbd{Q} and \kbd{P}, \kbd{mf} the corresponding space,1869and \kbd{coe} the coefficients of \kbd{F} on the basis of \kbd{mf}.18701871\f\kbd{mfgaloistype(mf,$\{F\}$)}: \kbd{mf} being either $[N,1,\chi]$ or1872a new or cuspidal space of weight $1$ forms, outputs the type of the projective1873representations attached to all the eigenforms in \kbd{mf}, or only that of1874\kbd{F} if it is given. The output is $2n$ for $D_n$, or $-12$, $-24$, $-60$1875for $A_4$, $S_4$, $A_5$.18761877\f\kbd{mfhecke(mf,F,n)}: Computes $T(n)(f)$, where $T(n)$ is the $n$th Hecke1878operator. Note that the level which is used is that of the modular form space1879\kbd{mf}, not that of $F$ if it is different.18801881\f\kbd{mfheckemat(mf,n)}: matrix of $T(n)$ on the space \kbd{mf}.18821883\f\kbd{mfinit(NK,$\{\text{space}=4\}$)}: create the space of modular forms1884associated to $NK=[N,k,\chi]$ or $NK=[N,k]$. Codes for \kbd{space} is $0$,1885new space, $1$ cuspidal space, $2$ old space, $3$ space of Eisenstein series,1886$4$ full space $M_k$ (default). $NK$ can also be of the form $NK=[N,k,0]$,1887where $0$ is a wildcard, in which case it gives the vector of all nonzero1888\kbd{mfinit} for each Galois orbit of characters $\chi$.18891890\f\kbd{mfisCM(F)}: returns $0$ if $F$ does not have complex multiplication,1891and the CM discriminant(s) if it does. Note that in weight $1$ $F$ may have1892two CM discriminants, which occurs iff its galoistype is $D_2$.18931894\f\kbd{mfisequal(F,G,$\{\text{lim}=0\}$)}: Are $F$ and $G$ equal, or at least1895are their first \kbd{lim+1} Fourier coefficients equal ?18961897\f\kbd{mfkohnenbasis}(mf): \kbd{mf} being a cuspidal space of half-integral1898weight and level $4N$ with $N$ squarefree, computes a basis $B$ of the Kohnen1899$+$-space as a matrix whose columns are the coefficients of $B$ on the basis1900of \kbd{mf}.19011902\f\kbd{mfkohnenbijection}(mf): \kbd{mf} being a cuspidal space of1903half-integral weight, computes \kbd{[mf2,M,K,shi]}, where \kbd{M} is a matrix1904giving a Hecke-module isomorphism from the cuspidal space \kbd{mf2} of weight1905$2k-1$ and level $N$ to the Kohnen $+$-space of weight $k$ and level $4N$,1906the columns of the matrix \kbd{K} are the coefficients of the Kohnen $+$-space1907on the basis of \kbd{mf}, and \kbd{shi} gives technical information about1908which linear combination of Shimura lifts has been chosen.19091910\f\kbd{mfkohneneigenbasis}(mf,bij): \kbd{mf} being a cuspidal space of1911half-integral weight and \kbd{bij} the output of \kbd{mfkohnenbijection(mf)},1912computes a triple \kbd{[mf0,Bnew,Beigen]}, where \kbd{Bnew} and \kbd{Beigen}1913are matrices whose columns are the coefficients of a basis of the Kohnen1914new space and of the eigenforms on the basis of \kbd{mf} respectively, and1915\kbd{mf0} is the corresponding new space of integral weight $2k-1$.19161917\f\kbd{mflinear(vecF,vecL)}: linear combination of the forms in \kbd{vecF}1918with coefficients in \kbd{vecL}. Forms must have the same weight and1919character, but not necessarily the same level. This function is used1920for simpler operations such as1921\begin{verbatim}1922mflinear([F],[s]) \\ scalar multiplication1923mflinear([F,G],[1,1]) \\ addition1924mflinear([F,G],[1,-1]) \\ subtraction1925\end{verbatim}1926If \kbd{vecF=mfbasis(mf)}, it is better to write \kbd{mflinear(mf,vecL)}1927instead, since coefficient computations will be faster.19281929\f\kbd{mfmanin(FS)}: $FS$ being a modular symbol associated to an eigenform,1930returns $[[P^+,P^-],[\omega^+,\omega^-,r]]$ where the $P^{\pm}$ are the1931even/odd polynomials of special values, the $\omega^{\pm}$ the1932corresponding periods, and $r=\Im(\omega^+\overline{\omega^-})/<F,F>$.19331934\f\kbd{mfmul(F,G)}: product of the modular forms $F$ and $G$.19351936\f\kbd{mfnumcusps(N)}: number of cusps of $\G_0(N)$.19371938\f\kbd{mfparams(F)}: returns parameters $[N,k,\chi,P]$ of the modular form $F$,1939where $K$ is the polynomial defining the number field containing the1940coefficients of $F$ (e.g., $y$ if $F$ is rational), or $[-1,-1,-1,0]$ if1941it is not defined. If $F$ is a modular form space, returns $[N,k,\chi,space]$.19421943\f\kbd{mfperiodpol(mf,F,$\{\text{parity}=0\}$)}: period polynomial of the1944form $F$; if the \kbd{parity} argument is $1$ or $-1$, return the even/odd1945period polynomial.19461947\f\kbd{mfperiodpolbasis(k,$\{\text{parity}=0\}$)}: basis of period polynomials of weight1948$k$ for the full modular group, even/odd ones if \kbd{parity} is $1$ or $-1$.19491950\f\kbd{mfpetersson(FS,$\{\text{GS}=\text{FS}\}$)}: $FS$ and $GS$ being the modular symbols associated1951to $F$ and $G$ with \kbd{mfsymbol}, computes the Petersson product of $F$ and1952$G$ with the usual normalization $1/[\G:\G_0(N)]$. (Petersson square if $GS$1953is omitted.)19541955\f\kbd{mfpow(F, n)}: Modular form $F$ to the power $n$.19561957\f\kbd{mfsearch([N,k], V, $\{\text{space}=4\}$)}: search for \emph{rational}1958modular forms of weight~$k$ and level $N$ in the specified modular1959form spaces whose Fourier expansion up to the length of $V$ exactly matches1960$V$. The output is a list of forms. The parameter $N$ may be replaced1961by a list of allowed levels, e.g. \kbd{[$N_1$..$N_2$]} for all levels1962between $N_1$ and $N_2$.19631964\f\kbd{mfshift(F,m)}: \kbd{F} divided by $q^m$, omitting the remainder if there1965is one, where $m$ can be positive or negative. The result is usually not1966a modular form.19671968\f\kbd{mfshimura(mf,F,$\{D = 1\}$)}: $F$ being a modular form of1969half-integral weight $k\ge3/2$ and $D$ a discriminant, return1970\kbd{[mf2,FS,v]}, where \kbd{FS} is the corresponding Shimura lift of integral1971weight $2k-1$, \kbd{mf2} the corresponding modular form space and \kbd{v} the1972coefficients of \kbd{FS} on the basis of \kbd{mf2}. By extension, $D$ can also1973be a positive squarefree integer.19741975\f\kbd{mfslashexpansion(mf,f,g,n,flrat,$\{\&P\}$)}: compute the Fourier1976expansion of $f|_k g$ to order $n$, where $f$ is a form in \kbd{mf} and1977$g\in M_2^+(\Q)$. If \kbd{flrat} is set, try to ``rationalize''1978(error if unsuccessful). If the output is $[a(0),...,a(n)]$ and the1979optional $P$ contains parameters $[\al,w,A]$, then $f|_k g = F|_k A$1980where1981$F(\tau) = q^{\al}\sum_{0\le j\le n}a(j)q^{j/w}$, with $q=\exp(2\pi i\tau)$.1982$A$ is always upper triangular and usually the identity, so that $F|_k A$1983is immediate to compute.19841985\f\kbd{mfspace(mf,$\{F\}$)}: type of modular space \kbd{mf} if $F$ is omitted,1986or of a modular form $F$ in \kbd{mf}: result is $0$ for new, $1$ for cuspidal,1987$2$ for old, $3$ for full, $4$ for Eisenstein, and $-1$ if form is not in1988the space.19891990\f\kbd{mfsplit(mf,$\{\text{dimlim}=0\}$,$\{\text{flag}=0\}$)}: compute the1991eigenforms in \kbd{mf}, and limit the dimension of each Galois orbit to1992\kbd{dimlim} if set. \kbd{flag} is used to avoid some long computations (see1993doc). The space \kbd{mf} \emph{must} contain the new space. Note that the1994result is only a two-component vector \kbd{vF,vK}, where \kbd{vF} is a vector1995of eigenforms and \kbd{vK} the corresponding number fields, but is \emph{not}1996similar to the output of an \kbd{mfinit} command.19971998\f\kbd{mfsturm(mf)}: If \kbd{mf} is a space, true Sturm bound of \kbd{mf}, i.e.,1999largest valuation at infinity of a nonzero form. If \kbd{mf} is $[N,k,\chi]$,2000only an upper bound.20012002\f\kbd{mfsymbol(mf,F)}: initialize data for working with integrals related2003to $F$ such as \kbd{mfsymboleval}, \kbd{mfpetersson}, and \kbd{mfmanin}.20042005\f\kbd{mfsymboleval(FS,path,$\{\ga\}$)}: $FS$ being the modular symbol2006assocated to some form $F$ and \kbd{path} being $[s_1,s_2]$ where $s_1$ and2007$s_2$ are cusps or points in the upper half-plane, evaluate the symbol on the2008path, i.e., compute the polynomial2009$\int_{s_1}^{s_2}(X-\tau)^{k-2}F(\tau)\,d\tau$. If $\ga\in GL_2^+(\Q)$ is2010given, replace $F$ by $F|_k\ga$. If the integral diverges, the result will be2011either a rational function or a polynomial of degree $d>k-2$.20122013\f\kbd{mftaylor(F,n,$\{\text{fl}=0\}$)}: for now, only for $F\in M_k(\G)$ and2014at the point $i$. Compute the first $n$ Taylor coefficients of $F$ around2015$i$; if \kbd{fl} is set compute in fact $p_n$ such that2016$$f(\tau)=(2i/(\tau+i))^k\sum_{n\ge0}p_n((\tau-i)/(\tau+i))^n\;.$$20172018\f\kbd{mfTheta($\{\chi\}$)}: unary theta series corresponding to the primitive2019Dirichlet character $\chi$, thus in weight $1/2$ (resp., $3/2$)2020if $\chi$ is even (resp., odd).20212022\f\kbd{mftobasis(mf,F,$\{\text{flag}=0\}$)}: coefficients of form $F$ on the2023basis in \kbd{mf}. If \kbd{flag} is set, do not return an error if $F$ does2024not belong to \kbd{mf} or not enough coefficients.20252026\f\kbd{mftocoset(N,M,L)}: $L$ being the list of cosets output by2027\kbd{L=mfcosets(N)} and $M$ being in $\SL_2(\Z)$, output a pair2028$[\ga,i]$ such that $M=\ga L[i]$, where $\ga\in \G_0(N)$.20292030\f\kbd{mftonew(mf,F)}: Decompose $F$ is the cuspidal space \kbd{mf} as2031a sum of $B(d)G_M$ where $G_M\in S_k^{\new}(\G_0(M),\chi)$ and $dM\mid N$,2032return the vector of $[M,d,G]$.20332034\f\kbd{mftraceform(NK,$\{\text{space}=0\}$)}: gives the trace form2035corresponding to $NK=[N,k,\chi]$ and \kbd{space} (only the new space and the2036cuspidal space).20372038\f\kbd{mftwist(F,D)}: twist of the form $F$ by the quadratic character2039$(D/n)$.2040\end{document}204120422043