︠78211bb9-e2f0-43d7-b602-fd76e3fd4789︠ ### How to experiment with modular forms in Sage ### ︡a09c357f-2fc8-485e-9bcd-c02364019367︡︡{"done":true} ︠5be6b2e6-3efd-4b98-b2c8-58e451a10b84︠ ## Before starting with modular forms commands, we briefly look at some basic Python/SageMath syntax ## ︡776be0dd-42cb-4c6a-bccc-c13135adf8ab︡︡{"done":true} ︠dc5d17e9-4043-46d5-a056-92a1170ec594︠ # Variables are pretty standard, we get some output using the print command # To evaluate a code block, press shift-enter a = 7 b = 8 print a + b mystring = "Variables can handle anything, " mystring_number_two = "and are allowed pretty long names." print mystring + mystring_number_two ︡40a836ae-d439-4d3b-802b-7a0893bd5d4f︡︡{"stdout":"15\n"}︡{"stdout":"Variables can handle anything, and are allowed pretty long names.\n"}︡{"done":true} ︠4b3d16d8-fb93-4bcd-8875-cc08b9f0189b︠ # The if-statement shows how indentation works. The Sage notebook tries to help you by indenting the cursor with 4 spaces when indentation is needed. Also, this examples shows that you can use variables from other code blocks (provided they are evaluated earlier). if a == b: print "We aren't working in the zero ring, are we?" else: if true: print "If-statements can be nested." ︡f6eca592-6f4b-4ce4-849c-8eb4a5e986d2︡︡{"stdout":"If-statements can be nested.\n"}︡{"done":true} ︠4d988825-b170-488c-82c7-a1a8b6ba7fb6︠ # A typical while-loop c=5 while c < 10: print c c = c + 2 ︡67d51a05-063f-4509-b4fd-fd0dbaff8707︡︡{"stdout":"5\n7\n9\n"}︡{"done":true} ︠256e83e8-6912-4276-aa74-6439a0e2c1ae︠ # Lists R=[1,2,4]; print R S=[1..5]; print S T=[x^2 for x in S]; print T print prime_range(17) print prime_range(7,18) ︡6b9ce68e-8f47-4360-a307-77cc5465cea1︡︡{"stdout":"[1, 2, 4]\n"}︡{"stdout":"[1, 2, 3, 4, 5]\n"}︡{"stdout":"[1, 4, 9, 16, 25]\n"}︡{"stdout":"[2, 3, 5, 7, 11, 13]\n"}︡{"stdout":"[7, 11, 13, 17]\n"}︡{"done":true} ︠9b7d7135-b6e4-4499-9437-de996699dd95︠ # A typical for-loop S = [3..7] for x in S: print 2*x ︡f1b3c5e9-ad22-4477-81b4-ff63fdfb6f0e︡︡{"stdout":"6\n8\n10\n12\n14\n"}︡{"done":true} ︠8dcb1786-4a3d-4478-87df-9ae3e972413a︠ ## Now we start with modular forms commands ## ︡e62ee350-6a47-460b-b37b-486acef70686︡︡{"done":true} ︠af3555a7-6ea0-4d65-bd94-6730c12ac9e2︠ # Create some congruence subgroups G = SL2Z G02 = Gamma0(2) G15 = Gamma1(5) G16 = Gamma1(6) G7 = Gamma(7) ︡7dcd56fb-025b-44f1-baf1-3200301f0371︡︡{"done":true} ︠b3f3bb3c-71a1-47a1-9e0f-31b727249bad︠ # Print a description of two of the objects we have defined print G print G02 ︡43e43f2d-962d-4e4b-ba6c-0cb8cd93f14d︡︡{"stdout":"Modular Group SL(2,Z)\n"}︡{"stdout":"Congruence Subgroup Gamma0(2)\n"}︡{"done":true} ︠5473473b-2d9e-4983-be48-b9d9de1feb2b︠ # Sage knows about relations between different groups print G16.is_subgroup(G02) print G16.index()/G02.index() ︡8f470b66-6b19-44a3-a131-3cf7603d7342︡︡{"stdout":"True\n"}︡{"stdout":"8\n"}︡{"done":true} ︠90775032-cf4a-4f68-a64e-8573a37305db︠ # Representatives for the cusps print G.cusps() print G15.cusps() ︡a56735ce-258c-4c53-82ac-ab64d49672e3︡︡{"stdout":"[Infinity]\n"}︡{"stdout":"[0, 2/5, 1/2, Infinity]\n"}︡{"done":true} ︠73fa2271-0128-49b8-9e6a-c94a685ab96a︠ # Generators print "Generators for SL2Z:" for g in G.gens(): print g print "" print "Generators for Gamma0(2):" for g in G02.gens(): print g print "" ︡3473644a-6587-4e6c-804b-b0901f8d7dd4︡︡{"stdout":"Generators for SL2Z:\n"}︡{"stdout":"[ 0 -1]\n[ 1 0]\n\n[1 1]\n[0 1]\n\n"}︡{"stdout":"Generators for Gamma0(2):\n"}︡{"stdout":"[1 1]\n[0 1]\n\n[ 1 -1]\n[ 2 -1]\n\n"}︡{"done":true} ︠be948e43-712d-4ab9-8e81-1f904aa4013d︠ #Coset representatives print "Coset representatives of Gamma0(2) in SL2Z:" for g in G02.coset_reps(): print g print "" ︡3f15152f-de5b-436b-a796-d911700a9d8d︡︡{"stdout":"Coset representatives of Gamma0(2) in SL2Z:\n"}︡{"stdout":"[1 0]\n[0 1]\n\n[ 0 -1]\n[ 1 0]\n\n[1 0]\n[1 1]\n\n"}︡{"done":true} ︠34a834d9-25ad-4df9-8f39-47b8bdb834e9︠ #Fundamental domains (the FareySymbol can be considered as a black box) FareySymbol(G02).fundamental_domain(show_pairing=true) FareySymbol(G15).fundamental_domain(show_pairing=true) ︡99b6231e-bbe0-4af8-ae92-ffa64285acff︡︡{"file":{"filename":"/projects/0d171da5-84c5-42cd-b702-55b21bf8f103/.sage/temp/compute1-us/16669/tmp_0cY5Hd.svg","show":true,"text":null,"uuid":"d6c883a4-922d-4501-8e66-db3ee9115e8b"},"once":false}︡{"html":"
"}︡{"file":{"filename":"/projects/0d171da5-84c5-42cd-b702-55b21bf8f103/.sage/temp/compute1-us/16669/tmp_ryf2CB.svg","show":true,"text":null,"uuid":"08061017-5177-408a-af95-7663d6397b9b"},"once":false}︡{"html":"
"}︡{"done":true} ︠e3545d41-c3cf-429f-a9ce-73f3245bc18c︠ # Construct a space of modular forms M = ModularForms(SL2Z, 12) print M ︡8bca1ef3-6f73-4696-9c1e-f886c719945b︡︡{"stdout":"Modular Forms space of dimension 2 for Modular Group SL(2,Z) of weight 12 over Rational Field\n"}︡{"done":true} ︠527dc95b-fd45-4e81-ac04-79080e83fd3b︠ # Compute a basis and give the q-expansions print M.basis() ︡da35de18-6664-496d-84fa-d6d014dc45df︡︡{"stdout":"[\nq - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6),\n1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + 3199218815520/691*q^5 + O(q^6)\n]\n"}︡{"done":true} ︠8e34cf13-22a1-474e-a693-978075096903︠ # Getting more terms is no problem. print M.q_expansion_basis(20) ︡3c518064-70bc-4e0b-9b34-b4892b45f3aa︡︡{"stdout":"[\nq - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 - 113643*q^9 - 115920*q^10 + 534612*q^11 - 370944*q^12 - 577738*q^13 + 401856*q^14 + 1217160*q^15 + 987136*q^16 - 6905934*q^17 + 2727432*q^18 + 10661420*q^19 + O(q^20),\n1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + 3199218815520/691*q^5 + 23782204031040/691*q^6 + 129554448266880/691*q^7 + 563087459516400/691*q^8 + 2056098632318640/691*q^9 + 6555199353000480/691*q^10 + 18693620658498240/691*q^11 + 48705965462306880/691*q^12 + 117422349017369760/691*q^13 + 265457064498837120/691*q^14 + 566735214731736960/691*q^15 + 1153203117089652720/691*q^16 + 2245494646076179680/691*q^17 + 4212946097620893360/691*q^18 + 7632441763011374400/691*q^19 + O(q^20)\n]\n"}︡{"done":true} ︠8607451a-7770-4505-96d6-2c3582b27e82︠ # picking out a modular form from the basis # showing q_expansion and picking out coefficients of q^p with p prime delta=M.basis()[0] print delta.q_expansion() print delta.q_expansion(12) print [delta[p] for p in prime_range(2,12)] ︡acd1528a-91ef-4d06-b12a-93763037fe2f︡︡{"stdout":"q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)\n"}︡{"stdout":"q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 - 113643*q^9 - 115920*q^10 + 534612*q^11 + O(q^12)\n"}︡{"stdout":"[-24, 252, 4830, -16744, 534612]\n"}︡{"done":true} ︠56a73384-5e84-49ec-adf9-184e632d98f3︠ # Construct a space of cusp forms S = CuspForms(SL2Z,24) print S ︡ea3ba8a4-7645-4170-9b22-ad75c2321211︡︡{"stdout":"Cuspidal subspace of dimension 2 of Modular Forms space of dimension 3 for Modular Group SL(2,Z) of weight 24 over Rational Field\n"}︡{"done":true} ︠0e554da6-0f89-4d31-b504-8f7c27ab7d99︠ # Hecke operators # Matrix with respect to computed basis, here: S.basis() # characteristic polynomial of the operator/matrix T2=S.T(2) print T2 print T2.matrix() print T2.charpoly() ︡efbbef96-8bfa-492d-bc25-376fb5ac0a93︡︡{"stdout":"Hecke operator T_2 on Cuspidal subspace of dimension 2 of Modular Forms space of dimension 3 for Modular Group SL(2,Z) of weight 24 over Rational Field\n"}︡{"stdout":"[ 0 20468736]\n[ 1 1080]\n"}︡{"stdout":"x^2 - 1080*x - 20468736\n"}︡{"done":true} ︠c59a3548-322b-4d38-b1e5-70e8ac8a1ce1︠ # Hecke operator on modular form print T2(delta*delta) print T2(delta*delta) == S.basis()[0]+1080*S.basis()[1] ︡bdcfaddb-9177-4ce9-ad1e-b07a720daf1e︡︡{"stdout":"q + 1080*q^2 + 143820*q^3 + 13246528*q^4 + 28412910*q^5 + O(q^6)\n"}︡{"stdout":"True\n"}︡{"done":true} ︠a97f317e-1a66-4a2c-9eac-6e8c7e6211df︠ # The diamond operator MM=ModularForms(Gamma1(7),2) print MM d5=MM.diamond_bracket_operator(5) print d5 print d5.matrix() ︡185202e0-96f5-4c61-8872-1b9a662a6d40︡︡{"stdout":"Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(7) of weight 2 over Rational Field\n"}︡{"stdout":"Diamond bracket operator <5> on Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(7) of weight 2 over Rational Field\n"}︡{"stdout":"[ -47 -84 -420 -420 -1260]\n[ -13 -24 -120 -115 -355]\n[ 2 4 19 18 57]\n[ 3 5 27 25 81]\n[ 1 2 9 10 26]\n"}︡{"done":true} ︠bff60c17-ebdf-4ac0-8937-fc9bf1ee27cds︠ ︡1d569614-a782-4e09-9967-7efdbe57e687︡︡{"done":true} ︠9e2b03ae-5d52-43ee-8a98-d7c2ae435ed4︠ %md 26 April -------- _The Petersson inner product; old and new subspaces_ ︡4c7a1ab7-d142-44db-a107-4cb422fb672f︡︡{"done":true,"md":"26 April\n--------\n\n_The Petersson inner product; old and new subspaces_"} ︠6eda7fd5-d418-4d2b-b842-9c4d70de3b60s︠ # Eisenstein subspace and cuspidal subspace M = ModularForms(Gamma1(14), 4) E = M.eisenstein_submodule() S = CuspForms(Gamma1(14), 4) S == M.cuspidal_submodule() M.dimension() (E.dimension(), S.dimension()) ︡36764c47-4826-4a52-8675-89511de0790d︡︡{"stdout":"True\n"}︡{"stdout":"24\n"}︡{"stdout":"(12, 12)\n"}︡{"done":true} ︠f4899a49-419f-4a12-a8d6-f5d42914b34bs︠ # Old and new subspaces Sold = S.old_submodule() Snew = S.new_submodule() (Sold.dimension(), Snew.dimension()) ︡30eee5a0-dab6-45b7-b748-930c9e11167a︡︡{"stdout":"(6, 6)\n"}︡{"done":true} ︠607306a7-4d14-4e1e-bff7-4e5c899fafa2︠ # Check consistency with dimensions of spaces of lower level CuspForms(Gamma1(2), 4).dimension() CuspForms(Gamma1(7), 4).dimension()s ︡ec9c8c77-eadf-4bf5-8169-e4962254a047︡︡{"stdout":"0\n"}︡{"stdout":"3\n"}︡{"done":true} ︠729e5964-b241-454d-9216-e7fed01a7016s︠ S.old_submodule(2) ︡f9ada2e9-fe77-4c46-919e-cc4c9277a7b6︡︡{"stdout":"Modular Forms subspace of dimension 6 of Modular Forms space of dimension 24 for Congruence Subgroup Gamma1(14) of weight 4 over Rational Field\n"}︡{"done":true} ︠f8452ca6-7682-4b65-a60f-4da63146413fs︠ # An example of a non-diagonalisable Hecke operator. This shows that the result # stated in the lecture on simultaneous eigenvectors for the T_m with m coprime to # the level N cannot be generalised directly to the T_m with m not coprime to N. S = CuspForms(Gamma0(16), 4) T2 = S.hecke_matrix(2) T2.jordan_form() ︡1b4b2880-76e6-4c6b-b1d8-956f21037929︡︡{"stdout":"[0 1|0]\n[0 0|0]\n[---+-]\n[0 0|0]\n"}︡{"done":true} ︠243d06fe-9dce-430f-9c84-cfeca000871e︠ ︡2718672f-c4e2-4b63-ad0b-6459d108c934︡ ︠e041d564-b8d8-49af-a2ba-1278a9281c68i︠ %md 3 May ----- _Newforms_ ︡25766dee-2e50-4c3d-9e35-77b2884ce98f︡︡{"done":true,"md":"3 May\n-----\n\n_Newforms_"} ︠e93f12dd-1633-4f41-a12a-c2b4335889fcs︠ # We can compute the set of newforms (primitive forms) of a given level and weight. S = CuspForms(Gamma1(15), 2) N = S.newforms() N Newforms(Gamma1(15), 2) == N ︡947bfd04-a241-4225-b980-52ab27f8f124︡︡{"stdout":"[q - q^2 - q^3 - q^4 + q^5 + O(q^6)]\n"}︡{"stdout":"True"}︡{"stdout":"\n"}︡{"done":true} ︠870e0a04-5d86-4c88-b60b-8bad84cc4ceds︠ # An example with multiple newforms Newforms(Gamma0(26), 2) ︡e0fefd8a-d5f2-4029-8874-7f4ef8d8f53d︡︡{"stdout":"[q - q^2 + q^3 + q^4 - 3*q^5 + O(q^6), q + q^2 - 3*q^3 + q^4 - q^5 + O(q^6)]"}︡{"stdout":"\n"}︡{"done":true} ︠f77b6c48-9ad3-4a35-8c3b-4a8bc5bcd0b1s︠ # We have to be careful when the newforms don't have rational coefficients Newforms(Gamma1(26), 2) ︡caf29572-4e52-4357-80c5-0e1ff5c402fe︡︡{"stderr":"Error in lines 2-2\n"}︡{"stderr":"Traceback (most recent call last):\n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, in \n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/modular/modform/constructor.py\", line 454, in Newforms\n return CuspForms(group, weight, base_ring).newforms(names)\n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/modular/modform/space.py\", line 1675, in newforms\n raise ValueError(\"Please specify a name to be used when generating names for generators of Hecke eigenvalue fields corresponding to the newforms.\")\nValueError: Please specify a name to be used when generating names for generators of Hecke eigenvalue fields corresponding to the newforms.\n"}︡{"done":true} ︠be06b41f-df4f-477f-813c-d0c1cce4d087︠ # In this case we have to specify a "names" parameter. N = Newforms(Gamma1(26), 2, names='a') N ︡7dbe6fb7-971d-4fc7-afda-de92531961dc︡︡{"stdout":"[q - q^2 + q^3 + q^4 - 3*q^5 + O(q^6), q + q^2 - 3*q^3 + q^4 - q^5 + O(q^6), q + a2*q^2 + (-a2 - 1)*q^4 - q^5 + O(q^6), q + a3*q^2 - q^3 - q^4 - 3*a3*q^5 + O(q^6)]\n"}︡{"done":true} ︠36e73916-557d-455e-8d8b-fb7db9ea5effs︠ # Every newform has a character [f.character() for f in N] ︡5818490d-012b-4bef-b0fd-e363971ed86f︡︡{"stdout":"[Dirichlet character modulo 26 of conductor 1 mapping 15 |--> 1, Dirichlet character modulo 26 of conductor 1 mapping 15 |--> 1, Dirichlet character modulo 26 of conductor 13 mapping 15 |--> -a2 - 1, Dirichlet character modulo 26 of conductor 13 mapping 15 |--> -1]"}︡{"stdout":"\n"}︡{"done":true} ︠914bcc14-3ef9-4e0e-95a3-f7a0ec50abbe︠ # Let us compare our list of newforms with the dimension of the new subspace. S = CuspForms(Gamma1(26), 2) Sold = S.old_submodule() Snew = S.new_submodule() (Sold.dimension(), Snew.dimension()) ︡5da63904-ecdf-4ce6-a813-182bc1328990︡︡{"stdout":"(4, 6)\n"}︡{"done":true} ︠a2f51d97-0ee8-43f9-8142-b1b82b4b9f6cs︠ # Sage only gives 4 newforms, but the new subspace has dimension 6. # This is explained by the fact that two of the forms have larger coefficient fields: [f.base_ring().degree() for f in N] ︡42358158-4237-4f97-93a2-9dcf7469a592︡︡{"stdout":"[1, 1, 2, 2]\n"}︡{"done":true} ︠27e01ca5-da43-4a38-bd66-f5a8753893a3s︠ # The following computation shows that the coefficient fields of the last two forms # are Q(\sqrt{-3}) and Q(\sqrt{-1}), respectively. [f.base_ring().discriminant() for f in N] ︡365ce084-fc68-4850-92f2-b66c7bdf61f4︡︡{"stdout":"[1, 1, -3, -4]\n"}︡{"done":true} ︠cfebb6f0-2164-46f1-9ec0-eab27410fb73︠ ︡154f13a2-db50-49ec-b370-b4d2c6b3b87d︡ ︠2258270b-a26f-4517-a4b9-e0e787302756︠ %md 10 May ------ _$L$-functions_ ︡55d4406d-4804-45c2-9048-22816241d367︡{"done":true,"md":"10 May\n------\n\n_$L$-functions_"} ︠fa1b02b5-563b-41c3-973b-00eb29106840s︠ # Here is a newform of which we are going to compute the L-series. # Warning: some things only work for forms with rational coefficients... N = 14 f = Newforms(Gamma1(N))[0]; f ︡9cf6cc79-7279-4135-819b-2bbc093f8c77︡{"stdout":"q - q^2 - 2*q^3 + q^4 + O(q^6)\n"}︡{"done":true}︡ ︠517898a8-0925-410c-9820-7cce3bed06dbs︠ Lf = f.lseries() Lf ︡c3ed09df-e480-499f-b0fe-7a10f66d2eae︡{"stdout":"L-series associated to the cusp form q - q^2 - 2*q^3 + q^4 + O(q^6)\n"}︡{"done":true}︡ ︠7439237b-c92b-412c-a03a-d7f1af1ea960s︠ # We can evaluate L-series both inside and outside the # right half-plane where the Dirichlet series converges. Lf(3) Lf(3+2*I) Lf(-2-I) ︡e00a6425-201d-4eb0-acd4-88c2c73f850b︡{"stdout":"0.826125962101783\n"}︡{"stdout":"0.995825161298581 + 0.180645100106889*I"}︡{"stdout":"\n"}︡{"stdout":"1.25737321267029 - 0.432187040382323*I\n"}︡{"done":true}︡ ︠ba1a6c45-2b23-41da-bca6-0081b8b0d97fs︠ # The L-function is holomorphic. Lf.poles ︡7eccf1e6-54f9-4e0d-9c83-baeb5268f5c9︡{"stdout":"[]\n"}︡{"done":true}︡ ︠0be8d3c2-9c63-44a0-b3db-58ab5220deees︠ # Like the Riemann zeta function, it has some 'trivial' zeroes. [Lf(s) for s in [-4..-1]] ︡371b74ed-98a1-4fd1-abf4-61a88ef4691f︡{"stdout":"[0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000]"}︡{"stdout":"\n"}︡{"done":true}︡ ︠45473713-3df5-49c9-be2b-3ec817c67935s︠ # Unfortunately, SageMath is not bug-free: Lf(0) ︡260f7add-55b2-4934-bc18-56240b0230a3︡{"stdout":" *** at top-level: L(0.000000000000000)\n *** ^--------------------\n *** in function L: polcoeff(Lseries(ss,cutoff,de\n *** ^--------------------\n *** in function Lseries: ...\"));LSSeries=sum(k=0,der,Lstar(ss,cutoff,k)*S\n *** ^--------------------\n *** in function Lstar: ...cf2,if(cfvec[k],cfvec[k]*G(k*cutoff/vA,ss,der\n *** ^--------------------\n *** in function G: ...ss,der]);if(t -1\n"}︡{"stderr":"Error in lines 2-2\nTraceback (most recent call last):\n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, in \n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/lfunctions/dokchitser.py\", line 405, in __call__\n raise RuntimeError\nRuntimeError\n"}︡{"done":true}︡ ︠23799505-cf6d-473d-bb0a-0bdf56084617s︠ # Sign of the functional equation Lf.eps ︡b707cd27-917b-4464-908b-1d9b9bc7cb5e︡{"stdout":"1\n"}︡{"done":true}︡ ︠a41e9adf-dd71-4b91-a070-c8babfc4056es︠ Lf.conductor ︡a81113b9-a3d8-4d3d-bbd5-84e0f03acdb2︡{"stdout":"14\n"}︡{"done":true}︡ ︠c91dbf5f-7d88-4ae3-82e8-66646463d675s︠ # Check numerically that the completed L-function # satisfies the expected functional equation. def Lambda(s): return gamma(s)*N^(s/2)/(2*pi.n())^s * Lf(s) s = 1.43250982+.435873*I [Lambda(s), Lambda(2 - s)] ︡d308de93-89eb-46bb-b067-20683c0189a7︡{"stdout":"[0.196288571460192 + 0.0108503534364708*I, 0.196288571460192 + 0.0108503534364707*I]"}︡{"stdout":"\n"}︡{"done":true}︡ ︠b891fada-bbe0-4464-a7ed-592b196b9f6bs︠ # There is also a quicker (but more obscure) way: Lf.check_functional_equation() # answer should be a small number ︡7ec9281f-0219-4cc6-b1b4-d63c63f83ef6︡{"stdout":"-1.68051336735253e-18\n"}︡{"done":true}︡ ︠a86cbdcc-ad65-4ebc-8227-f4105f60e25as︠ ︡710c9077-ec1b-4c2f-9bea-6415d3af2c5d︡ ︠6685df68-191b-4ea8-a9d5-1e18fb895010i︠ %md 17 May ------ _Elliptic curves, modularity and the conjecture of Birch and Swinnerton-Dyer_ ︡a5125091-0c6f-4277-91b7-12539b31a4b0︡{"done":true,"md":"17 May\n------\n\n_Elliptic curves, modularity and the conjecture of Birch and Swinnerton-Dyer_"} ︠b60ef960-c550-4869-a6ed-040423284ae8s︠ # We construct an elliptic curve over Q. E = EllipticCurve([0, -1, 1, 0, 0]); E ︡e3743827-5b41-4118-9071-289d59721cb3︡{"stdout":"Elliptic Curve defined by y^2 + y = x^3 - x^2 over Rational Field\n"}︡︡{"done":true} ︠31a3f3c7-6f48-4ab8-b288-bc1fc1a763b3s︠ # The conductor of E is 11, so by the modularity theorem # E corresponds to a cusp form for Gamma0(11) (of weight 2). N = E.conductor(); N ︡33c18c45-5abb-4f1a-a373-a3b6bcd047ff︡{"stdout":"11\n"}︡{"done":true}︡ ︠f844ec05-c3b0-4603-93f5-3c2e94b6102fs︠ # There is only one such cusp form: nf = Newforms(Gamma0(N), 2); len(nf) f = nf[0]; f ︡5fb4424f-3329-44c2-8554-ab4b752db305︡{"stdout":"1"}︡{"stdout":"\n"}︡{"stdout":"q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6)\n"}︡{"done":true}︡ ︠c96b209e-3cf3-4118-9065-4778b1b09547s︠ # Check that the coefficients agree to some precision all(f[p] == E.ap(p) for p in primes(500)) ︡90164077-0a51-4faa-a327-35a069cf8361︡{"stdout":"True"}︡{"stdout":"\n"}︡{"done":true}︡ ︠1a37fccf-74fe-48a3-93af-82cf60f0b9d0s︠ # Construct the corresponding L-functions LE = E.lseries(); LE Lf = f.lseries(); Lf ︡a318aa8b-ca5a-4da4-8520-47f903dd4ed5︡{"stdout":"Complex L-series of the Elliptic Curve defined by y^2 + y = x^3 - x^2 over Rational Field\n"}︡{"stdout":"L-series associated to the cusp form q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6)"}︡{"stdout":"\n"}︡{"done":true}︡ ︠0ecad312-4aac-4c0f-b91e-b1be30cb62bbs︠ # Check that the L-values in s = 1 agree. # (For L(E, 1), the second number returned is an error bound). Lf(1) LE.at1() ︡4c8e481d-386f-4ff5-8eb6-b12529f5e2cf︡{"stdout":"0.253841860855911\n"}︡{"stdout":"(0.253804, 0.000181444)\n"}︡{"done":true}︡ ︠e2a0217b-f16d-4b25-ba0c-dd7d3e923a66s︠ # Check that the (strong) BSD conjecture holds for E. # The output is a list of primes such that L^*(E, 1) equals # the value predicted by BSD up to a product of powers of # primes in this list. E.prove_BSD() ︡f6bc273b-17d1-4c2a-bcb7-80cc69131568︡{"stdout":"[]"}︡{"stdout":"\n"}︡{"done":true}︡ ︠3f5fdf2f-c749-47eb-9de9-b45535ba8717s︠ # Unfortunately, nothing about BSD is known for elliptic curves # of higher rank. E = EllipticCurve('5077a1'); E E.rank() E.prove_BSD() ︡e0eaa184-24f6-4149-91db-750f345493fc︡{"stdout":"Elliptic Curve defined by y^2 + y = x^3 - 7*x + 6 over Rational Field"}︡{"stdout":"\n"}︡{"stdout":"3\n"}︡{"stdout":"Set of all prime numbers: 2, 3, 5, 7, ..."}︡{"stdout":"\n"}︡{"done":true}︡ ︠caeb03f6-6a62-42ef-8d24-1af50a2c7bb1s︠ # Solve the congruent number problem for n def is_congruent(n): return EllipticCurve([0, 0, 0, -n^2, 0]).rank() > 0 [n for n in range(1, 25) if is_congruent(n)] ︡32c238a9-cbd1-42bc-aed5-7965cdc4d36e︡{"stdout":"[5, 6, 7, 13, 14, 15, 20, 21, 22, 23, 24]"}︡{"stdout":"\n"}︡{"done":true}︡ ︠54058789-00ca-486a-8f48-3fd939e946fas︠ ︡e355e612-dbb9-447d-ab3c-63a421faad42︡{"done":true}︡