Does light charge the quons? › Files cited on the page › check_m8_fable/

a7b_cm_samples.py

In the investigation at sim/light_ether_review/check_m8_fable/a7b_cm_samples.py · last changed in commit 18dc38d, 23 November 2026 · 1,046 bytes · the folder as a zip


#!/usr/bin/env python3
"""A7 (blind), part 2: is the small-f residual against Clausius-Mossotti a disorder fluctuation? Average over samples."""
import subprocess, numpy as np
print("git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True).stdout.strip())
src = open("a7_matter_on_lattice.py").read()
ns = {}
exec(src.split("# (i) one dipole")[0].replace('print("git HEAD:"', 'pass #'), ns)
exec(src[src.index("def solve_eps"):src.index("rng = np.random")], ns)
solve_eps, cm, N = ns["solve_eps"], ns["cm"], ns["N"]
for f in (0.05, 0.2):
    res = []
    for seed in range(6):
        rng = np.random.default_rng(100 + seed)
        mask = (rng.uniform(size=(N, N, N)) < f).astype(float); fa = mask.mean()
        a = 0.1; a_iso = a / (1 + a / 3)
        eps, _ = solve_eps(mask, a)
        res.append((eps - cm(fa * a_iso)) / (fa * a_iso)**2)
    res = np.array(res)
    print(f"f = {f}: residual/(f a_iso)^2 over 6 samples: mean {res.mean():+.4f}, std {res.std(ddof=1):.4f}, values {np.round(res, 3).tolist()}")