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

fig_relay_in_time.py

In the investigation at sim/charge_wave/fig_relay_in_time.py · last changed in commit e881255, 12 November 2026 · 2,843 bytes · runnable copies in the scripts zip


"""fig_relay_in_time.py - the figure for section 8.3 of the charging-quons paper, from trial 3's case B
(relay_in_time_B.npz, written by relay_in_time.py). Plots only; no new results.
Run: ~/aspden-review-venv/bin/python3 fig_relay_in_time.py   (writes ../../papers/figures/fig-relay-in-time.png)
"""
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt

d = np.load("relay_in_time_B.npz")
t, E1, P1, tc1, w0 = d["t"], d["E1"], d["P1"], float(d["tc1"]), float(d["w0"])
T = 2 * np.pi / w0                                   # the light's period
s = (t - tc1) / T                                    # time in periods, 0 at the pulse's centre
x = P1 / np.max(np.abs(P1))                          # the quon's stretch, largest = 1
e = E1 / np.max(np.abs(E1))                          # the field at the quon, largest = 1
env = np.exp(-((t - tc1) ** 2) / (2 * 500.0**2))     # the beam's envelope (sigma = 500 = 5 periods)

fig, ax = plt.subplots(2, 1, figsize=(10, 7.2), gridspec_kw={"height_ratios": [1.1, 1]})
a = ax[0]
m = np.abs(s) <= 30
a.plot(s[m], x[m], color="#2471a3", lw=0.5)
a.plot(s[m], env[m], color="#777", lw=1, ls="--")
a.plot(s[m], -env[m], color="#777", lw=1, ls="--")
a.axhline(0, color="#ddd", lw=1, zorder=0)
a.set_xlim(-30, 30); a.set_ylim(-1.15, 1.15)
a.set_xlabel("time, in periods of the light (0 = the middle of the light pulse)")
a.set_ylabel("stretch of the quon's charge\n(largest = 1)")
a.set_title("(a) One quon as a pulse of light passes: its charge stretches one way, then the other, at the light's\n"
            "frequency, and is back to rest when the pulse has gone (dashed: the pulse's envelope)", fontsize=10, loc="left")
a.text(17, 0.55, "after the pulse:\nbelow 10⁻¹⁰ of its peak", fontsize=9, color="#444")
b = ax[1]
z = np.abs(s) <= 1.5
b.plot(s[z], e[z], color="#ca6f1e", lw=2.2, label="electric field of the light at the quon")
b.plot(s[z], x[z], color="#2471a3", lw=1.3, ls="--", label="stretch of the quon's charge")
b.axhline(0, color="#ddd", lw=1, zorder=0)
b.set_xlim(-1.5, 1.5); b.set_ylim(-1.15, 1.55)
b.set_xlabel("time, in periods of the light")
b.set_ylabel("each scaled to\nits largest = 1")
b.set_title("(b) Three periods at the middle of the pulse: the stretch follows the field, in step with it", fontsize=10, loc="left")
b.legend(loc="upper center", ncol=2, fontsize=9, frameon=False)
fig.text(0.01, 0.005, "Trial 3, case B (sim/charge_wave/relay_in_time.py): all four of Maxwell's equations in one dimension. The quons carry three\n"
         "quarters of light's ε₀ (f = 0.25), and their own frequency is ten times the light's (ω_r = 10ω₀).",
         fontsize=8, color="#555")
plt.tight_layout(rect=(0, 0.04, 1, 1))
plt.savefig("../../papers/figures/fig-relay-in-time.png", dpi=150)
print("wrote papers/figures/fig-relay-in-time.png")