Open KenZhenLin opened 4 months ago
Hi @KenZhenLin ,
Thanks for reporting this. You are correct, groebner
should always return a reduced basis, and it clearly fails in this case.
However, here, the situation is a bit subtle: groebner
tries to return polynomials in the same type as they were given in the input.
system
has Int coefficients. It is not possible to construct the reduced basis and preserve the type, so it chooses a normalization where denominators are equal to 1.
The current situation is not ideal. It would perhaps make sense to return polynomials with rational numbers as coefficients here. Hmm..
To illustrate what I mean consider this:
@polyvar x1 x2
system = [10*x1*x2^2 - 11*x1 + 10,
10*x1^2*x2 - 11*x2 + 10 // 1]
groebner(system)
3-element Vector{Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}, Rational{Int64}}}:
10//11x2 - 10//11x1 - x2² + x1²
1//1 - 11//10x2 - 10//11x2² + 10//11x1x2 + x2³
1//1 - 11//10x1 + x1x2²
But you are right, this behavior seems questionable to me. Also the example in the documentation could be updated.
@sumiya11 Thanks for your answer! It makes sense to me!
I tried that documentation example and indeed it returned the same results as in the documentation. To make sure I understand your point: groebner
returns the unique reduced Gröbner bases, but up to the multiplication by some nonzero constant, is that right?
To make sure I understand your point: groebner returns the unique reduced Gröbner bases, but up to the multiplication by some nonzero constant, is that right?
Yes.
For now, to get a trully reduced basis with DynamicPolynomials.jl, you can make polynomial coefficients rational, as in my example above.
For now, to get a trully reduced basis with DynamicPolynomials.jl, you can make polynomial coefficients rational, as in my example above.
I see, that's a good way!
I do have some codes for which it's better not to change the type, so if I do not make it rational, the groebner
will give me the reduced Gröbner bases or the reduced Gröbner bases multiplied by a nonzero constant, correct?
Thanks!
so if I do not make it rational, the groebner will give me the reduced Gröbner bases or the reduced Gröbner bases multiplied by a nonzero constant, correct?
Yep !
EDIT: and this constant may be different for each polynomial in the basis. Is this sufficient for your application at the moment ?
Hi,
The
groebner
returns the unique Reduced Gröbner bases by default, for any ordering, correct? Then why does the example below NOT have leading coefficient 1 ? This is an example from the documentation. Thanks!I'm using this version if that matters:
[0b43b601] Groebner v0.6.4