Isogeny_Computations_Find_Bugs

332 days ago by Ben.LeVeque

There are a couple small issues with graphing, but the functions are properly computing isogenies and graphing most of them! See images below.

x = var('x') K.<a> = NumberField(x^2-x-1) import psage.modform.hilbert.sqrt5.tables as sqrt5 
       
def ap(E,p): return E.change_ring(p.residue_field()).trace_of_frobenius() R.<ch> = GF(2)[] def frob(E,p): t = ap(E,p) return ch^2 - ap(E, p)*ch + int(p.norm()) def disc(E, p): t = ap(E, p) return t^2 - 4*p.norm() def isogeny_primes(E, norm_bound, isog_degree_bound): P = [p for p in sqrt5.ideals_of_bounded_norm(norm_bound) if p.is_prime() and E.has_good_reduction(p)] w = set(primes(isog_degree_bound+1)) i = 0 w.remove(2) while len(w) > 0 and i < len(P): d = disc(E, P[i]) w = [ell for ell in w if not (legendre_symbol(d,ell) == -1)] i = i +1 i = 0 while i < len(P): if frob(E,P[i]).is_irreducible(): break i = i+1 if i == len(P): w.insert(0,2) return w 
       
def isogeny_class_computation(E,p): if p != 2: E = E.short_weierstrass_model() F = E.division_polynomial(p).change_ring(K) f = F.factor() i=0 S.<x> = K[] t=f[0][0].degree() w=[S(1)] while t < (p+1)/2: for j in w: if (j*f[i][0]).degree() < (p + 1)/2 and (j*f[i][0]).divides(F): w.append(j*f[i][0]) t = f[i+1][0].degree() i+=1 v=[] o = 1 while o < len(w): try: v.append(E.isogeny(w[o]).codomain()) except ValueError: pass o+=1 v = [F.change_ring(K).global_minimal_model() for F in v] return v else: w = [Q for Q in E.torsion_subgroup() if order(Q)==2] v = [E.isogeny(E(Q)).codomain() for Q in w] return v 
       
#def isogeny_class_computation2(E,p): #William's # if p != 2: # E = E.short_weierstrass_model() # F = E.division_polynomial(p) # print F.parent(), type(F), F # F = F.change_ring(K) # try: # w = (f for f in F.divisors() if f.degree() == (p-1)/2) # except AttributeError: # print F.parent(), type(F) # raise AttributeError # for f in w: # try: # v.append(E.change_ring(K).isogeny(f).codomain()) # except ValueError: # pass # v = [F.change_ring(K).global_minimal_model() for F in v] # return v # else: # w = [Q for Q in E.torsion_subgroup() if order(Q)==2] # v = [E.isogeny(E(Q)).codomain() for Q in w] # return v 
       
def curve_isogeny_classes(E): isolist = isogeny_primes(E,1000,1000) for i in isolist: print i,'- isogeny class: ' for j in isogeny_class_computation(E,i): print ' ',j.a_invariants() 
       
def curve_isogeny_vector(E): curve_list = [E] i = 0 Adj = matrix(50) ins = 1 while i < len(curve_list): isolist = isogeny_primes(curve_list[i],500,500) for j in isolist: for F in isogeny_class_computation(curve_list[i],j): bool = True for G in curve_list: if F.is_isomorphic(G): bool = False break if bool: curve_list.append(F) Adj[i,ins]=j Adj[ins,i]=j ins += 1 i+=1 Adj = Adj.submatrix(nrows=len(curve_list),ncols=len(curve_list)) return curve_list, Adj 
       
def isogeny_printer(E): X,Y=curve_isogeny_vector(E) for i in X: print i.a_invariants() show(Y) show(Graph(Y)) 
       
 
       
E = EllipticCurve(K,[a,-a+1,1,-1,0]) isogeny_printer(E) 
       
(a, -a + 1, 1, -1, 0)
(a, -a + 1, 1, -5*a + 9, -8*a + 6)
(a, -a + 1, 1, -45*a - 151, -264*a - 858)
(a, -a + 1, 1, -3365*a - 12621, -229016*a - 564210)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrr} 0 & 3 & 0 & 0 \\ 3 & 0 & 3 & 0 \\ 0 & 3 & 0 & 3 \\ 0 & 0 & 3 & 0 \end{array}\right)
(a, -a + 1, 1, -1, 0)
(a, -a + 1, 1, -5*a + 9, -8*a + 6)
(a, -a + 1, 1, -45*a - 151, -264*a - 858)
(a, -a + 1, 1, -3365*a - 12621, -229016*a - 564210)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrr} 0 & 3 & 0 & 0 \\ 3 & 0 & 3 & 0 \\ 0 & 3 & 0 & 3 \\ 0 & 0 & 3 & 0 \end{array}\right)
F = EllipticCurve(K,[0,a,1,1,0]) isogeny_printer(F) 
       
