Read-only forum archive

Compute the generic initial ideal

Compute the generic initial ideal

Yeongseok Song · Thu Feb 28, 2008 11:08 am

Hi!
I am a beginner of Singular
I want to compute the generic initial ideal. but I can't compute that in Singular!
How can I compute the generic initial ideal in Singular?

Thanks!

Re: Compute the generic initial ideal

levandov · Sun Jul 19, 2009 4:33 pm

Hi, up to now there was no command in Singular to
compute the gin. But according to the tutorial paper of Mark Green and Michael Stillman (from the book "Groebner bases and Applications", Cambridge University Press, 1998), it can be coded in Singular as follows:

Code:
LIB "random.lib";
LIB "poly.lib";
proc gin(ideal I)
{
matrix M = randommat(1,nvars(basering), maxideal(1), 1000); // the random coeffs will be in range [-1000,1000]
ideal m = ideal(M); map F = basering, m;
ideal J = F(I);
J = groebner(J);
J = normalize(lead(J));
return(J);
}


For instance, try the examples from the tutorial:
Code:
// for revlex gin:
ring r = 0,(a,b,c,d),dp;
ideal I = a^3+c^2*d, b^3-a*d^2;
gin(I);


Code:
// for lex gin:
ring r = 0,(a,b,c,d),lp;
ideal I = a^3+c^2*d, b^3-a*d^2;
gin(I); // be patient, it takes some time


This agrees with the answers, computed e.g. with Macaulay2.

Regards,
Viktor Levandovskyy

Re: Compute the generic initial ideal

bulygin · Mon Jul 20, 2009 10:57 am

You may use the function randomid from random.lib as follows:
Code:
LIB "random.lib";
ring r = 0,(a,b,c,d),dp;
ideal I = a^3+c^2*d, b^3-a*d^2;
ideal J=randomid(I,2,100);

This will give you an ideal with two random generators which are random linear combinations of generators of I with coefficients in [-100,100].
More info in http://www.singular.uni-kl.de/Manual/latest/sing_751.htm#SEC828