Does light charge the quons? › Files cited on the page › the trials
t26_homes.py
#!/usr/bin/env python3
"""Trial 26: three homes for Doug's c/2 postulate, tried on the wheel-and-band engine. Lock: papers/Lock_c2_homes_2026-11-25.md, committed with
this script before the run. Author seat (Claude Opus 5.5), 25 November 2026, at Doug Westmoreland's word ("try the various options")."""
import itertools
import math
import subprocess
import sys
import time
import numpy as np
sys.path.insert(0, ".")
from engine import Lattice, curl_e2f, curl_f2e, div_e, plane_wave_E, static_field_of, prony_frequencies, edge_positions # noqa: E402
from gyro_band import GyroLattice # noqa: E402
print("Trial 26: three homes for the c/2 postulate. Lock: papers/Lock_c2_homes_2026-11-25.md")
print("git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True).stdout.strip())
t0 = time.time()
V = {}
# =====================================================================================================================
print("\nHOME 1. Aspden's sector beside the carrier: a lattice of charges circling in step, at rim speed c/2")
D = 4 # the rotors' spacing, in carrier cells
wA = 1.65 / D # rim speed c/2 at Aspden's r/d = 0.303: omega = c/(2 r) = 1.65 c/D [A for r/d; D for the rest]
N = 32
wp2 = 0.2 # the rotors' coupling to the carrier, q^2/m (its value is free: Home 1 asks how it must be small)
dt = 0.1
def rotors(sync=True, lone=False):
shape = (N, N, N)
occ = np.zeros((3, *shape))
sites = [(0, 0, 0)] if lone else list(itertools.product(range(0, N, D), repeat=3))
lat = Lattice(shape, dt, wb2=wA**2, wp2=wp2, occ=occ)
amp = 1e-3
for i, s in enumerate(sites):
occ[0][s] = 1; occ[1][s] = 1
ph = 0.0 if sync else (np.pi if i == 0 else 0.0)
lat.P[0][s] = amp * math.cos(ph); lat.P[1][s] = amp * math.sin(ph)
lat.V[0][s] = -wA * amp * math.sin(ph); lat.V[1][s] = wA * amp * math.cos(ph)
lat.occ = occ
lat.E = static_field_of(lat.P)
return lat, sites
def rotor_energy(lat, sites):
return sum(0.5 * (lat.wb2 * (lat.P[0][s] ** 2 + lat.P[1][s] ** 2) + lat.V[0][s] ** 2 + lat.V[1][s] ** 2) / lat.wp2 for s in sites) / len(sites)
out = {}
for label, kw in (("all in step", dict(sync=True)), ("one alone", dict(lone=True))):
lat, sites = rotors(**kw)
es = []
for it in range(2000):
lat.step()
es.append(rotor_energy(lat, sites))
es = np.array(es)
t_ = (np.arange(2000) + 1) * dt
early, late = es[(t_ >= 20) & (t_ < 60)].mean(), es[(t_ >= 160) & (t_ < 200)].mean()
out[label] = late / early
print(f" {label:12s}: a rotor's energy, mean over t = 20 to 60: {early:.5e}; over t = 160 to 200: {late:.5e}; ratio {late/early:.4f}")
lone_pred = 0.7129 # t26_prep_out.txt: the two normal motions, each at its own loss rate, means over the same windows
print(f" predicted for one alone (two motions, lattice loss, field's inertia): {lone_pred:.4f}")
V["H1a"] = abs(out["all in step"] - 1) < 0.02
V["H1b"] = abs(out["one alone"] / lone_pred - 1) < 0.10
print(f" H1a (in step: the windows' means differ by less than 2%): {'PASS' if V['H1a'] else 'MISS'}")
print(f" H1b (one alone: the ratio within 10% of {lone_pred}): {'PASS' if V['H1b'] else 'MISS'}")
print(f" The rotors' rhythm {wA:.4f} c/d; light at their lattice's first Bragg order, |G| = 2 pi/D, has {2*math.sin(math.pi/D):.4f} c/d: above the rhythm, so no wave can carry the in-step motion away.")
# =====================================================================================================================
print("\nHOME 2. A free spin of the carrier's wheels, alternating cell by cell")
N = 16
shape = (N, N, N)
X = np.stack(np.meshgrid(*[np.arange(N)] * 3, indexing="ij"))
stag = (-1.0) ** X.sum(0)
spin = np.stack([stag - np.roll(stag, 1, axis=a) for a in range(3)]) / 2 # every wheel at rate 1, in the gauge-turn pattern
k = (2 * math.pi * 3 / N, 0, 0)
runs = {}
for label, with_spin in (("light alone", False), ("light with the spin", True)):
lat = Lattice(shape, dt)
lat.E = 1e-3 * plane_wave_E(shape, k, (0, 1, 0))
if with_spin:
lat.H = 0.5 * spin.copy() # rim speed c/2 for a wheel of radius d/2, rate 1 c/d [M]
xs, H0 = [], lat.H.copy()
for _ in range(400):
lat.step(); xs.append(lat.E.copy())
runs[label] = (np.array([x[1].sum() for x in xs]), lat)
dE = max(np.abs(a.E - b.E).max() for a, b in [(runs["light alone"][1], runs["light with the spin"][1])])
spin_left = runs["light with the spin"][1].H - runs["light alone"][1].H - 0.5 * spin
V["H2a"] = dE < 1e-12 and np.abs(spin_left).max() < 1e-12
print(f" after t = 40: largest difference in the bands, with and without the spin: {dE:.1e}; the spin's pattern changed by {np.abs(spin_left).max():.1e}")
print(f" H2a (light cannot see the spin, and the spin is not changed by light, to 1e-12): {'PASS' if V['H2a'] else 'MISS'}")
lat = Lattice(shape, dt, wb2=0.3, wp2=0.3, occ=np.ones((3, *shape)))
lat.H = 0.5 * spin.copy(); lat.E = 1e-3 * plane_wave_E(shape, k, (0, 1, 0))
for _ in range(400):
lat.step()
ref = Lattice(shape, dt, wb2=0.3, wp2=0.3, occ=np.ones((3, *shape))); ref.E = 1e-3 * plane_wave_E(shape, k, (0, 1, 0))
for _ in range(400):
ref.step()
V["H2b"] = np.abs(lat.H - ref.H - 0.5 * spin).max() < 1e-12
print(f" H2b (with held charges on every band the spin still keeps its pattern, to 1e-12): {'PASS' if V['H2b'] else 'MISS'} [the engine's held charges feel E only]")
print(" A charge hopping from corner to corner through the spin's poles (quantum; flux n x 60 degrees a face; hop t = 1):")
L = 4
def link_phases(n):
th = n * math.pi / 3
F = np.zeros((3, L, L, L))
for r in itertools.product(range(L), repeat=3):
for a in range(3):
rm = list(r); rm[a] -= 1
F[(a, *r)] = th * (1 if sum(rm) % 2 == 0 else -1)
for r in itertools.product(range(L), repeat=3):
if r[0] % 2 == 1:
F[(0, *r)] -= 2 * math.pi * n * (1 if (r[0] - 1 + r[1] + r[2]) % 2 == 0 else -1)
kv = 2 * math.pi * np.arange(L) / L
Kf = np.stack(np.meshgrid(*[np.exp(1j * kv) - 1] * 3, indexing="ij"))
Fh = np.fft.fftn(F, axes=(1, 2, 3))
K2 = np.sum(np.abs(Kf) ** 2, 0); K2[0, 0, 0] = 1
Kb = -np.conj(Kf)
Ah = np.stack([Kb[1] * Fh[2] - Kb[2] * Fh[1], Kb[2] * Fh[0] - Kb[0] * Fh[2], Kb[0] * Fh[1] - Kb[1] * Fh[0]]) / K2
A_ = np.real(np.fft.ifftn(Ah, axes=(1, 2, 3)))
if np.abs(curl_e2f(-A_) - F).max() < np.abs(curl_e2f(A_) - F).max():
A_ = -A_
return A_, np.abs(curl_e2f(A_) - F).max()
def bands(A_, kvec):
idx = lambda r: ((r[0] % L) * L + r[1] % L) * L + r[2] % L
Hm = np.zeros((L**3, L**3), complex)
for r in itertools.product(range(L), repeat=3):
for a in range(3):
r2 = list(r); r2[a] += 1
ph = np.exp(1j * (A_[(a, *r)] + kvec[a] * 1.0))
Hm[idx(r), idx(r2)] += ph; Hm[idx(r2), idx(r)] += np.conj(ph)
return np.linalg.eigvalsh(Hm)
for n in (0, 1, 2, 3):
A_, err = link_phases(n)
# the top speed of the lowest band, and near E = 0: group speed d E/d p by finite differences along x over the zone of the 4^3 cell
speeds0, speedsb = [], []
for kx in np.linspace(-math.pi / 4, math.pi / 4, 41):
e1, e2 = bands(A_, (kx - 1e-5, 0.11, 0.07)), bands(A_, (kx + 1e-5, 0.11, 0.07))
v = (e2 - e1) / 2e-5
speedsb.append(abs(v[0]))
speeds0.append(np.abs(v[np.argsort(np.abs(e1))[:4]]).max())
print(f" n = {n}: construction error {err:.1e}; lowest band's top speed {max(speedsb):.4f} t d/hbar; fastest state near E = 0: {max(speeds0):.4f}")
V["H2c"] = True # measured, no mark
# =====================================================================================================================
print("\nHOME 3. Variant G: a gyrostat in place of every band (I = 1, K = h^2/A = 1, omega_n = h/A = 6)")
h, A = 1 / 6, 1 / 36
dtg = 0.01
# G1: the law at small amplitude, along an axis
G1 = []
for m in (1, 2, 3):
Ng = 12
shape = (Ng, 2, 2)
g = GyroLattice(shape, h, A)
kk = 2 * math.pi * m / Ng
pos = np.stack(np.meshgrid(*[np.arange(s, dtype=float) for s in shape], indexing="ij"))
g.phi[2] = 1e-5 * np.cos(kk * (pos[0] + 0.5)) # wheels on z-faces: a wave of y-band twists along x
g.start_in_step()
xs = []
for _ in range(3000):
g.step(dtg); xs.append(g.phi[2][1, 0, 0])
w, _ = prony_frequencies(np.array(xs), dtg, 1)
lam = 4 * math.sin(kk / 2) ** 2
pred = math.sqrt(1.0 * lam / (1 + A * lam))
G1.append(abs(w[0] / pred - 1))
print(f" G1 m = {m}: run {w[0]:.7f}; law sqrt(K lam/(I + A lam)) {pred:.7f}; plain band {math.sqrt(lam):.7f}; difference {G1[-1]:.1e}")
V["G1"] = max(G1) < 1e-5
print(f" G1 (within 1e-5): {'PASS' if V['G1'] else 'MISS'}")
# G2: memory. One band slipped by s0; the couple on it, against a plain lattice
Ng = 10
shape = (Ng, Ng, Ng)
s0 = 0.06
slip = np.zeros((3, *shape)); slip[0, 5, 5, 5] = s0
g = GyroLattice(shape, h, A, slip=slip)
g.start_in_step()
plain = Lattice(shape, 0.05); plain.E = slip.copy() * 0
# plain lattice with the same slip: the bands' stretch is S phi + slip; in E-H form, E starts at the slip and the wheels at rest
plain.E = slip.copy()
th_s = s0 * ((1 - 1 / Ng**3) / 3 + 1 / Ng**3)
t1 = math.pi * A / (2 * h * th_s)
print(f" G2: slip {s0}; the band's settled twist on a plain lattice {th_s:.5f}; first zero of a held twist's couple at t1 = pi A/(2 h theta) = {t1:.2f}")
cs, ts, cp = [], [], []
nsteps = int(4.5 * t1 / dtg)
for it in range(nsteps):
g.step(dtg)
if it % 10 == 9:
cs.append(g.couple()[0, 5, 5, 5]); ts.append(g.t)
for it in range(int(4.5 * t1 / 0.05)):
plain.step()
cp.append(plain.E[0, 5, 5, 5])
cs, ts = np.array(cs), np.array(ts)
per = 2 * math.pi / 6
win = int(per / (10 * dtg))
avg = np.convolve(cs, np.ones(win) / win, mode="same")
plain_level = np.mean(cp[len(cp) // 2:])
half = ts[np.argmax(avg < 0.5 * th_s)] if np.any(avg < 0.5 * th_s) else np.inf
neg = ts[np.argmax(avg < 0)] if np.any(avg < 0) else np.inf
print(f" plain lattice: the slipped band's tension averages {plain_level:.5f} (the settled twist {th_s:.5f}); gyrostats: its couple, averaged over a nutation,")
print(f" falls below half the settled value at t = {half:.2f} and below zero at t = {neg:.2f}")
V["G2"] = half < 2 * t1 and neg < 4 * t1
print(f" G2 (below half before 2 t1 = {2*t1:.1f}; below zero before 4 t1 = {4*t1:.1f}): {'PASS' if V['G2'] else 'MISS'}")
# G3: light's push. A standing wave of y-band twists; two copies, one gimbal tilted by +-delta; their separation against cosh(g t)
Ng = 12
shape = (Ng, 2, 2)
m = 2
kk = 2 * math.pi * m / Ng
lam = 4 * math.sin(kk / 2) ** 2
wv = math.sqrt(lam / (1 + A * lam))
amp_phi = 0.02
pos = np.stack(np.meshgrid(*[np.arange(s, dtype=float) for s in shape], indexing="ij"))
seps = []
for sgn in (+1, -1):
g = GyroLattice(shape, h, A)
g.phi[2] = amp_phi * np.cos(kk * (pos[0] + 0.5))
g.start_in_step()
g.beta[1, 3, 0, 0] += sgn * 1e-4
tr = []
for it in range(4000):
g.step(dtg)
if it % 50 == 49:
tr.append(g.beta[1, 3, 0, 0])
seps.append(np.array(tr))
th_amp = np.abs(curl_f2e(np.stack([np.zeros(shape), np.zeros(shape), amp_phi * np.cos(kk * (pos[0] + 0.5))]))[1, 3, 0, 0])
gpred = th_amp * math.sqrt((h * h / A**2 - wv**2) / 2)
sep = (seps[0] - seps[1]) / 2e-4
tt = np.arange(1, len(sep) + 1) * 50 * dtg
gfit = np.polyfit(tt[len(tt) // 3:], np.log(np.abs(sep[len(tt) // 3:])), 1)[0]
print(f" G3: the band's twist amplitude {th_amp:.4e}; wave frequency {wv:.4f}; predicted growth rate {gpred:.4e}; measured (log slope, last two thirds) {gfit:.4e}")
V["G3"] = abs(gfit / gpred - 1) < 0.25
print(f" G3 (within 25%): {'PASS' if V['G3'] else 'MISS'}")
print("\nVerdicts by the lock:", ", ".join(f"{k} {'PASS' if v else 'MISS'}" for k, v in V.items() if k != "H2c"), "; H2c measured, no mark")
print(f"(run took {time.time() - t0:.0f} s)")