Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread John Cremona
On 17 April 2014 01:55, Irene irene.alv...@gmail.com wrote: Hello! I want to define a polynomial that I know lies in GF(p^2,'b')[x], p=371. 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

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread Irene
Sorry, I didn't write it correctly. I meant GF(p^12,'a') instead of GF(p^13,'a'). As 2 divides 12, GF(p^12,'a') is an extension of GF(p^2,'b'). My question is the same now with the correct data. On Thursday, April 17, 2014 11:04:40 AM UTC+2, John Cremona wrote: On 17 April 2014 01:55, Irene

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread John Cremona
OK, that makes sense now. It boils down to this: given an element of F12=GF(p^12) which happens to lie in F2 = GF(p^2), how to express it in terms of a generator of F2. This is not quite as easy as it should be but this works (assuming that you have defined F12 with generator a and F2 with

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread Irene
I think that this is exactly what I need. Nevertheless I cannot use neither i.section() nor i.inverse_image(). The second one because of the same reason as you, and the first one when I try it is says TypeError: 'NoneType' object is not callable. On Thursday, April 17, 2014 12:07:18 PM UTC+2,

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread John Cremona
On 17 April 2014 08:43, Irene irene.alv...@gmail.com wrote: I think that this is exactly what I need. Nevertheless I cannot use neither i.section() nor i.inverse_image(). The second one because of the same reason as you, and the first one when I try it is says TypeError: 'NoneType' object is

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread Irene
p=371 Fp=GF(p) E=EllipticCurve([Fp(3),Fp(5)]) j=E.j_invariant() l=13#Atkin prime n=((l-1)/2).round() r=2# Phi_13 factorize in factors of degree 2 s=12#Psi_13 factorize in factors of degree 12 #repsq(a,n) computes a^n def repsq(a,n): B = Integer(n).binary() C=list(B) k=len(B)-1

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread Peter Bruin
This works for me in Sage 5.13 (I don't have an older version installed), after replacing the definition of FFps by FFps.X=PolynomialRing(Fps) # the .X was missing However, without the .X the error I got was different from yours (TypeError: You must specify the names of the variables.) Op

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread John Cremona
Your code works ok with Sage 6.1.1 (apart from a small slip in the code you posted: the line FFps=PolynomialRing(Fps) should say FFpsX=PolynomialRing(Fps) and the result is x^6 + (973912*b + 2535329)*x^5 + (416282*b + 3608920)*x^4 + (686636*b + 908282)*x^3 + (2100014*b + 2063451)*x^2 +

Re: [sage-support] Change the field where a polynomial is considered

2014-04-17 Thread Irene
I got it in another version! Thank you very much! On Thursday, April 17, 2014 6:18:56 PM UTC+2, John Cremona wrote: Your code works ok with Sage 6.1.1 (apart from a small slip in the code you posted: the line FFps=PolynomialRing(Fps) should say FFpsX=PolynomialRing(Fps) and the