Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to compute correct Gröbner basis on DynamicPolynomials variable with non-standard monomial ordering #116

Closed
0708andreas opened this issue Feb 5, 2024 · 7 comments

Comments

@0708andreas
Copy link

I think the issue is best described by the following two examples:

When using variables with a designated monomial order, Gröbner basis computations seem to fail, sometimes (the failure isn't random, it is repeatable. But I don't see a pattern)

julia> using DynamicPolynomials
julia> using Groebner
julia> @polyvar x y z monomial_order=LexOrder
(x, y, z)
julia> isgroebner(groebner([1+z*x, 1+z*y^2]))
false
julia> isgroebner(groebner([1+z*x, 1+z*y^2], ordering=Lex()), ordering=Lex())
true
julia> isgroebner(groebner([1+z*x, 1+z*y^2], ordering=DegLex()), ordering=DegLex())
false

However, with standard monomial order, the problem disappears:

julia> using DynamicPolynomials
julia> using Groebner
julia> @polyvar x y z
(x, y, z)
julia> isgroebner(groebner([1+z*x, 1+z*y^2]))
true
julia> isgroebner(groebner([1+z*x, 1+z*y^2], ordering=Lex()), ordering=Lex())
true
julia> isgroebner(groebner([1+z*x, 1+z*y^2], ordering=DegLex()), ordering=DegLex())
true

The workaround, for now, is to use the default monomial order and specify the wanted order in each call to groebner.

I'm on julia 1.10.0 and using Grobner.jl v0.6.3 from the registry.

Bests, Andreas

@sumiya11
Copy link
Owner

sumiya11 commented Feb 5, 2024

Hi! Thanks for reporting this, I can reproduce it.
I will have a look.

@sumiya11
Copy link
Owner

I am a bit confused at the moment -- maybe you know how can I query the ordering ?

For example,

using DynamicPolynomials
@polyvar x y z monomial_order=LexOrder
ordering(x)
# returns
GradedLex()

with

⌃ [102ac46a] MultivariatePolynomials v0.5.3
  [7c1d4256] DynamicPolynomials v0.5.3

@sumiya11
Copy link
Owner

Hi @0708andreas , the fix is in progress #121

But keep in mind that the arithmetic for LexOrder in DP.jl seems to be incorrect at the moment (unless I have messed up something) JuliaAlgebra/DynamicPolynomials.jl#152

@0708andreas
Copy link
Author

Thank you so much. That's an... interesting issue in DP.jl XD

@sumiya11
Copy link
Owner

@0708andreas I registered a new version of Groebner, should work with the latest DP.jl. Let me know in case you face other issues

@sumiya11
Copy link
Owner

sumiya11 commented Feb 15, 2024

Note that at the moment I only support LexOrder, Graded{LexOrder}, Graded{Reverse{InverseLexOrder}} natively from DP.jl.
For other orderings, use can use the ordering= keyword with a Groebner.jl equivalent.

@sumiya11
Copy link
Owner

I will close this issue, feel free to open a new one if you encounter other issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants