Does light charge the quons? › Files cited on the page › the trials

relay_stiffness.py

In the investigation at sim/charge_wave/relay_stiffness.py · last changed in commit 9fb66a7, 12 November 2026 · 11,678 bytes · runnable copies in the scripts zip


"""relay_stiffness.py - trial 2 of the charging-quons work (lock: papers/Lock_relay_stiffness_2026-11-12.md).

Can opposite charge around each quon give the relay of section 7 its stiffness across the beam? A numerical check of
derivations, not a candidate mechanism. Units as in lattice_dynamics.py (Gaussian lattice units): spacing d = 1,
charge q = 1, inertia 1, Coulomb energy 1/r, so w_p^2 = 4 pi n q^2/m = 4 pi on the simple cubic lattice. The opposite
charge is held fixed; its uniform part is the jellium's own background, and only the remainder is added to D(k).
Run: ~/aspden-review-venv/bin/python3 relay_stiffness.py > relay_stiffness_out.txt
"""
import itertools, math
import numpy as np
from scipy.special import erfc

# ---------------- copied unchanged from lattice_dynamics.py (the record's Ewald dynamical matrices) ----------------
ETA = 1.9            # Ewald splitting parameter (lattice units); results do not depend on it (checked below)
NR, NG = 5, 5        # real-space and reciprocal-space shells

R = np.array([v for v in itertools.product(range(-NR, NR + 1), repeat=3) if v != (0, 0, 0)], float)
G = 2 * np.pi * np.array([v for v in itertools.product(range(-NG, NG + 1), repeat=3)], float)

def hess_short(Rv, eta=ETA):
    """d_a d_b [erfc(eta r)/r] at each lattice vector (array n x 3 x 3)."""
    r = np.linalg.norm(Rv, axis=1)
    ex = np.exp(-(eta * r) ** 2) * 2 * eta / math.sqrt(math.pi)
    f1 = -erfc(eta * r) / r**2 - ex / r                       # f'
    f2 = 2 * erfc(eta * r) / r**3 + ex * (2 / r**2 + 2 * eta**2)  # f''
    xx = np.einsum('ni,nj->nij', Rv, Rv) / r[:, None, None] ** 2
    return (f2 - f1 / r)[:, None, None] * xx + (f1 / r)[:, None, None] * np.eye(3)

H_S = hess_short(R)

def dyn(k, eta=ETA):
    """Dynamical matrix D(k) of a simple cubic lattice of point charges in a rigid uniform neutralising background:
    D = (4 pi/3) I - S(k), S(k) = sum_{R != 0} d_a d_b (1/R) exp(i k.R), evaluated by Ewald summation."""
    k = np.asarray(k, float)
    s_real = np.einsum('n,nij->ij', np.cos(R @ k), H_S if eta == ETA else hess_short(R, eta))
    K = G + k
    K2 = np.einsum('ni,ni->n', K, K)
    m = K2 > 1e-12
    s_rec = -np.einsum('n,ni,nj->ij', 4 * np.pi * np.exp(-K2[m] / (4 * eta**2)) / K2[m], K[m], K[m])
    s_self = 4 * eta**3 / (3 * math.sqrt(math.pi)) * np.eye(3)
    return (4 * np.pi / 3) * np.eye(3) - (s_real + s_rec + s_self)

def dyn_bcc(k, eta=1.6, n=5):
    a1, a2, a3 = np.array([-.5, .5, .5]), np.array([.5, -.5, .5]), np.array([.5, .5, -.5])   # cube side 1, 2 sites
    A = np.array([a1, a2, a3]); vol = abs(np.linalg.det(A))
    Rb = np.array([i*a1 + j*a2 + l*a3 for i, j, l in itertools.product(range(-n, n+1), repeat=3) if (i, j, l) != (0, 0, 0)])
    B = 2*np.pi*np.linalg.inv(A).T
    Gb = np.array([i*B[0] + j*B[1] + l*B[2] for i, j, l in itertools.product(range(-n, n+1), repeat=3)])
    k = np.asarray(k, float)
    s_real = np.einsum('n,nij->ij', np.cos(Rb @ k), hess_short(Rb, eta))
    K = Gb + k; K2 = np.einsum('ni,ni->n', K, K); m = K2 > 1e-12
    s_rec = -np.einsum('n,ni,nj->ij', 4*np.pi/vol*np.exp(-K2[m]/(4*eta**2))/K2[m], K[m], K[m])
    s_self = 4*eta**3/(3*math.sqrt(math.pi))*np.eye(3)
    return (4*np.pi/(3*vol))*np.eye(3) - (s_real + s_rec + s_self), 4*np.pi/vol
