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

check_35th_g3.py

In the investigation at sim/m8_engine/check_35th_g3.py · last changed in commit 46c285d, 25 November 2026 · 1,594 bytes · runnable copies in the scripts zip


#!/usr/bin/env python3
"""The author seat's check of the thirty-fifth reviewer's F2 (G3' in trial 27): the growth rate read two ways from the same kind of run. Post hoc; not a trial."""
import math
import subprocess
import sys

import numpy as np

sys.path.insert(0, ".")
from engine import curl_f2e  # noqa: E402
from gyro_band import GyroLattice  # noqa: E402

print("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))
th_amp = abs(curl_f2e(np.stack([np.zeros(shp), np.zeros(shp), phi_z]))[1, 1, 0, 0])
wv = math.sqrt(4 * math.sin(kk / 2) ** 2 / (1 + A * 4 * math.sin(kk / 2) ** 2))
law = th_amp * math.sqrt((h * h / A**2 - wv**2) / 2)
tr = []
for sgn in (+1, -1):
    g = GyroLattice(shp, h, A); g.phi[2] = phi_z.copy(); g.start_in_step(); g.beta[1, 1, 0, 0] += sgn * 1e-4
    x = []
    for it in range(4000):
        g.step(dtg)
        if it % 50 == 49:
            x.append(g.beta[1, 1, 0, 0])
    tr.append(np.array(x))
sep = (tr[0] - tr[1]) / 2e-4
t = np.arange(1, len(sep) + 1) * 0.5
slope = np.polyfit(t[len(t) // 3:], np.log(np.abs(sep[len(t) // 3:])), 1)[0]
ac = np.arccosh(np.clip(np.abs(sep), 1, None))
acs = np.polyfit(t[len(t) // 3:], ac[len(t) // 3:], 1)[0]
print(f"law {law:.4e}; log-slope (last two thirds) {slope:.4e} = {slope/law:.3f} of the law; acosh reading {acs:.4e} = {acs/law:.3f} of the law")