On Monday 02 April 2007 22:53, Kate Minola wrote: > Would a kind person explain to me why element 1 and element 2 > are not equal? And what I need to do to test if element 1 is zero > in K? > > # setup > f = conway_polynomial(2,63) > K.<a> = GF(2**63, name='a', modulus=f) > n = f.degree() > m = 3; > e = (2^n - 1) / (2^m - 1) > c = a^e > conway = conway_polynomial(2,m) > > # element 1 > print conway(c) # says 0 > print type(c) > print parent(c) > print c in K # says True > > # element 2 > print K(0) # says 0 > print type(K(0)) > print parent(K(0)) > > print conway(c) == K(0) # says False???
This seems to be a bug in the pari.gen.gen class: sage: e1 = conway(c) sage: e2 = K(0) When compare is called on them, their pari values are compared, these differ in their representation. sage: e1._FiniteField_ext_pariElement__value 0 sage: e2._FiniteField_ext_pariElement__value Mod(Mod(0, 2), Mod(1, 2)*a^63 + Mod(1, 2)*a^24 + Mod(1, 2)*a^23 + Mod(1, 2)*a^22 + Mod(1, 2)*a^17 + Mod(1, 2)*a^16 + Mod(1, 2)*a^15 + Mod(1, 2)*a^11 + Mod(1, 2)*a^9 + Mod(1, 2)*a^8 + Mod(1, 2)*a^4 + Mod(1, 2)*a^3 + Mod(1, 2)*a^2 + Mod(1, 2)*a + Mod(1, 2)) Their comparison fails as follows: e2._FiniteField_ext_pariElement__value._cmp(e1._FiniteField_ext_pariElement__value ) --------------------------------------------------------------------------- <class 'gen.PariError'> Traceback (most recent call last) /home/malb/<ipython console> in <module>() /home/malb/gen.pyx in gen._pari_trap() <class 'gen.PariError'>: incorrect type (20) I openend a ticket on Trac for this. Martin -- name: Martin Albrecht _pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99 _www: http://www.informatik.uni-bremen.de/~malb _jab: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---