Gravitational Lensing

Mass bends light. Here you can bend it yourself, one ray-traced pixel at a time.

README.TXT~/lensing

Einstein's general relativity says that mass curves spacetime, and light follows that curvature. A galaxy or a cluster of galaxies between us and a more distant source works like a lens. Not a very good lens, but a huge one. It can magnify, stretch and multiply what lies behind it, turning a distant galaxy into arcs, rings and crosses.

There are three toys on this page:

Deep fieldDrag a galaxy or a whole cluster across the real Hubble Ultra Deep Field and watch the background galaxies warp. This is strong lensing at cluster scale.
Lens labOne lens, one source. Move the source and watch images appear, merge and vanish as it crosses a caustic. You also get magnifications and time delays.
Time delaysA quasar behind the lens flickers, and each image flickers later than the last. Line up the light curves and you have measured the Hubble constant.

Then there's the theory behind it (with an interactive ray diagram and an Einstein-radius calculator), a gallery of famous lenses you can load into the simulators, and a list of things to try.

Lensing the Hubble Ultra Deep Field~/lensing/deepfield
Image: NASA, ESA, S. Beckwith (STScI) and the HUDF Teamfield ≈ 3′ across
Before / after lensed
More lensing toys and the theory →
Lens
Distances

We pretend the whole deep field sits at the source redshift.

Show
Loading the Hubble Ultra Deep Field…
Lens lab: one source, many images~/lensing/lab

The left panel shows where the source really is (the source plane). The right panel shows what a telescope would see (the image plane). Drag in either panel to move the source. Watch what happens when it crosses the yellow line: that's a caustic, and two images are born or destroyed on the red line, the critical curve. Angles are in units of the Einstein radius θE, about 1″ for a massive galaxy.

Source plane (what is really there, zoomed in)yellow: caustics
Image plane (what we see)red: critical curves
Source
Show
Lens

Images are found by solving the lens equation numerically for the centre of the source (the markers). Δt is the arrival-time delay for a galaxy-scale lens with θE = 1″, zlens = 0.5 and zsource = 2. Minima arrive first, saddles next, maxima last. μ < 0 means the image is mirror-flipped (negative parity).

Drag the source.
Time-delay cosmography: measure H0 yourself~/lensing/timedelays

A quasar flickers on its own, by a few tenths of a magnitude over weeks to months. Every lensed image shows the same flicker, but each one arrives late by a different amount. The light took paths of different lengths, through different depths of the lens potential. All those delays scale with the time-delay distance DΔt, and DΔt ∝ 1/H0. Below are three seasons of simulated monitoring from a universe with a secret Hubble constant. Your job: find it. The steps below the plots walk you through it.

The lens, with arrival-time contourslabels: delay after A
Light curves: dots = data, lines = your model (brighter is up)
Your model in the H0–λ plane: drag the red crossblue: light curves · orange: kinematics
Your cosmology and lens model

Images and flux ratios only fix the lens up to a mass-sheet transformation, κ → λκ + 1 − λ. Every λ fits them equally well, but the predicted delays scale with λ. λ = 1 is the "naive" model.

Stellar kinematics

Show
The lens
Ready.
Theory: how a lens made of gravity works~/lensing/theory.tex

1Light falls, too

In general relativity, light travels along the straightest possible paths (null geodesics) through curved spacetime. Near a mass those paths bend. A light ray passing a compact mass M at impact parameter ξ, far outside the mass, is deflected by

α^=4GMc2ξ=2RSξ(1)

where RS = 2GM/c2 is the Schwarzschild radius. This is a weak-field result, valid when ξ ≫ RS, which is true for every lens on this page. For light grazing the Sun it gives 1.75″. If you treat light as Newtonian particles moving at c, you get exactly half of that, 0.87″. Johann von Soldner did that calculation around 1801, and Einstein got the same half value in 1911, before he finished general relativity (0.84″ and 0.83″ with the solar data of their day). The extra factor of 2 comes from the curvature of space itself. In 1919, Dyson, Eddington and Davidson measured stars near the eclipsed Sun and found the full value. That result made Einstein famous overnight.

For every lens on this page the deflection is tiny: α^ is at most a few tens of arcseconds. That allows two very good approximations. First, the thin-lens approximation: all the bending happens in a single plane, because the lens is far thinner than the distances involved. Second, all angles are small, so sin θ ≈ tan θ ≈ θ.

