#!/usr/bin/env python3 """Lambda_1(T_x, p) brackets for folds p = 5..31 over the iecell tiles (reuses ana4301.bracket), with the heuristic p-local limit L_p = 1 + (2p-8)/(3p-8)^2 as an exact fraction. Usage: folds4301.py (reads c.json here) -> stdout.""" import json, os, sys from fractions import Fraction here = os.path.dirname(os.path.abspath(__file__)) src = open(os.path.join(here, "ana4301.py")).read().split("args = sys.argv[1:]")[0] ns = {}; exec(src, ns); bracket = ns["bracket"] XS = (23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101) out = {"heuristic_L_p": {}, "brackets": {}} for p in (5, 7, 11, 13, 17, 19, 23, 29, 31): out["heuristic_L_p"][str(p)] = str(1 + Fraction(2 * p - 8, (3 * p - 8) ** 2)) out["brackets"][str(p)] = {} for x in XS: if x < p: continue b = bracket(json.load(open(os.path.join(here, "c%d.json" % x))), p) out["brackets"][str(p)][str(x)] = [b["Lambda1_lo"], b["Lambda1_hi"]] print(json.dumps(out, indent=1))