Does light charge the quons? › Files cited on the page › check_trials25-27_fable/

a1_laws.py

In the investigation at sim/m8_engine/check_trials25-27_fable/a1_laws.py · last changed in commit 46c285d, 25 November 2026 · 4,512 bytes · the folder as a zip


"""A1 (blind): the engine's stepped law for one plane wave, by hand and against the engine.
Thirty-fifth reviewer, 25 November 2026. Imports engine.py; all else is my own.

By hand [D]. The leapfrog centres every difference (H, V at half steps; E, P at whole steps), so for e^{i(k.r - w t)}
every time derivative gives -i Om, Om = (2/dt) sin(w dt/2), and the forward/backward pair of space differences gives
-Kt^2, Kt^2 = sum_a 4 sin^2(k_a/2). Transverse wave:
  (i)   empty:                     Om^2 = Kt^2
  (ii)  a held charge on every band (occ = 1, hold wb2, wp2 = q^2/m):
        P = wp2 E/(wb2 - Om^2), D = E + P, Om^2 (1 + wp2/(wb2 - Om^2)) = Kt^2,
        i.e. Om^4 - Om^2 (wb2 + wp2 + Kt^2) + Kt^2 wb2 = 0: two branches (a polariton), gap between sqrt(wb2) and sqrt(wb2 + wp2).
        Longitudinal: Om^2 = wb2 + wp2 at every k.
  (iii) free charges (wb2 = 0):    Om^2 = Kt^2 + wp2 (and the longitudinal plasma line Om^2 = wp2).
Note for (ii): the medium's resonance is the bare hold wb2, not the lone charge's wb2 + wp2/3; with every band filled
the Lorentz field of the others (+P/3) and the self-field (-P/3) cancel exactly, so eps(Om) = 1 + wp2/(wb2 - Om^2) = 1 + alpha_b/(1 - Om^2/wb2).
"""
import subprocess, sys, time
import numpy as np

sys.path.insert(0, "/home/doug/aetherscience.org/aspden-investigation/sim/m8_engine")
import engine as eng

print("git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True,
                                  cwd="/home/doug/aetherscience.org/aspden-investigation").stdout.strip())
print("clock:", time.strftime("%Y-%m-%d %H:%M:%S %Z"))

N, dt = 32, 0.1
shape = (N, N, N)


def law_w(Om):
    """Real frequency the run shows for a lattice frequency Om (invert Om = (2/dt) sin(w dt/2))."""
    return 2 / dt * np.arcsin(dt * Om / 2)


def run_and_measure(m, wb2, wp2, occ_all, nfreq, steps=600):
    k = (2 * np.pi * m / N, 0.0, 0.0)
    Kt2 = 4 * np.sin(k[0] / 2) ** 2
    occ = np.ones((3, *shape)) if occ_all else None
    L = eng.Lattice(shape, dt, wb2=wb2, wp2=wp2, occ=occ)
    L.E = 1e-3 * eng.plane_wave_E(shape, k, (0, 0, 1))
    probe = (2, 0, 5, 7)   # x = 0: cos(0) = 1, never a node (my first probes at x = 3 and x = 2 sat on nodes for some m)
    x = []
    for _ in range(steps):
        x.append(L.E[probe])
        L.step()
    w, _ = eng.prony_frequencies(np.array(x), dt, nfreq)
    return Kt2, np.sort(w)


print("\n(i) empty lattice: k = (2 pi m/N, 0, 0), pol z, N = 32, dt = 0.1")
print(f"{'m':>3} {'Kt^2':>10} {'w by hand':>12} {'w engine':>12} {'diff':>10}")
for m in (1, 2, 4, 8, 12):
    Kt2, w = run_and_measure(m, 0.0, 0.0, False, 1)
    wh = law_w(np.sqrt(Kt2))
    print(f"{m:>3} {Kt2:>10.6f} {wh:>12.8f} {w[0]:>12.8f} {w[0]-wh:>10.2e}")

wb2, wp2 = 0.2, 0.5
print(f"\n(ii) a held charge on every band: wb2 = {wb2}, wp2 = {wp2}; two branches")
print(f"{'m':>3} {'Kt^2':>10} {'w- hand':>12} {'w- engine':>12} {'w+ hand':>12} {'w+ engine':>12}")
for m in (1, 2, 4, 8):
    Kt2, w = run_and_measure(m, wb2, wp2, True, 2, steps=1500)
    b = wb2 + wp2 + Kt2
    Om2 = np.array([(b - np.sqrt(b * b - 4 * Kt2 * wb2)) / 2, (b + np.sqrt(b * b - 4 * Kt2 * wb2)) / 2])
    wh = law_w(np.sqrt(Om2))
    print(f"{m:>3} {Kt2:>10.6f} {wh[0]:>12.8f} {w[0]:>12.8f} {wh[1]:>12.8f} {w[1]:>12.8f}")
print(f"gap by hand: sqrt(wb2) = {np.sqrt(wb2):.6f} to sqrt(wb2+wp2) = {np.sqrt(wb2+wp2):.6f}")

wp2 = 0.5
print(f"\n(iii) free charges on every band: wb2 = 0, wp2 = {wp2}")
print(f"{'m':>3} {'Kt^2':>10} {'w by hand':>12} {'w engine':>12} {'diff':>10}")
for m in (1, 2, 4, 8):
    Kt2, w = run_and_measure(m, 0.0, wp2, True, 1, steps=800)
    wh = law_w(np.sqrt(Kt2 + wp2))
    print(f"{m:>3} {Kt2:>10.6f} {wh:>12.8f} {w[0]:>12.8f} {w[0]-wh:>10.2e}")
print("cutoff by hand: sqrt(wp2) =", np.sqrt(wp2))

# Longitudinal check for (ii): E along x varying along x (curl-free), every band held.
print("\n(ii) longitudinal mode, every band held: expect Om^2 = wb2 + wp2 at every k")
wb2, wp2 = 0.2, 0.5
for m in (1, 4):
    k = (2 * np.pi * m / N, 0.0, 0.0)
    L = eng.Lattice(shape, dt, wb2=wb2, wp2=wp2, occ=np.ones((3, *shape)))
    L.E = 1e-3 * eng.plane_wave_E(shape, k, (1, 0, 0))
    x = []
    for _ in range(600):
        x.append(L.E[(0, 2, 5, 7)]); L.step()
    w, _ = eng.prony_frequencies(np.array(x), dt, 1, with_zero=True)   # E = E0 - P oscillates about a constant
    print(f"  m = {m}: w engine = {w[0]:.8f}, by hand {law_w(np.sqrt(wb2 + wp2)):.8f}")
print("clock:", time.strftime("%Y-%m-%d %H:%M:%S %Z"))