# ---------------- end of the copy ----------------

wp2 = 4 * np.pi
def show(tag, text, val="", unit=""):
    print(f"  {tag:4s} {text:<88s} {val:>22s} {unit}")

def TL(D, axis=0):
    """longitudinal (along x) and transverse (y) entries for k along x, in units of w_p^2"""
    return D[axis, axis] / wp2, D[(axis + 1) % 3, (axis + 1) % 3] / wp2

k0 = [1e-4, 0, 0]
print("C1  Uniform continuum (the record's jellium): D(k -> 0 along [100]) / w_p^2")
L1, T1 = TL(dyn(k0))
show("1", "longitudinal (expect 1, Part 1A W3 line 5), transverse (expect 0, line 6)", f"{L1:.8f} {T1:+.2e}")

print("\nC2  Gaussian clouds of charge -1, rms width w per axis, one on each simple cubic site (held fixed)")
print("       w     rho_at (real sum)   added Hessian/w_p^2 (recip.)   (rho_at-1)/3     D_T         D_L       (rho_at+2)/3  max off-diag")
mG = 14
Gc = 2 * np.pi * np.array([v for v in itertools.product(range(-mG, mG + 1), repeat=3) if v != (0, 0, 0)], float)
Gc2 = np.einsum('ni,ni->n', Gc, Gc)
Rc = np.array(list(itertools.product(range(-8, 9), repeat=3)), float)
Rc2 = np.einsum('ni,ni->n', Rc, Rc)
worst2 = 0.0
def rho_at(w):
    return float(np.sum(np.exp(-Rc2 / (2 * w * w)))) / ((2 * np.pi) ** 1.5 * w ** 3)
for w in (0.1, 0.2, 0.25, 0.3, 0.5, 1.0):
    Hc = np.einsum('n,ni,nj->ij', 4 * np.pi * np.exp(-Gc2 * w * w / 2) / Gc2, Gc, Gc)
    ra = rho_at(w)
    D = dyn(k0) + Hc
    L, T = TL(D)
    off = np.max(np.abs(Hc - np.diag(np.diag(Hc)))) / wp2
    worst2 = max(worst2, abs(T - (ra - 1) / 3), abs(L - (ra + 2) / 3), abs(Hc[0, 0] - Hc[1, 1]) / wp2)
    print(f"     {w:4.2f}   {ra:16.8f}   {Hc[0,0]/wp2:22.8f}   {(ra-1)/3:16.8f} {T:11.8f} {L:11.8f} {(ra+2)/3:12.8f}  {off:.1e}")
show("1", "largest disagreement with the rule (D_T, D_L, isotropy)", f"{worst2:.2e}")

print("\nC3  Point charges at no quon's site (the opposite charge in a finer lattice, held fixed), by Ewald sums")
def hess_points(pos, qs, eta):
    """Hessian at the origin of the potential of the periodic point charges qs at pos (+ the uniform background that
    cancels their mean: the G = 0 term omitted)."""
    H = np.zeros((3, 3))
    for p, qv in zip(pos, qs):
        vecs = np.array([-(p + Rv) for Rv in itertools.product(range(-NR, NR + 1), repeat=3)], float)
        H += qv * hess_short(vecs, eta).sum(axis=0)
    Gn = G[np.einsum('ni,ni->n', G, G) > 1e-12]; Gn2 = np.einsum('ni,ni->n', Gn, Gn)
    phase = np.zeros(len(Gn))
    for p, qv in zip(pos, qs):
        phase += qv * np.cos(Gn @ p)
    H += -np.einsum('n,ni,nj->ij', 4 * np.pi * phase * np.exp(-Gn2 / (4 * eta**2)) / Gn2, Gn, Gn)
    return H
