Skip to main content
Sandbox Physics
From quantum ripples to cosmic texture

Deriving the Mode Equation Behind a Computed Spectrum

The Lab does not use slow-roll formulas to make its spectrum. It integrates the background and then every mode from its quantum vacuum until the mode freezes. This chapter derives those equations and the two checks that tell you a run can be trusted.

The background in e-fold time

Start from the Friedmann equation 3H2=12ϕ˙2+V3H^2=\tfrac12\dot\phi^2+V and the field equation ϕ¨+3Hϕ˙+V,ϕ=0\ddot\phi+3H\dot\phi+V_{,\phi}=0. Replace time derivatives with ϕ˙=Hϕ′\dot\phi=H\phi'.

The Friedmann equation becomes H2(3−12ϕ′2)=VH^2(3-\tfrac12\phi'^2)=V. With ϵ=12ϕ′2\epsilon=\tfrac12\phi'^2, which equals −H˙/H2-\dot H/H^2, this is the first formula below. Using H′/H=−ϵH'/H=-\epsilon in the field equation gives the second.

These two lines are the whole background. Inflation ends where ϵ=1\epsilon=1. Nothing here assumes slow roll; the field may lurch over a step and the equations still hold.

H2=V3−ϵ,ϕ′′=−(3−ϵ) ϕ′−V,ϕH2,ϵ=12ϕ′2H^{2}=\frac{V}{3-\epsilon},\qquad \phi''=-(3-\epsilon)\,\phi'-\frac{V_{,\phi}}{H^{2}},\qquad \epsilon=\tfrac12\phi'^{2}
Exact single-field background equations in e-fold time.

Reading: Ellis, Vennin & Wands, Review 23: Inflation, Review of Particle Physics (PDG 2025, revised August 2025) · Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2

Slow roll is an approximation, not the model

When the potential is flat, ϕ′′\phi'' is small and ϵ≈ϵV=12(V,ϕ/V)2\epsilon\approx\epsilon_V=\tfrac12(V_{,\phi}/V)^2. The Lab uses this only for its dashed reference curve.

Worked example on the R2R^2 plateau V=V0(1−e−2/3 ϕ)2V=V_0(1-e^{-\sqrt{2/3}\,\phi})^2. Where the pivot exits for N∗=55N_*=55, the integrator finds ϕ∗=5.3213\phi_*=5.3213. There e−2/3 ϕ∗=0.012974e^{-\sqrt{2/3}\,\phi_*}=0.012974, so V,ϕ/V=0.021464V_{,\phi}/V=0.021464 and ϵV=2.30×10−4\epsilon_V=2.30\times10^{-4}. The integrated background gives ϵ=2.28×10−4\epsilon=2.28\times10^{-4}, about one per cent lower.

Reading: Planck Collaboration, Planck 2018 results. X. Constraints on inflation, arXiv:1807.06211v2 · Original background and mode calculations with an independent Python reference

From the field to a wave equation

Expanding the action to second order in comoving gauge leaves one scalar degree of freedom, the curvature perturbation R\mathcal{R}. The combination v=zRv=z\mathcal{R} with z=aϕ′z=a\phi' obeys a wave equation in conformal time with an effective mass z′′/zz''/z.

Rewritten in e-folds, it becomes the first equation below. The friction term is dln⁡(z2aH)/dNd\ln(z^2aH)/dN; this is the flux form of the previous chapter, expanded. Each tensor polarisation has the same structure with zz replaced by aa, so its friction is only 3−ϵ3-\epsilon.

A sharp step makes ϕ′′/ϕ′\phi''/\phi' jump for a fraction of an e-fold. The friction term then kicks the modes crossing the horizon at that moment. That is where the ringing comes from.

R′′+(3−ϵ+2ϕ′′ϕ′)R′+(kaH)2R=0,h′′+(3−ϵ) h′+(kaH)2h=0\mathcal{R}''+\left(3-\epsilon+\frac{2\phi''}{\phi'}\right)\mathcal{R}'+\left(\frac{k}{aH}\right)^{2}\mathcal{R}=0,\qquad h''+(3-\epsilon)\,h'+\left(\frac{k}{aH}\right)^{2}h=0
Scalar and tensor mode equations in e-fold time. Both are linear, so every kk can be integrated on its own.

Reading: Maldacena, Non-Gaussian features of primordial fluctuations in single field inflationary models (2003), astro-ph/0210603v5 · Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2

Starting in the Bunch–Davies vacuum

Deep inside the horizon the mode is a flat-space wave, which fixes the starting state v→e−ikτ/2kv\to e^{-ik\tau}/\sqrt{2k}. We use the exact de Sitter form of that solution at τ=−1/(aH)\tau=-1/(aH) and start when k/aH=100k/aH=100.

Starting too late would add an error from the approximate initial state; starting earlier only costs time. The benchmark script checks this choice: against the exact power-law answer, the error stays below 2×10−62\times10^{-6} whether the start is k/aH=50k/aH=50, 100100 or 200200.

vk(τ)=e−ikτ2k(1−ikτ),Rk=vkzv_k(\tau)=\frac{e^{-ik\tau}}{\sqrt{2k}}\left(1-\frac{i}{k\tau}\right),\qquad \mathcal{R}_k=\frac{v_k}{z}
The de Sitter mode function used for the initial data; τ\tau is conformal time.

Reading: Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2 · Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1 · Original background and mode calculations with an independent Python reference

The Wronskian, a free accuracy check

Canonical quantisation requires v ∂τv∗−v∗∂τv=iv\,\partial_\tau v^*-v^*\partial_\tau v=i for all time. Since v=zRv=z\mathcal{R} and ∂τ=aH d/dN\partial_\tau=aH\,d/dN, this becomes the condition below. Exact solutions keep it; numerical errors break it.

In the Lab’s fixed-step integrator the drift falls with the step size as expected. For a power-law test, step factors 0.30.3, 0.150.15 and 0.0750.075 give Wronskian drifts of 1.1×10−31.1\times10^{-3}, 4.3×10−54.3\times10^{-5} and 5.5×10−65.5\times10^{-6}, beside power errors of 7.7×10−47.7\times10^{-4}, 4.4×10−54.4\times10^{-5} and 6.5×10−66.5\times10^{-6}. The two shrink together, so the drift is a usable warning light.

z2aH(R R∗′−R∗R′)=iz^{2}aH\left(\mathcal{R}\,\mathcal{R}^{*\prime}-\mathcal{R}^{*}\mathcal{R}'\right)=i
Must hold at every step. Its deviation from ii measures integration error without knowing the answer.

Reading: Original background and mode calculations with an independent Python reference · Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1

Reading out the spectrum

We stop each mode at k/aH=10−3k/aH=10^{-3}, when it has frozen, and form the spectra below. The tensor factor 88 combines two polarisations with the 2/Mpl2/M_{\mathrm{pl}} normalisation of each.

The leading slow-roll estimate H2/(8π2ϵ)H^2/(8\pi^2\epsilon) at k=aHk=aH is the dashed curve. On the plateau it sits 2.5%2.5\% below the numerical result at the pivot; for 12m2ϕ2\tfrac12m^2\phi^2 the gap is 0.8%0.8\%. The leading formula drops terms of the order of the slow-roll parameters. On the plateau ∣ηV∣|\eta_V| is about 0.0170.017 while ϵ\epsilon is near 2×10−42\times10^{-4}, so a gap of a few per cent is the expected size.

PR=k3∣Rk∣22π2,Pt=8k3∣hk∣22π2,PR≈H28π2ϵ∣k=aH\mathcal{P}_{\mathcal{R}}=\frac{k^{3}|\mathcal{R}_k|^{2}}{2\pi^{2}},\qquad \mathcal{P}_{t}=\frac{8k^{3}|h_k|^{2}}{2\pi^{2}},\qquad \mathcal{P}_{\mathcal{R}}\approx\left.\frac{H^{2}}{8\pi^{2}\epsilon}\right|_{k=aH}
Numerical readout and the leading slow-roll estimate. In our variables hk=vk/ah_k=v_k/a for one polarisation.

Reading: Original background and mode calculations with an independent Python reference · Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1

Exercises and explained answers

  1. Check that v=e−ikτ/2kv=e^{-ik\tau}/\sqrt{2k} satisfies v ∂τv∗−v∗∂τv=iv\,\partial_\tau v^*-v^*\partial_\tau v=i.

    Read the explanation

    ∂τv∗=ik eikτ/2k\partial_\tau v^*=ik\,e^{ik\tau}/\sqrt{2k}, so v ∂τv∗=i/2v\,\partial_\tau v^*=i/2. Likewise v∗∂τv=−i/2v^*\partial_\tau v=-i/2. The difference is ii, independent of time.

  2. Derive H2=V/(3−ϵ)H^2=V/(3-\epsilon) from the Friedmann equation, and say what happens to HH as ϵ\epsilon rises to 11.

    Read the explanation

    With ϕ˙=Hϕ′\dot\phi=H\phi', 3H2=12H2ϕ′2+V3H^2=\tfrac12H^2\phi'^2+V, so H2(3−ϵ)=VH^2(3-\epsilon)=V. As ϵ→1\epsilon\to1, H2→V/2H^2\to V/2 instead of V/3V/3: kinetic energy now makes up a third of the total, and acceleration stops.

  3. Why does a step change the scalar spectrum strongly but the tensor spectrum hardly at all?

    Read the explanation

    The step enters the scalar friction through 2ϕ′′/ϕ′2\phi''/\phi', which jumps when the field lurches. The tensor friction 3−ϵ3-\epsilon only sees ϵ\epsilon, which a small step barely changes. The Lab’s tensor ratio at the pivot stays 0.003550.00355 with or without the default step.

Try the prediction

Compare the full calculation with slow roll

  1. Choose Smooth plateau. In the spectrum chart, compare the computed line with the dashed slow-roll reference: they are parallel but a few per cent apart.
  2. Choose Steep slope, strong gravitational waves. The gap shrinks, as the 0.8%0.8\% figure predicts.
  3. Choose Sharp step, exaggerated. The slow-roll reference shows one dip where the field lurches, while the computed spectrum rings over a wider band. The leading formula reads only the local background, so it misses the ringing.

Sources and calculation scope

  1. Planck Collaboration, Planck 2018 results. X. Constraints on inflation, arXiv:1807.06211v2

    Full v2 PDF (2 August 2019) read for Sections 4.2 and 7.1–7.3: equations 47–48, the step template in equations 57–62, Table 11 priors, Table 12 step results and Figure 28. The headline spectral index and amplitude quoted in this course come from its parameter tables.

  2. Ellis, Vennin & Wands, Review 23: Inflation, Review of Particle Physics (PDG 2025, revised August 2025)

    Full review read. Used: Section 23.3.4 equations 23.55–23.57 and its sentence on the ACT combination, Section 23.6 on reheating and the number of e-folds after the pivot exits, and Section 23.7.3.2 equations 23.101–23.103 for the sign convention of the local non-Gaussian amplitude and its single-field squeezed-limit value.

  3. Adams, Cresswell & Easther, Inflationary perturbations from a potential with a step (2001), astro-ph/0102236v2

    Full v2 read. Equation 1 defines the tanh step we use; equations 6–19 set out the mode equation in e-fold time and its initial data. Our code is written independently and puts the step on the Starobinsky plateau and on a quadratic potential, not only on the paper’s quadratic case.

  4. Maldacena, Non-Gaussian features of primordial fluctuations in single field inflationary models (2003), astro-ph/0210603v5

    Full v5 read. Equation 1.2 gives the squeezed-limit argument. In that paper the tilt symbol means the deviation from scale invariance, which modern papers write as the spectral index minus one.

  5. Stewart & Lyth, A more accurate analytic calculation of the spectrum of cosmological perturbations produced during inflation (1993), gr-qc/9302019v1

    Full v1 read, with printed pages 4–6 checked as images. Equations 31, 41 and 43 give the exact power-law-inflation spectra that our solver must reproduce.

  6. Original background and mode calculations with an independent Python reference

    Our own calculations: the Lab integrator and a separate NumPy/SciPy reference agree to better than three parts in ten thousand on all five presets. The ZIP holds the Python reference, closed-form benchmarks, five inputs and expected outputs. No Engine code and no paper text is included.

Keep reading

What this page links to directly

From quantum ripples to cosmic texture · Reading path

Horizon exit, the mode equation and spectral constraints

  1. ArticleHow a Quantum Ripple Becomes Cosmic Structure
  2. ArticleWhy a Stretched Ripple Stops Changing After Horizon Exit
  3. You are hereDeriving the Mode Equation Behind a Computed Spectrum
  4. ArticleWhat the Tilt, Tensors and Squeezed Triangles Measure
  5. ArticleRecompute a Primordial Spectrum and Test the Solver
  6. ArticleReading Planck’s Searches for Inflation Features and Non-Gaussianity
Something broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy