Path: blob/main/scripts/groups/Make-images/dump-modcurve-names.py
1136 views
import sys, os, re1from collections import defaultdict2HOME=os.path.expanduser("~")3sys.path.append(os.path.join(HOME, 'sage', 'lmfdb'))4from lmfdb import db56myhash = defaultdict(list)78triples = set((rec["level"], rec["index"], rec["genus"]) for rec in db.gps_gl2zhat_fine.search({"contains_negative_one":True}, ["level", "index", "genus"]))910FAM_RE = re.compile(r"X([^\(]*)\((\d+(,\d+)?)\)")1112count = 113with open("eqguts.tex", "w") as eqguts:14with open("prettyindex", "w") as prettyindex:15prettyindex.write('[1,"?"]\n')16eqguts.write(r'$?$'+'\n')17for (level, index, genus) in triples:18pp = "%s_{%s}^{%s}" % (level, index, genus)19eqguts.write(f'${pp}$\n')20count += 121prettyindex.write('[%d, "%s"]\n'%(count, pp))22for name in db.gps_gl2zhat_fine.search({"name":{"$ne":""}}, "name"):23fam, n, _ = FAM_RE.fullmatch(name).groups()24if fam == "0":25fam = "_0"26elif fam == "1":27fam = "_1"28elif fam == "pm1":29fam = r"_{\pm 1}"30elif fam == "sp":31fam = r"_{\mathrm{sp}}"32elif fam == "ns":33fam = r"_{\mathrm{ns}}"34elif fam == "sp+":35fam = r"_{\mathrm{sp}}^+"36elif fam == "ns+":37fam = r"_{\mathrm{ns}}^+"38elif fam == "S4":39fam = r"_{S_4}"40elif fam != "":41raise ValueError(fam)42tex = f"X{fam}({n})"43pp = name44eqguts.write(f'${tex}$\n')45count += 146prettyindex.write('[%d, "%s"]\n'%(count, pp))4748print ("Max count is %d" % count)495051