Re: [sage-support] Re: Extension of a field extension

2014-04-24 Thread Irene
Ok! Thank you! Do you have some idea about the first question? *I want to add to A1 the square root of theta^3+3*theta+5.* *The problem is that when I consider the following:* gamma2=theta^3+3*theta+5 AA1.xbar=PolynomialRing(A1) AA.gamma=A1.extension(xbar^2-gamma2)

[sage-support] Re: Extension of a field extension

2014-04-21 Thread Irene
I forgot to write what is repsq(): #repsq(a,n) computes a^n def repsq(a,n): B = Integer(n).binary() C=list(B) k=len(B)-1 bk=a i=1 while i = k: if C[i]==1: bk=(bk^2)*a else: bk=bk^2 i=i+1 return bk On Monday, April 21,

Re: [sage-support] Re: Extension of a field extension

2014-04-21 Thread John Cremona
On 21 April 2014 13:58, Irene irene.alv...@gmail.com wrote: I forgot to write what is repsq(): You could use the builtin function power_mod: sage: power_mod? Type: function String Form:function power_mod at 0x1f78668 File: