Does light charge the quons? › Files cited on the page › check_trial24_fable/
r33_xuma.py
#!/usr/bin/env python3
"""Thirty-third reviewer, trial 24, blind part (d): Xu and Ma 2016 (arXiv:1607.03203) Table 1, own fits,
own look-elsewhere test, and the limits of LHAASO 2024, HESS 2011, Abdo 2009 (GRB 090510) and MAGIC 2008
written as predictions of the Xu-Ma slope.
Own code. Table 1 typed from the PDF text (sources/slow_light_2026-11-23/arxiv_1607.03203.pdf, page 3).
Columns: label, z, t_high (s), t_low (s), E_obs (GeV), Delta t_obs/(1+z) (s), K1 (1e18 s GeV) +- as printed.
"""
import math, sys
import numpy as np
from scipy import integrate
T = [
("080916C(1)", 4.35, 16.545, 5.984, 12.4, 1.974, 4.46, 0.45),
("080916C(2)", 4.35, 40.509, 5.984, 27.4, 6.453, 9.86, 0.99),
("090510", 0.903, 0.828, -0.032, 29.9, 0.452, 7.21, 0.73),
("090902B_a", 1.822, 81.746, 9.768, 39.9, 25.506, 12.9, 1.3),
("090902B_b", 1.822, 11.671, 9.768, 11.9, 0.674, 3.84, 0.39),
("090902B_c", 1.822, 14.166, 9.768, 14.2, 1.559, 4.58, 0.47),
("090902Bs_a", 1.822, 26.168, 9.768, 18.1, 5.812, 5.84, 0.59),
("090902Bs_b", 1.822, 42.374, 9.768, 12.7, 11.554, 4.10, 0.42),
("090902Bs_c", 1.822, 45.608, 9.768, 15.4, 12.700, 4.97, 0.51),
("090926A", 2.1071, 24.835, 4.320, 19.5, 6.603, 6.53, 0.66),
("100414A", 1.368, 33.365, 0.288, 29.7, 13.968, 8.70, 0.88),
("130427A", 0.3399, 18.644, 0.544, 72.6, 13.509, 9.02, 0.91),
("140619B", 2.67, 0.613, 0.096, 22.7, 0.141, 7.96, 0.82),
]
H0 = 67.3 # km/s/Mpc, as Xu-Ma
OM, OL = 0.315, 0.685
MPC_KM = 3.0856775814913673e19
INV_H0_S = MPC_KM / H0 # seconds
def K1(z, E_obs):
"""Xu-Ma Eq. 8 with n = 1: K1 = (E_obs/(1+z)) (1/H0) int_0^z (1+z') dz' / sqrt(Om (1+z')^3 + OL), in s GeV."""
I, _ = integrate.quad(lambda zp: (1 + zp) / math.sqrt(OM * (1 + zp) ** 3 + OL), 0, z)
return E_obs / (1 + z) * INV_H0_S * I
def ols(x, y):
n = len(x)
xm, ym = x.mean(), y.mean()
sxx = ((x - xm) ** 2).sum()
b = ((x - xm) * (y - ym)).sum() / sxx
a = ym - b * xm
r = y - (a + b * x)
s2 = (r ** 2).sum() / (n - 2)
sb = math.sqrt(s2 / sxx)
sa = math.sqrt(s2 * (1 / n + xm ** 2 / sxx))
return a, b, sa, sb, r
def main():
lab = [t[0] for t in T]
z = np.array([t[1] for t in T]); E = np.array([t[4] for t in T])
y = np.array([t[5] for t in T]); K = np.array([t[6] for t in T]); sK = np.array([t[7] for t in T])
th = np.array([t[2] for t in T]); tl = np.array([t[3] for t in T])
print("# r33 Xu-Ma re-analysis (own code)")
print("## Check of the table's own arithmetic: y = (t_high - t_low)/(1+z), and K1 recomputed from z, E_obs (H0 = 67.3, Om = 0.315)")
print("label | y printed | y recomputed | K1 printed | K1 recomputed (1e18 s GeV) | ratio")
for i in range(len(T)):
yr = (th[i] - tl[i]) / (1 + z[i])
Kr = K1(z[i], E[i]) / 1e18
print(f"{lab[i]:12s} | {y[i]:7.3f} | {yr:7.3f} | {K[i]:5.2f} | {Kr:5.2f} | {Kr/K[i]:.3f}")
print(f"K1 stated errors / K1: " + ", ".join(f"{s/k:.3f}" for s, k in zip(sK, K)) + " (all 10 %: the LAT energy resolution)")
print("\n## C1: OLS, all 13 (y on K; y in s, K in 1e18 s GeV; slope in 1e-18 GeV^-1)")
a, b, sa, sb, r = ols(K, y)
print(f"slope {b:.2f} +- {sb:.2f} ({b/sb:.1f} sigma from zero); intercept {a:.2f} +- {sa:.2f}; rms residual {math.sqrt((r**2).mean()):.2f} s")
# Identify the mainline 8 by residual from the published line
pub_b, pub_a = 2.78, -10.7
res_pub = y - (pub_a + pub_b * K)
order = np.argsort(np.abs(res_pub))
main8 = sorted(order[:8])
print("\n## Mainline (the 8 points nearest the published line y = 2.78 K - 10.7):")
for i in range(len(T)):
print(f" {lab[i]:12s} resid {res_pub[i]:+7.2f} s {'MAIN' if i in main8 else 'off'}")
a8, b8, sa8, sb8, r8 = ols(K[main8], y[main8])
print(f"C2: OLS on those 8: slope {b8:.3f} +- {sb8:.3f}; intercept {a8:.2f} +- {sa8:.2f}; rms residual {math.sqrt((r8**2).mean()):.3f} s; "
f"max |resid| {np.abs(r8).max():.3f} s")
# Chi-square of the 8 against their own stated errors (x-errors propagated through the slope)
sig_y = b8 * sK[main8] # s
chi2 = float(((r8 / sig_y) ** 2).sum())
print(f" chi2 of the 8 about their own line using the stated 10 % K errors propagated (sigma_y = slope * sigma_K): "
f"{chi2:.2f} for {len(main8)-2} dof; expected ~{len(main8)-2}. Mean sigma_y = {sig_y.mean():.2f} s vs rms residual {math.sqrt((r8**2).mean()):.2f} s")
# Probability of chi2 this small or smaller
from scipy import stats
print(f" P(chi2 <= {chi2:.2f} | dof = {len(main8)-2}) = {stats.chi2.cdf(chi2, len(main8)-2):.4f}")
# Fit the 8 with x-errors by effective variance (iterate)
bb = b8
for _ in range(20):
w = 1.0 / (bb * sK[main8]) ** 2
W = w.sum(); xm = (w * K[main8]).sum() / W; ym = (w * y[main8]).sum() / W
bb = (w * (K[main8] - xm) * (y[main8] - ym)).sum() / (w * (K[main8] - xm) ** 2).sum()
aa = ym - bb * xm
sbb = math.sqrt(1.0 / (w * (K[main8] - xm) ** 2).sum())
print(f" effective-variance fit of the 8 with the stated errors: slope {bb:.3f} +- {sbb:.3f} (formal, from the stated errors alone), intercept {aa:.2f}")
# Look-elsewhere test, own design
print("\n## C3-type look-elsewhere test (own design)")
tol = float(np.abs(r8).max())
print(f"Tolerance = largest |residual| of the 8 from THEIR OWN best line = {tol:.3f} s (the published line gives {np.abs(res_pub[main8]).max():.3f} s)")
def max_on_line(xv, yv, tol, positive=True):
n = len(xv); best = 0
for i in range(n):
for j in range(i + 1, n):
if xv[j] == xv[i]:
continue
s = (yv[j] - yv[i]) / (xv[j] - xv[i])
if positive and s <= 0:
continue
c = yv[i] - s * xv[i]
cnt = int((np.abs(yv - (c + s * xv)) <= tol).sum())
best = max(best, cnt)
return best
real = max_on_line(K, y, tol)
print(f"Real data: largest number of the 13 within +-{tol:.3f} s of a positive-slope line through two of them = {real}")
rng = np.random.default_rng(33)
N = 20000
for null_name in ["permute y among K", "y uniform on [min,max] of observed y", "y uniform, K uniform on observed ranges"]:
counts = np.zeros(N, dtype=int)
for k in range(N):
if null_name.startswith("permute"):
yy = rng.permutation(y); xx = K
elif null_name.startswith("y uniform on"):
yy = rng.uniform(y.min(), y.max(), len(y)); xx = K
else:
yy = rng.uniform(y.min(), y.max(), len(y)); xx = rng.uniform(K.min(), K.max(), len(K))
counts[k] = max_on_line(xx, yy, tol)
frac8 = (counts >= 8).mean(); frac7 = (counts >= 7).mean(); frac6 = (counts >= 6).mean()
print(f"Null '{null_name}': P(>=8 on a line) = {frac8:.4f}; P(>=7) = {frac7:.4f}; P(>=6) = {frac6:.4f}; "
f"mean max = {counts.mean():.2f}; distribution: " + ", ".join(f"{c}:{(counts==c).mean():.3f}" for c in range(3, 11)))
# Any-sign slope variant with the permutation null
counts = np.zeros(N, dtype=int)
for k in range(N):
counts[k] = max_on_line(K, rng.permutation(y), tol, positive=False)
print(f"Null 'permute', any sign of slope: P(>=8) = {(counts>=8).mean():.4f}; P(>=7) = {(counts>=7).mean():.4f}")
# Note on structure: 6 of the 13 points share one GRB (090902B) and one t_low; 2 share 080916C
print("Note: 6 of the 13 points come from one burst (090902B) with one t_low; 2 more share 080916C. The permutation null treats all 13 as exchangeable, which overstates the independence of the real data in both directions.")
# Predictions of the Xu-Ma slope against other limits
print("\n## C4/C5: the Xu-Ma slope as a prediction, against the nulls")
inv_ELV = 2.78e-18 # GeV^-1
ELV = 1 / inv_ELV
print(f"E_LV = {ELV:.3e} GeV")
# LHAASO GRB 221009A: z = 0.151, 0.2-7 TeV; limit E_QG,1 > 1.0e20 GeV (subluminal)
for Eg in (200.0, 1000.0, 7000.0):
k = K1(0.151, Eg)
dt = (1 + 0.151) * k * inv_ELV
print(f" GRB 221009A (z=0.151), E = {Eg:.0f} GeV: K1 = {k:.3e} s GeV; Xu-Ma delay vs ~0 GeV = {dt:.1f} s; "
f"LHAASO allows (E_QG,1 > 1.0e20) < {(1+0.151)*k/1.0e20:.3f} s; ratio {1.0e20/ELV:.0f}")
# GRB 090510: z = 0.900 (1-sigma low), E = 28.0 GeV (1-sigma low), Abdo limits (a) 859 ms, (d) 99 ms, (e) 10 ms
k = K1(0.900, 28.0)
dt = (1 + 0.900) * k * inv_ELV
print(f" GRB 090510 (z=0.900, 28 GeV): K1 = {k:.3e}; Xu-Ma delay = {dt:.1f} s; Abdo (a) 0.859 s -> ratio {dt/0.859:.0f}; "
f"(d) 0.099 s -> {dt/0.099:.0f}; (e) 0.010 s -> {dt/0.010:.0f}")
print(f" Xu-Ma's escape: the 'lower line' intercept -20.77 s (source frame) = {20.77*1.903:.1f} s observer frame before the first low-energy peak of a short burst (<2 s long)")
# HESS 2011: M_QG,1 > 2.1e18 GeV (95 %)
print(f" HESS 2011 PKS 2155-304: M_QG,1 > 2.1e18 GeV; Xu-Ma E_LV = {ELV:.2e} is {2.1e18/ELV:.1f} times below it")
print(f" Abdo 2009 (a): M_QG,1 > 1.19 M_Pl = {1.19*1.22e19:.2e} GeV; ratio to Xu-Ma {1.19*1.22e19/ELV:.0f}; (e): > 102 M_Pl, ratio {102*1.22e19/ELV:.0f}")
# MAGIC 2008: tau_l = 0.030 +- 0.012 s/GeV at z = 0.034; M_QG1 = 1.445e16 s / tau_l (their formula)
tau, stau = 0.030, 0.012
M_magic = 1.445e16 / tau
inv_magic = 1 / M_magic
sinv = inv_magic * stau / tau
# own conversion: delay per GeV at z = 0.034 = K1(z, 1 GeV)*(1+z)/E_LV
k1 = K1(0.034, 1.0) * (1 + 0.034)
print(f" MAGIC: tau = {tau} +- {stau} s/GeV -> 1/M_QG1 = {inv_magic:.2e} +- {sinv:.2e} GeV^-1 (their 1.445e16 s); "
f"own conversion with H0 = 67.3: 1/E_LV = tau/K1(z,1GeV)(1+z) = {tau/k1:.2e} GeV^-1")
d = (inv_ELV - inv_magic) / math.sqrt(sinv ** 2 + 0.20e-18 ** 2)
print(f" Xu-Ma 2.78 +- 0.20 vs MAGIC {inv_magic*1e18:.2f} +- {sinv*1e18:.2f} (x1e-18): difference {d:.1f} sigma -> consistent with each other; "
f"both lie above HESS's and LHAASO's limits (under those papers' assumptions of no intrinsic lag)")
if __name__ == '__main__':
main()