Does light charge the quons? › Files cited on the page › the trials
slow_light_figure.py
#!/usr/bin/env python3
"""Trial 24: the reading version of the figure (post hoc layout only). Every point and every number is the locked script's;
helium's intercepts get their own axis so that nothing is dropped and the rest can be read."""
import importlib.util
import os
import sys
import numpy as np
sys.dont_write_bytecode = True
HERE = os.path.dirname(os.path.abspath(__file__))
spec = importlib.util.spec_from_file_location("m", os.path.join(HERE, "slow_light_zero_pressure.py"))
m = importlib.util.module_from_spec(spec)
spec.loader.exec_module(m)
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
COL = {"nitrogen": "#2a78d6", "argon": "#1baf7a", "helium": "#eda100"}
MK = {"nitrogen": "o", "argon": "s", "helium": "^"}
INK, MUT, GRID, RED = "#1d1d1f", "#5f6368", "#e4e4e8", "#c43a39"
plt.rcParams.update({"font.family": "DejaVu Sans", "font.size": 11, "axes.edgecolor": MUT, "axes.labelcolor": INK, "xtick.color": MUT, "ytick.color": MUT})
def style(a):
a.grid(True, color=GRID, lw=0.8)
a.set_axisbelow(True)
for s in ("top", "right"):
a.spines[s].set_visible(False)
out = m.part_a(quiet=True)
S = m.summary(out)
fig = plt.figure(figsize=(13, 19))
g0 = fig.add_gridspec(3, 2, height_ratios=[1.05, 1.0, 1.35], width_ratios=[1.35, 1], hspace=0.34, wspace=0.28)
a, z = fig.add_subplot(g0[0, 0]), fig.add_subplot(g0[0, 1])
for q in (a, z):
style(q)
for g in m.GASES:
T, p, r, iso = m.load(g)
s = iso == 20
c, _, _ = m.fit(T[s], p[s], r[s], 293.15, m.PRIMARY[g])
co = list(c[:-1]) + [0] * (3 - len(c[:-1]))
rr = np.linspace(0, r[s].max(), 300)
pp = co[0] * rr + co[1] * rr**2 + co[2] * rr**3 + c[-1]
for q in (a, z):
q.plot(pp / 1e3, rr * 1e4, color=COL[g], lw=2)
q.plot(p[s] / 1e3, r[s] * 1e4, MK[g], ms=6, color=COL[g], mec="white", mew=0.5, label=f"{g}: {s.sum()} points" + (" (raw, 3.5% low)" if g == "helium" else ""))
a.annotate(g, (p[s].max() / 1e3, r[s].max() * 1e4), xytext=(7, 0), textcoords="offset points", va="center", color=INK)
a.set_xlim(-10, 590); a.set_ylim(-0.4, 14.6); z.set_xlim(-3, 100); z.set_ylim(-0.1, 2.9)
for q in (a, z):
q.plot([0], [0], "D", color=INK, ms=8, zorder=5, clip_on=False)
q.set_xlabel("pressure (kPa)")
a.set_ylabel("slowing of the crests, n − 1 (parts in 10,000)")
a.legend(frameon=False, loc="upper left")
z.annotate("vacuum: the instrument's\nown reference, so zero\nby construction", (1, 0.03), xytext=(48, 0.55), color=INK, va="center", arrowprops=dict(arrowstyle="-", color=MUT))
z.annotate("lines: the fits,\ncarried past the\nlast point to zero", (20, 0.53), xytext=(4, 2.0), color=INK, va="center", arrowprops=dict(arrowstyle="-", color=MUT))
a.set_title("1. Measured slowing of light in three gases (NIST, 20 °C)", loc="left", color=INK, fontsize=13)
z.set_title("the same, near zero pressure", loc="left", color=INK, fontsize=12)
b, h = fig.add_subplot(g0[1, 0]), fig.add_subplot(g0[1, 1])
for q in (b, h):
style(q)
q.axvline(0, color=INK, lw=1.3)
y, yt = 0, []
for g in ("nitrogen", "argon"):
y0 = y
for w in out[g]:
b.errorbar(w[1] * 1e10, y, xerr=2 * w[3] * 1e10, fmt=MK[g], ms=6, color=COL[g], elinewidth=1.6)
y += 1
yt.append(((y0 + y - 1) / 2, f"{g}, nine\ntemperatures"))
y += 0.6
b.errorbar(S[g][0] * 1e10, y, xerr=2 * S[g][1] * 1e10, fmt="D", ms=9, color=COL[g], mec=INK, elinewidth=4)
yt.append((y, f"{g}, combined"))
y += 2.2
A20 = out["nitrogen"][0][5]
b.errorbar(0.108 / A20 * 1e10, y, xerr=2 * 0.006 / A20 * 1e10, fmt="v", ms=10, color=RED, elinewidth=2); yt.append((y, "GAMOR 2019, cause unknown\n(bar: scatter only)")); y += 2.2
b.errorbar(0, y, xerr=0.002 / A20 * 1e10, fmt="|", ms=16, color=INK, elinewidth=6); yt.append((y, "NIST 2016 (limit)"))
b.set_yticks([t[0] for t in yt]); b.set_yticklabels([t[1] for t in yt]); b.invert_yaxis()
b.set_xlabel("slowing left at zero pressure (parts in 10¹⁰), bars 2σ")
b.set_title("2. What is left when the fits reach zero pressure", loc="left", color=INK, fontsize=13)
for i, w in enumerate(out["helium"]):
h.errorbar(w[1] * 1e10, i, xerr=2 * w[3] * 1e10, fmt="^", ms=7, color=COL["helium"], elinewidth=1.8)
h.set_yticks(range(9)); h.set_yticklabels([f"{w[0]} °C" for w in out["helium"]]); h.invert_yaxis()
h.set_xlabel("the same, for helium (wider scale)")
h.set_title("helium (NIST: hot, it soaks into the glass)", loc="left", color=INK, fontsize=12)
c = fig.add_subplot(g0[2, :])
style(c)
P = np.logspace(5.2, -12, 200)
c.loglog(P, [m.ciddor(0.633, x, 20, True) * m.C for x in P], color=COL["nitrogen"], lw=3)
for x, t, off in ((101325.0, "1 atmosphere: 84 km/s", (12, 4)), (1.0, "1 Pa: 0.83 m/s", (12, 6)), (1e-7, "10⁻⁷ Pa (good lab vacuum): 8 × 10⁻⁸ m/s", (-14, -16)), (1e-10, "10⁻¹⁰ Pa (best vacuum): 8 × 10⁻¹¹ m/s", (12, 8))):
v = m.ciddor(0.633, x, 20, True) * m.C
c.plot([x], [v], "o", color=COL["nitrogen"], ms=9)
c.annotate(t, (x, v), xytext=off, textcoords="offset points", ha="right" if off[0] < 0 else "left", color=INK)
kT = 1.380649e-23 * 293.15
w_ = 2 * np.pi * m.C / 633e-9
pe = m.E**2 / (2 * m.EPS0 * m.ME * w_**2)
pH = 4.5 * 4 * np.pi * 5.29177210903e-11**3 / 2
for k, nH, ne, ha, dx in (("between the planets", 0, 5e6, "left", 12), ("between the stars", 1e6, 3e4, "left", 12), ("between the galaxies", 0, 0.25, "right", -12)):
x = max((nH + ne) * kT, 1.2e-21)
v = (nH * pH + ne * pe) * m.C
c.plot([x], [v], "s", color="#4a3aa7", ms=10)
c.annotate(f"{k}: {v:.0e} m/s", (x, v), xytext=(dx, 4), textcoords="offset points", ha=ha, color=INK)
for d, t, left in ((1.3e-6 + 5.4e-6, "electrons against light (1973)", 0), (2e-7, "electrons against gamma rays (1974)", 0), (3 * 3600 / (168000 * 365.25 * 86400), "supernova neutrinos against light (1987)", 0),
(1.2e-11, "electrons at LEP against light (2009)", 0), (7e-16, "gravity waves against light (2017)", 0), (4e-24, "cosmic rays against light", 1)):
c.axhline(d * m.C, color=RED, lw=1.3, ls=(0, (5, 4)))
c.annotate(f"{t}: under {d*m.C:.0e} m/s", (1.6e5 if left else 2e-21, d * m.C), xytext=(0, 4), textcoords="offset points", ha="left" if left else "right", fontsize=10, color=MUT)
c.set_xlim(4e5, 1e-21); c.set_ylim(1e-21, 1e7)
c.set_xlabel("pressure (Pa), falling to the right. Space is placed at the pressure its density would have at 20 °C")
c.set_ylabel("how much a light signal slows (m/s)")
c.set_title("3. The prediction, 0.83 m/s per pascal of air. Dashed: limits on any slowing of the vacuum itself\n (light timed against things that are not light; blind to a slowing that matter shares)", loc="left", color=INK, fontsize=13)
fn = os.path.join(m.ROOT, "papers/figures/fig-slow-light-reading.png")
fig.savefig(fn, dpi=130, bbox_inches="tight", facecolor="white")
print(fn)