JuliaAlgebra / DynamicPolynomials.jl

Multivariate polynomials implementation of commutative and non-commutative variables
Other
60 stars 20 forks source link

wrong calculation with LexOrder? #155

Closed KenZhenLin closed 4 months ago

KenZhenLin commented 4 months ago

Hi,

Could you please help me understand this?

@polyvar toya[1:6] monomial_order = LexOrder

@show toya[6]-(1+toya[1]) gives toya[6] - (1 + toya[1]) = -toya₁, the variable toya[6] and constant -1 disappear, while @show toya[6]-1-toya[1] is correct, and gives (toya[6] - 1) - toya[1] = -1 + toya₆ - toya₁

And toya[6]-(1+toya[1]) == toya[6]-1-toya[1] is false.

The above issue does NOT happen if I remove the monomial_order = LexOrder.

Thanks!

blegat commented 4 months ago

Are you using the latest version, it was fixed in https://github.com/JuliaAlgebra/DynamicPolynomials.jl/pull/153

KenZhenLin commented 4 months ago

Are you using the latest version, it was fixed in #153

Oh ok, sorry I'm not. I will try the latest and see if it works! Thanks a lot!