How to consider a field extension as a field and not just a ring?

39 views
Skip to first unread message

Irene

unread,
Apr 7, 2014, 10:33:00 AM4/7/14
to sage-s...@googlegroups.com
I am programming an example about elliptic curves but I need to define a couple of field extensions to make there some operations and Sage consider them as rings, then it doesn't allow me to compute divisions.
What can I do?
Here is the code:

p=3700001
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
bk=a
i=1
while i <= k:
if C[i]=="1":
bk=(bk^2)*a
else:
bk=bk^2
i=i+1
return bk

d=E.division_polynomial(13)
Fps=GF(repsq(p,s),'a')
Fpr=GF(repsq(p,r),'b')
FFpr.<x>=PolynomialRing(Fpr)
Fl=GF(l)
c=GF(2)
rts=d.roots(Fps,multiplicities=False)
Px=rts[0]
Py2=Px^3+3*Px+5
c=Fl.multiplicative_generator()

def produx(n,Qx):
if is_odd(n):
pro=Qx-(E.division_polynomial(n-1,(Qx,1),two_torsion_multiplicity=1)*E.division_polynomial(n+1,(Qx,1),two_torsion_multiplicity=1))/((E.division_polynomial(n,(Qx,1),two_torsion_multiplicity=1)^2) * (Qx+3*Qx+5))
else:
pro=Qx-(E.division_polynomial(n-1,(Qx,1),two_torsion_multiplicity=1)*E.division_polynomial(n+1,(Qx,1),two_torsion_multiplicity=1))*(Qx^3+3*Qx+5)/(E.division_polynomial(n,(Qx,1),two_torsion_multiplicity=1)^2)
return pro

#Ray-polynomial
def EP(x,Qx,n):
i=2
m=(x-Qx)
while i<=n:
m=m*(x-produx(n,Qx))
i=i+1
return m

ep=EP(x,Px,n)
#A1.<theta>=FFpr.extension(ep)
#A1.<theta>=PolynomialQuotientRing(Fpr,ep)

Maarten Derickx

unread,
Apr 7, 2014, 2:09:59 PM4/7/14
to sage-s...@googlegroups.com
You should use on of the following two commands:

A1.<theta>=FFpr.quotient(ep)


A1.<theta>=PolynomialQuotientRing(FFpr,ep)

Irene

unread,
Apr 9, 2014, 5:11:17 AM4/9/14
to sage-s...@googlegroups.com
Thank you! I had already tried it, but Sage doesn't allow me to do that because the coefficients of the polynomial ep are not in Fpr.
Reply all
Reply to author
Forward
0 new messages