Hi Dule,
On 30 Jul., 12:03, DuleOrlovic <[email protected]> wrote:
>...
> [x^2*y, x*y^2, 2*x^2 + x*y, 3*x*y, 2*y^2]
> ... this is wrong result.
> Right one is [x*y^3, 2*x^2 + x*y, 3*x*y, 2*y^2]
No, you are wrong. Your expected answer is definitely not correct,
since it does not reduce all elements of I to zero:
sage: R.<x,y>=PolynomialRing(ZZ,2)
sage: I=R*(4*x^2*y^2+2*x*y^3+3*x*y,2*x^2+x*y,2*y^2)
sage: (y*I.0 -2*y^3*I.1 -x*I.2).reduce([x*y^3, 2*x^2 + x*y, 3*x*y,
2*y^2])
x*y^2
On the contrary, the answer of Sage reduces all elements of your
expected result to zero:
sage: G = I.groebner_basis(); G
[x^2*y, x*y^2, 2*x^2 + x*y, 3*x*y, 2*y^2]
sage: [g.reduce(G) for g in [x*y^3, 2*x^2 + x*y, 3*x*y, 2*y^2]]
[0, 0, 0, 0]
So, if any of the two answers is correct then it is G -- provided that
all elements of G belong to I.
Here might indeed be a problem. I am using singular's liftstd:
sage: r = singular(R)
sage: i = singular(I)
sage: singular.eval('matrix m')
'matrix m;'
sage: singular.eval('liftstd(%s,m)'%i.name())
'_[1]=2*y^2\n_[2]=-3*x*y\n_[3]=2*x^2+x*y\n_[4]=x*y^2\n_[5]=x^2*y'
sage: singular('m')
0,-1, 0,y, -3*x-y,
0,2*y^2,1,-2*y^3,2*y^3+5*y,
1,0, 0,-x, -x-2*y
So, singular yields the elements of G in opposite order (up to sign),
which is fine.
However, there indeed seems to be something wrong, because multiplying
i with the matrix m should result in the returned Gröbner basis:
sage: i.matrix()*singular('m')
2*y^2,-3*x*y,2*x^2+x*y,x*y^2,-12*x^3*y^2-6*x^2*y^3+x^2*y-4*y^3
So, the last polynomial is not as expected.
I'll file a bug report to singular.
You are certainly aware that the Gröbner basis crucially depends on
the choice of a term ordering. What ordering did you use? G is a
degrevlex Gröbner basis:
sage: R.term_order()
Degree reverse lexicographic term order
Cheers,
Simon
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org