Does light charge the quons? › Files cited on the page › the trials
check_33rd_findings.py
#!/usr/bin/env python3
"""The author seat's check of the thirty-third reviewer's findings on trial 24, before folding them in. Own code; post hoc."""
import importlib.util
import math
import os
import subprocess
import sys
import numpy as np
from scipy.stats import t as tdist
sys.dont_write_bytecode = True
HERE = os.path.dirname(os.path.abspath(__file__))
spec = importlib.util.spec_from_file_location("m", os.path.join(HERE, "slow_light_zero_pressure.py"))
m = importlib.util.module_from_spec(spec)
spec.loader.exec_module(m)
print("git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, cwd=HERE).stdout.strip())
print("\nF1. Straight-line intercepts, isotherm by isotherm (1e-8)")
o = m.part_a(boot=0, quiet=True, form="line")
for g in m.GASES:
print(f" {g}: " + "; ".join(f"{q[0]}C {q[1]*1e8:+.1f}" for q in o[g]))
x = np.array([q[1] for q in o[g]])
print(f" plain mean {x.mean():+.2e}; largest size {np.abs(x).max():.2e}; true limit {dict(nitrogen=1.72e-10, argon=2.80e-10, helium=1.43e-9)[g]:.2e}")
print("\nF3. t = 3.2 with 5 degrees of freedom: p =", round(2 * tdist.sf(3.2, 5), 3), "; in a normal distribution that p is", "2.2 sigma")
print("\nF14. helium's limit over nitrogen's and argon's:", round(1.43e-9 / 1.72e-10, 1), round(1.43e-9 / 2.80e-10, 1))
print("\nF15. 20.8 s at the source for GRB 090510, seen:", round(20.77 * 1.903, 1), "s")
print("\nF10. Three parallel lines: how many of 13 shuffled points fall within 1.25 s of the best three (slope through any pair, positive)")
K = np.array([e[4] for e in m.XM]); Y = np.array([e[3] for e in m.XM])
def cover(x, y, tol, k=3):
best = 0
n = len(x)
for i in range(n):
for j in range(i + 1, n):
if x[i] == x[j]:
continue
s = (y[j] - y[i]) / (x[j] - x[i])
if s <= 0:
continue
r = np.sort(y - s * x)
left = list(r)
tot = 0
for _ in range(k): # greedy: the window of width 2 tol that holds most of what is left
if not left:
break
a = np.array(left)
cnt = [((a >= v) & (a <= v + 2 * tol + 1e-12)).sum() for v in a]
q = int(np.argmax(cnt))
tot += cnt[q]
left = [v for v in left if not (a[q] <= v <= a[q] + 2 * tol + 1e-12)]
best = max(best, tot)
return best
rng = np.random.default_rng(33)
real = cover(K, Y, 1.25)
N = 600
c = np.array([cover(K, rng.permutation(Y), 1.25) for _ in range(N)])
print(f" real data: {real} of 13; shuffled ({N} tries): >= 12 in {np.mean(c >= 12):.2f}, 13 in {np.mean(c >= 13):.3f}")
print(" within GRB 090902B alone (6 photons, one redshift): correlation of delay with energy:",
round(float(np.corrcoef([e[2] for e in m.XM if e[0].startswith('090902B')], [e[3] for e in m.XM if e[0].startswith('090902B')])[0, 1]), 2))
print("\nF12. A delay of 4.7 h over 168,000 light-years as a fraction:", f"{4.7*3600/(168000*3.15576e7):.1e}", "; the 1.7 s of GRB 170817A over 130 million light-years:", f"{1.7/(1.3e8*3.15576e7):.1e}")
print(" if the delay grew with distance alone, 130 million light-years would give", f"{4.7*1.3e8/168000/24/365:.2f} years; if only our Galaxy's and the source's potential mattered, hours.")