2The lens equation

Put the observer, the lens and the source on a line, at angular-diameter distances Dd (to the lens, the "deflector"), Ds (to the source) and Dds (from lens to source). Note that in an expanding universe Dds ≠ Ds − Dd. The source sits at true angular position β on the sky. We see it at angle θ instead. Simple geometry gives the lens equation:

𝛃=𝛉−DdsDs𝛂^(Dd𝛉)≡𝛉−𝛂(𝛉)(2)

It maps each image position θ to exactly one source position β. Going the other way, from β back to θ, is what makes lensing interesting: one β can have several solutions θ. Each solution is an image. The simulators on this page do exactly this: for every pixel θ they compute β = θ − α(θ) and look up the colour of the source there. This is called inverse ray-tracing.

What the observer sees

Side view, drag the source up and down. The vertical scale is stretched by a huge factor: real deflections are arcseconds, not tens of degrees. Solid lines are the actual light paths, which bend once, at the lens plane. Dashed lines show where the observer thinks the light came from. With no lens, the faint straight line would be the only path.

3The Einstein radius

If the source sits exactly behind a round lens (β = 0), symmetry turns its image into a ring, the Einstein ring. Its angular radius θE sets the scale of everything in strong lensing. For a point mass:

θE=4GMc2⁢DdsDdDs,θ±=12(β±β2+4θE2)(3)

A point mass always makes two images, one on each side. Galaxies are better described by the singular isothermal sphere (SIS). Its density falls as ρ ∝ r−2, which is what gives galaxies their flat rotation curves. Its strength is set by the stellar velocity dispersion σv. It deflects every ray by the same angle, θE:

θE=4πσv2c2DdsDs,θ±=β±θE(second image only if β<θE)(4)

For any round lens, the mean surface density inside the Einstein radius equals the critical surface density. So the Einstein radius directly measures the projected mass inside it, independent of how that mass is distributed:

M(<θE)=πΣcr(DdθE)2,Σcr=c24πGDsDdDds(5)

This is why lensing is so good at weighing dark matter: it doesn't care whether the mass shines.

LensTypical θEWhat we observe
The Sun (light grazing the limb)1.75″ deflectionStars near the eclipsed Sun shift outward. The Sun's Einstein ring would sit inside its own disk, so we don't get one.
A star in the Milky Way~0.5 masMicrolensing: no resolved images, the source just brightens for weeks.
A massive galaxy~1″Two or four images, arcs and Einstein rings. Time delays of days to months.
A galaxy cluster10″–50″Giant arcs, dozens of multiple images. Delays of years.
The large-scale structure(no images)Weak lensing: every distant galaxy is sheared by ~1%. You only see it statistically.

Einstein-radius calculator

Flat ΛCDM with H0 = 70 km/s/Mpc and Ωm = 0.3. For other cosmologies (and many more distances), see the Cosmology Toolbox.

4Magnification, critical curves and caustics

It is convenient to write the deflection as the gradient of a lensing potential ψ, α = ∇ψ, which itself obeys a 2D Poisson equation, ∇²ψ = 2κ. Here κ = Σ/Σcr is the convergence: the projected surface density in units of the critical one. How a small patch of the source gets distorted is described by the Jacobian of the lens equation:

𝐀=∂𝛃∂𝛉=(1−κ−γ1−γ2−γ21−κ+γ1),μ=1det𝐀=1(1−κ)2−γ2(6)

Convergence κ magnifies images the same way in every direction. Shear γ stretches them along one direction. Lensing never creates or destroys photons, and it conserves surface brightness. So a magnified image is not brighter per square arcsecond. It is bigger, and the total flux grows by |μ|. Images with μ < 0 are mirror images: they have negative parity.

Where det A = 0, the magnification formally becomes infinite. In the image plane these points form the critical curves (red in the simulators). Mapped back to the source plane, they become the caustics (yellow). Caustics divide the source plane into regions with different numbers of images. Each time a source crosses a caustic, the image count changes by two: a pair of images is born or merges on the critical curve. A tangential critical curve (1 − κ − γ = 0) stretches images tangentially into arcs. A radial one (1 − κ + γ = 0) stretches them radially. Smooth parts of a caustic are folds (two images merge), and the sharp points are cusps (three images merge).

