Path: blob/main/scripts/lfunctions/build_Lfunction_db_2.py
1128 views
# This builds a database of L-functions that occur (maybe on the fly) on the website12from lmfdb import base3from sage.all import DirichletGroup4from lmfdb.lfunctions import RiemannZeta, Lfunction_Dirichlet, Lfunction_EC_Q56C = base.getDBConnection()78# Iterators over L-functions. It would be nice to have all of the types of forms that appear on the site91011def Dirichlet_Lfunctions_iterator(qMax):12for q in [3..qMax]:13for n in range(len(DirichletGroup(q))):14yield Lfunction_Dirichlet(charactermodulus=q, characternumber=n)151617def EC_iterator():18data = set(_["label"] for _ in C.elliptic_curves.curves.find({}, ["label"]))19for c in data:20yield Lfunction_EC_Q(c["label"])212223def Lfunction_iterator(dirichlet_max=100):24yield RiemannZeta()25for L in Dirichlet_Lfunctions_iterator(dirichlet_max):26yield L27for L_of_curve in EC_iterator():28yield L_of_curve293031def inject_Lfunctions(it):32for L in it:33L.inject_database(["original_mathematical_object()"])343536# def build_indices():37# C.Lfunctions.Lfunctions.create_index("level", "self_dual")3839if __name__ == "__main__":40# build_indices()41# remove_all()42inject_Lfunctions(Dirichlet_Lfunctions_iterator(10))434445