 LIB "hnoether.lib";
// ======== The irreducible case ========
ring s = 0,(x,y),ds;
poly f = y42x3y24x5y+x6x7;
list hn = develop(f);
show(hn[1]); // HamburgerNoether matrix
==> // matrix, 3x3
==> 0,x, 0,
==> 0,1, x,
==> 0,1/4,1/2
displayHNE(hn); // HamburgerNoether development
==> y = z(1)*x
==> x = z(1)^2+z(1)^2*z(2)
==> z(1) = 1/4*z(2)^21/2*z(2)^3 + ..... (terms of degree >=4)
setring s;
displayInvariants(hn);
==> characteristic exponents : 4,6,7
==> generators of semigroup : 4,6,13
==> Puiseux pairs : (3,2)(7,2)
==> degree of the conductor : 16
==> delta invariant : 8
==> sequence of multiplicities: 4,2,2,1,1
// invariants(hn); returns the invariants as list
// partial parametrization of f: param takes the first variable
// as infinite except the ring has more than 2 variables. Then
// the 3rd variable is chosen.
param(hn);
==> // ** Warning: result is exact up to order 5 in x and 7 in y !
==> _[1]=1/16x43/16x5+1/4x7
==> _[2]=1/64x65/64x7+3/32x8+1/16x91/8x10
ring extring=0,(x,y,t),ds;
poly f=x3+2xy2+y2;
list hn=develop(f,1);
param(hn); // partial parametrization of f
==> // ** Warning: result is exact up to order 2 in x and 3 in y !
==> _[1]=t2
==> _[2]=t3
list hn1=develop(f,6);
param(hn1); // a better parametrization
==> // ** Warning: result is exact up to order 6 in x and 7 in y !
==> _[1]=t2+2t44t6
==> _[2]=t3+2t54t7
// instead of recomputing you may extend the development:
list hn2=extdevelop(hn,12);
param(hn2); // a still better parametrization
==> // ** Warning: result is exact up to order 12 in x and 13 in y !
==> _[1]=t2+2t44t6+8t816t10+32t12
==> _[2]=t3+2t54t7+8t916t11+32t13
//
// ======== The reducible case ========
ring r = 0,(x,y),dp;
poly f=x112y2x8y3x7y2x6+y4x5+2y4x3+y5x2y6;
// = (x51y2) * (x62x3y21x2y3+y4)
list L=hnexpansion(f);
==> // No change of ring necessary, return value is HN expansion.
show(L[1][1]); // HamburgerNoether matrix of 1st branch
==> // matrix, 3x3
==> 0,x,0,
==> 0,1,x,
==> 0,1,1
displayInvariants(L);
==>  invariants of branch number 1 : 
==> characteristic exponents : 4,6,7
==> generators of semigroup : 4,6,13
==> Puiseux pairs : (3,2)(7,2)
==> degree of the conductor : 16
==> delta invariant : 8
==> sequence of multiplicities: 4,2,2,1,1
==>
==>  invariants of branch number 2 : 
==> characteristic exponents : 2,5
==> generators of semigroup : 2,5
==> Puiseux pairs : (5,2)
==> degree of the conductor : 4
==> delta invariant : 2
==> sequence of multiplicities: 2,2,1,1
==>
==>  contact numbers : 
==>
==> branch  2
==> +
==> 1  2
==>
==>  intersection multiplicities : 
==>
==> branch  2
==> +
==> 1  12
==>
==>  delta invariant of the curve : 22
param(L[2]); // parametrization of 2nd branch
==> _[1]=x2
==> _[2]=x5
