From e5e8adc8a7658c1586dbe9f6fb130141f14c185b Mon Sep 17 00:00:00 2001 From: SethulekshmiBeena Date: Fri, 23 Oct 2026 19:18:52 +0100 Subject: [PATCH 1/2] Make README math render correctly on GitHub Inline math with escapes, subscripts or adjacent punctuation now uses $`...`$; the 2000-2800 range sits in a single math span; z_* to z_\ast. No change to content, numbers or citations. --- README.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 00d304e..7004f51 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,16 @@ When is the cosmic microwave background actually emitted, and how thick is the "surface" it comes from? This project is my attempt to answer that from first principles, by following the -free-electron fraction of the Universe, $x_e(z)$, through hydrogen recombination. +free-electron fraction of the Universe, $`x_e(z)`$, through hydrogen recombination. I started with the Saha equation, which is the textbook answer, and quickly found that it puts last -scattering at $z \approx 1280$, about 200 in redshift too early. The reason is that recombination is +scattering at $`z \approx 1280`$, about 200 in redshift too early. The reason is that recombination is a bottleneck rather than an equilibrium process. An electron captured straight into the ground state emits a photon that ionises the next atom, and Lyman-α photons are trapped by resonant scattering. So I implemented the Peebles three-level atom, in which hydrogen reaches the ground state only through two slow channels: Lyman-α photons redshifting out of the line, and the two-photon 2s→1s decay. From -the resulting $x_e(z)$ I compute the Thomson scattering rate, the optical depth $\tau(z)$ and the -visibility function $g(z)$, which is the probability distribution for when a CMB photon last scattered. +the resulting $`x_e(z)`$ I compute the Thomson scattering rate, the optical depth $\tau(z)$ and the +visibility function $`g(z)`$, which is the probability distribution for when a CMB photon last scattered. Everything uses Planck 2018 parameters, and I check each step against CAMB, which uses the RECFAST recombination code. @@ -38,33 +38,33 @@ alone. | | This work | CAMB 2.0.5 (RECFAST) | Difference | |---|---|---|---| -| Last-scattering redshift $z_*$ ($\tau = 1$) | 1089.44 | 1089.89 | −0.45 | -| Peak of $g(z)$, per unit redshift | 1078.80 | 1078.37 | +0.43 | +| Last-scattering redshift $`z_\ast`$ ($`\tau = 1`$) | 1089.44 | 1089.89 | −0.45 | +| Peak of $`g(z)`$, per unit redshift | 1078.80 | 1078.37 | +0.43 | | Peak of visibility, per unit conformal time | 1089.11 | 1088.78 | +0.32 | -| Width of last scattering (FWHM of $g$) | 203.3 | 204.0 | −0.7 | -| $z_{\rm dec}$, where $\Gamma_T = H$ | 903.2 | 903.6 | −0.4 | -| Residual ionisation $x_e(z = 200)$ | 3.85 × 10⁻⁴ | 3.38 × 10⁻⁴ | +14% | -| Residual ionisation $x_e(z = 0)$ | 2.67 × 10⁻⁴ | 1.74 × 10⁻⁴ | +53% | +| Width of last scattering (FWHM of $`g`$) | 203.3 | 204.0 | −0.7 | +| $`z_{\rm dec}`$, where $`\Gamma_T = H`$ | 903.2 | 903.6 | −0.4 | +| Residual ionisation $`x_e(z = 200)`$ | 3.85 × 10⁻⁴ | 3.38 × 10⁻⁴ | +14% | +| Residual ionisation $`x_e(z = 0)`$ | 2.67 × 10⁻⁴ | 1.74 × 10⁻⁴ | +53% | -For comparison, Saha alone gives $z_* = 1291$. +For comparison, Saha alone gives $`z_\ast = 1291`$. The last-scattering numbers agree with CAMB to better than one unit of redshift. That's because the Peebles model tracks RECFAST to within about 2% between $z \approx 1000$ and 1500, which is where $\tau$ builds up. The late-time residual ionisation is a different story: my model is 14% high at -$z = 200$. I think this comes from two simplifications rather than a bug. First, a three-level atom +$`z = 200`$. I think this comes from two simplifications rather than a bug. First, a three-level atom recombines too slowly at late times, which is why RECFAST introduced a fudge factor; with their $F = 1.14$ my value drops to within 1% of CAMB. Second, I assume the gas stays at the radiation -temperature, while in reality it cools faster below $z \sim 300$. Helium is the other visible gap. -I treat it in Saha equilibrium, so at $z \approx 2000$–2800 my $x_e$ is up to 6% lower than CAMB's, +temperature, while in reality it cools faster below $`z \sim 300`$. Helium is the other visible gap. +I treat it in Saha equilibrium, so at $`z \approx 2000\text{–}2800`$ my $`x_e`$ is up to 6% lower than CAMB's, where helium recombination is delayed. -A detail worth pointing out: the familiar "$z \approx 1090$" is not where $g(z)$ peaks when you +A detail worth pointing out: the familiar "$`z \approx 1090`$" is not where $g(z)$ peaks when you plot it per unit redshift. That peak is at 1079. The 1090 comes from the $\tau = 1$ definition, or from the visibility per unit conformal time. I report all three in the table, and [`docs/theory.md`](docs/theory.md#63-which-redshift-of-last-scattering) explains why they differ. -To make sure my optical-depth integrator wasn't hiding errors, I also fed CAMB's own $x_e(z)$ into -it. It recovers CAMB's internal $z_* = 1089.892$ to within 0.01. +To make sure my optical-depth integrator wasn't hiding errors, I also fed CAMB's own $`x_e(z)`$ into +it. It recovers CAMB's internal $`z_\ast = 1089.892`$ to within 0.01. ## How it's organised @@ -84,8 +84,8 @@ archive/ my original scripts, kept as they were ``` The derivations in [`docs/theory.md`](docs/theory.md) go from the Boltzmann distribution to the Saha -equation, then through the rate balance for the $n = 2$ level to the Peebles equation and the $C_r$ -factor, and finally to $\tau(z)$ and $g(z)$. I've tried to state each approximation at the point +equation, then through the rate balance for the $n = 2$ level to the Peebles equation and the $`C_r`$ +factor, and finally to $\tau(z)$ and $`g(z)`$. I've tried to state each approximation at the point where it's made. ## Running it @@ -116,10 +116,10 @@ print(ls.z_tau_one(), ls.z_peak(), ls.fwhm()[0]) # 1089.44 1078.80 203.33 ## How I tested it The tests check things that physics says must be true: -- $x_e \to 1$ at early times; +- $`x_e \to 1`$ at early times; - the Peebles rate vanishes exactly at the Saha solution (detailed balance); - charge is conserved in the hydrogen–helium Saha solution; -- $\int g\,dz = 1 - e^{-\tau}$. +- $`\int g\,dz = 1 - e^{-\tau}`$. They also check that the answers don't change when I tighten the ODE tolerances, refine the redshift grid, or move the point where the ODE takes over from Saha. The comparison tests against CAMB use @@ -134,8 +134,8 @@ GitHub Actions runs the tests, rebuilds the figures and runs the notebook on eve - **Evolving the matter temperature** separately from the radiation temperature. - **Reionisation.** The optical depth here stops at recombination; Planck measures an extra $\tau \approx 0.054$ from reionisation. -- **Parameter sensitivity.** I'd like to look at how $z_*$ and the width of last scattering respond - to $\Omega_b h^2$ and $Y_p$. +- **Parameter sensitivity.** I'd like to look at how $`z_\ast`$ and the width of last scattering respond + to $`\Omega_b h^2`$ and $`Y_p`$. ## References From 32d8e9461bc1f84ad473a3a8e47eb58abe486db6 Mon Sep 17 00:00:00 2001 From: SethulekshmiBeena Date: Fri, 23 Oct 2026 19:27:15 +0100 Subject: [PATCH 2/2] Make README numbers consistent with the code and theory.md Saha-only last scattering is z* = 1291 (tau = 1) in both the intro and the results note. The helium Saha deficit spans z ~ 1800-2800, matching theory.md: it starts at the 1800 switch and peaks at -5.8% near z = 2300. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7004f51..c25b8d3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ comes from? This project is my attempt to answer that from first principles, by free-electron fraction of the Universe, $`x_e(z)`$, through hydrogen recombination. I started with the Saha equation, which is the textbook answer, and quickly found that it puts last -scattering at $`z \approx 1280`$, about 200 in redshift too early. The reason is that recombination is +scattering at $`z \approx 1291`$, about 200 in redshift too early. The reason is that recombination is a bottleneck rather than an equilibrium process. An electron captured straight into the ground state emits a photon that ionises the next atom, and Lyman-α photons are trapped by resonant scattering. So I implemented the Peebles three-level atom, in which hydrogen reaches the ground state only through @@ -55,7 +55,7 @@ $`z = 200`$. I think this comes from two simplifications rather than a bug. Firs recombines too slowly at late times, which is why RECFAST introduced a fudge factor; with their $F = 1.14$ my value drops to within 1% of CAMB. Second, I assume the gas stays at the radiation temperature, while in reality it cools faster below $`z \sim 300`$. Helium is the other visible gap. -I treat it in Saha equilibrium, so at $`z \approx 2000\text{–}2800`$ my $`x_e`$ is up to 6% lower than CAMB's, +I treat it in Saha equilibrium, so at $`z \approx 1800\text{–}2800`$ my $`x_e`$ is up to 6% lower than CAMB's, where helium recombination is delayed. A detail worth pointing out: the familiar "$`z \approx 1090`$" is not where $g(z)$ peaks when you