back to table · edit · history · where entries came from · files · download
2060 bytes, as of the version from 2026-10-16 11:15 (current). Recorded here, not run.
"""Check the geometric conventions against frozen API reads of T458 and T462."""
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from fractions import Fraction
from pathlib import Path
from math import factorial, prod
import json
from independent import psi_one, vectors
from checks import as_qq, flatten
from generate import SimpleHurwitz
def run():
here=Path(__file__).resolve().parent
psi=json.loads((here/'T458.json').read_text())['Numbers']['1']
hodge=json.loads((here/'T462.json').read_text())['Numbers']['1']
def v(tree,n,a):
leaf=tree[str(n)][','.join(map(str,sorted(a)))]
return as_qq(Fraction(leaf['number'] if isinstance(leaf,dict) else leaf))
assert v(psi,1,(1,))==QQ(1)/QQ(24)
assert v(hodge,1,(0,))==QQ(1)/QQ(24)
counts={'psi_rows':0,'lambda_one_rows':0,'elsv_hurwitz_rows':0}
for n,rows in psi.items():
for profile in rows:
a=tuple(map(int,profile.split(',')))
assert v(psi,int(n),a)==as_qq(psi_one(a))
counts['psi_rows']+=1
for n,rows in hodge.items():
for profile in rows:
a=tuple(map(int,profile.split(',')))
assert v(hodge,int(n),a)==QQ(factorial(sum(a)))/QQ(24*prod(factorial(x) for x in a))
counts['lambda_one_rows']+=1
values=flatten(json.loads((here/'T463-stored.json').read_text())) if (here/'T463-stored.json').exists() else {
(int(p['g']),tuple(map(int,p['mu'].split(',')))):SimpleHurwitz().value(p) for p in SimpleHurwitz().enumerate()}
for (g,mu),value in values.items():
n=len(mu)
if g!=1 or n>5:continue
top=sum(v(psi,n,a)*prod(x**k for x,k in zip(mu,a)) for a in vectors(n,n))
bottom=sum(v(hodge,n,a)*prod(x**k for x,k in zip(mu,a)) for a in vectors(n-1,n))
factor=QQ(factorial(sum(mu)+n)*prod(x**x for x in mu))/QQ(prod(factorial(x) for x in mu))
assert value==factor*(top-bottom),(g,mu)
counts['elsv_hurwitz_rows']+=1
print(json.dumps(counts,indent=2))
if __name__=='__main__':run()