worst3 = 0.0
for s in (3, 2):
    ax = (np.arange(s) + 0.5) / s
    pos = np.array(list(itertools.product(ax, ax, ax)))
    qs = np.full(len(pos), -1.0 / s**3)
    for eta in (1.9, 2.4):
        Hp = hess_points(pos, qs, eta)
        L, T = TL(dyn(k0) + Hp)
        worst3 = max(worst3, abs(T + 1/3), abs(L - 2/3))
        show(f"{s}", f"s = {s}: {s**3} charges -1/{s**3} at {', '.join(f'{x:.4f}' for x in ax)} per axis; eta = {eta}: D_L, D_T",
             f"{L:+.8f} {T:+.8f}")
    show("", f"   added Hessian / w_p^2 (expect -1/3 on the diagonal, 0 off it)", f"{Hp[0,0]/wp2:+.8f} {np.max(np.abs(Hp-np.diag(np.diag(Hp))))/wp2:.1e}")
show("4", "largest disagreement with the rule (D_T = -1/3, D_L = 2/3)", f"{worst3:.2e}")
show("5", "a negative D_T means the transverse long wave grows by itself: the lattice polarizes spontaneously", "")

print("\nC4  Stability: the cloud adds (rho_at - 1)/3 = f to every eigenvalue, so the relay is stable only if f >= -lowest")
grid = np.linspace(-np.pi, np.pi, 17)[:-1] + np.pi / 16
wmin_sc = 1e9; neg = 0; tot = 0
for kx, ky, kz in itertools.product(grid, grid, grid):
    w = np.linalg.eigvalsh(dyn([kx, ky, kz])) / wp2
    tot += 3; neg += int((w < 0).sum()); wmin_sc = min(wmin_sc, w[0])
pts = {"X": (np.pi, 0, 0), "M": (np.pi, np.pi, 0), "R": (np.pi, np.pi, np.pi)}
sym = {p: np.linalg.eigvalsh(dyn(v)) / wp2 for p, v in pts.items()}
show("1", "simple cubic: lowest eigenvalue on the 16^3 grid; unstable fraction of grid modes (U28: 0.184)", f"{wmin_sc:+.5f} {neg/tot:.3f}")
for p in pts:
    show("", f"   at {p}: eigenvalues", " ".join(f"{x:+.5f}" for x in sym[p]))
lam_min_sc = min(wmin_sc, *(sym[p][0] for p in pts))
wmin_b = 1e9
for kx, ky, kz in itertools.product(grid, grid, grid):
    Db, wpb = dyn_bcc([kx*2, ky*2, kz*2])
    wmin_b = min(wmin_b, np.linalg.eigvalsh(Db)[0] / wpb)
show("2", "bcc: lowest eigenvalue on the same grid (U28 step 4: +0.003)", f"{wmin_b:+.5f}")
show("3", "so the least f for a stable cloud relay: simple cubic, bcc", f"{-lam_min_sc:.4f} {max(0.0, -wmin_b):.4f}")

print("\nC5  The jellium's transverse eigenvalues at short waves, lambda_T = beta (k d_n)^2, d_n = n^(-1/3)")
dirs = {"[100]": np.array([1., 0, 0]), "[110]": np.array([1., 1, 0]) / math.sqrt(2), "[111]": np.ones(3) / math.sqrt(3)}
betas = {}
for latt in ("sc", "bcc"):
    dn = 1.0 if latt == "sc" else 2 ** (-1 / 3)
    for name, kh in dirs.items():
        row = []
        for kdn in (0.02, 0.05):
            kv = kh * kdn / dn
            if latt == "sc":
                ev, vec = np.linalg.eigh(dyn(kv)); ev = ev / wp2
            else:
                Db, wpb = dyn_bcc(kv); ev, vec = np.linalg.eigh(Db); ev = ev / wpb
            tr = [i for i in range(3) if abs(vec[:, i] @ kh) < 0.5]          # the two transverse modes
            row.append([ev[i] / kdn**2 for i in tr])
        betas[(latt, name)] = row
        show("1", f"{latt:3s} {name}: beta of the two transverse modes at k d_n = 0.02 | 0.05",
             " ".join(f"{b:+.5f}" for b in row[0]) + " | " + " ".join(f"{b:+.5f}" for b in row[1]))
