You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When comparing polynomials from different rings I get inconsistent behaviour. Sometimes I just get false and sometimes an error.
To Reproduce
julia> R0,(x0) = polynomial_ring(QQ,1)
(Multivariate polynomial ring in 1 variable over QQ, QQMPolyRingElem[x1])
julia> R1,(x1) = polynomial_ring(ZZ,1)
(Multivariate polynomial ring in 1 variable over ZZ, ZZMPolyRingElem[x1])
julia> R2,(x2) = polynomial_ring(GF(2),1)
(Multivariate polynomial ring in 1 variable over GF(2), FqMPolyRingElem[x1])
julia> x0 == x1
false
julia> x0 == x2
false
julia> R3,(x3) = polynomial_ring(GF(3),1)
(Multivariate polynomial ring in 1 variable over GF(3), FqMPolyRingElem[x1])
julia> x2 == x3
ERROR: parents do not match
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] check_parent
@ ~/.julia/packages/AbstractAlgebra/QjFtH/src/AbstractAlgebra.jl:208 [inlined]
[3] check_parent
@ ~/.julia/packages/AbstractAlgebra/QjFtH/src/AbstractAlgebra.jl:207 [inlined]
[4] ==(a::FqMPolyRingElem, b::FqMPolyRingElem)
@ Nemo ~/.julia/packages/Nemo/4P3uO/src/flint/fq_default_mpoly.jl:295
[5] ==(A::Vector{FqMPolyRingElem}, B::Vector{FqMPolyRingElem})
@ Base ./abstractarray.jl:2943
[6] top-level scope
@ REPL[18]:1
julia> x0 == x3
false
Expected behavior
We have many places where we first compare the "surrounding space" before comparing the actual objects. So I would expect an error to get thrown. E.g. try
cube(2) == cube(3)
Additional context
Maybe this needs a styleguide entry, I actually did not look it up.
The text was updated successfully, but these errors were encountered:
Some background: In the cases with an error printed, the types of both arguments are equal, but the parents are not.
In the other cases, the types are not equal and thus julia delegated == to ===.
It seems that there are cases where we would want an error rather than false when the parents are not ===. So maybe this inconsistency is hard to avoid. After discussing in triage, no conclusion on proper behavior was reached.
Describe the bug
When comparing polynomials from different rings I get inconsistent behaviour. Sometimes I just get
false
and sometimes an error.To Reproduce
Expected behavior
We have many places where we first compare the "surrounding space" before comparing the actual objects. So I would expect an error to get thrown. E.g. try
Additional context
Maybe this needs a styleguide entry, I actually did not look it up.
The text was updated successfully, but these errors were encountered: