////////////////////////////////////////////////////////////////////////////////////////////////// // Computation of jinvariant for the two vertices for Type V and the single vertex for Type IV // ////////////////////////////////////////////////////////////////////////////////////////////////// LIB "all.lib"; LIB "poly.lib"; LIB "all.lib"; LIB "tropical.lib"; ring r = (0,a2,a3,a4,a5), (x,y),dp; poly ff=y^2-x*(x-a2)*(x-a3)*(x-a4)*(x-a5); // ff; // -x^5+(a2+a3+a4+a5)*x^4+(-a2*a3-a2*a4-a2*a5-a3*a4-a3*a5-a4*a5)*x^3+(a2*a3*a4+a2*a3*a5+a2*a4*a5+a3*a4*a5)*x^2+y^2+(-a2*a3*a4*a5)*x matrix m = coef(ff,xy); // m; // m[1,1]=x^5 // m[1,2]=x^4 // m[1,3]=x^3 // m[1,4]=x^2 // m[1,5]=y^2 // m[1,6]=x // m[2,1]=-1 // m[2,2]=(a2+a3+a4+a5) // m[2,3]=(-a2*a3-a2*a4-a2*a5-a3*a4-a3*a5-a4*a5) // m[2,4]=(a2*a3*a4+a2*a3*a5+a2*a4*a5+a3*a4*a5) // m[2,5]=1 // m[2,6]=(-a2*a3*a4*a5) // Computation of j-invariant for the curve dual to the vertex v1 (involves the terms y^2, x, x^2, and x^3) and the vertex v2 (involves the terms y^2, x^3,x^4,x^5): // We take the terms with x, x^2, x^3, x^4, x^5, y^2 from the matrix m above: poly B1 = m[2,6]; poly B2 = m[2,4]; poly B3 = m[2,3]; poly By2 = m[2,5]; poly B4 = m[2,2]; poly B5 = m[2,1]; poly C1 = By2*y^2 + B1*x + B2*x^2 + B3*x^3; // C1; // (-a2*a3-a2*a4-a2*a5-a3*a4-a3*a5-a4*a5)*x^3+(a2*a3*a4+a2*a3*a5+a2*a4*a5+a3*a4*a5)*x^2+y^2+(-a2*a3*a4*a5)*x // We replace y by y/x to get a cubic equation and disregard issues with characteristic 3 on the residue field: poly C2 = By2*y^2 + B3*x + B4*x^2 + B5*x^3; // C2; // -x^3+(a2+a3+a4+a5)*x^2+y^2+(-a2*a3-a2*a4-a2*a5-a3*a4-a3*a5-a4*a5)*x // we use the j-invariant function from "tropical.lib" and write the two j-invariants as a plain text output. LIB "tropical.lib"; poly j1= jInvariant(C1); write(":w jC1Output.txt", "jC1 =", j1, ""); poly j2= jInvariant(C2); write(":w jC2Output.txt", "jC2 =", j2, "");