The odd-number theoremA smooth, non-singular lens always makes an odd number of images (1, 3, 5, …, as long as the source is not exactly on a caustic). Cluster lenses can make 7 or more. So why do we usually see 2 or 4? The extra image forms near the dense centre of the lens. It is strongly demagnified, and the lens galaxy's own light usually drowns it out. A perfectly singular isothermal lens destroys that image completely. Its boundary in the source plane is then not a caustic but a cut (dashed orange in the lens lab). Give the lens a core in the lens lab and watch the faint central image appear.

5Time delays and the Hubble constant

Each image is a different path from the source to us, and different paths take different times. The arrival time, relative to an undeflected ray, is the Fermat potential:

t(𝛉)=DΔtc[12(𝛉−𝛃)2−ψ(𝛉)],DΔt=(1+zd)DdDsDds∝1H0(7)

The first term is the geometric delay (bent paths are longer). The second is the Shapiro delay (light passing through a potential well is slowed down). Images form where t is stationary: at minima, saddle points and maxima of the arrival-time surface. That is Fermat's principle, applied to gravity. If the source varies, as a quasar or a supernova does, the variation shows up in each image at a different time. A measured delay gives DΔt, and with it the Hubble constant H0, in a single step and without any distance ladder. Sjur Refsdal proposed exactly this in 1964. You can try it in the time-delay box. The catch is that you need the lens potential ψ, and the images alone do not quite pin it down. That is the subject of the next section.

6The mass-sheet degeneracy

Take any lens model that reproduces the observed images: a convergence κ(θ) and a source position β. Now build a second model. Scale the lens down by a factor λ and add a uniform sheet of convergence 1 − λ on top. A uniform sheet pulls every ray towards the centre by an angle proportional to its distance, here (1 − λ)θ, just like a uniform disk would. So the new lens equation is simply λ times the old one:

κλ=λκ+(1−λ),𝛉−𝛂λ(𝛉)=λ[𝛉−𝛂(𝛉)]=λ𝛃(8)

The images land exactly where they were. Only the source has moved, from β to λβ, and nobody ever gets to see the source without the lens in front of it. The Jacobian of the lens equation is multiplied by λ as well (A → λA), so every image gets the same extra magnification 1/λ². That leaves the flux ratios untouched, and flux ratios are all we can measure, since we don't know how bright the source really is. Even the shapes of extended arcs come out identical, as long as the source is also λ times smaller. No image you will ever take can tell the two lenses apart. Their arrival-time surfaces do differ, though: t(θ) is scaled by λ, and so is every delay.

μλ=μλ2,Δtλ=λΔt∝λH0(9)

A measured delay therefore only fixes H0/λ. If the true lens has λ = 0.9 and you model it with λ = 1, your H0 comes out 10% too high, and nothing in the data warns you. Move λ below: the image positions and the flux ratio stay put, while the source, the delay and the inferred H0 all move.

Grey: a singular isothermal sphere with θE = 1″ at zlens = 0.5, zsource = 2, with the source at β. Blue: its mass-sheet transform. The mean convergence inside θE is 1 for every λ, so the Einstein radius never changes. Both arrival-time curves are stationary at the same two image positions, A and B, but B arrives λ times later.

A lens that hides itselfA uniform sheet with κ = 1, on its own, is a perfect lens. It deflects every ray by exactly α = θ, so the whole sky behind it is focused onto one point. A weaker sheet, κ0 < 1, maps the sky onto itself shrunk by a factor 1 − κ0. It magnifies everything behind it uniformly and leaves no other trace. Unless you know how big or how bright the sources really are, you cannot tell it is there.

Where would such a sheet come from? There are two places. Outside the lens, galaxies and dark matter along the line of sight add a small external convergence κext, typically a few percent. The lens model absorbs it, which amounts to λ = 1 − κext, so the true H0 is (1 − κext) times the one the model gives. It is estimated by counting galaxies around the lens and comparing with simulations, or from weak lensing. Inside the lens, a sheet that goes on forever is not physical. For λ > 1 it would even turn negative far out (the shaded region in the plot, which the curve reaches for λ > 1.2). But any mass component that is nearly uniform across the images and fades further out does the same job where it matters. In practice it is a change in the radial density profile near θE. Assuming a profile shape, for example a power law, quietly fixes λ.

