Path: blob/main/scripts/abvar/check_correctness.sage
1128 views
sys.path.append("../..")1from collections import defaultdict2from lmfdb import db34'''5Reads files from counts_filenames, and for each prime power q,6add the number of isogeny labels of genus 1 over F_q7from each of the files. Then we check if it matches the LMFDB data.8'''910counts_filenames = ["counts23_0_1728.txt", "counts.txt"]1112counts = defaultdict(int)1314for filename in counts_filenames:15with open(filename, "r") as file:16for line in file:17line = line.replace(" ", "")18if not line:19continue20tokens = line.split(",")2122if all(token.isdigit() for token in tokens) and len(tokens)>1:23counts[int(tokens[0])] += int(tokens[1])2425lmfdb_counts = db.av_fq_isog.stats.column_counts(["g", "q"])2627for key in sorted(counts):28assert lmfdb_counts[(1, key)] == counts[key], "Number of labels for q=%s does not match." % (key)2930print("SUCCESS: we just verified that the number of labels in our output matches the lmfdb data.")3132