I was trying to create sets of immutable matrices of univariate Laurent polynomials over the integers, and strangely was getting duplicate copies of the same matrix depending on they were computed, which is exactly what I wanted to avoid. Digging a little further, I seem to have uncovered a fundamental problem in the hashing for univariate Laurent polynomials, both on the current version at SageMathCloud and using 7.0 on my own computer.
Minimal reproducible example follows: sage: version() 'SageMath Version 7.0, Release Date: 2016-01-19' sage: P.<t> = LaurentPolynomialRing(ZZ); P Univariate Laurent Polynomial Ring in t over Integer Ring sage: a = P(0); a 0 sage: b = t - t; b 0 sage: a.__class__ <type 'sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_univariate'> sage: b.__class__ <type 'sage.rings.polynomial.laurent_polynomial.LaurentPolynomial_univariate'> sage: a._fraction_pair() (0, 1) sage: b._fraction_pair() (0, 1) sage: a == b True hash(a) 0 hash(b) 1 Is this a known issue? I wasn't able to find it in any current tickets. I know that hashing of mathematical objects is a difficult area, and in fact should be disabled except for objects with a quickly computable canonical form (like, say, univariate Laurent polynomials over the integers), but it seems that when two objects both call themselves zero they ought to have the same hash. —Tracy Hall -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
