Does light charge the quons? › Files cited on the page › the trials
t27_g3_posthoc.py
#!/usr/bin/env python3
"""POST HOC (after trial 27's G3' miss), not locked, not a trial: what twist does the watched band really feel, and does the single-gyrostat law hold
when that band's own measured twist is used? Author seat, 25 November 2026."""
import math
import subprocess
import sys
import numpy as np
sys.path.insert(0, ".")
from engine import curl_f2e, prony_frequencies # noqa: E402
from gyro_band import GyroLattice # noqa: E402
print("POST HOC diagnostic of trial 27's G3'. git HEAD:", subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True).stdout.strip())
h, A, dtg = 1 / 6, 1 / 36, 0.01
Ng, m = 12, 2
shp = (Ng, 2, 2)
kk = 2 * math.pi * m / Ng
pos = np.stack(np.meshgrid(*[np.arange(q, dtype=float) for q in shp], indexing="ij"))
phi_z = 0.02 * np.cos(kk * (pos[0] + 0.5))
g = GyroLattice(shp, h, A); g.phi[2] = phi_z.copy(); g.start_in_step()
th, b = [], []
for it in range(4000):
g.step(dtg)
th.append(curl_f2e(g.phi)[1, 1, 0, 0]); b.append(g.beta[1, 1, 0, 0])
th, b = np.array(th), np.array(b)
w, _ = prony_frequencies(th[:2000], dtg, 1)
print(f" the band's twist: rms {np.sqrt(np.mean(th**2)):.4e} (a cos: amplitude {np.sqrt(2*np.mean(th**2)):.4e}); first half's frequency {w[0]:.5f}; max |twist| {np.abs(th).max():.4e}")
print(f" its gimbal's angle: mean over the run {b.mean():+.3e}, rms {np.sqrt(np.mean(b**2)):.3e}")
# the same gimbal law with the band's twist PRESCRIBED as recorded: the single-gyrostat drift rate
a_eff = np.sqrt(2 * np.mean(th**2))
print(f" single-gyrostat law with that amplitude and frequency: g = {a_eff*math.sqrt((h*h/A**2 - w[0]**2)/2):.4e}")
# every y-band's twist amplitude along x (where the drift law would put the fastest gimbals)
amps = [np.abs(curl_f2e(np.stack([np.zeros(shp), np.zeros(shp), phi_z]))[1, x, 0, 0]) for x in range(Ng)]
print(" starting twist amplitude of each y-band along x:", " ".join(f"{v:.4f}" for v in amps))