\\ --------------- GP code --------------------------------------- \\ \\ Time-stamp: <2001-09-15 15:10:31 apacetti> \\ Description: Compute Weierstrass form of Jacobian of general cubic \\ \\ File: /home/merak/villegas/gp/jac_cubic.gp \\ \\ Original Author: Fernando Rodriguez Villegas \\ villegas@math.utexas.edu \\ \\ \\ Created: Wed Jun 7 2000 \\ \\----------------------------------------------------------------- \\ PRELIMINARY VERSION \\ \\ This is joint work with John Tate. See also work of McCallum and \\ his students on the same topic. \\----------------------------------------------------------------- \\ The notation for the quantities associated to a generalized \\ Weierstrass form are the standard ones. \\ Weierstrass form of Jacobian of general cubic. The input is a \\ vector with the 10 coefficients of the cubic f ordered as follows \\ [q0,q1,q2,q3,r0,r1,r2,s0,s1,t0] where \\ \\ f= \\ t_0 y^3 + \\ s_1 y^2z + s_0 xy^2 + \\ r_2 yz^2 + r_1 xyz + r_0 x^2y \\ q_3 z^3 + q_2 xz^2 + q_1 x^2z + q_0 x^3 \\ \\ With this labeling of the coefficients all the polynomials given \\ below are homogeneous of degree equal to their index. The functions \\ getcoeffh and getcoeffnh below will transform degree 3 polynomials \\ into a vector of its coefficients with this ordering. \\ \\ For example, if f=x^3+y^3+z^3+k*x*y*z is the Hesse family then \\ \\ getcoeffh(f) (see below) returns \\ \\ [1, 0, 0, 1, 0, k, 0, 0, 0, 1] \\ \\ and jac_cubic( [1, 0, 0, 1, 0, k, 0, 0, 0, 1]) gives \\ \\ [k, 0, 9, 0, k^3 - 27] \\ \\ while getc([k, 0, 9, 0, k^3 - 27]) gives \\ \\ [k^4 - 216*k, -k^6 - 540*k^3 + 5832] \\ \\ for the values of c_4 and c_6. jac_cubic(v)= {local(q0,q1,q2,q3,r0,r1,r2,s0,s1,t0); q0=v[1];q1=v[2];q2=v[3];q3=v[4]; r0=v[5];r1=v[6];r2=v[7]; s0=v[8];s1=v[9]; t0=v[10]; [r1, -(s0*q2 + s1*q1 + r0*r2), (9*t0*q0 - s0*r0)*q3 + ((-t0*q1 - s1*r0)*q2 + (-s0*r2*q1 - s1*r2*q0)), ((-3*t0*r0 + s0^2)*q1 + (-3*s1*s0*q0 + s1*r0^2))*q3 + (t0*r0*q2^2 + (s1*s0*q1 + ((-3*t0*r2 + s1^2)*q0 + s0*r0*r2))*q2 + (t0*r2*q1^2 + s1*r0*r2*q1 + s0*r2^2*q0)), (-27*t0^2*q0^2 + (9*t0*s0*r0 - s0^3)*q0 - t0*r0^3)*q3^2 + (((9*t0^2*q0 - t0*s0*r0)*q1 + ((-3*t0*s0*r1 + (3*t0*s1*r0 + 2*s1*s0^2))*q0 + (t0*r0^2*r1 - s1*s0*r0^2)))*q2 +(-t0^2*q1^3 + (t0*s0*r1 + (2*t0*s1*r0 - s1*s0^2))*q1^2 + ((3*t0*s0*r2 + (-3*t0*s1*r1 + 2*s1^2*s0))*q0 + ((2*t0*r0^2 - s0^2*r0)*r2 + (-t0*r0*r1^2 + s1*s0*r0*r1 - s1^2*r0^2)))*q1 + ((9*t0*s1*r2 - s1^3)*q0^2 + (((-3*t0*r0 + s0^2)*r1 - s1*s0*r0)*r2 + (t0*r1^3 - s1*s0*r1^2 + s1^2*r0*r1))*q0)))*q3 + (-t0^2*q0*q2^3 + (-t0*s1*r0*q1 + ((2*t0*s0*r2 + (t0*s1*r1 - s1^2*s0))*q0 - t0*r0^2*r2))*q2^2 + (-t0*s0*r2*q1^2 + (-t0*s1*r2*q0 + (t0*r0*r1 - s1*s0*r0)*r2)*q1 + ((2*t0*r0 - s0^2)*r2^2 + (-t0*r1^2 + s1*s0*r1 - s1^2*r0)*r2)*q0)*q2 + (-t0*r0*r2^2*q1^2 + (t0*r1 - s1*s0)*r2^2*q0*q1 - t0*r2^3*q0^2))] } \\ Get coefficients of cubic (a degree 3 homogeneous polynomial in 3 \\ variables) as a vector in specific ordering (suitable for feeding \\ into jac_cubic above) with respect to 3 variables in vector v (if \\ given, otherwise set v=[x,y,z]). getcoeffh(p,v)= {local(u); if(v,,v=[x,y,z]); u=[]; for(j=0,3, for(k=j,3, u=concat(u, polcoeff(polcoeff(polcoeff(p,3-k,v[1]), j,v[2]),k-j,v[3])))); u } \\====================================================================== \\ Get coefficients of a degree 3 polynomial in 2 variables as a \\ vector in specific ordering (suitable for feeding into jac_cubic \\ above) with respect to 2 variables in vector v (if given, otherwise \\ set v=[x,y]). getcoeffnh(p,v)= {local(u); if(v,,v=[x,y]); u=[]; for(j=0,3, for(k=j,3, u=concat(u, polcoeff(polcoeff(p,3-k,v[1]),j,v[2])))); u } \\====================================================================== \\ Get b's from a's getb(v)= {local(a1,a2,a3,a4,a6); a1=v[1];a2=v[2];a3=v[3];a4=v[4];a6=v[5]; [a1^2+4*a2, a1*a3+2*a4, a3^2+4*a6, -a1*a3*a4-a4^2+a1^2*a6+a2*a3^2+4*a2*a6] } \\====================================================================== \\ Get b_2, b_4, b_6 from a's getbb(v)= {local(a1,a2,a3,a4,a6); a1=v[1];a2=v[2];a3=v[3];a4=v[4];a6=v[5]; [a1^2+4*a2, a1*a3+2*a4, a3^2+4*a6, -a1*a3*a4-a4^2+a1^2*a6+a2*a3^2+4*a2*a6] } \\====================================================================== \\ Get c4, c6 from a's getc(v)= {local(b); b=getbb(v); [b[1]^2-24*b[2], -b[1]^3+36*b[1]*b[2]-216*b[3]] } \\====================================================================== \\ Get Delta from a's getdelta(v)= {local(b); b=getb(v); -b[1]^2*b[4]-8*b[2]^3-27*b[3]^2+9*b[1]*b[2]*b[3] }