Hashing members of a fraction field

17 views
Skip to first unread message

dei...@gmail.com

unread,
Mar 10, 2023, 11:37:44 AM3/10/23
to sage-support

I am attempting to compute some sets of rational functions.  Unfortunately, it seems that elements of a fraction field are only reduced to unit multiples of numerator and denominator.  Multiplying the numerator and denominator by the same unit gives equal elements, but they hash to different things.


I can separate each rational function into numerator and denominator, rescale them and reconstruct the fraction, but is there a simpler way?



R.<w>=PolynomialRing(ZZ)

K=FractionField(R)

test = (K(-1)/K(-w))

test.reduce()

print(test)


-1/-w


print(test == K(1/w))

True

s = set([K(1/w), test])
print(s)

{1/w, -1/-w}

dei...@gmail.com

unread,
Mar 10, 2023, 11:59:02 AM3/10/23
to sage-support
I forgot:

'SageMath version 10.0.beta3, Release Date: 2023-03-02'


Compiled this morning on OSX 12.6.3


Reply all
Reply to author
Forward
0 new messages