(0, a, 1, 1, 0)
(0, a, 1, 30*a - 59, 102*a - 186)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rr} 0 & 5 \\ 5 & 0 \end{array}\right)
(0, a, 1, 1, 0)
(0, a, 1, 30*a - 59, 102*a - 186)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rr} 0 & 5 \\ 5 & 0 \end{array}\right)
G = EllipticCurve(K,[1,-1,a,-2*a,a]) isogeny_printer(G) 
       
(1, -1, a, -2*a, a)
(1, -1, a, -17*a - 15, 52*a + 30)
(1, -1, a, 13*a - 15, 20*a - 26)
(1, -1, a + 1, a - 2, -2*a + 1)
(1, -1, a, 148*a - 285, 1262*a - 1943)
(1, -1, a + 1, 16*a - 32, -53*a + 82)
(1, -1, a + 1, -14*a - 2, -21*a - 6)
(1, -1, a + 1, -149*a - 137, -1263*a - 681)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrrrrrr} 0 & 2 & 3 & 5 & 0 & 0 & 0 & 0 \\ 2 & 0 & 0 & 0 & 3 & 5 & 0 & 0 \\ 3 & 0 & 0 & 0 & 0 & 0 & 5 & 0 \\ 5 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 3 & 0 & 0 & 0 & 0 & 0 & 5 \\ 0 & 5 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 5 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 5 & 0 & 0 & 0 \end{array}\right)
(1, -1, a, -2*a, a)
(1, -1, a, -17*a - 15, 52*a + 30)
(1, -1, a, 13*a - 15, 20*a - 26)
(1, -1, a + 1, a - 2, -2*a + 1)
(1, -1, a, 148*a - 285, 1262*a - 1943)
(1, -1, a + 1, 16*a - 32, -53*a + 82)
(1, -1, a + 1, -14*a - 2, -21*a - 6)
(1, -1, a + 1, -149*a - 137, -1263*a - 681)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrrrrrr} 0 & 2 & 3 & 5 & 0 & 0 & 0 & 0 \\ 2 & 0 & 0 & 0 & 3 & 5 & 0 & 0 \\ 3 & 0 & 0 & 0 & 0 & 0 & 5 & 0 \\ 5 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 3 & 0 & 0 & 0 & 0 & 0 & 5 \\ 0 & 5 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 5 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 5 & 0 & 0 & 0 \end{array}\right)
H = EllipticCurve(K,[1,-1,1,-5,-7]) isogeny_printer(H) 
       
(1, -1, 1, -5, -7)
(1, -1, 1, -95, -331)
(1, -1, 1, 40, 155)
(1, -1, 1, -320, 1883)
(1, -1, 1, -1535, 23591)
(1, -1, 1, -24575, 1488935)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrrrr} 0 & 2 & 3 & 0 & 0 & 0 \\ 2 & 0 & 0 & 3 & 0 & 0 \\ 3 & 0 & 0 & 0 & 3 & 0 \\ 0 & 3 & 0 & 0 & 0 & 3 \\ 0 & 0 & 3 & 0 & 0 & 0 \\ 0 & 0 & 0 & 3 & 0 & 0 \end{array}\right)
(1, -1, 1, -5, -7)
(1, -1, 1, -95, -331)
(1, -1, 1, 40, 155)
(1, -1, 1, -320, 1883)
(1, -1, 1, -1535, 23591)
(1, -1, 1, -24575, 1488935)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(\begin{array}{rrrrrr} 0 & 2 & 3 & 0 & 0 & 0 \\ 2 & 0 & 0 & 3 & 0 & 0 \\ 3 & 0 & 0 & 0 & 3 & 0 \\ 0 & 3 & 0 & 0 & 0 & 3 \\ 0 & 0 & 3 & 0 & 0 & 0 \\ 0 & 0 & 0 & 3 & 0 & 0 \end{array}\right)
isogeny_primes(EllipticCurve(K,[1,-1,1,-320,1883]),500,500) 
       
[2, 3]
[2, 3]
isogeny_class_computation(EllipticCurve(K,[1,-1,1,-320,1883]),2)[0].global_minimal_model() 
       
Elliptic Curve defined by y^2 + x*y + y = x^3 + (-1)*x^2 + 40*x + 155
over Number Field in a with defining polynomial x^2 - x - 1
Elliptic Curve defined by y^2 + x*y + y = x^3 + (-1)*x^2 + 40*x + 155 over Number Field in a with defining polynomial x^2 - x - 1