The hash value for a LaurentMPolyWrap a and its negative is equal:
julia> using AbstractAlgebra
julia> R, (a, b) = laurent_polynomial_ring(QQ, [:a, :b])
(Multivariate Laurent polynomial ring in 2 variables over rationals, AbstractAlgebra.Generic.LaurentMPolyWrap{Rational{BigInt}, AbstractAlgebra.Generic.MPoly{Rational{BigInt}}, AbstractAlgebra.Generic.LaurentMPolyWrapRing{Rational{BigInt}, AbstractAlgebra.Generic.MPolyRing{Rational{BigInt}}}}[a, b])
julia> hash(a) == hash(-a)
true
It could be caused by this line:
|
h ^= 0x9c64b62806a3d51d%UInt |
which does not make much sense to me, it seems to be always zero for every even integer:
julia> for i in 1:10
println(UInt(i)^0x9c64b62806a3d51d)
end
1
0
6835022377903901075
0
17694793150345534037
0
5333000080861380455
0
15995747220507601513
0
The hash value for a LaurentMPolyWrap
aand its negative is equal:It could be caused by this line:
AbstractAlgebra.jl/src/generic/LaurentMPoly.jl
Line 45 in 6c4cf51
which does not make much sense to me, it seems to be always zero for every even integer: