Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168738
Image: ubuntu2004
""" Author: Stefan Keil, 2011-12-19. Calculates the dimension of embedding of coker phi-dual in QQ* mod fifth powers, via a surjection from coker eta-dual. """
###### a1,b1,a2,b2 have to be non-zero integers def get_dim_of_coker_phi_dual(a1,b1,a2,b2,N=5): ###### START INITIALIZATION ###### create the two elliptic curves d1=a1/b1; d2=a2/b2; E1 = EllipticCurve(QQ,[d1+1,d1,d1,0,0]); E2 = EllipticCurve(QQ,[d2+1,d2,d2,0,0]); ###### calculate a base for the Mordell-weil group modulo torsion generators1 = E1.gens(sat_bound=10000); print "Calculations for generators of E_1 completed. Rank is" print len(generators1); if E1.gens_certain()==false: print "generators for E_1 may be wrong!"; generators2 = E2.gens(sat_bound=10000); print "Calculations for generators of E_2 completed. Rank is" print len(generators2); if E2.gens_certain()==false: print "generators for E_2 may be wrong!"; ###### calculate the image of the Modell-Weil group in QQ* ###### start with the image of the 5-torsion; ignore other torsion image1=[d1]; image2=[d2]; ###### run through a base of MW mod torsion for i in range(len(generators1)): image1.append(get_image_of_point_of_coker_in_QQ_star(generators1[i])); for i in range(len(generators2)): image2.append(get_image_of_point_of_coker_in_QQ_star(generators2[i])); print "the two images of generators of the cokernels in QQ*" print image1 print image2 ###### reduce images modulo N-th powers and remove trivial ones reduced_image1=get_mod_N_reduced_non_trivial_images_as_a_list_in_prime_factors(image1, N); reduced_image2=get_mod_N_reduced_non_trivial_images_as_a_list_in_prime_factors(image2, N); print "reduced non-trivial images" print reduced_image1 print reduced_image2 ###### END INITIALIZATION ###### join reduced_image1 and reduced_image2 (this DOES change reduced_image1, maybe there is a better method to join two lists) final_image_unchecked=reduced_image1; final_image_unchecked.extend(reduced_image2); print "final_image_unchecked" print final_image_unchecked ###### order all occurring primes in increasing order and calculates the matrix of exponents of the factorizations matrix_of_exponents=get_matrix_of_exponents(final_image_unchecked, N); ###### the rank of this matrix is the dimension in question dimension=matrix_of_exponents.rank(); print "rank of matrix is" return dimension;
def get_image_of_point_of_coker_in_QQ_star(P): x=P[0]; y=P[1]; z=-x^2+(x+1)*y; return z;
###### image is a list of rational numbers. Returns a list of prime factorizations, whose exponents are reduced mod N def get_mod_N_reduced_non_trivial_images_as_a_list_in_prime_factors(image, N=5): reduced_image=[]; ###### run through all rational numbers for i in range(len(image)): prime_factors=list(image[i].factor()); ###### reduce exponents mod N=5 reduced_prime_factors=[]; ###### run through all prime factors for j in range(len(prime_factors)): reduced_exponent=Mod(prime_factors[j][1],N); ###### add primes having non-trivial exponent if reduced_exponent != 0: reduced_prime_factors.append([prime_factors[j][0],reduced_exponent]); ###### ignore trivial images if len(reduced_prime_factors)>0: reduced_image.append(reduced_prime_factors); return reduced_image;
###### calculates matrix of the exponents (mod N-th powers) ###### list_of_candidates is a list of primes factorizations, where the exponents are reduced mod N def get_matrix_of_exponents(list_of_candidates, N=5): number_of_candidates=len(list_of_candidates); primes=get_list_of_all_primes_in_increasing_order(list_of_candidates); print "primes to consider are" print primes number_of_primes=len(primes); ###### construct 'exponent-arrays' of the candidates matrix_of_exponents=[]; for i in range(number_of_candidates): exponents_of_candidate=[]; candidate=list_of_candidates[i]; ###### go through all primes in the list of all primes for j in range(number_of_primes): exponents_of_candidate.append(get_exponent_of_candidate_of_specific_prime(candidate,primes[j])); matrix_of_exponents.append(exponents_of_candidate); print "matrix of all exponents" print matrix_of_exponents return matrix(IntegerModRing(N),matrix_of_exponents);
def get_exponent_of_candidate_of_specific_prime(candidate,prime): exponent=0; number_of_primes_to_check_against=len(candidate); i=0; while i < number_of_primes_to_check_against: ###### if primes agree, take its exponent and stop if prime==candidate[i][0]: exponent=candidate[i][1]; i=number_of_primes_to_check_against; i=i+1; return exponent;
###### we assume that list_of_candidates is not empty def get_list_of_all_primes_in_increasing_order(list_of_candidates): ###### initialize primes=[]; for j in range(len(list_of_candidates[0])): primes.append(list_of_candidates[0][j][0]); ###### now go through all other candidates number_of_candidates=len(list_of_candidates); for i in range(number_of_candidates-1): #print primes candidate=list_of_candidates[i+1]; number_of_primes_of_candidate=len(candidate); for j in range(number_of_primes_of_candidate): new_prime=candidate[j][0]; ###### join j-th prime in the list of primes at right position primes=join_prime_at_right_position(primes, new_prime); return primes;
###### we assume that list_of_primes is not an empty list def join_prime_at_right_position(list_of_primes, new_prime): returnvalue=list_of_primes; number_of_primes=len(list_of_primes); i=0; while i < number_of_primes: ###### if the prime is in the list, nothing to do; stop if new_prime==list_of_primes[i]: #print "primes identical" i=number_of_primes; else: ###### if new_prime is smaller that the one checking against put it in the list; then stop if new_prime<list_of_primes[i]: #print "prime smaller" returnvalue=[]; for j in range(number_of_primes+1): if j<i: returnvalue.append(list_of_primes[j]); else: if j==i: returnvalue.append(new_prime); else: returnvalue.append(list_of_primes[j-1]); i=number_of_primes; ###### if new_prime is bigger than the one checking against, go to next prime to check against else: #print "prime bigger" i=i+1; ###### if this was the last prime in the list, have to put prime at the end of the list if i==number_of_primes: returnvalue.append(new_prime); return returnvalue;
get_dim_of_coker_phi_dual(30,7,11,13)
Calculations for generators of E_1 completed. Rank is 1 Calculations for generators of E_2 completed. Rank is 2 the two images of generators of the cokernels in QQ* [30/7, -2500/7] [11/13, -243/169, -13/32] reduced non-trivial images [[[2, 1], [3, 1], [5, 1], [7, 4]], [[2, 2], [5, 4], [7, 4]]] [[[11, 1], [13, 4]], [[13, 3]], [[13, 1]]] final_image_unchecked [[[2, 1], [3, 1], [5, 1], [7, 4]], [[2, 2], [5, 4], [7, 4]], [[11, 1], [13, 4]], [[13, 3]], [[13, 1]]] primes to consider are [2, 3, 5, 7, 11, 13] matrix of all exponents [[1, 1, 1, 4, 0, 0], [2, 0, 4, 4, 0, 0], [0, 0, 0, 0, 1, 4], [0, 0, 0, 0, 0, 3], [0, 0, 0, 0, 0, 1]] rank of matrix is 4
get_dim_of_coker_phi_dual(160,1,5,1)
Calculations for generators of E_1 completed. Rank is 2 Calculations for generators of E_2 completed. Rank is 0 image1, image2, image2_inv: [1/160, -3298324480, -72410125625/32] [1/5] [5] reduced non-trivial images [[[5, 4]], [[2, 2], [5, 1]], [[5, 4]]] [[[5, 1]]] final_image_unchecked [[[5, 4]], [[2, 2], [5, 1]], [[5, 4]], [[5, 1]]] final_image_pairwise_lin_indep [[[5, 4]], [[2, 2], [5, 1]]] only up to two candidates; since they are already pairwise lin indep, they are lin indep [[[5, 4]], [[2, 2], [5, 1]]] dimension is 2
get_dim_of_coker_phi_dual(6,1,-10,1)
Calculations for generators of E_1 completed. Rank is 0 Calculations for generators of E_2 completed. Rank is 0 the two images of generators of the cokernels in QQ* [6] [-10] reduced non-trivial images [[[2, 1], [3, 1]]] [[[2, 1], [5, 1]]] final_image_unchecked [[[2, 1], [3, 1]], [[2, 1], [5, 1]]] primes to consider are [2, 3, 5] matrix of all exponents [[1, 1, 0], [1, 0, 1]] rank of matrix is 2
get_dim_of_coker_phi_dual(192,1,6,1)
get_dim_of_coker_phi_dual(6,1,6,1)
Calculations for generators of E_1 completed. Rank is 0 Calculations for generators of E_2 completed. Rank is 0 the two images of generators of the cokernels in QQ* [6] [6] reduced non-trivial images [[[2, 1], [3, 1]]] [[[2, 1], [3, 1]]] final_image_unchecked [[[2, 1], [3, 1]], [[2, 1], [3, 1]]] primes to consider are [2, 3] matrix of all exponents [[1, 1], [1, 1]] rank of matrix is 1
get_dim_of_coker_phi_dual(-6,35,10,21)
Calculations for generators of E_1 completed. Rank is 1 Calculations for generators of E_2 completed. Rank is 0 the two images of generators of the cokernels in QQ* [-6/35, 504/3125] [10/21] reduced non-trivial images [[[2, 1], [3, 1], [5, 4], [7, 4]], [[2, 3], [3, 2], [7, 1]]] [[[2, 1], [3, 4], [5, 1], [7, 4]]] final_image_unchecked [[[2, 1], [3, 1], [5, 4], [7, 4]], [[2, 3], [3, 2], [7, 1]], [[2, 1], [3, 4], [5, 1], [7, 4]]] primes to consider are [2, 3, 5, 7] matrix of all exponents [[1, 1, 4, 4], [3, 2, 0, 1], [1, 4, 1, 4]] rank of matrix is 3