Hi!

On 2014-09-18, Clemens Heuberger <[email protected]> wrote:
> The same problem is in the Fraction Field of Univariate Polynomial Ring in u
> over Integer Ring:
>
>    sage: R1 = PolynomialRing(ZZ, names=['u']).fraction_field()
>    sage: (u,) = R1.gens()
>    sage: a = 1/(1 - u)
>    sage: b = -1/(u - 1)
>    sage: a == b
>    True
>    sage: hash(a) == hash(b)
>    False

As I have stated in my reply to Travis, simplification of fractions
currently just means to divide numerator and denominator by their gcd.
The gcd of -1 and -x is 1 in ZZ[x], hence, no simplification happens:
  sage: P.<x> = ZZ[]
  sage: -1/(-x)
  -1/-x

Again, "normalisation" would help. The problem is: What does
"normalisation" mean, in the general case? I.e., should we special-case
fraction fields of polynomial rings over ordered rings, where we can
achieve that the denominator's leading coefficient is positive?

Anyway, I am sure that that's the underlying reason for the broken hash
function.

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" 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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to