Hello, I want to define a polynomial that I know lies in GF(p^2,'b')[x], > p=3700001. The problem is that I have to define it as a product > E=(X-a_1)*(X-a_2)*(X-a_3)*(X-a_4)*(X-a_5)*(X-a_6), where every a_j is in > GF(p^13,'a')[X]. > I tried to do GF(p^2,'b')[x](E), but then Sage just changes the generator > 'a' and writes the same expression with the generator 'b'. > Any idea about how to do this? >
There is a mathematical difficulty behind this: although the field of p^2 elements is a subfield of the field of p^12 elements, it is not a subfield in a canonical way. If you want automatic conversion between the two fields, you have to make sure that Sage recognises GF(p^2) as being a subfield of GF(p^12) in some well-defined way. This can be done using Conway polynomials as defining polynomials for the two finite fields. If (in Sage 5.13 or newer) you create the finite fields with sage: K = GF(p^2, 'a', conway=True, prefix='z') sage: L = GF(p^12, 'b', conway=True, prefix='z') then it should be possible to automatically map field elements back and forth between the two fields. sage: R = K['x'] sage: S = L['x'] sage: x = S.gen() sage: f = (x - b) * (x - b^9); f x^2 + (2*b^3 + 2*b^2)*x + 2*b^3 + 2*b^2 + 1 sage: R(f) x^2 + (a + 2)*x + a sage: S(R(f)) == f True There was actually another bug (involving polynomial rings) that caused this not to work; it was fixed only 6 weeks ago, so you may have to wait for Sage 6.2 or to download the latest development version. I just saw that John Cremona gave another solution, which does not rely on Conway polynomials and automatic conversion, so this may be easier to use (although you have to explicitly invoke the maps i and j). Peter -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.