Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241697 views
/*** EXAMPLE: Dirichlet L-function of a general character modulo odd P   ***/
/*** (illustration of functional equations with 2 different L-functions) ***/
/***                                                                     ***/
/*** v1.2, July 2013, questions to [email protected]          ***/
/*** type \rex-chgen or read("ex-chgen") at pari prompt to run this      ***/

read("computel");                 \\ read the ComputeL package
                                  \\ and set the default values
default(realprecision,28);        \\ set working precision; used throughout

P = 37;                           \\ May change this to any odd prime

\\ Take the character defined by the following modulo P (has order P-1)
\\    (primitive root) -> e^(2 Pi I/(P-1))
\\ a(n) = if(n%P,exp(2*Pi*I/(P-1)*znlog(n,prim)),0);
\\ znlog needs pari 2.1, the following works with earlier versions

prim = znprimroot(P);
avec = vector(P,k,0);
for (k=0,P-1,avec[lift(prim^k)+1]=exp(2*Pi*I*k/(P-1)));
a(n)  = avec[n%P+1];

                          \\ initialize L-function parameters
conductor = P;            \\ exponential factor
gammaV    = [1];          \\ [0] for even, [1] for odd
weight    = 1;            \\ L(s)=sgn*L(weight-s)
sgn       = X;            \\ unknown, to be solved from functional equation

initLdata("a(k)",,"conj(a(k))");  \\ initialize L-series coefficients a(k)
                                  \\ and the ones of the dual motive

sgneq = Vec(checkfeq());       \\ checkfeq() returns c1+X*c2, should be 0
sgn   = -sgneq[2]/sgneq[1];    \\ hence solve for the sign

print("EXAMPLE: L(s)=L(Chi,s), Chi=character of order P-1 modulo P");
print("         with ",default(realprecision)," digits precision");
print("         take P=",P);
print("Chi(",lift(prim),")      = exp(2*Pi*I/",P-1,\
      ")    defines the character (mod ",P,")");
print("Parity      = ", if(gammaV[1],"odd","even"));
print("Sign          we will try to solve from the functional equation");
print("            = ", sgn);
print("|sign|      = ", abs(sgn));
print("Verifying functional equation. Error: ",errprint(checkfeq(1.1)));
print("L(Chi,2)    = ",L(2));
print("  (check)   = ",L(2,1.1));
print("L(Chi,I)    = ",L(I));
print("  (check)   = ",L(I,1.1));