Does light charge the quons? › Files cited on the page › check_trial23_fable/
tuned_cancellation.py
#!/usr/bin/env python3
"""Trial 23, level 2: how far can the grain's advance cancel the resonance's delay?
29th reviewer (Fable 5.2, maximum effort), post hoc, own code. Nothing is imported from the trial.
Written while the report was being drafted, to correct one line of report_numbers_out.txt (line 77:
'relaxed by at most 1.89 over all directions'). That line tuned the spacing for S = 1/3; it is not the best tuning.
To order E^2 (report_numbers_out.txt, section 3):
n^2 - 1 = h2 x^2 [1 + c_n t], x = E/E2, t = 2 xi^2/h2, xi = E2 d/(hbar c) [D]
c_n = B (1 - f)^2/(8 pi), B = b1 + (b2 + b3 S)/f [D: my lattice sums]
S = sum_j (a_j e_j)^2 runs from 0 to 1/2 over directions a and polarizations e.
The bracket is what is left of the resonance term. Limit (e) is two-sided, so the hold bound goes as sqrt(|bracket|).
If the bound must hold for every direction and polarization, the best spacing makes the largest |bracket| smallest.
"""
import math
import subprocess
import sys
LATTICES = { # b1, b2, b3 from dipole_lattice_bravais_out.txt, section 2
"simple cubic": (-1.891532, +0.164847, -1.770000),
"body-centred cubic": (-1.925641, -0.294623, +0.510296),
"face-centred cubic": (-1.925521, -0.298704, +0.530757),
}
checks = [0, 0]
def check(ok, text, detail=""):
checks[1] += 1
checks[0] += bool(ok)
print(f" CHECK {'pass' if ok else 'FAIL'}: {text} {detail}")
def c_n(lat, f, S):
b1, b2, b3 = LATTICES[lat]
return (b1 + (b2 + b3 * S) / f) * (1 - f) ** 2 / (8 * math.pi)
def worst(lat, f, t, n=201):
"""Largest |1 + c_n t| over S in [0, 1/2] (c_n is linear in S, so the ends decide; the grid is a check of that)."""
return max(abs(1 + c_n(lat, f, 0.5 * i / (n - 1)) * t) for i in range(n))
def main():
head = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True).stdout.strip()
print("Trial 23, level 2: the best tuned cancellation of grain against resonance. 29th reviewer, post hoc.")
print(f"git HEAD: {head} ; python {sys.version.split()[0]}")
print("\n1. Best tuning when the bound must hold for every direction and polarization (S from 0 to 1/2)")
print(" " + f"{'lattice':<21}{'f':<7}{'c_n(S=0)':<11}{'c_n(S=1/2)':<12}{'best xi':<9}{'left over':<11}{'hold bound relaxed by':<22}")
for lat in LATTICES:
for f in (0.25, 0.085):
h2 = 1 - f
c0, c1 = c_n(lat, f, 0.0), c_n(lat, f, 0.5)
if c0 < 0 and c1 < 0: # both ends advance: balance the two ends
t_best = 2 / (abs(c0) + abs(c1))
left = abs(abs(c0) - abs(c1)) / (abs(c0) + abs(c1))
else: # one end is a delay: the grain adds there, and no spacing helps
t_best, left = 0.0, 1.0
# brute force over t, independent of the closed form
ts = [i * 1e-3 for i in range(0, 400001)]
vals = [worst(lat, f, t, n=3) for t in ts]
i_min = min(range(len(ts)), key=vals.__getitem__)
scan_left = vals[i_min]
xi = math.sqrt(t_best * h2 / 2)
relax = 1 / math.sqrt(left)
print(" " + f"{lat:<21}{f:<7.3f}{c0:<+11.5f}{c1:<+12.5f}{xi:<9.3f}{left:<11.4f}{relax:<22.3f}")
check(abs(scan_left - left) < 2e-4, "a scan over the spacing finds the same least left-over", f"({scan_left:.4f} at t = {ts[i_min]:.3f})")
check(abs(worst(lat, f, t_best) - left) < 1e-12 if t_best else True, "the ends of the S range decide (201-point grid in S)")
print("\n2. The line this corrects (report_numbers_out.txt, line 77): body-centred, f = 0.25, tuned for S = 1/3")
lat, f = "body-centred cubic", 0.25
t13 = -1 / c_n(lat, f, 1 / 3)
r0, r1 = 1 + c_n(lat, f, 0.0) * t13, 1 + c_n(lat, f, 0.5) * t13
print(f" xi = {math.sqrt(t13 * (1 - f) / 2):.3f}: left over {r0:+.3f} (S = 0) to {r1:+.3f} (S = 1/2); relaxed by {1 / math.sqrt(max(abs(r0), abs(r1))):.2f}.")
check(abs(r0 + 0.281) < 1e-3 and abs(r1 - 0.140) < 1e-3, "the earlier line's -0.281 and +0.140 are reproduced")
print(" That tuning is not the best one. Section 1's is: the earlier 'at most 1.89' is superseded.")
print("\n3. One burst is one direction")
print(" Along a cube axis S = 0 for both polarizations; along a cube diagonal S = 1/3 for both.")
print(" For a burst that happens to lie along such a direction the E^2 term can cancel completely at one spacing;")
print(" the E^4 terms then decide. They are not computed here.")
print(f"\nChecks: {checks[0]} of {checks[1]} pass.")
if __name__ == "__main__":
main()