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

Monomial ordering #77

Closed
saschatimme opened this issue Apr 6, 2018 · 6 comments · Fixed by #276
Closed

Monomial ordering #77

saschatimme opened this issue Apr 6, 2018 · 6 comments · Fixed by #276

Comments

@saschatimme
Copy link
Collaborator

Could elaborate which monomial ordering is currently used? Lexicographic? And is this enforced by the interface, i.e. MultivariatePolynomials, or is it depending on the implementation, i.e. DynamicPolynomials etc.?
And would it maybe make sense to be able to specify the ordering?

@blegat
Copy link
Member

blegat commented Apr 6, 2018

Currently the ordering used is graded lexicographic order by DynamicPolynomials and TypedPolynomials. I agree that it would be nice to query the ordering used and be able to choose the monomial ordering in e.g. @polyvar.

@saschatimme
Copy link
Collaborator Author

There are actually two things. The first one is the ordering and the other is the ordering of the variables itself. Currently we have the following behaviour:
DynamicPolynomials.@polyvar b a results in the variable ordering b > a but TypedPolynomials.@polyvar b a results in a > b. This is quite subtle and could lead to some surprises.
cc: @rdeits

@blegat
Copy link
Member

blegat commented Apr 6, 2018

Yes, DynamicPolynomials compares variables using creation order while TypedPolynomials compares them with names. There is the same subtlety with == :-P

@rdeits
Copy link
Collaborator

rdeits commented Apr 6, 2018

The problem is that in TypedPolynomials the only identity a Variable has is its literal name, so that's the only information I can possibly use for comparison. Perhaps this is just something we have to document better?

@projekter
Copy link
Contributor

With the 0.5 release, there is the possibility to have different monomial orderings (although it is not fully implemented yet, as for example DP.monomials always generates graded lex order and therefore fails to produce valid monomial vectors, as mentioned in JuliaAlgebra/DynamicPolynomials.jl#138).
However, unless I'm mistaken, a way to query this ordering is still missing: While there is ordering(::APL), this gives the AbstractOrdering of the polynomial, which does not seem to be related in any way with the AbstractMonomialOrdering of the monomials.
There is no such monomial_ordering(::Monomial{V,M}) where {V,M} = M, as for example the implementation in DynamicPolynomials would look like.

@blegat
Copy link
Member

blegat commented Oct 24, 2023

Oops, indeed this ordering and AbstractOrdering are not in sync with the rest, we should make it match

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

Successfully merging a pull request may close this issue.

4 participants