Does light charge the quons? › Files cited on the page › check_trial20_fable/
check_trial20.py
"""Independent check of trial 20, "light in glass, molecule by molecule" (22 November 2026), by the twenty-third reviewer.
Own code throughout, written without copying sim/matter_light/light_in_glass.py:
- the Sellmeier sum is evaluated in frequency, n^2 - 1 = sum B_i w_i^2/(w_i^2 - w^2), and checked against the wavelength form;
- derivatives are central differences in frequency with Richardson extrapolation (the trial used analytic wavelength derivatives);
- the molecules' own holds (eps = -2) are the roots of a cubic in E^2 (the trial bracketed and bisected);
- the cosmology integrals are done with Simpson's rule on a fine grid as well as scipy's quad;
- the energy shares come from Brillouin's d(w eps)/dw (the trial summed the oscillators' potential and kinetic energies);
- the GRB delay for "a vacuum with glass's ratio" is also integrated exactly along the path, with the photon's energy redshifting.
It also derives the amorphous-aether scattering bound (V3) and estimates a quantum lattice's zero-point structure factor.
Writes nothing but stdout. Run: OMP_NUM_THREADS=1 ~/aspden-review-venv/bin/python3 check_trial20.py > check_trial20_out.txt
Labels: [S] standard physics, [I] measured input, [D] derived, [M] modelling choice. Anything from memory is marked.
"""
import os
import subprocess
import numpy as np
from scipy import constants as K
from scipy.integrate import quad, simpson
here = os.path.dirname(os.path.abspath(__file__))
try:
head = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, timeout=10, cwd=here).stdout.strip()
except Exception as exc:
head = f"(not available: {exc.__class__.__name__})"
print(f"Twenty-third reviewer's check of trial 20. git HEAD at run: {head}; numpy {np.__version__}")
c, h, hbar, e, me, eps0, mu0, kB, NA = K.c, K.h, K.hbar, K.e, K.m_e, K.epsilon_0, K.mu_0, K.k, K.N_A
a0 = K.physical_constants['Bohr radius'][0]
alpha_fs = K.fine_structure
hc_eVum = h * c / e * 1e6
hbarc_eVm = hbar * c / e
YR = K.Julian_year
GLY = c * YR * 1e9
AU = K.au
M_PLANCK = np.sqrt(hbar * c / K.G)
# ---- inputs, copied from the files in sources/light_in_glass_2026-11-22/ (read with python3 -I) [I] ----
BK7_B = np.array([1.03961212, 0.231792344, 1.01046945]); BK7_C = np.array([0.00600069867, 0.0200179144, 103.560653])
H2O_B = np.array([5.684027565e-1, 1.726177391e-1, 2.086189578e-2, 1.130748688e-1])
H2O_C = np.array([5.101829712e-3, 1.821153936e-2, 2.620722293e-2, 1.069792721e1])
SIO2_B = np.array([0.6961663, 0.4079426, 0.8974794]); SIO2_C = np.array([0.0684043, 0.1162414, 9.896161]) ** 2
BK7_K = {0.300: 2.8607e-6, 0.400: 1.0227e-8, 0.546: 6.9658e-9, 1.060: 1.0137e-8, 2.500: 8.1300e-6}
RHO_BK7 = 2510.0
LAM_C, LAM_D, LAM_F = 0.6562725, 0.5875618, 0.4861327
# Fizeau 1851 / Phil. Mag. 1860 and Michelson-Morley 1886, as read in the Wikisource copies [I]
FIZ_L, FIZ_U, FIZ_LAM, FIZ_OBS, FIZ_FRESNEL, FIZ_FULL = 1.4875, 7.059, 0.526e-6, 0.23, 0.2022, 0.4597
MM_X, MM_DX, MM_N2, MM_LAM = 0.434, 0.02, 1.78, 0.57e-6
# GRB 090510 limit (a), the record's cosmology (Part 1 U15; relay_requirements.py)
GRB_DT, E_HI, E_LO, Z, H0_KMSMPC, OM = 0.859, 28e9, 0.1e6, 0.903, 67.4, 0.3153
# the record
REC_ERES, REC_A, REC_CT0 = 3.0e19, 2.3e-26, 10.3
M_QUON_EV = 0.04078 * me * c ** 2 / e # Aspden's quon, 0.04078 m_e (Part 1 U17; the record's 20.84 keV)
M_LEVEL29_EV = M_QUON_EV * 3 ** 29 # U44's nesting rule at level 29 (s = 3), the carrying level of section 7.3 item 5
# from memory (marked in the output)
SIO2_RHO, SIO2_M, TF, BETA_T = 2200.0, 60.08e-3, 1450.0, 7e-11
CHI_WATER = -9.0e-6
CAF2_DN, CAF2_A, CAF2_N, CAF2_LAM = 1.12e-6, 0.546e-9, 1.56, 157e-9
V_LAB, E_SUN = 369.82e3, 716.0
results = [] # (name, trial's value, mine, tolerance)
def cmp(name, trial, mine, tol):
rel = abs(mine / trial - 1) if trial != 0 else abs(mine - trial)
results.append((name, trial, mine, rel, rel <= tol))
print(f" {'ok ' if rel <= tol else 'DIFF'} {name}: trial {trial:.6g}, mine {mine:.6g}, rel diff {rel:.1e}")
# ---- the Sellmeier sum in frequency [S] ----
def w_of_lam_um(lam_um):
return 2 * np.pi * c / (lam_um * 1e-6)
def eps_w(w, B, C):
"""n^2(w) from the oscillator sum in angular frequency."""
wi2 = (2 * np.pi * c / (np.sqrt(C) * 1e-6)) ** 2
return 1.0 + np.sum(B * wi2 / (wi2 - w ** 2))
def n_w(w, B, C):
return np.sqrt(eps_w(w, B, C))
def d1(fn, x, rel=1e-4):
hh = rel * x
D = lambda s: (fn(x + s) - fn(x - s)) / (2 * s)
return (4 * D(hh) - D(2 * hh)) / 3
def d2(fn, x, rel=1e-3):
hh = rel * x
D = lambda s: (fn(x + s) - 2 * fn(x) + fn(x - s)) / s ** 2
return (4 * D(hh) - D(2 * hh)) / 3
def n_lam(lam_um, B, C):
return n_w(w_of_lam_um(lam_um), B, C)
def n_group(lam_um, B, C):
w = w_of_lam_um(lam_um)
return d1(lambda x: x * n_w(x, B, C), w) # d(n w)/dw
def gvd_fs2_mm(lam_um, B, C):
w = w_of_lam_um(lam_um)
return d2(lambda x: x * n_w(x, B, C), w) / c * 1e27 # d^2k/dw^2 in s^2/m -> fs^2/mm
def eps_lam_form(lam_um, B, C):
return 1 + np.sum(B * lam_um ** 2 / (lam_um ** 2 - C))
print("\n=== 1. N-BK7: index, group index, dispersion [I -> D] ===")
print(f" frequency form against wavelength form at d: {eps_w(w_of_lam_um(LAM_D), BK7_B, BK7_C) - eps_lam_form(LAM_D, BK7_B, BK7_C):.1e}")
nd, nF, nC = (n_lam(x, BK7_B, BK7_C) for x in (LAM_D, LAM_F, LAM_C))
Vd = (nd - 1) / (nF - nC)
cmp("n_d", 1.516800, nd, 1e-6); cmp("V_d", 64.167, Vd, 1e-4); cmp("n_F - n_C", 0.008054, nF - nC, 1e-3)
for lam, nm, tn, tng in ((LAM_C, "C", 1.514322, 1.534783), (LAM_D, "d", 1.516800, 1.541360), (LAM_F, "F", 1.522376, 1.557547),
(0.400, "400", 1.530849, 1.584114), (0.800, "800", 1.510776, 1.526650), (1.060, "1060", 1.506688, 1.520690)):
cmp(f"n({nm})", tn, n_lam(lam, BK7_B, BK7_C), 2e-6); cmp(f"n_g({nm})", tng, n_group(lam, BK7_B, BK7_C), 2e-6)
ng_d = n_group(LAM_D, BK7_B, BK7_C)
cmp("n_g - n at d", 0.02456, ng_d - nd, 1e-3)
cmp("GVD 800 nm (fs^2/mm)", 44.65, gvd_fs2_mm(0.800, BK7_B, BK7_C), 2e-3)
cmp("GVD 1060 nm (fs^2/mm)", 22.69, gvd_fs2_mm(1.060, BK7_B, BK7_C), 2e-3)
print("\n=== 2. What the molecules supply [D] ===")
f_glass = 1 / nd ** 2
LL = (nd ** 2 - 1) / (nd ** 2 + 2)
cmp("molecules' share 1 - 1/n^2 at d", 0.5653, 1 - f_glass, 1e-3); cmp("vacuum's share 1/n^2", 0.4347, f_glass, 1e-3)
cmp("Lorentz-Lorenz fraction", 0.302436274159, LL, 1e-9)
cmp("K2 identity (1-f)/(1+2f)", LL, (1 - f_glass) / (1 + 2 * f_glass), 1e-13)
N_unit = RHO_BK7 * NA / 60.08e-3
a_mol = N_unit ** (-1 / 3)
alpha_p = 3 * LL / (4 * np.pi * N_unit)
cmp("N (SiO2-equivalents /m^3)", 2.5159e28, N_unit, 1e-4); cmp("spacing a (nm)", 0.3413, a_mol * 1e9, 1e-3)
cmp("alpha/(4 pi eps0) (A^3)", 2.870, alpha_p * 1e30, 1e-3)
wi2 = (2 * np.pi * c / (np.sqrt(BK7_C) * 1e-6)) ** 2
wp2 = BK7_B * wi2
N_e_eff = eps0 * me * np.sum(wp2[:2]) / e ** 2
cmp("N_e,eff from the UV terms (/m^3)", 2.061e29, N_e_eff, 1e-3); cmp("electrons per unit", 8.19, N_e_eff / N_unit, 2e-3)
cmp("hbar w_p UV1 (eV)", 16.32, hbar * np.sqrt(wp2[0]) / e, 1e-3); cmp("hbar w_p UV2 (eV)", 4.22, hbar * np.sqrt(wp2[1]) / e, 2e-3)
cmp("static limit 1 + sum B", 3.2819, 1 + BK7_B.sum(), 1e-4)
lat_d = BK7_B[2] * LAM_D ** 2 / (LAM_D ** 2 - BK7_C[2])
cmp("lattice term at d", -0.00338, lat_d, 2e-3)
print("\n=== 3. The holds and the molecules' own holds [D] ===")
E_hold = hc_eVum / np.sqrt(BK7_C) # eV, poles of n^2
u_i = E_hold ** 2
# eps + 2 = 0 <=> 3 prod_j (u_j - u) + sum_i B_i u_i prod_{j != i} (u_j - u) = 0, a cubic in u = E^2.
# np.poly(r) is the monic prod (u - r_j): three factors give prod (u_j - u) = -np.poly(u_i), two factors give +np.poly(others).
poly = -3 * np.poly(u_i)
for i in range(3):
others = [u_i[j] for j in range(3) if j != i]
poly = np.polyadd(poly, BK7_B[i] * u_i[i] * np.poly(others))
roots = np.sort(np.sqrt(np.roots(poly).real))
E_d = hc_eVum / LAM_D
for Ei, E0, tE, tE0 in zip(np.sort(E_hold), roots, (0.1218, 8.7631, 16.0054), (0.1355, 8.9851, 18.6263)):
cmp(f"hold {tE} eV", tE, Ei, 5e-4); cmp(f"own hold {tE0} eV", tE0, E0, 5e-4)
print(f" eps at the root: {eps_w(E0 * e / hbar, BK7_B, BK7_C):+.3e} (should be -2); above its pole: {E0 > Ei}")
cmp("trace sum(E0^2 - E^2) (eV^2)", 94.711245, np.sum(roots ** 2 - u_i), 1e-6)
cmp("trace sum B E^2/3", 94.711245, np.sum(BK7_B * u_i) / 3, 1e-6)
x1, x2 = E_d / E_hold[0], E_d / E_hold[1]
cmp("x_1 = E_d/E_1", 0.1318, x1, 1e-3); cmp("x_2 = E_d/E_2", 0.2408, x2, 1e-3)
print("\n=== 4. GRB 090510: the record's requirement, and the delay for a glass-like vacuum [D] ===")
H0 = H0_KMSMPC * 1e3 / (1e6 * K.parsec)
hz = lambda z: np.sqrt(OM * (1 + z) ** 3 + 1 - OM)
zz = np.linspace(0, Z, 20001)
T = {n: quad(lambda z: (1 + z) ** n / hz(z), 0, Z)[0] / H0 for n in (-1, 0, 2, 3)}
Ts = {n: simpson((1 + zz) ** n / hz(zz), x=zz) / H0 for n in (-1, 0, 2, 3)}
for n in (-1, 0, 2, 3):
print(f" T_{n} = int (1+z)^{n}/h dz / H0: quad {T[n]:.4e} s, Simpson {Ts[n]:.4e} s; c T_{n} = {c * T[n] / GLY:.2f} Gly")
cmp("T0 (s)", 3.2450e17, T[0], 1e-4); cmp("T2 (s)", 6.6835e17, T[2], 1e-4); cmp("cT0 (Gly)", 10.28, c * T[0] / GLY, 1e-3)
lim2 = GRB_DT / T[2]
cmp("allowed group-index difference 0.859/T2", 1.285e-18, lim2, 1e-3)
Eres0 = E_HI * np.sqrt(1.5 / lim2)
cmp("E_res (f = 0) (eV)", 3.025e19, Eres0, 1e-3); cmp("E_res (f = 1/4) (eV)", 2.620e19, E_HI * np.sqrt(1.5 * 0.75 / lim2), 1e-3)
cmp("x(28 GeV), f = 0", 9.257e-10, E_HI / Eres0, 1e-3)
ratio_vac = Eres0 / E_HI
cmp("vacuum hold / photon", 1.080e9, ratio_vac, 1e-3); cmp("glass hold / d line (1/x2)", 4.15, 1 / x2, 2e-3)
cmp("ratio of ratios", 2.60e8, ratio_vac * x2, 2e-3)
# the delay for a vacuum with glass's ratio: the trial's way (delta at the observed energy times T2)
delta = lambda x: (1 - x ** 2) ** -1.5 - 1
dt_trial = (delta(x2) - delta(x2 * E_LO / E_HI)) * T[2]
cmp("n_g - 1 at x = 0.241", 0.0937, delta(x2), 2e-3)
cmp("delay, the trial's way (s)", 6.26e16, dt_trial, 2e-3); cmp("delay (years)", 1.99e9, dt_trial / YR, 3e-3)
# exactly: the photon's energy is (1+z') E along the path, and the one-oscillator form is not quadratic at x = 0.46
Eres_glass = E_HI / x2
dt_exact = quad(lambda z: (delta(E_HI * (1 + z) / Eres_glass) - delta(E_LO * (1 + z) / Eres_glass)) / hz(z), 0, Z)[0] / H0
print(f" exact path integral with the redshifted energy (x = {E_HI * (1 + Z) / Eres_glass:.3f} at emission): {dt_exact:.3e} s = {dt_exact / YR:.2e} years"
f" ({dt_exact / dt_trial:.2f} times the trial's quadratic estimate). 'About 2 billion years' stands as an order of magnitude.")
cmp("n_F - n_C over the allowed difference", 6.3e15, (nF - nC) / lim2, 2e-2)
print("\n=== 5. Discreteness and scattering [D, M] ===")
k_d = 2 * np.pi * nd / (LAM_D * 1e-6)
ka2 = (k_d * a_mol) ** 2
cmp("(ka)^2 in BK7", 3.064e-5, ka2, 1e-3)
for name, b, t in (("1/8", 1 / 8, 3.83e-6), ("1/24", 1 / 24, 1.28e-6), ("0.057", 0.057, 1.75e-6), ("0.003", 0.003, 9.19e-8)):
cmp(f"beta (ka)^2, beta = {name}", t, b * ka2, 5e-3)
k_caf2 = 2 * np.pi * CAF2_N / CAF2_LAM
ka2_caf2 = (k_caf2 * CAF2_A) ** 2
cmp("CaF2 (ka)^2 (from memory inputs)", 1.162e-3, ka2_caf2, 1e-3); cmp("CaF2 coefficient", 6.18e-4, CAF2_DN / (CAF2_N * ka2_caf2), 2e-3)
# fused silica at the d line
N_s = SIO2_RHO * NA / SIO2_M
n_s = n_lam(LAM_D, SIO2_B, SIO2_C)
k0 = 2 * np.pi / (LAM_D * 1e-6)
alpha_s = 3 * (n_s ** 2 - 1) / (n_s ** 2 + 2) / (4 * np.pi * N_s)
h_ind = N_s * (8 * np.pi / 3) * k0 ** 4 * alpha_s ** 2
S0 = N_s * kB * TF * BETA_T
rd = (n_s ** 2 - 1) * (n_s ** 2 + 2) / 3
h_fl = k0 ** 4 / (6 * np.pi) * rd ** 2 * kB * TF * BETA_T
dBm = 10 / np.log(10)
cmp("silica n at d (Malitson)", 1.45846, n_s, 1e-5); cmp("silica alpha' (A^3)", 2.957, alpha_s * 1e30, 1e-3)
cmp("independent-molecule extinction (/m)", 2.112e-2, h_ind, 2e-3); cmp("... in dB/km", 91.7, h_ind * dBm * 1e3, 2e-3)
cmp("S(0) = N kB Tf betaT (memory inputs)", 0.0309, S0, 2e-3)
cmp("fluctuation form (/m)", 2.337e-3, h_fl, 2e-3); cmp("... dB/(km um^4)", 1.21, h_fl * dBm * 1e3 * LAM_D ** 4, 5e-3)
cmp("actual/independent = S(0) L^4", 0.1107, h_fl / h_ind, 2e-3)
print(f" identity check: S(0) ((n^2+2)/3)^4 = {S0 * ((n_s ** 2 + 2) / 3) ** 4:.4f}")
# the vacuum medium at the record's spacing bound
k_grb = E_HI / hbarc_eVm
N_v = REC_A ** -3
print(f" vacuum medium: k = {k_grb:.3e} /m, ka = {k_grb * REC_A:.1e}, N = {N_v:.2e} /m^3, cT0 = {c * T[0]:.3e} m, cT3 = {c * T[3]:.3e} m")
print(" derivation: in bare-space units the medium has eps_r = 1/f and the bare wavenumber k_b = sqrt(f) w/c; a dipole radiating in a")
print(" medium of index n_b emits n_b times the vacuum power and the incident intensity carries the same n_b, so h = (k_b^4/6pi) <(d eps_r)^2> V,")
print(" identical to (k_wave^4/6pi) <(d eps/eps_total)^2> V with k_wave = w/c. Lorentz-Lorenz gives rho d eps_r/d rho = (eps_r-1)(eps_r+2)/3 [M].")
for f, th, ttau, tS, tmfp1, tmfp03 in ((0.25, 5.89e-10, 5.73e16, 1.7e-17, 1.70e9, 5.66e10), (0.085, 4.61e-9, 4.49e17, 2.2e-18, 2.17e8, 7.23e9)):
eps_r = 1 / f
rdv = (eps_r - 1) * (eps_r + 2) / 3
kb = np.sqrt(f) * k_grb
h_per_S = kb ** 4 / (6 * np.pi) * rdv ** 2 / N_v
# the same from point dipoles: N sigma L^4 with sigma = (8pi/3) k_b^4 alpha'^2, alpha' = 3 (1-f)/((1+2f) 4 pi N), L = (eps_r+2)/3
Lf = (eps_r + 2) / 3
alpha_v = 3 * (1 - f) / (1 + 2 * f) / (4 * np.pi * N_v)
h_dip = N_v * (8 * np.pi / 3) * kb ** 4 * alpha_v ** 2 * Lf ** 4
print(f" f = {f}: L = (eps_r+2)/3 = {Lf:.2f}, L^4 = {Lf ** 4:.0f}; fluctuation form {h_per_S:.3e} /m per unit S, dipole form {h_dip:.3e} /m (same);"
f" without the local-field factor it would be {h_per_S / Lf ** 4:.2e} /m")
cmp(f"f = {f}: extinction per unit S(0) (/m)", th, h_per_S, 3e-3)
cmp(f"f = {f}: optical depth per unit S over cT0", ttau, h_per_S * c * T[0], 3e-3)
cmp(f"f = {f}: S(0) bound with cT0", tS, 1 / (h_per_S * c * T[0]), 3e-2)
print(f" with the k^4 law weighted along the path, int (1+z)^3 dz/H (the photon was bluer earlier): bound S(0) < {1 / (h_per_S * c * T[3]):.1e}"
f" (tighter by {T[3] / T[0]:.2f}); with the light-travel distance cT_-1 only: {1 / (h_per_S * c * T[-1]):.1e}")
cmp(f"f = {f}: mean free path S = 1 (m)", tmfp1, 1 / h_per_S, 3e-3); cmp(f"f = {f}: mean free path S = 0.03 (m)", tmfp03, 1 / (0.03 * h_per_S), 3e-3)
print(f" = {1 / h_per_S / c:.1f} light-seconds (S = 1), {1 / (0.03 * h_per_S) / AU:.3f} AU (S = 0.03)")
ratio_f = lambda f: (1 - f) ** 2 * (1 + 2 * f) ** 2 / f ** 2
print(f" f-dependence: h proportional to (1-f)^2 (1+2f)^2 / f^2; ratio f = 0.085 to f = 1/4: {ratio_f(0.085) / ratio_f(0.25):.3f} (trial's numbers: {4.61e-9 / 5.89e-10:.3f})")
print(f" and proportional to a^3 at fixed S(0) (alpha' falls as 1/N while the number of scatterers rises as N). As f -> 0 the local field factor diverges.")
print("\n=== 6. A quantum lattice's zero-point density fluctuations (the reviewer's estimate) [S, D; order of magnitude] ===")
print(" Feynman's relation (from memory [S]): at small k a quantum solid or superfluid has S(k) = hbar k/(2 M c_s) at T = 0, from the f-sum rule")
print(" with one phonon branch; a classical lattice at T = 0 has S(k) = 0 away from Bragg peaks, and a thermal one S(0) = kB T/(M c_s^2).")
hk = hbar * k_grb
print(f" hbar k at 28 GeV = {hk:.3e} kg m/s. For S(k) < 2e-17: M c_s > {hk / (4e-17):.3f} kg m/s, i.e. M > {hk / (4e-17) / c:.2e} kg (c_s = c)"
f" = {hk / (4e-17) / c / M_PLANCK:.3f} Planck masses = {hk / (4e-17) / c * c ** 2 / e / 1e9:.1e} GeV")
for name, M_eV in (("Aspden's quon, 20.84 keV (level 0)", M_QUON_EV), ("the nesting rule's level-29 quon", M_LEVEL29_EV), ("the Planck mass", M_PLANCK * c ** 2 / e)):
M = M_eV * e / c ** 2
for cs_name, cs in (("c/2", c / 2), ("c", c)):
S = hk / (2 * M * cs)
note = " (hbar k >> M c_s: the one-phonon formula is out of range; a free quon recoils, S -> 1)" if hk > M * cs else ""
print(f" M = {M_eV:.3e} eV ({name}), c_s = {cs_name}: S(k) = {S:.2e}{note}")
# zero-point spread against the spacing (Lindemann): <u^2> = hbar/(2 M Omega) per axis with the hold as the frequency
for hold_name, hO_eV in (("the hold at 3e19 eV", 3e19), ("a Debye frequency pi c_s/a with c_s = c", np.pi * hbarc_eVm / REC_A)):
u2 = hbar / (2 * M * hO_eV * e / hbar)
print(f" zero-point spread with {hold_name} ({hO_eV:.1e} eV): u_rms = {np.sqrt(u2):.2e} m = {np.sqrt(u2) / REC_A:.1e} spacings")
print(f" thermal S(0) = kB T/(M c_s^2) at the CMB's 2.725 K with c_s = c: {kB * 2.725 / (M * c ** 2):.1e}")
print(" kinematics [S, D]: a photon at c can hand momentum hbar q to a lattice excitation of energy E(q) only if E(q)/(hbar q) <= c (Landau's")
print(" argument: c(|k| - |k'|) = E(q) and |k| - |k'| <= |k - k'| = q). So a lattice whose every excitation at these momenta costs more than")
print(" hbar q c passes: acoustic branches all faster than light (c_s > c), or no acoustic branch and a hold above the photon's energy")
print(f" ({E_HI * (1 + Z) / 1e9:.0f} GeV at emission; the record's hold is above 3e19 eV). An incompressible continuum (c_s -> infinity) passes either way.")
print("\n=== 7. The magnetic response and Fresnel drag [S, D] ===")
chi_req = f_glass - 1
N_e_tot = RHO_BK7 * 1e3 * NA * 0.5
chi_L = -mu0 * N_e_tot * e ** 2 * (0.7e-10) ** 2 / (6 * me)
cmp("required chi_m", -0.5653, chi_req, 1e-3); cmp("N_e total (/m^3)", 7.56e29, N_e_tot, 2e-3); cmp("Langevin chi", -2.2e-5, chi_L, 2e-2)
cmp("required/Langevin", 2.6e4, abs(chi_req / chi_L), 2e-2); cmp("required/water", 6.3e4, abs(chi_req / CHI_WATER), 2e-2)
cmp("(2 pi a/lam)^2", 1.1e-6, (2 * np.pi * 1e-10 / (LAM_D * 1e-6)) ** 2, 5e-2); cmp("alpha^2", 5.3e-5, alpha_fs ** 2, 2e-2)
print(" Fresnel drag with Lorentz's term: u = c/n + v (1 - 1/n^2 + (w/n) dn/dw) = c/n + v (1 - 1/n^2 - (lam/n) dn/dlam) [S];")
print(" derivation: the medium sees the lab's wave Doppler-shifted to w' = w(1 - n v/c), so c/n(w') = c/n + v (w/n) dn/dw to first order.")
for lam, who, tn, tfr, tdisp in ((0.526, "water 526 nm", 1.33563, 0.4394, 0.0165), (0.570, "water 570 nm", 1.33397, 0.4380, 0.0145)):
w = w_of_lam_um(lam)
nw = n_w(w, H2O_B, H2O_C)
disp = (w / nw) * d1(lambda x: n_w(x, H2O_B, H2O_C), w) # + (w/n) dn/dw, equal to -(lam/n) dn/dlam
cmp(f"{who}: n", tn, nw, 1e-5); cmp(f"{who}: 1 - 1/n^2", tfr, 1 - 1 / nw ** 2, 1e-3); cmp(f"{who}: dispersion term", tdisp, disp, 1e-2)
print(f" sign check: dn/dlam = {d1(lambda x: n_lam(x, H2O_B, H2O_C), lam):.4f} /um (negative, normal dispersion) -> term positive")
w = w_of_lam_um(LAM_D)
disp_bk7 = (w / nd) * d1(lambda x: n_w(x, BK7_B, BK7_C), w)
cmp("BK7 dispersion term", 0.0162, disp_bk7, 1e-2)
n526 = n_lam(0.526, H2O_B, H2O_C)
pred_fresnel = 4 * FIZ_L * FIZ_U * (n526 ** 2 - 1) / (c * FIZ_LAM)
pred_full = 4 * FIZ_L * FIZ_U * n526 ** 2 / (c * FIZ_LAM)
w526 = w_of_lam_um(0.526)
disp526 = (w526 / n526) * d1(lambda x: n_w(x, H2O_B, H2O_C), w526)
pred_lorentz = 4 * FIZ_L * FIZ_U * n526 ** 2 * (1 - 1 / n526 ** 2 + disp526) / (c * FIZ_LAM)
cmp("Fizeau: Fresnel displacement recomputed", 0.2088, pred_fresnel, 2e-3); cmp("Fizeau: full drag recomputed", 0.4751, pred_full, 2e-3)
print(f" Fizeau with Lorentz's dispersion term: {pred_lorentz:.4f} of a band (observed 0.23; the gap falls from {0.23 - pred_fresnel:.3f} to {0.23 - pred_lorentz:.3f})")
n_impl = 1 / np.sqrt(1 - FIZ_FRESNEL / FIZ_FULL)
c_impl = 4 * FIZ_L * FIZ_U * n_impl ** 2 / (FIZ_FULL * FIZ_LAM)
cmp("Fizeau's implied n", 1.3361, n_impl, 1e-4); cmp("Fizeau's implied c (m/s)", 3.101e8, c_impl, 1e-3)
n570 = n_lam(0.570, H2O_B, H2O_C)
w570 = w_of_lam_um(0.570)
disp570 = (w570 / n570) * d1(lambda x: n_w(x, H2O_B, H2O_C), w570)
print(f" Michelson-Morley: 0.434 +- 0.02 against Fresnel {1 - 1 / n570 ** 2:.4f} (gap {abs(MM_X - (1 - 1 / n570 ** 2)):.4f}) and Lorentz {1 - 1 / n570 ** 2 + disp570:.4f}"
f" (gap {abs(MM_X - (1 - 1 / n570 ** 2 + disp570)):.4f}): both inside +- 0.02. Their own (n^2-1)/n^2 with n^2 = 1.78 is {(MM_N2 - 1) / MM_N2:.4f}; they printed .437 (n = 4/3 gives {1 - 9 / 16:.4f}).")
cmp("relay drag (1 - f) v_lab, km/s", 277.37, 0.75 * V_LAB / 1e3, 1e-4)
print("\n=== 8. The front velocity and the spring [S, D] ===")
E_x = 1e4
n2m1 = eps_w(E_x * e / hbar, BK7_B, BK7_C) - 1
cmp("n - 1 at 10 keV (fit)", -1.421e-6, n2m1 / (1 + np.sqrt(1 + n2m1)), 2e-3)
hwp_all = hbar * np.sqrt(N_e_tot * e ** 2 / (eps0 * me)) / e
cmp("hbar w_p all electrons (eV)", 32.28, hwp_all, 2e-3); cmp("n - 1 at 10 keV (all electrons)", -5.210e-6, -(hwp_all / E_x) ** 2 / 2, 2e-3)
E01 = roots[-1]
K1 = me * (E01 * e / hbar) ** 2
cmp("K_1 (N/m)", 729.5, K1, 2e-3); cmp("e^2/(4 pi eps0 a0^3) (N/m)", 1556.9, e ** 2 / (4 * np.pi * eps0 * a0 ** 3), 1e-3)
cmp("sunlight shift (m)", 1.57e-19, e * E_SUN / K1, 5e-3)
print(f" Sellmeier terms -> 0 as w -> infinity: eps(1e6 x UV1) - 1 = {eps_w(1e6 * np.sqrt(wi2[0]), BK7_B, BK7_C) - 1:.1e}; the front travels at the bare speed [S].")
print("\n=== 9. Energy, from Brillouin's d(w eps)/dw [S] ===")
print(" u = (eps0 E0^2/4) [d(w eps_r)/dw + n^2]; the field's electric part 1, the magnetic n^2, the molecules' (eps_r - 1) + w d eps_r/dw.")
for lam, nm, tmol, tshare, tSu in ((LAM_C, "C", 1.3551, 0.2915, 0.65156), (LAM_D, "d", 1.3752, 0.2941, 0.64878), (LAM_F, "F", 1.4247, 0.3004, 0.64204),
(0.400, "400", 1.5066, 0.3106, 0.63127), (0.800, "800", 1.3304, 0.2884, 0.65503), (1.060, "1060", 1.3123, 0.2864, 0.65760)):
w = w_of_lam_um(lam)
n = n_w(w, BK7_B, BK7_C)
mol = d1(lambda x: x * eps_w(x, BK7_B, BK7_C), w) - 1
tot = 1 + n ** 2 + mol
cmp(f"molecules' energy ({nm})", tmol, mol, 1e-3); cmp(f"molecules' share ({nm})", tshare, mol / tot, 1e-3)
cmp(f"S/u in c ({nm})", tSu, 2 * n / tot, 1e-4); cmp(f"1/n_g ({nm})", tSu, 1 / n_group(lam, BK7_B, BK7_C), 1e-4)
# kinetic part: sum B_i y^2/(1-y^2)^2 (the oscillator decomposition is needed for the split; checked against the trial)
y2 = BK7_C / LAM_D ** 2
kin = np.sum(BK7_B * y2 / (1 - y2) ** 2); pot = np.sum(BK7_B / (1 - y2) ** 2)
cmp("kinetic/mechanical at d", 0.0271, kin / (pot + kin), 5e-3)
cmp("low-frequency share (n^2-1)/(2n^2)", 0.2827, (nd ** 2 - 1) / (2 * nd ** 2), 1e-3)
print(f" trial 3's (1 - f)/2: f = 0.25 -> {0.75 / 2:.3f}, f = 0.05 -> {0.95 / 2:.3f} (the record's 38% to 48%)")
print(" absorption [I -> S]:")
for lam, kk, tal, tT in ((0.300, 2.8607e-6, 1.1983e2, 0.3017), (0.400, 1.0227e-8, 3.2129e-1, 0.9968), (0.546, 6.9658e-9, 1.6032e-1, 0.9984),
(1.060, 1.0137e-8, 1.2017e-1, 0.9988), (2.500, 8.1300e-6, 4.0866e1, 0.6645)):
al = 4 * np.pi * kk / (lam * 1e-6)
cmp(f"alpha at {lam} um (/m)", tal, al, 1e-3); cmp(f"T(10 mm) at {lam} um", tT, np.exp(-0.01 * al), 1e-3)
n546 = n_lam(0.546, BK7_B, BK7_C)
cmp("k/(n-1) at 546 nm", 1.3e-8, 6.9658e-9 / (n546 - 1), 5e-2)
lam_grb = hc_eVum * 1e-6 / E_HI
cmp("k_vac bound at 28 GeV", 3.6e-44, lam_grb / (4 * np.pi * c * T[0]), 2e-2)
print(f" BK7's 0.70 dB/m at 546 nm over silica's Rayleigh floor {h_fl * dBm:.4f} dB/m (fluctuation form): {4 * np.pi * 6.9658e-9 / 0.546e-6 * dBm / (h_fl * dBm):.0f};"
f" over the measured 0.6 to 0.9 dB/(km um^4) (from memory) at 546 nm: {4 * np.pi * 6.9658e-9 / 0.546e-6 * dBm / (0.9e-3 / 0.546 ** 4):.0f} to {4 * np.pi * 6.9658e-9 / 0.546e-6 * dBm / (0.6e-3 / 0.546 ** 4):.0f}")
print("\n=== 10. The one-oscillator relay form [D] ===")
for f in (0.0, 0.25):
x = 0.01
n = np.sqrt(f + (1 - f) / (1 - x ** 2))
ng = d1(lambda xx: xx * np.sqrt(f + (1 - f) / (1 - xx ** 2)), x)
print(f" f = {f}: n_g - 1 = {ng - 1:.6e} against (3/2)(1-f)x^2 = {1.5 * (1 - f) * x ** 2:.6e}: rel diff {abs((ng - 1) / (1.5 * (1 - f) * x ** 2) - 1):.1e}")
print(f" f = 0 exact: n_g = (1 - x^2)^(-3/2); at x = 0.241: {(1 - x2 ** 2) ** -1.5:.4f}")
print("\n=== Summary ===")
bad = [r for r in results if not r[4]]
print(f" {len(results) - len(bad)} of {len(results)} compared numbers agree within tolerance.")
for r in bad:
print(f" DIFF: {r[0]}: trial {r[1]:.6g}, mine {r[2]:.6g}, rel {r[3]:.1e}")