
D.13.4.10 jInvariant
Procedure from library tropical.lib (see tropical_lib).
 Usage:
 jInvariant(f[,#]); f poly, # list
 Assume:
  f is a a polynomial whose Newton polygon has precisely one
interior lattice point, so that it defines an elliptic curve
on the toric surface corresponding to the Newton polygon
 it the optional argument # is present the base field should be
Q(t) and the optional argument should be one of the following
strings:
'ord' : then the return value is of type integer,
namely the order of the jinvariant
'split' : then the return value is a list of two polynomials,
such that the quotient of these two is the jinvariant
 Return:
 poly, the jinvariant of the elliptic curve defined by poly
 Note:
 the characteristic of the base field should not be 2 or 3,
unless the input is a plane cubic
Example:
 LIB "tropical.lib";
==> Welcome to polymake version
==> Copyright (c) 19972015
==> Ewgenij Gawrilow, Michael Joswig (TU Darmstadt)
==> http://www.polymake.org
ring r=(0,t),(x,y),dp;
// jInvariant computes the jinvariant of a cubic
jInvariant(x+y+x2y+y3+1/t*xy);
==> (32768t12+24576t10+3072t81024t696t4+24t21)/(256t12+32t10+11t8t6)
// if the ground field has one parameter t, then we can instead
// compute the order of the jinvariant
jInvariant(x+y+x2y+y3+1/t*xy,"ord");
==> 6
// one can compare the order of the jinvariant to the tropical jinvariant
tropicalJInvariant(x+y+x2y+y3+1/t*xy);
==> // ** int division with `/`: use `div` instead in line >> genus=genus/2\
; // we have counted each bounded edge twice<<
==> 6
// the following curve is elliptic as well
poly h=x22y11+x19y10+x17y9+x16y9+x12y7+x9y6+x7y5+x2y3+x14y8;
// its jinvariant is
jInvariant(h);
==> 912673/528

