---
title: "Recompute the Hubble constant from seven TDCOSMO lenses"
description: "Turn the published time-delay distances of seven lensed quasars into the Hubble constant, then test how mass slope, line of sight and matter density move it."
canonical_url: "https://sandboxphysics.com/stories/quasar-time-delays/recompute-h0-from-a-frozen-tdcosmo-slice/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/quasar-time-delays/recompute-h0-from-a-frozen-tdcosmo-slice/"
last_modified: "2026-11-14"
---

[Lensed quasar time delays and the Hubble constant](https://sandboxphysics.com/stories/quasar-time-delays/)

# Recompute the Hubble constant from seven TDCOSMO lenses

Sandbox Physics · 2026-11-14

This guide turns the published time-delay distances of the seven TDCOSMO lenses into a Hubble constant, one lens at a time. With the line-of-sight correction and no internal mass sheet the seven lenses give $H_0=74.2\pm1.6$. Multiplying by the internal sheet $\lambda_{\rm int}=0.91\pm0.04$ that TDCOSMO IV found with extra stellar-speed data gives $67.5\pm3.3$, close to the paper's $67.4^{+4.1}_{-3.2}$. A slope shift of 0.05 moves the answer by 5.3 percent; the matter density hardly moves it.

Read [the mass-sheet chapter](https://sandboxphysics.com/stories/quasar-time-delays/mass-sheet-degeneracy-and-stellar-speeds/) first. This is a check of the scaling relations on real inputs. It is not the paper's hierarchical inference, which uses stellar kinematics, orbit anisotropy and full posteriors.

## Get the files

Put these five files in one empty folder:

- [README.md](https://sandboxphysics.com/stories/quasar-time-delays/materials/README.md), run instructions, known errors and failure cases
- [tdcosmo-iv-table2.json](https://sandboxphysics.com/stories/quasar-time-delays/materials/tdcosmo-iv-table2.json), the inputs transcribed from Table 2 and the published values used for comparison
- [reproduce.py](https://sandboxphysics.com/stories/quasar-time-delays/materials/reproduce.py), the script
- [expected-outputs.json](https://sandboxphysics.com/stories/quasar-time-delays/materials/expected-outputs.json), the numbers quoted on this page
- [provenance.json](https://sandboxphysics.com/stories/quasar-time-delays/materials/provenance.json), Python version, units and SHA-256 checksums

Then run:

```
python3 reproduce.py --check
```

The script needs only the Python standard library. We ran it with Python 3.9.6. It prints the tables below, writes outputs.json in the current folder and exits with status 1 if the rounded outputs differ from expected-outputs.json.

## The input: Table 2 of TDCOSMO IV

TDCOSMO IV, Birrer et al. 2020, arXiv version 3, published in A&A 643, A165. Table 2 lists for each lens the redshifts, Einstein radius, power-law slope $\gamma_{\rm pl}$, external convergence $\kappa_{\rm ext}$ and the time-delay distance $D_{\Delta t}^{\rm pl}$ of the power-law model. The caption says $D_{\Delta t}^{\rm pl}$ comes from imaging and time delays and does not include external convergence or internal mass-sheet terms. That is exactly the quantity the mass sheet acts on. [TDCOSMO IV, Sec. 5.1 and Table 2](https://arxiv.org/abs/2007.02941v3)

Each value is stored as a list of three numbers: the median, the lower error and the upper error. We transcribed the table by hand from the ar5iv HTML rendering; check a digit against the PDF before relying on it.

## Step 1: one lens, one Hubble constant

For flat $\Lambda$CDM the time-delay distance is proportional to $1/H_0$ at fixed redshifts and $\Omega_{\rm m}$. So compute $D_{\Delta t}$ at $H_0=70$ km s$^{-1}$ Mpc$^{-1}$ and $\Omega_{\rm m}=0.3$, by integrating $1/E(z)$ numerically, and scale:

$$
H_0^{\rm pl}=70\times\frac{D_{\Delta t}(H_0=70)}{D_{\Delta t}^{\rm pl}} .
$$

The error is the mean half-width of the $D_{\Delta t}^{\rm pl}$ interval, carried as a fraction.

## Step 2: the line of sight

The measured distance is the lens-specific one, $D_{\Delta t}^{\rm lens}=(1-\kappa_{\rm ext})D_{\Delta t}^{\rm bkg}$ (Eq. 32). Cosmology predicts the smooth-universe distance, so $H_0\to(1-\kappa_{\rm ext})H_0^{\rm pl}$, with the $\kappa_{\rm ext}$ error added in quadrature.

**Table 5.1** Lens-by-lens Hubble constant from Table 2 of TDCOSMO IV, in km s$^{-1}$ Mpc$^{-1}$.

| Lens | $D_{\Delta t}$ at $H_0=70$ (Mpc) | Power law | Times $1-\kappa_{\rm ext}$ |
| --- | --- | --- | --- |
| B1608+656 | 5136 | 75.3 ± 2.1 | 67.5 ± 5.2 |
| RXJ1131$-$1231 | 2334 | 83.9 ± 1.5 | 78.1 ± 3.2 |
| HE0435$-$1223 | 2757 | 71.6 ± 4.2 | 71.3 ± 4.6 |
| SDSS1206+4332 | 5754 | 68.9 ± 7.3 | 69.2 ± 7.6 |
| WFI2033$-$4723 | 4877 | 75.2 ± 2.4 | 70.8 ± 5.1 |
| PG1115+080 | 1668 | 80.1 ± 6.4 | 80.6 ± 6.8 |
| DES0408$-$5354 | 3584 | 71.9 ± 1.5 | 74.7 ± 2.7 |

The inverse-variance mean of the last column is $74.2\pm1.6$.

## Step 3: an internal mass sheet

The total transform is $\lambda=(1-\kappa_{\rm s})\lambda_{\rm int}$ and $H_{0,\lambda}=\lambda H_0$ (Eqs. 29 and 34). Multiply by the population means of Table 6:

**Table 5.2** The seven-lens result times three choices of internal mass sheet, against the published values.

| $\lambda_{\rm int}$ | This script | Published |
| --- | --- | --- |
| 1 (power law) | 74.2 ± 1.6 | H0LiCOW, six lenses: $73.3^{+1.7}_{-1.8}$ |
| $1.02^{+0.08}_{-0.09}$ (TDCOSMO only) | 75.7 ± 6.5 | $74.5^{+5.6}_{-6.1}$ |
| $0.91\pm0.04$ (TDCOSMO + SLACS) | 67.5 ± 3.3 | $67.4^{+4.1}_{-3.2}$ |

[TDCOSMO IV, Table 6](https://arxiv.org/abs/2007.02941v3) [H0LiCOW XIII, abstract](https://arxiv.org/abs/1907.04869v2)

The middle row is 1.2 above the paper. Our shortcut multiplies a fixed $\lambda_{\rm int}$ into a fixed combined $H_0$; the paper infers $\lambda_{\rm int}$, the anisotropy and $H_0$ together from the kinematics and lets $\lambda_{\rm int}$ vary with the ratio of each lens's half-light radius to its Einstein radius. We did not reproduce that inference, so do not read the agreement in the last row as more than a check of the scaling. What the table does show is the size of the effect: a 9 percent sheet moves $H_0$ by about 7 units.

## Step 4: slope and matter density

**Slope.** At fixed image positions the predicted delay scales close to $\gamma'-1$ (Kochanek 2002, Eq. 8), so the inferred $H_0$ does too. Shifting every slope by $+0.05$ raises the combined value by 5.3 percent; $-0.05$ lowers it by 5.3 percent. This is a rough guide, not a refit. In a real model a slope change also moves the other parameters. [Kochanek 2002, Sec. 2.1](https://arxiv.org/abs/astro-ph/0205319v1)

**Matter density.** Changing $\Omega_{\rm m}$ from 0.3 to 0.25 raises the result by 0.2 percent; changing it to 0.35 lowers it by 0.3 percent. The time-delay distance is a ratio of distances times $1+z_{\rm d}$, and most of the dependence on the expansion history cancels.

## Failure cases

- **Ignore the line of sight.** Setting $\kappa_{\rm ext}=0$ gives 76.8. The sample mean $\kappa_{\rm ext}$ is positive, 0.035 (TDCOSMO IV, Sec. 5.1), so leaving it out biases $H_0$ upward.
- **Trust one lens.** RXJ1131$-$1231 alone gives $78.1\pm3.2$. Its small distance error hides the model and environment errors that only show up across a sample.
- **Drop the lens H0LiCOW did not use.** Without DES0408$-$5354 the remaining six give 73.9, close to the H0LiCOW XIII value from the same six lenses.
- **Treat asymmetric errors as Gaussian.** We do this throughout. For B1608+656 the $\kappa_{\rm ext}$ interval is $-0.045/+0.084$, and averaging it understates the chance of a large correction.
- **Edit an input.** Change a distance or a $\kappa_{\rm ext}$ in the JSON and the --check run fails. Any edit breaks the checksums in provenance.json.

## What this does not show

Image positions alone cannot fix $H_0$: every number here starts from distances that already include measured delays. Stellar kinematics fix $\lambda_{\rm int}$ in the paper; here we copied $\lambda_{\rm int}$ in. Line-of-sight corrections come from the paper's per-lens $\kappa_{\rm ext}$ posteriors, which we reduced to two numbers each.

## A checklist for the next lensing paper

1. Find which time-delay distance a table lists: with or without external convergence, with or without an internal sheet.
2. Find which mass profile it assumes, and how the slope uncertainty enters.
3. Find where $\lambda$ comes from: an assumed profile, kinematics, or an external sample with its own selection.
4. Check how much the result moves when $\kappa_{\rm ext}$ is set to zero, as a sense of scale.
5. Separate what is measured (delays, image positions, velocity dispersions) from what is assumed (profile shape, anisotropy, the parent population).

The next page reads TDCOSMO IV section by section: [how to read TDCOSMO IV](https://sandboxphysics.com/stories/quasar-time-delays/reading-tdcosmo-iv/).

## Try it in the Lab

[Quasar time delays in the gravitational-lens Lab](https://sandboxphysics.com/labs/gravitational-lens-telescope/?mode=time-delay): Set the hidden sheet to 0.91 and compare the Lab's shift in the Hubble constant with the tutorial's.

## Sources

1. [TDCOSMO IV, Sec. 5.1 and Table 2](https://arxiv.org/abs/2007.02941v3)
2. [H0LiCOW XIII, abstract](https://arxiv.org/abs/1907.04869v2)
3. [Kochanek 2002, Sec. 2.1](https://arxiv.org/abs/astro-ph/0205319v1)

## Keep reading

Lensed quasar time delays and the Hubble constant · Reading path

### From a delayed flare to the Hubble constant

1. [Article **How a delayed quasar flare measures the size of the universe**](https://sandboxphysics.com/stories/quasar-time-delays/one-flare-many-paths/)
2. [Article **Arrival time, the Fermat potential and the delay of an isothermal lens**](https://sandboxphysics.com/stories/quasar-time-delays/arrival-time-and-the-fermat-potential/)
3. [Article **Mass slope, shear and the time-delay distance**](https://sandboxphysics.com/stories/quasar-time-delays/mass-slope-shear-and-the-time-delay-distance/)
4. [Article **The mass-sheet degeneracy and what stellar speeds add**](https://sandboxphysics.com/stories/quasar-time-delays/mass-sheet-degeneracy-and-stellar-speeds/)
5. [You are here **Recompute the Hubble constant from seven TDCOSMO lenses**](https://sandboxphysics.com/stories/quasar-time-delays/recompute-h0-from-a-frozen-tdcosmo-slice/)
6. [Article **How to read TDCOSMO IV on the mass sheet and the Hubble constant**](https://sandboxphysics.com/stories/quasar-time-delays/reading-tdcosmo-iv/)

1 more group

### Other articles that use the same experiments

Each experiment from this article that another series also uses, followed by the articles there.

1. [Lab **Gravitational Lens Telescope**](https://sandboxphysics.com/labs/gravitational-lens-telescope/)
2. [Article **How a dark planet makes a distant star brighten**](https://sandboxphysics.com/stories/microlensing-planets/a-dark-planet-brightens-a-star/)
3. [Article **From a bent light ray to two stellar images**](https://sandboxphysics.com/stories/microlensing-planets/from-bent-light-to-two-images/)
4. [Article **What happens when a stellar disk crosses a caustic?**](https://sandboxphysics.com/stories/microlensing-planets/a-stellar-disk-crosses-a-caustic/)
5. [Article **What can a microlensing light curve tell us about its lens?**](https://sandboxphysics.com/stories/microlensing-planets/read-a-light-curve-without-weighing-too-soon/)
6. [Article **Read a dark planet’s mass from Earth and space**](https://sandboxphysics.com/stories/microlensing-planets/read-ground-space-and-roman-evidence/)
7. [Article **Fit the published OGLE-2005-BLG-390 photometry**](https://sandboxphysics.com/stories/microlensing-planets/refit-the-published-ogle390-files/)
8. [Article **A background star helped weigh an isolated black hole**](https://sandboxphysics.com/stories/astronomy-gravity/isolated-black-hole-microlensing/)
