Testing latest pari + WASM + node.js... and it works?! Wow.
License: GPL3
ubuntu2004
% Copyright (c) 2015 The PARI Group1%2% This file is part of the PARI/GP documentation3%4% Permission is granted to copy, distribute and/or modify this document5% under the terms of the GNU General Public License6\chapter{$L$-functions}78\section{Accessors}910\fun{long}{is_linit}{GEN data}1112\fun{GEN}{ldata_get_an}{GEN ldata}1314\fun{GEN}{ldata_get_dual}{GEN ldata}1516\fun{long}{ldata_isreal}{GEN ldata}1718\fun{GEN}{ldata_get_gammavec}{GEN ldata}1920\fun{long}{ldata_get_degree}{GEN ldata}2122\fun{GEN}{ldata_get_k}{GEN ldata}2324\fun{GEN}{ldata_get_k1}{GEN ldata}2526\fun{GEN}{ldata_get_conductor}{GEN ldata}2728\fun{GEN}{ldata_get_rootno}{GEN ldata}2930\fun{GEN}{ldata_get_residue}{GEN ldata}3132\fun{long}{ldata_get_type}{GEN ldata}3334\fun{long}{linit_get_type}{GEN linit}3536\fun{GEN}{linit_get_ldata}{GEN linit}3738\fun{GEN}{linit_get_tech}{GEN linit}3940\fun{GEN}{lfun_get_domain}{GEN tech}4142\fun{GEN}{lfun_get_dom}{GEN tech}4344\fun{long}{lfun_get_bitprec}{GEN tech}4546\fun{GEN}{lfun_get_factgammavec}{GEN tech}4748\fun{GEN}{lfun_get_step}{GEN tech}4950\fun{GEN}{lfun_get_pol}{GEN tech}5152\fun{GEN}{lfun_get_Residue}{GEN tech}5354\fun{GEN}{lfun_get_k2}{GEN tech}5556\fun{GEN}{lfun_get_w2}{GEN tech}5758\fun{GEN}{lfun_get_expot}{GEN tech}5960\fun{long}{lfun_get_bitprec}{GEN tech}6162\fun{GEN}{lfunprod_get_fact}{GEN tech}6364\fun{GEN}{theta_get_an}{GEN tdata}6566\fun{GEN}{theta_get_K}{GEN tdata}6768\fun{GEN}{theta_get_R}{GEN tdata}6970\fun{long}{theta_get_bitprec}{GEN tdata}7172\fun{long}{theta_get_m}{GEN tdata}7374\fun{GEN}{theta_get_tdom}{GEN tdata}7576\fun{GEN}{theta_get_isqrtN}{GEN tdata}7778\section{Conversions and constructors}7980\fun{GEN}{lfunmisc_to_ldata}{GEN obj} converts \kbd{obj} to \kbd{Ldata} format.81Exception if \kbd{obj} cannot be converted.8283\fun{GEN}{lfunmisc_to_ldata_shallow}{GEN obj} as \tet{lfunmisc_to_ldata},84shallow result. Exception if \kbd{obj} cannot be converted.8586\fun{GEN}{lfunmisc_to_ldata_shallow_i}{GEN obj} as87\tet{lfunmisc_to_ldata_shallow_i}, returning \kbd{NULL} on failure.8889\fun{GEN}{lfunrtopoles}{GEN r}9091\fun{int}{sdomain_isincl}{double k, GEN dom, GEN dom0}9293\fun{GEN}{ldata_vecan}{GEN ldata, long N, long prec}94return the vector of coefficients of indices $1$ to $N$ to precision95\kbd{prec}. The output is allowed to be a \typ{VECSMALL} when the96coefficients are known to be all integral and fit into a \kbd{long};97for instance the Dirichlet $L$ function of a real character or the98$L$-function of a rational elliptic curve.99100\fun{GEN}{ldata_newprec}{GEN ldata, long prec}101return a shallow copy of \kbd{ldata} with fields accurate to precision102\kbd{prec}.103104\fun{long}{etaquotype}{GEN *peta, GEN *pN, GEN *pk, GEN *pCHI, long *pv, long105*psd, long *pcusp} Let \kbd{eta} be the integer matrix factorization supposedly106attached to an $\eta$-quotient $f(z) = \prod_i \eta(n_i z)^{e_i}$. Assuming107\kbd{*peta} is initially set to \kbd{eta}, this function returns $0$ if108there is a type error or this does not define a function on some $X_0(N)$.109Else it returns $1$ and sets110111\item \kbd{*peta} to a normalized factorization (as would be returned by112\kbd{factor}),113114\item \kbd{*pN} to the level $N$ of $f$,115116\item \kbd{*pk} to the modular weight $k$ of $f$,117118\item \kbd{*pCHI} to the Nebentypus of $f$ (quadratic character)119as an integer,120121\item \kbd{*pv} to the valuation at infinity $v_q(f)$,122123\item \kbd{*psd} to $1$ if and only if $f$ is self-dual,124125\item \kbd{*pcusp} to $1$ if $f$ is cuspidal, else to $0$ if $f$ holomorphic126at all cusps, else to $-1$.127128The last three arguments \kbd{pCHI}, \kbd{pv} and \kbd{pcusp} can be set to129\kbd{NULL}, in which case the relevant information is not computed, which130saves time.131132\section{Variants of GP functions}133134\fun{GEN}{lfun}{GEN ldata, GEN s, long bitprec}135136\fun{GEN}{lfuninit}{GEN ldata, GEN dom, long der, long bitprec}137138\fun{GEN}{lfuninit_make}{long t, GEN ldata, GEN tech, GEN domain}139140\fun{GEN}{lfunlambda}{GEN ldata, GEN s, long bitprec}141142\fun{GEN}{lfunquadneg}{long D, long k} for $L(\chi_D, k)$, $D$ fundamental143discriminant and $k \geq 0$.144145\fun{long}{lfunthetacost}{GEN ldata, GEN tdom, long m, long bitprec}:146\kbd{lfunthetacost0} when the first argument is known to be an \kbd{Ldata}.147148\fun{GEN}{lfunthetacheckinit}{GEN data, GEN tinf, long m, long bitprec}149150\fun{GEN}{lfunrootno}{GEN data, long bitprec}151152\fun{GEN}{lfunzetakinit}{GEN pol, GEN dom, long der, long bitprec}153154\fun{GEN}{lfunellmfpeters}{GEN E, long bitprec}155156\fun{GEN}{ellanalyticrank}{GEN E, long prec} DEPRECATED.157158\fun{GEN}{ellL1}{GEN E, long prec} DEPRECATED.159160\section{Inverse Mellin transforms of Gamma products}161162\fun{GEN}{gammamellininv}{GEN Vga, GEN s, long m, long bitprec}163164\fun{GEN}{gammamellininvinit}{GEN Vga, long m, long bitprec}165166\fun{GEN}{gammamellininvrt}{GEN K, GEN s, long bitprec} no GC-clean, but167suitable for \kbd{gerepileupto}.168169\fun{int}{Vgaeasytheta}{GEN Vga} return 1 if the inverse Mellin transform is170an exponential and 0 otherwise.171172\fun{double}{dbllemma526}{double a, double b, double c, long B}173174\fun{double}{dblcoro526}{double a, double c, long B}175176\newpage177178\chapter{Modular symbols}179180\fun{void}{checkms}{GEN W} raise an exception if $W$ is not an \var{ms}181structure from \kbd{msinit}.182183\fun{void}{checkmspadic}{GEN W} raise an exception if $W$ is not an184\var{mspadic} structure from \kbd{mspadicinit}.185186\fun{GEN}{mseval2_ooQ}{GEN W, GEN phi, GEN c} let $W$ be a \kbd{msinit}187structure for $k = 2$, $\phi$ be a modular symbol with integral values188and $c$ be a rational number. Return the integer $\phi(p)$,189where $p$ is the path $\{\infty,c\}$.190191\fun{void}{mspadic_parse_chi}{GEN s, GEN *s1, GEN *s2} see \kbd{mspadicL};192let $\chi$ be the cyclotomic character from193$\text{Gal}\big(\Q_p(mu_{p^\infty})/\Q_p\big)$ to $\Z_p^*$194and $\tau$ be the Teichm\"uller character for $p > 2$ and the character of195order $2$ on $(\Z/4\Z)^*$ if $p = 2$. Let $s$ encode196the $p$-adic characther $\chi^s := \langle\chi\rangle^{s_1} \tau^{s_2}$;197set \kbd{*s1} and \kbd{*s2} to the integers $s_1$ and $s_2$.198199\fun{GEN}{mspadic_unit_eigenvalue}{GEN ap, long k, GEN p, long n}200let $p$ be a prime not dividing the trace of Frobenius \kbd{ap},201return the unit root of $x^2 - ap*x + p^(k-1)$ to $p$-adic accuracy $p^n$.202203Variants of \kbd{mfnumcusps} :204205\fun{ulong}{mfnumcuspsu}{ulong n}206207\fun{GEN}{mfnumcusps_fact}{GEN fa} where \kbd{fa} is \kbd{factor}$(n)$.208209\fun{ulong}{mfnumcuspsu_fact}{GEN fa} where \kbd{fa} is \kbd{factoru}$(n)$.210211\chapter{Modular forms}212213\section{Implementation of public data structures}214215\fun{void}{checkMF}{GEN mf} raise an exception if the argument is not a216modular form space.217218\fun{GEN}{checkMF_i}{GEN mf} return the underlying modular form space219if \kbd{mf} is either directly a modular form space from \kbd{mfinit}220or a symbol from \kbd{mfsymbol}. Return \kbd{NULL} otherwise.221222\fun{int}{checkmf_i}{GEN mf} return $1$ if the argument is a modular form223and $0$ otherwise.224225\fun{int}{checkfarey_i}{GEN F} return $1$ if the argument is a Farey symbol226(from \kbd{mspolygon} or \kbd{msfarey}) and $0$ otherwise.227228\subsec{Accessors for modular form spaces}229230Shallow functions; assume that their argument is a modular form space231is created by \kbd{mfinit} and checked using \kbd{checkMF}.232233\fun{GEN}{MF_get_gN}{GEN mf} return the level $N$ as a \typ{INT}.234235\fun{long}{MF_get_N}{GEN mf} return the level $N$ as a \kbd{long}.236237\fun{GEN}{MF_get_gk}{GEN mf} return the level $k$ as a \typ{INT}.238239\fun{long}{MF_get_k}{GEN mf} return the level $k$ as a \kbd{long}.240241\fun{long}{MF_get_r}{GEN mf} assuming the level is a half-integer, return242the integer $r = k - (1/2)$.243244\fun{GEN}{MF_get_CHI}{GEN mf} return the nebentypus $\chi$, which is a245special form of character structure attached to Dirichlet characters (see246next section). Its values are given as algebraic numbers: either $\pm1$ or247\typ{POLMOD} in $t$.248249\fun{long}{MF_get_space}{GEN mf} returns the space type, corresponding250to \kbd{mfinit}'s \kbd{space} flag. The current list is251252\bprog253mf_NEW, mf_CUSP, mf_OLD, mf_EISEN, mf_FULL254@eprog255256\fun{GEN}{MF_get_basis}{GEN mf} return the $\Q$-basis of the space,257concatenation of \tet{MF_get_E} and \tet{MF_get_S}, in this order; the forms258have coefficients in $\Q(\chi)$. Low-level version of \kbd{mfbasis}.259260\fun{long}{MF_get_dim}{GEN mf} returns the dimension $d$ of the space. It261is the cardinality of \tet{MF_get_basis}.262263\fun{GEN}{MF_get_E}{GEN mf} returns a $\Q$-basis for the subspace264spanned by Eisenstein series in the space; the forms have coefficients in265$\Q(\chi)$.266267\fun{GEN}{MF_get_S}{GEN mf} returns a $\Q$-basis for the cuspidal subspace268in the space; the forms have coefficients in $\Q(\chi)$.269270\fun{GEN}{MF_get_fields}{GEN mf} returns the vector of polynomials defining271each Galois orbit of newforms over $\Q(\chi)$. Uses memoization: a first call272splits the space and may be costly; subsequent calls return the cached273result.274275\fun{GEN}{MF_get_newforms}{GEN mf} returns a vector \kbd{vF} containing the276coordinates of the eigenforms on \tet{MF_get_basis} (\kbd{mftobasis} form).277Low-level version of278\kbd{mfeigenbasis}, whose elements are recovered as \kbd{mflinear(mf,279gel(vF,i))}. Uses memoization, sharing the same data as280\kbd{MF\_get\_fields}. Note that it is much more efficient to use281\kbd{mfcoefs(mf,)} then multiply by this vector than to compute the282coefficients of eigenforms from \kbd{mfeigenbasis} individually.283284The following accessors are technical,285286\fun{GEN}{MF_get_M}{GEN mf} the $(1+m) \times d$ matrix whose $j$-th column287contain the coefficients of the $j$-th entry in \tet{MF_get_basis}, $m$288is the optimal ``Sturm bound'' for the space: the maximum of the $v_\infty(f)$289over nonzero forms. It has entries in $\Q(\chi)$.290291\fun{GEN}{MF_get_Mindex}{GEN mf} is a \typ{VECSMALL} containing $d$ row292indices, the corresponding rows of $M$ form an invertible matrix $M_0$.293294\fun{GEN}{MF_get_Minv}{GEN mf} the inverse of $M_0$ in a form suitable for fast295multiplication.296297\fun{GEN}{MFcusp_get_vMjd}{GEN mf} valid only for a full298\emph{cuspidal} space. Then the functions in \tet{MF_get_S} are299of the form $B_d T_j Tr^{new}_M$. This returns the vector of triples300(\typ{VECSMALL}) $[M,j,d]$, in the same order.301302\fun{GEN}{MFnew_get_vj}{GEN mf} valid only for a \emph{new} space. Then303the functions in \tet{MF_get_S} are of the form $T_j Tr^{new}_N$. This304returns a \typ{VECSMALL} of the Hecke indices $j$, in the same order.305306\subsec{Accessors for individual modular forms}307308\fun{GEN}{mf_get_gN}{GEN F} return the level of $F$, which may be a multiple of309the conductor, as a \typ{INT}310311\fun{long}{mf_get_N}{GEN F} return the level as a \kbd{long}.312313\fun{GEN}{mf_get_gk}{GEN F} return the weight of $F$ as a \typ{INT}314or a \typ{FRAC} with denominator $2$ (half-integral weight).315316\fun{long}{mf_get_k}{GEN F} return the weight as a \kbd{long}; if the weight is317not integral, this raises an exception.318319\fun{long}{mf_get_r}{GEN F} assuming $F$ is a modular form of half-integral320weight $k = (2r+1)/2$, return $r = k - (1/2)$.321322\fun{GEN}{mf_get_CHI}{GEN F} return the nebentypus, which is a special form of323character structure attached to Dirichlet characters (see next section). Its324values are given as algebraic numbers: either $\pm1$ or \typ{POLMOD}325in $t$.326327\fun{GEN}{mf_get_field}{GEN F} return the polynomial (in variable $y$)328defining $\Q(f)$ over $\Q(\chi)$.329330\fun{GEN}{mf_get_NK}{GEN F} return the tag attached to $F$: a vector containing331\kbd{gN}, \kbd{gk}, \kbd{CHI}, \kbd{field}. Never use its component directly,332use individual accessors as above.333334\fun{long}{mf_get_type}{GEN F} returns a symbolic name for the constructur335used to create the form, e.g. \kbd{t\_MF\_EISEN} for a general Eisenstein336series. A form has a recursive structure represented by a tree: its337definition may involve other forms, e.g. the tree attached to $T_n f$338contains $f$ as a subtree. Such trees have \emph{leaves}, forms339which do not contain a strict subtree, e.g. \kbd{t\_MF\_DELTA} is a leaf,340attached to Ramanujan's $\Delta$.341342Here is the current list of types; since the names are liable to change,343they are not documented at this point. Use \kbd{mfdescribe} to visualize344their mathematical structure.345\bprog346/*leaves*/347t_MF_CONST, t_MF_EISEN, t_MF_Ek, t_MF_DELTA, t_MF_ETAQUO, t_MF_ELL,348t_MF_DIHEDRAL, t_MF_THETA, t_MF_TRACE, t_MF_NEWTRACE,349/*recursive*/350t_MF_MUL, t_MF_POW, t_MF_DIV, t_MF_BRACKET, t_MF_LINEAR, t_MF_LINEAR_BHN,351t_MF_SHIFT, t_MF_DERIV, t_MF_DERIVE2, t_MF_TWIST, t_MF_HECKE,352t_MF_BD,353@eprog354355\subsec{Nebentypus} The characters stored in modular forms and modular form356spaces have a special structure. One can recover the parameters357of an ordinary Dirichlet character by \kbd{G = gel(CHI,1)} (the underlying358\kbd{znstar}) and \kbd{chi = gel(CHI,2)} (the underlying character in359\kbd{znconreylog} form).360361\fun{long}{mfcharmodulus}{GEN CHI} the modulus of $\chi$.362363\fun{long}{mfcharorder}{GEN CHI} the order of $\chi$.364365\fun{GEN}{mfcharpol}{GEN CHI} the cyclotomic polynomial $\Phi_n$366defining $\Q(\chi)$, always normalized so that $n$ is not $2$ mod $4$.367368\subsec{Miscellaneous functions}369370\fun{long}{mfnewdim}{long N, long k, GEN CHI} dimension of the new part371of the cuspidal space.372373\fun{long}{mfcuspdim}{long N, long k, GEN CHI} dimension of the cuspidal space.374375\fun{long}{mfolddim}{long N, long k, GEN CHI} dimension of the old part376of the cuspidal space.377378\fun{long}{mfeisensteindim}{long N, long k, GEN CHI} dimension of the379Eisenstein subspace.380381\fun{long}{mffulldim}{long N, long k, GEN CHI} dimension of the full space.382383384385\fun{GEN}{mfeisensteinspaceinit}{GEN NK}386387\fun{GEN}{mfdiv_val}{GEN F, GEN G, long vG}388389390\fun{GEN}{mfembed}{GEN E, GEN v}391392\fun{GEN}{mfmatembed}{GEN E, GEN v}393394\fun{GEN}{mfvecembed}{GEN E, GEN v}395396397\fun{long}{mfsturmNgk}{long N, GEN k}398399\fun{long}{mfsturmNk}{long N, long k}400401\fun{long}{mfsturm_mf}{GEN mf}402403\fun{long}{mfiscuspidal}{GEN mf, GEN F}404405\fun{GEN}{mftobasisES}{GEN mf, GEN F}406407\fun{GEN}{mftocol}{GEN F, long lim, long d}408409\fun{GEN}{mfvectomat}{GEN vF, long lim, long d}410411\newpage412413\chapter{Plots}414415A \tet{PARI_plot} canvas is a record of dimensions, with the following fields:416\bprog417long width; /* window width */418long height; /* window height */419long hunit; /* length of horizontal 'ticks' */420long vunit; /* length of vertical 'ticks' */421long fwidth; /* font width */422long fheight;/* font height */423void (*draw)(PARI_plot *T, GEN w, GEN x, GEN y);424@eprog\noindent The \kbd{draw} method performs the actual drawing of425a \typ{VECSMALL} w (rectwindow indices); $x$ and $y$ are \typ{VECSMALL}s426of the same length and rectwindow $w[i]$ is drawn with its upper left427corner at offset $(x[i],y[i])$. No plot engine is available in \kbd{libpari}428by default, since thie would introduce a dependency on extra graphical429libraries. See the files \kbd{src/graph/plot*} for basic implementations of430various plot engines: \kbd{plotsvg} is particularly simple (\kbd{draw} is a4311-liner).432433\fun{void}{pari_set_plot_engine}{void (*T)(PARI_plot *)} installs the434graphical engine $T$ and initializes the graphical subsystem. No routine in435this chapter will work without this initialization.436437\fun{void}{pari_kill_plot_engine}{void} closes the graphical subsystem and438frees the ressources it occupies.439440\subsec{Highlevel function}441Those functions plot $f(E,x)$ for $x\in [a,b]$, using $n$ regularly spaced442points (by default).443444\fun{GEN}{ploth}{void *E, GEN(*f)(void*,GEN), GEN a, GEN b, long flags,long445n, long prec} draw physically.446447\fun{GEN}{plotrecth}{void *E, GEN(*f)(void*,GEN), long w, GEN a,GEN b, ulong448flags,long n, long prec} draw in rectwindow $w$.449450\subsec{Function }451452\fun{void}{plotbox}{long ne, GEN gx2, GEN gy2}453454\fun{void}{plotclip}{long rect}455456\fun{void}{plotcolor}{long ne, long color}457458\fun{void}{plotcopy}{long source, long dest, GEN xoff, GEN yoff, long flag}459460\fun{GEN}{plotcursor}{long ne}461462\fun{void}{plotdraw}{GEN list, long flag}463464\fun{GEN}{plothraw}{GEN listx, GEN listy, long flag}465466\fun{GEN}{plothsizes}{long flag}467468\fun{void}{plotinit}{long ne, GEN x, GEN y, long flag}469470\fun{void}{plotkill}{long ne}471472\fun{void}{plotline}{long ne, GEN x2, GEN y2}473474\fun{void}{plotlines}{long ne, GEN listx, GEN listy, long flag}475476\fun{void}{plotlinetype}{long ne, long t}477478\fun{void}{plotmove}{long ne, GEN x, GEN y}479480\fun{void}{plotpoints}{long ne, GEN listx, GEN listy}481482\fun{void}{plotpointsize}{long ne, GEN size}483484\fun{void}{plotpointtype}{long ne, long t}485486\fun{void}{plotrbox}{long ne, GEN x2, GEN y2}487488\fun{GEN}{plotrecthraw}{long ne, GEN data, long flags}489490\fun{void}{plotrline}{long ne, GEN x2, GEN y2}491492\fun{void}{plotrmove}{long ne, GEN x, GEN y}493494\fun{void}{plotrpoint}{long ne, GEN x, GEN y}495496\fun{void}{plotscale}{long ne, GEN x1, GEN x2, GEN y1, GEN y2}497498\fun{void}{plotstring}{long ne, char *x, long dir}499500\subsec{Obsolete functions} These draw directly to a PostScript file501specified by a global variable and should no longer be used. Use502\kbd{plotexport} and friends instead.503504\fun{void}{psdraw}{GEN list, long flag}505506\fun{GEN}{psplothraw}{GEN listx, GEN listy, long flag}507508\fun{GEN}{psploth}{void *E, GEN(*f)(void*,GEN), GEN a, GEN b, long flags,509long n, long prec} draw to a PostScript file.510511512\subsec{Dump rectwindows to a PostScript or SVG file}513514$w,x,y$ are three \typ{VECSMALL}s indicating the rectwindows to dump, at515which offsets. If $T$ is \kbd{NULL}, rescale with respect to the installed516graphic engine dimensions; else with respect to $T$.517518\fun{char*}{rect2ps}{GEN w, GEN x, GEN y, PARI_plot *T}519520\fun{char*}{rect2ps_i}{GEN w, GEN x, GEN y, PARI_plot *T, int plotps}521if \kbd{plotps} is $0$, as above; else private version used to implement522the \kbd{plotps} graphic engine (do not rescale, rotate to portrait523orientation).524525\fun{char*}{rect2svg}{GEN w, GEN x, GEN y, PARI_plot *T}526527\subsec{Technical functions exported for convenience}528529\fun{void}{pari_plot_by_file}{const char *env, const char *suf, const char *img}530backend used by the \kbd{plotps} and \kbd{plotsvg} graphic engines.531532\fun{void}{colorname_to_rgb}{const char *s, int *r, int *g, int *b} convert533an \kbd{X11} colorname to RGB values.534535\fun{void}{color_to_rgb}{GEN c, int *r, int *g, int *b} convert a pari color536(\typ{VECSMALL} RGB triple or \typ{STR} name) to RGB values.537538\fun{void}{long_to_rgb}{long c, int *r, int *g, int *b} split a standard539hexadecimal color value \kbd{0xfdf5e6} to its rgb components (\kbd{0xfd},540\kbd{0xf5}, \kbd{0xe6}).541\newpage542543544