Breaking the degeneracy takes information that does not come from lensing a single source. Stellar kinematics of the lens galaxy help, because σv2 scales roughly with λ: the sheet changes the mass the stars feel. So do sources at several redshifts behind the same lens, and sources of known brightness, such as a lensed type Ia supernova, whose absolute magnification measures λ directly. Falco, Gorenstein & Shapiro pointed out the degeneracy in 1985, for the Twin Quasar. It matters in practice: H0LiCOW measured H0 = 73.3−1.8+1.7 km/s/Mpc from six lenses, assuming standard mass profiles. When TDCOSMO (Birrer et al. 2020) dropped that assumption and let the kinematics alone constrain λ, seven lenses, six of them the same, gave 74.5−6.1+5.6. The central value barely moved, but the uncertainty more than tripled. You can walk through the whole argument in the time-delay box, where λ is the "Mass sheet" slider and the orange band is the kinematics.

7Strong, weak and micro

Strong lensing means multiple images, arcs and rings. It happens only where κ ≳ 1, in the cores of massive galaxies and clusters. It is what the first two simulators show.

Weak lensing happens everywhere else. Each background galaxy is sheared by a percent or so, far below the natural scatter in galaxy shapes. Averaging over thousands of galaxies reveals a coherent pattern, the reduced shear g = γ/(1 − κ). From it we can map the mass of clusters (including the dark matter in the Bullet Cluster) and of the cosmic web itself ("cosmic shear", a key science goal of Euclid and the Rubin Observatory).

Microlensing is strong lensing by stars, with images far too close together to resolve. Because the lens and source move relative to each other, the total magnification changes with time. For a point lens it is:

A(u)=u2+2uu2+4,u(t)=u02+(t−t0tE)2(10)

Here u = β/θE, and tE = θE/μrel is the Einstein-crossing time, typically a few weeks. This symmetric curve is the "Paczyński curve" (Paczyński 1986). A planet orbiting the lens star adds small caustics of its own. A source that crosses or passes near one of them produces a short anomaly. Microlensing is most sensitive to planets near the Einstein ring (a few AU), including cold, low-mass planets that other methods struggle to find.

8What these simulators leave out

  • The deep field puts every background galaxy at the same redshift, the "source z" slider. Real galaxies sit at many redshifts and each one would see a different θE. The few stars with diffraction spikes are in our own Milky Way. In reality they sit in front of any lens and would not be lensed at all.
  • The deep-field image is a finite, pixelated patch of sky. Rays that land outside it come back black.
  • All lenses are thin and use simple analytic profiles: isothermal ellipsoids (optionally cored), point masses and external shear. Real lens models (with GLEE, lenstronomy, Lenstool and friends) use more flexible mass profiles. They also model the PSF, noise and the light of the source.
  • The time-delay box assumes the intrinsic light curve of the quasar is known. Real analyses have to infer it together with the delays. Microlensing by stars in the lens galaxy is mimicked by a small, slow, independent wobble in each image.
  • Light is treated with geometric optics. Wave effects (relevant for gravitational waves, not for starlight) are ignored.
Reading time: about 20 minutes. Understanding time: varies.
Famous lenses~/lensing/hall_of_fame

A few lenses that made history. Three of them can be loaded into a simulator as a configuration of the same type. These are lookalikes, not published models.

Dates are discovery or publication years.
Things to try~/lensing/experiments.txt

Short guided experiments. Show me sets up the simulator. Predict what will happen before you open the explanation.

    No lab coat required.
    Further reading and watching~/lensing/refs.bib

    Gentle

    Deeper

    • P. Schneider, J. Ehlers & E. E. Falco, Gravitational Lenses (Springer, 1992). The reference.
    • M. Bartelmann & P. Schneider, Weak Gravitational Lensing, Phys. Rep. 340, 291 (2001).
    • B. S. Gaudi, Exoplanetary Microlensing (2010), and the ARA&A review Microlensing Surveys for Exoplanets, 50, 411 (2012).
    • R. Kormann, P. Schneider & M. Bartelmann, Isothermal elliptical gravitational lens models, A&A 284, 285 (1994), and C. R. Keeton, A Catalog of Mass Models for Gravitational Lensing (2001). Where the formulas used here come from.
    • S. Birrer & A. Amara, lenstronomy (2018). If you want to model real lenses, this is a good place to start.
    All links open in a new tab.
    Note