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

margins.py

In the investigation at sim/charge_wave/check_lattices_fable/margins.py · last changed in commit cae720f, 13 November 2026 · 1,756 bytes · the folder as a zip


"""Edge margins: for each passing row of run 3, how far the finer quons nearest the quon's edge sit from it, in finer
spacings, against the radius a smaller-copy finer quon would have (b/d = 0.036 finer spacings). Rows with a margin below
about one such radius depend on the finer quons' shape (as section 9.1 says of sc 24 and 25)."""
import re, sys, numpy as np
sys.argv = [sys.argv[0]]
import my_lattices as M
B = M.B
EW = {k: M.Ewald(k) for k in M.KINDS}
kind = None
print("lattice  N   alpha   site                 n   nearest shell inside (dist, count, margin)   nearest shell outside (dist, count, margin)  share")
for line in open("../cubic_lattices_out.txt", encoding="utf-8"):
    m = re.match(r"^  (sc|bcc|fcc) \(stability needs", line)
    if m: kind = m.group(1)
    m = re.match(r"\s+(\d+)\s+(\d\.\d{4})\s+(.+?)\s+(\d+)\s+([+-]\d+\.\d{4}) ([+-]\d+\.\d{4}) ([+-]\d+\.\d{4})\s+(\d\.\d{3})\s+(ok|MISS)\s+(pass|fail)", line)
    if m and kind and m.group(10) == "pass":
        N, nm, n, share = int(m.group(1)), m.group(3).strip(), int(m.group(4)), m.group(8)
        ew = EW[kind]; a = B * N
        if nm not in M.SPECIAL[kind]: continue
        v = np.array(M.SPECIAL[kind][nm], float) * ew.a
        r = np.sort(np.linalg.norm(ew.R - v, axis=1))
        ins = r[r < a]; out = r[r >= a]
        di = ins[-1] if len(ins) else float('nan'); ci = int(np.sum(np.abs(ins - di) < 1e-6)) if len(ins) else 0
        do = out[0]; co = int(np.sum(np.abs(out - do) < 1e-6))
        flag = "  <-- within one finer-quon radius (0.036) of the edge" if min(a - di, do - a) < 0.04 else ""
        print(f"{kind:5s} {N:3d}  {a:.4f}  {nm:20s} {n:3d}   ({di:.4f}, {ci:2d}, {a - di:+.4f})                     ({do:.4f}, {co:2d}, {do - a:+.4f})   {share}{flag}")