read("/var/www/cgi-bin/mfd/buhler_gross.gp"); {isgooddisc(D) = return (D!=-3 && D!=-4 && D%4==1 && gcd(D,N)==1 && issquarefree(D)); \\ stronger condition: see page 227 of [Gross-Zagier: Heegner points...] /* return (D!=-3 && D!=-4 && (D%4==1 || D%4 == 0) && gcd(D,N)==1 && (issquarefree(D) || (D%4==0 && D%8!=0 && issquarefree(D/4)))); */ } {quadratic_twist(E, D) = local(a,b,c,d,e); a=E[1];b=E[2];c=E[3];d=E[4];e=E[5]; ED = ellinit([ 0, 0, 0, -27*a^4*D^2 - 216*a^2*b*D^2 + 648*a*c*D^2 - 432*b^2*D^2 + 1296*d*D^2, 54*a^6*D^3 + 648*a^4*b*D^3 - 1944*a^3*c*D^3 + 2592*a^2*b^2*D^3 - 3888*a^2*d*D^3 - 7776*a*b*c*D^3 + 3456*b^3*D^3 - 15552*b*d*D^3 + 11664*c^2*D^3 + 46656*e*D^3 ]); return(ED); } {minimal_model(E) = return(ellchangecurve(E, ellglobalred(E)[2])) } {fundamental_volume(E)= local(o); o = E.omega; return(abs(matdet([real(o[1]),imag(o[1]);real(o[2]),imag(o[2])]))); } {conductor(E) = return(ellglobalred(E)[1]); } {elllderiv2(E,s) = return((elllseries(E,s+10^(-10)) - elllseries(E,s)) / 10.0^(-10)); } /******************************************************************* The first n discriminants of quadratic imaginary fields with no extra units that satisfy the Heegner hypothesis for N *******************************************************************/ {heegner_discriminants(N, n)= local(P, ans, D, hh); P = factor(N)[,1]~; \\ the prime divisors of N ans = []; D = 0; while(length(ans) < n, D = D - 1; if(isgooddisc(D), hh=1; for(i=1,length(P),if(kronecker(D,P[i])==-1,hh=0)); if(hh, ans=concat(ans,D)); ) ); return(ans); } /******************************************************************* The height of the Heegner points corresponding to the field with discriminant D. Here D is assumed to be a fundamental discriminant with no extra units. *******************************************************************/ {heegner_height(E, D) = local(bnd, ED, L, ans); print("computing height for D = ",D); if(!isgooddisc(D),error("heegner_height: bad disc")); bnd = 500; \\ for now ED = quadratic_twist(E, D); E = minimal_model(E); ED = minimal_model(ED); if(ellrootno(E)*ellrootno(ED) != -1,error("heegner_height: bad root not, bug somewhere.")); if(ellrootno(E)==-1, L = elllseries(ED,1)*elllderiv(E,1,2*sqrt(conductor(E))), \\ else L = elllseries(E,1)*elllderiv(ED,1,2*sqrt(conductor(ED))) ); /* if(ellrootno(E)==-1, L = elllseries(ED,1)*elllderiv2(E,1), \\ else L = elllseries(E,1)*elllderiv2(ED,1) ); */ ans = sqrt(abs(D))*L/fundamental_volume(E); if (abs(ans)<10^(-10), ans=0); return (ans); } /******************************************************************* The heights of the Heegner points corresponding to the first n quadratic fields with no extra units that satisfy the Heegner hypothesis for N. *******************************************************************/ {heegner_heights(E, n) = local(N, discs, heights); N = ellglobalred(E)[1]; discs = heegner_discriminants(N, n); heights = vector(n, i, heegner_height(E,discs[i])); return ([discs,heights]); }