Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
AndrewVSutherland
GitHub Repository: AndrewVSutherland/lmfdb
Path: blob/main/scripts/lfunctions/build_Lfunction_db_2.py
1128 views
1
# This builds a database of L-functions that occur (maybe on the fly) on the website
2
3
from lmfdb import base
4
from sage.all import DirichletGroup
5
from lmfdb.lfunctions import RiemannZeta, Lfunction_Dirichlet, Lfunction_EC_Q
6
7
C = base.getDBConnection()
8
9
# Iterators over L-functions. It would be nice to have all of the types of forms that appear on the site
10
11
12
def Dirichlet_Lfunctions_iterator(qMax):
13
for q in [3..qMax]:
14
for n in range(len(DirichletGroup(q))):
15
yield Lfunction_Dirichlet(charactermodulus=q, characternumber=n)
16
17
18
def EC_iterator():
19
data = set(_["label"] for _ in C.elliptic_curves.curves.find({}, ["label"]))
20
for c in data:
21
yield Lfunction_EC_Q(c["label"])
22
23
24
def Lfunction_iterator(dirichlet_max=100):
25
yield RiemannZeta()
26
for L in Dirichlet_Lfunctions_iterator(dirichlet_max):
27
yield L
28
for L_of_curve in EC_iterator():
29
yield L_of_curve
30
31
32
def inject_Lfunctions(it):
33
for L in it:
34
L.inject_database(["original_mathematical_object()"])
35
36
37
# def build_indices():
38
# C.Lfunctions.Lfunctions.create_index("level", "self_dual")
39
40
if __name__ == "__main__":
41
# build_indices()
42
# remove_all()
43
inject_Lfunctions(Dirichlet_Lfunctions_iterator(10))
44
45