b_sc = max(abs(b) for (l, nm), row in betas.items() if l == "sc" for b in row[0])
b_bcc = max(abs(b) for (l, nm), row in betas.items() if l == "bcc" for b in row[0])
show("2", "largest |beta| at k d_n = 0.02: simple cubic, bcc", f"{b_sc:.5f} {b_bcc:.5f}")
print("       consequence: the relay's group speed changes by 3 beta (k d_n)^2 / (2 f); the nearest-neighbour relay's")
print("       coefficient is 1/8, so the record's GRB 090510 bound on the spacing (2.26e-26 m, cube axis, limit (a))")
print("       scales by sqrt(f/(12 |beta|)):")
print("          f        3|beta|/(2f), bcc    spacing bound, bcc (m)    3|beta|/(2f), sc    spacing bound, sc (m)")
for f in (1.0, 0.1, 0.01, 1e-4, 1e-8):
    print(f"       {f:7.0e}      {3*b_bcc/(2*f):12.4e}          {2.26e-26*math.sqrt(f/(12*b_bcc)):12.3e}        {3*b_sc/(2*f):12.4e}       {2.26e-26*math.sqrt(f/(12*b_sc)):12.3e}")

print("\nC6  The Gaussian width on the simple cubic lattice with rho_at = 4 (light at c with f = 1)")
lo, hi = 0.1, 0.5
for _ in range(60):
    mid = (lo + hi) / 2
    lo, hi = (mid, hi) if rho_at(mid) > 4 else (lo, mid)
show("1", "w / d (rms per axis)", f"{(lo+hi)/2:.5f}")

print("\nC7  A quon whose own charge moves like a conducting sphere of Aspden's radius b")
bd = 0.036135562     # b/d (aether_units.py U05)
na = 4 * np.pi * bd**3
u = na / 3
eq = 3 * u / (1 - u)
show("1", "n alpha / eps_b = 4 pi (b/d)^3", f"{na:.4e}")
show("2", "with Clausius-Mossotti, eps_q / eps_b", f"{eq:.4e}")
show("3", "section 7 relay speed with f = 1 (eps_b = eps0), v/c = 1/sqrt(eps_q/eps_b)", f"{1/math.sqrt(eq):.2f}")

print("\nC8  Charge moved per quon in sunlight (the quons supply eps0; the charge moved half a spacing [M])")
c = 299792458.0; eps0 = 8.8541878128e-12; e = 1.602176634e-19
E = math.sqrt(1361 / (c * eps0))
show("1", "E_rms for 1361 W/m^2 (solar constant, from memory)", f"{E:.1f}", "V/m")
for d, name in ((6.374e-13, "Aspden's spacing"), (9.3e-27, "level 29 for s = 3")):
    dq = 2 * eps0 * E * d * d
    show("2", f"{name}, d = {d:.3e} m: delta q", f"{dq:.3e} C = {dq/e:.2e} e")

print("\nThe excess needed at the quon for light at c, rho_at/rho_mean = 1 + 3f, and the gap between the speed of light and")
print("the speed from electrical measurements, sqrt(1 + f) - 1 (light sees eps0, Coulomb's law eps0 (1 + f)):")
for f in (1.0, 0.1, 0.093, 0.01, 1e-4, 1e-8):
    print(f"       f = {f:7.1e}:  rho_at/rho_mean = {1+3*f:.6g};  gap = {math.sqrt(1+f)-1:.3e}")
ok = worst2 < 1e-6 and worst3 < 1e-6 and abs(lam_min_sc + 0.093) < 1e-3 and abs(wmin_b - 0.003) < 1e-3
print(f"\nPass criteria (C1 to C3 to 1e-6, C4 within 1e-3 of U28): {'all met' if ok else 'NOT MET'}"
      f"  (C1 transverse {T1:+.1e}; C2 {worst2:.1e}; C3 {worst3:.1e}; C4 {lam_min_sc:+.4f}, {wmin_b:+.4f})")