I have to deal with this a lot, and I've gotten used to it but it annoys me. More support for specialization would be great. I am not that good with the guts of the polynomial ring code and singular or I would have dealt with it already. I would be happy to review patches related to this.
-M. Hampton On Oct 29, 10:01 am, Simon King <[EMAIL PROTECTED]> wrote: > Hi! > > On Oct 29, 4:34 pm, vpv <[EMAIL PROTECTED]> wrote: > > > The dimension of the ideal of the groebner basis of the new system is > > 4 and not 0? Why? > > Since you are still in a ring with 8 (and not 4) variables. > > <snip> > > > > > What i do next i set: > > > x[0]=P(0) > > x[1]=P(1) > > > x[4]=P(1) > > x[5]=P(0) > > > Then my new system is: > > > sage: e > > > [x2*x7 + x2 + x3*x6 + x3*x7 + x3, > > x3*x7 + x3 + x7, > > x2*x7 + x6 + 1, > > x3*x6 + x3*x7 + x3 + x6 + 1, > > x2*x7 + x3*x6 + x7, > > x2*x6 + x2*x7 + x3*x7 + x3, > > x2*x7 + x2 + x3*x7 + x3 + x7, > > x2*x6 + x3*x6 + x3, > > x2*x7 + x3 + x6 + x7 + 1, > > x2*x6 + x2 + x3*x7, > > x2*x6 + x2 + x3*x6 + x3 + x7] > > Apparently x2,x3,... are still generators of your original polynomial > ring P -- and P has 8 variables, even though the new system of > polynomials e uses only four of them. Defining a new ring with only > the "surviving" variables has the expected result: > > sage: P.<x2,x3,x6,x7> = PolynomialRing(GF(2), 4, 'x',order='lex') > sage: e = [x2*x7 + x2 + x3*x6 + x3*x7 + x3, > ....: x3*x7 + x3 + x7, > ....: x2*x7 + x6 + 1, > ....: x3*x6 + x3*x7 + x3 + x6 + 1, > ....: x2*x7 + x3*x6 + x7, > ....: x2*x6 + x2*x7 + x3*x7 + x3, > ....: x2*x7 + x2 + x3*x7 + x3 + x7, > ....: x2*x6 + x3*x6 + x3, > ....: x2*x7 + x3 + x6 + x7 + 1, > ....: x2*x6 + x2 + x3*x7, > ....: x2*x6 + x2 + x3*x6 + x3 + x7] > sage: I=ideal(e) > sage: I.dimension() > 0 > sage: I2=ideal(I.groebner_basis()) > sage: V=I2.variety() > sage: V > [{x2: 0, x7: 0, x6: 1, x3: 0}] > > Substitution of variables in a polynomial ideal *and* carrying it to a > smaller polynomial ring seems to be a common problem. > The subs-method does the substitution but keeps the ring: > > sage: I.subs({x2:0}) > Ideal (x2*x7 + x2 + x3*x6 + x3*x7 + x3, x3*x7 + x3 + x7, x2*x7 + x6 + > 1, x3*x6 + x3*x7 + x3 + x6 + 1, x2*x7 + x3*x6 + x7, x2*x6 + x2*x7 + > x3*x7 + x3, x2*x7 + x2 + x3*x7 + x3 + x7, x2*x6 + x3*x6 + x3, x2*x7 + > x3 + x6 + x7 + 1, x2*x6 + x2 + x3*x7, x2*x6 + x2 + x3*x6 + x3 + x7) of > Multivariate Polynomial Ring in x2, x3, x6, x7 over Finite Field of > size 2 > > Question to everybody: > Is there a method that substitutes, say, x2=0 and returns an ideal in > a polynomial ring over x3, x6, x7? > If not, do you agree that such method (called, say, "specialisation") > would be useful? > > Cheers > Simon --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---