# Revision history [back]

Yes, I think this is a bug. I get consistent behavior from

sage: F = GF(2^64,'a')
sage: K = GF(2^128,'b')
sage: F.gen().minpoly()
x^64 + x^33 + x^30 + x^26 + x^25 + x^24 + x^23 + x^22 + x^21 + x^20 + x^18 + x^13 + x^12 + x^11 + x^10 + x^7 + x^5 + x^4 + x^2 + x + 1
sage: K.gen().minpoly()
x^128 + x^7 + x^2 + x + 1


but it becomes erratic when I start including the generator in global namespace:

sage: a = F.gen()
sage: a.minpoly()
x^64 + x^33 + x^30 + x^26 + x^25 + x^24 + x^23 + x^22 + x^21 + x^20 + x^18 + x^13 + x^12 + x^11 + x^10 + x^7 + x^5 + x^4 + x^2 + x + 1
sage: b = K.gen()
sage: a.minpoly()
x^128 + x^7 + x^2 + x + 1
sage: b.minpoly()
x^128 + x^7 + x^2 + x + 1

sage: F = GF(2^64,'a')
sage: a = F.gen()
sage: b.minpoly()
x^64 + x^33 + x^30 + x^26 + x^25 + x^24 + x^23 + x^22 + x^21 + x^20 + x^18 + x^13 + x^12 + x^11 + x^10 + x^7 + x^5 + x^4 + x^2 + x + 1


On the other hand, the problem seems not to appear for finite fields with different characteristic:

sage: F = GF(2^64,'a')
sage: L = GF(3^64,'c')
sage: c = L.gen()
sage: a = F.gen()
sage: c.minpoly()
x^64 + x^63 + 2*x^60 + x^58 + x^57 + x^56 + x^55 + x^54 + 2*x^52 + x^50 + 2*x^49 + 2*x^48 + x^46 + 2*x^45 + x^44 + x^43 + x^42 + x^41 + 2*x^40 + x^39 + 2*x^37 + 2*x^35 + 2*x^33 + x^31 + 2*x^30 + 2*x^28 + 2*x^27 + x^25 + x^22 + 2*x^20 + x^17 + 2*x^16 + x^15 + x^13 + x^11 + 2*x^10 + 2*x^9 + 2*x^8 + 2*x^7 + 2*x^6 + x^5 + 2*x^4 + x^3 + x^2 + 2*x + 2
sage: a.minpoly()
x^64 + x^33 + x^30 + x^26 + x^25 + x^24 + x^23 + x^22 + x^21 + x^20 + x^18 + x^13 + x^12 + x^11 + x^10 + x^7 + x^5 + x^4 + x^2 + x + 1