\\ --------------- GP code ---------------------------- \\ \\ Time-stamp: \\ \\ Description: Compute explicit elliptic units \\ \\ \\ \\ Original Authors: Fernando Rodriguez-Villegas \\ villegas@math.utexas.edu \\ \\ Farshid Hajir \\ fhajir@math.ucla.edu \\ \\ Created: Sat Feb 7 1998 \\ \\ Comments: This paper is based on the results of "Explicit Elliptic \\ Units I" by Farshid Hajir and Fernando Rodriguez-Villegas, Duke \\ Math. J 90, (1997) 495-521., henceforth refered to as EEU-I. \\ \\------------------------------------------------------- \\ Read in files: bforms, operates with binary (definite) forms; etaf, \\ computes eta function efficiently; set, temporary (?) setting up \\ some constants and precision to be used. \r bforms \r etafunction.gp \\====================================================================== wx(d)= {local(n4,n3); n4=valuation(d,2);n3=valuation(d,3); 2*if(n4==2,if((-d/4)%4==1,2,1),1)*if(n4>3,4,1)*if(n3==0,1,3) } addhelp(wx,"Compute w_H= number of roots of unity in H= ring class field of discriminant d (where d<0)."); \\====================================================================== wz(d)=if(issquare(-d),2,1)*if(issquare(-d/3),3,1)*2 addhelp(wz,"Compute w_K= number of roots of unity in K itself (i.e. only interesting if K=\Q(i), \Q(\sqrt{-3}))."); \\====================================================================== nc(d)= {local(v,w); v=cprvecf(d,[2,3]);w=gcd(wx(d),12); for(k=1,length(v), v[k]=if(v[k][1]==1,1,w/gcd(w,v[k][1]-1))); v } addhelp(nc,"Compute vector of n_C's; i.e. smallest number n such that u_C^n \in H."); \\====================================================================== elluts(d)= {local(vf,h,w,pol,q,a,f,ncv,polv,plist,q0,qinv2,ww,z,sqa); vf=cprvecf(d,[2,3]);h=length(vf); w=wx(d);ww=w/2;w=gcd(w,12);polv=[]; ncv=vector(h,k,if(vf[k][1]==1,1,w/gcd(w,vf[k][1]-1))); for(k=2,h, if(red1f(vf[k])[2]<=0, pol=1;q=vf[k];a=q[1]; a=kronecker(-1,a)*a;sqa=sqrt(a); qinv2=[q[1],-q[2],q[3]]; plist=rad(6*a); for(j=1,h, q0=cprf(vf[j],plist); z=kronecker(a,q0[1])*et(compf(q,q0),ww)* et(compf(qinv2,q0),ww)/ et(q0,ww)^2/sqa; pol=pol*(x-z^ncv[k])); pol=rd(pol); polv=concat(polv,[[ncv[k],pol]]),)); polv } addhelp(elluts,"Compute the minimal polynomial pol_C of v_C= u_C^n_C (the smallest power of u_C that lies in H; n_C= 1,2,3,6) for all non-trivial C modulo C \sym C^{-1}. The ouput is a vector with entries [n_C,pol_C]. The height of pol_C will be generally smaller the smaller n_C is. Hence, for a polynomial generating H it is convenient to pick pol_C for which n_C= 1. There are 24 d's with class number bigger than 1 for which there is no non-trivial class with n_C=1. These are: [15, 20, 24, 32, 36, 48, 51, 52, 60, 72, 84, 96, 99, 112, 123, 132, 148, 180, 228, 240, 267, 288, 372, 708]."); \\====================================================================== ellnum(v)= {local(n,d,w,e,deg,r,ww,l,f,z,pol,plist,vf,u,h); n=length(v); u=info(v); if(u, d=u[1];w=u[2];vf=cprvecf(d,[2,3]); h=length(vf);ww=w/2; e=u[3]; l=1;pol=1; r=gcd(w,12)/e*if(u[5][1]==1,1,2); for(k=1,n, l=lcm(l,v[k][2][1])); plist=rad(l); for(j=1,h, if(j==1,q0=vf[1],q0=cprf(vf[j],plist)); z=prod(k=1,n,et(compf(q0,v[k][2]),ww)^v[k][1],1); pol=pol*(x-z^r)); concat(u,[r,rdreal(pol)]),) } addhelp(ellnum,"Compute the minimal polynomial of a given eta quotient; input is a degree 0 divisor [ ...[n_Q,Q] ...] where n_Q is an integer and Q is a binary form of disc -d. The output is the minimal polynomial of the smallest power of prod{eta(Q)^n_Q} which is in H. For now it is assumed that the ideal \prod{Q^n_Q} is a square."); \\====================================================================== sput(q)= {local(u); u=ellnum([[2,q],[-1,compf(q,q)],[-1,primefm(1,discrf(q))]]); [u[1],u[2],u[3],u[6],u[7]] } addhelp(sput,"Compute special unit associated to Q: v=[[2,Q],[-1,Q*Q],[-1,Q_0]], where Q*Q is the square of Q in the class group and Q_0 is the principal form. Output is vector: [d,w,e,r,pol], where d,w,e are as usual, r is the power of \eta actually used, and pol is the minimal polynomial of the unit."); \\====================================================================== info(v)= {local(q,deg,flagc,flagd,n,d,w,e,a,a1,b1,c1); n=length(v);d=discrf(v[1][2]); flagc=0;flagd=0;deg=0; for(k=1,n, deg=deg+v[k][1]; if(discrf(v[k][2])!=d, flagd=1,); if(gcd(v[k][2][1],d*6)!=1,flagc=1,) ); if(flagc+flagd+deg, if(deg,print("the degree is not 0"),); if(flagd, print("not all discriminants are the same"),); if(flagc, print("some ideals not prime to 6*d"),), w=wx(d); e=sum(k=1,n,v[k][1]*v[k][2][1],0)/2; e=gcd(e,gcd(w,12)); q=primefm(1,d);a=1; for(k=1,n, q=compf(q,powerf(v[k][2],v[k][1]%2)); a=a*v[k][2][1]^(v[k][1]%2)); a1=sqfp(q[1]); b1=q[2]%(2*a1);c1=(b1^2-d)/4/a1; [d,w,e,sqfp(sqrtint(a/q[1])),[a1,b1,c1]] ) } addhelp(info,"Describe information about a given divisor; output is a vector of the form: [d,w,e,m,q], where d,w,e are as usual and m,q represent the conductor of the quadratic symbol associated to the divisor described as: m\A, m \in \Z and \A is the primitive ideal corresponding to q."); \\====================================================================== sqfp(m)= {local(f); f=factor(m); prod(k=1,length(f~),f[k,1]^(f[k,2]%2),1) } addhelp(sqfp," Compute the square-free part of an integer."); \\====================================================================== et(q,w)= {if(w,,w=wx(discrf(q))/2); exp(2*Pi*I/48*(q[1]*(q[2]+3*w)))*etaf([q[1],-q[2],q[3]]) } addhelp(et,"Compute \eta(\A) as defined in EEU-I; q is a binary form corresponding to \A and w is the value of \tilde{w} (given as an optional input to function to avoid recomputing)."); \\====================================================================== \\ Round polynomial if coefficients are close to integers otherwise \\ gives polynomial back. rd(pol)= {local(rdpol); rdpol=simplify(round(pol)); if(norml2(Vec(pol-rdpol))<10^(-10),rdpol,pol) } \\====================================================================== \\ Check whether imaginary part of polynomial pol is close to 0, if it \\ is returns rd(real(pol)) otherwise rd(norm(pol)). rdreal(pol)= {local(impol); impol=simplify(imag(pol)); rd(if(norml2(Vec(impol))<10^(-10),real(pol),norm(pol))) } {helpexpell()= print("-------------------------------------------------------------------"); print(" Computational number Theory "); print("-------------------------------------------------------------------"); print(""); print("Description: Routines for operating with binary positive definite"); print("quadratic forms."); print(""); print("Original Authors: Fernando Rodriguez-Villegas"); print(" villegas@math.utexas.edu"); print(" University of Texas at Austin"); print(""); print(" Farshid Hajir"); print(" fhajir@math.ucla.edu"); print(""); print("With the assistance of: Ariel Pacetti"); print(" apacetti@math.utexas.edu"); print(" University of Texas at Austin"); print("-------------------------------------------------------------------"); print(""); print("List of routines'"); print(""); print("wx wz nc elluts ellnum sput info sqfp et"); print(""); }