Skip to main content
Sandbox Physics
Gravitational-wave lensing and frequency fringes

Recompute point-lens amplification and test a lens search

Sandbox Physics ·

This guide recomputes the point-lens amplification factor two independent ways and gets the same complex numbers to within 4.2×10−44.2\times10^{-4}. It then checks the low- and high-frequency limits and runs a small lens search on synthetic noise. The search finds a clear lens at y=0.5y=0.5, a doubtful one at y=2y=2, and a false lens in about one noise-only trial in nine. Every number below comes from one script you can run in about a minute.

Read the exact amplification factor and the matched-filtering chapter first. Nothing here uses detector strain. All signals and noise are synthetic.

Get the files

Put these eight files in one empty folder:

Then run:

python3 -m pip install numpy scipy mpmath
python3 reproduce.py

The script prints the largest change from the saved outputs and exits with status 0 when every amplification value agrees to 2×10−62\times10^{-6} and every injection median to 10−610^{-6}. We ran it with Python 3.9.6, numpy 2.0.2, scipy 1.13.1 and mpmath 1.3.0. Other versions may change the last digits of the random noise and fail the strict comparison; if so, python3 reproduce.py --write saves your own outputs, and the medians should stay close to ours.

Units and conventions

Table 5.1 Units and conventions shared by every script.
QuantityConvention
Lens massRedshifted mass MLzM_{Lz} in solar masses, with GM⊙/c3=4.925490947×10−6GM_\odot/c^3=4.925490947\times10^{-6} s
Frequencyw=8πGMLzf/c3w=8\pi GM_{Lz}f/c^3, dimensionless
Offsetyy in Einstein radii
Arrival timeT=12∣x−y∣2−ln⁡∣x∣−ϕm(y)T=\tfrac12\lvert x-y\rvert^2-\ln\lvert x\rvert-\phi_m(y), first image at T=0T=0
Fourier transformh~(f)=∫h(t) e+2πift dt\tilde h(f)=\int h(t)\,e^{+2\pi i f t}\,\mathrm dt, so a delay multiplies by e+2πifΔte^{+2\pi i f\Delta t}
Inner product4 Re∑a~∗b~/Sn Δf4\,\mathrm{Re}\sum\tilde a^*\tilde b/S_n\,\Delta f from 20 Hz to 219.9 Hz

The solar mass parameter is the IAU 2015 nominal value 1.3271244×1020 m3 s−21.3271244\times10^{20}\,\mathrm{m^3\,s^{-2}} divided by c3c^3.

Step 1: the closed form

point_lens_reference.py evaluates Eq. (17) of Takahashi and Nakamura (2003) at 60 significant digits with mpmath, and the two-image formula, their Eq. (18). We use Eq. (17) exactly as printed. Takahashi and Nakamura 2003, Sec. 2

Step 2: a second route that never uses the closed form

independent_fresnel_integral.py starts again from the lens-plane integral. Group the points of the lens plane by their arrival time. If A(τ)A(\tau) is the area where T<τT<\tau, then

F(w)=w2πi∫0∞dAdτ eiwτ dτ=1−iw∫0∞[I(τ)−1]eiwτ dτ,I(τ)=12πdAdτ.F(w)=\frac{w}{2\pi i}\int_0^\infty\frac{\mathrm dA}{\mathrm d\tau}\,e^{iw\tau}\,\mathrm d\tau=1-iw\int_0^\infty\bigl[I(\tau)-1\bigr]e^{iw\tau}\,\mathrm d\tau,\qquad I(\tau)=\frac1{2\pi}\frac{\mathrm dA}{\mathrm d\tau}.

The second form uses ∫0∞eiwτdτ=i/w\int_0^\infty e^{iw\tau}\mathrm d\tau=i/w. I(τ)I(\tau) is the response the lens would give to a sharp pulse, normalized to 1 without a lens. It is the time-domain picture in Eq. (16) of the 2003 paper.

The script computes I(τ)I(\tau) in four steps:

  1. For each direction from the lens, find where T=τT=\tau by bisection in ln⁡r\ln r, on both sides of the minimum along that ray.
  2. Integrate over direction with 240-point Gauss–Legendre quadrature, after a change of variable that removes the square-root singularity where the contour closes.
  3. Above the saddle time, cluster the nodes near the far side of the lens, where the contour pinches.
  4. Fourier-transform the tabulated I(τ)I(\tau) exactly for a piecewise-linear function, then add a tail beyond τ=400\tau=400 fitted as c1/τ+c2/τ2c_1/\tau+c_2/\tau^2.

Because this route never touches the gamma or hypergeometric function, agreement in both real and imaginary parts tests the phase convention of Eq. (17) as well as its magnitude.

Result. On y∈{0.1,0.3,1,3}y\in\{0.1,0.3,1,3\} and w∈{0.1,1,3,10,30}w\in\{0.1,1,3,10,30\}, the worst relative difference is 4.2×10−44.2\times10^{-4}, at y=0.3y=0.3, w=30w=30. The fitted tail coefficient is c1=0.499c_1=0.499 for every yy.

Table 5.2 Four of the 20 test points, closed form against the independent Fresnel route.
ywFresnel routeClosed form
0.111.58197 − 0.87469i1.58191 − 0.87445i
0.3101.15235 − 0.99952i1.15249 − 0.99890i
131.05026 − 0.38996i1.05027 − 0.38982i
311.09237 + 0.01542i1.09236 + 0.01542i

These four rows are a sample. All 20 are in expected-outputs.json.

The arrival-time constant matters here. If you write TT with +ϕm(y)+\phi_m(y), as Eq. (12) of the 2003 paper is printed, the Fresnel route gives FF times an extra phase e2iwϕme^{2iw\phi_m} and no longer matches Eq. (17). The paper's text says the minimum arrival time is set to zero, which needs −ϕm-\phi_m. We use that and make no claim about the paper beyond this.

Step 3: the two limits

These tests use the closed form, now trusted from step 2.

  • Low frequency. ∣F−1∣\lvert F-1\rvert should fall almost in proportion to ww, a little more slowly because of the wln⁡ww\ln w term. At y=1y=1 it is 2.2×10−22.2\times10^{-2}, 3.3×10−33.3\times10^{-3} and 4.4×10−44.4\times10^{-4} for w=10−2w=10^{-2}, 10−310^{-3} and 10−410^{-4}. At y=0.1y=0.1 and w=10−4w=10^{-4} it is 5.13×10−45.13\times10^{-4}, and the first-order formula πw/4+(iw/2)[ln⁡(w/2)+γ−2ϕm]\pi w/4+(iw/2)[\ln(w/2)+\gamma-2\phi_m] gives the same value.
  • High frequency. The difference from the two-image formula, divided by ∣F∣\lvert F\rvert, should fall as ww grows. At y=1y=1 it goes from 2.6×10−32.6\times10^{-3} at w=30w=30 to 2.6×10−52.6\times10^{-5} at w=1000w=1000. At y=0.3y=0.3 it is 3.1×10−23.1\times10^{-2}, 6.5×10−36.5\times10^{-3}, 8.7×10−38.7\times10^{-3} and 1.1×10−31.1\times10^{-3} at w=30w=30, 100, 300 and 1000. The rise between 100 and 300 is real: the leftover difference oscillates with ww.

Step 4: inject and search

signal_injection.py builds an 8 s stretch at 1024 samples per second:

  1. Noise. Gaussian, coloured by Eq. (4.7) of Ajith (2011), with standard deviation Sn/(4Δf)\sqrt{S_n/(4\Delta f)} in each real and imaginary part of each frequency bin. Ajith 2011, Sec. IV
  2. Signal. A 10+10 M⊙10+10\,M_\odot leading-order chirp from 20 Hz to 219.9 Hz, scaled to an unlensed signal-to-noise ratio of 20, and multiplied by the exact FF for a lensed injection. Cutler and Flanagan 1994, Eqs. 41–42
  3. Unlensed search. 17 component masses from 9.6 to 10.4 M⊙10.4\,M_\odot, each maximized over amplitude, arrival time and phase.
  4. Lensed search. 36 lens masses from 10 to 1500 M⊙1500\,M_\odot times 9 values of yy from 0.1 to 3, then 48 finer masses between the neighbours of the best mass for each yy, then a bounded one-dimensional polish of the best two. Lensed templates keep the true component mass.
  5. Statistic. Δln⁡L\Delta\ln L, the best lensed minus the best unlensed log likelihood ratio. The reporting threshold is 4.

Before any noise is added, the script checks that the search finds the injected lens. It does: lens mass within 0.001 percent and Δln⁡L\Delta\ln L within 10−810^{-8} of the exact-template value for both lensed cases.

Result.

Table 5.3 Injection results in Δln⁡L\Delta\ln L at an unlensed signal-to-noise ratio of 20.
CaseTrialsWithout noiseMedian90th percentileMaximumAbove 4
Lens, MLz=1000M_{Lz}=1000, y=0.5y=0.520115.2110.2153.3165.9100%
Lens, MLz=1000M_{Lz}=1000, y=2y=2406.034.278.2712.4952.5%
No lens12002.494.357.9711.7%

The clear lens is unmistakable. The faint lens is a coin toss, and the noise-only tail reaches values a faint lens also produces.

Failure cases kept on purpose

  • Coarse grid. The first version searched only the 36-mass grid, about 15 percent apart. At y=2y=2 the 90 ms delay shifts the fringe phase at 200 Hz by several radians between neighbouring masses, so even without noise the best grid template reached Δln⁡L=0.73\Delta\ln L=0.73 instead of 6.03. Its faint-lens median, 2.79, was mostly noise. The refinement in step 4 fixes this, and the noise-free check would catch it again.
  • Coarse amplification table. The first table of FF used 1500 points in ww. At y=3y=3 and ww near 41 it sampled each fringe about four times, and interpolation errors reached 3.8 percent. 6000 points bring this to 0.24 percent.
  • False lenses. 14 of 120 noise-only trials pass the threshold. The largest, seed 3058 with 7.97, prefers MLz≈1150M_{Lz}\approx1150 and y=1.5y=1.5.
  • What is missing. No spins, unequal masses, merger, ringdown, detector antenna pattern, glitches or galaxy around the lens; yy is searched only on its grid. These numbers illustrate the method and are not the sensitivity of any real search.

Checklist before you trust a rerun

  • python3 reproduce.py exits with status 0, or your own --write outputs differ from ours only in noise-dependent digits.
  • The SHA-256 checksums in provenance.json match your files.
  • The Fresnel route and Eq. (17) agree in real and imaginary parts, not just in magnitude.
  • ∣F−1∣\lvert F-1\rvert falls about as fast as wln⁡ww\ln w at low frequency, and the two-image error falls overall at high frequency.
  • The noise-free search recovers the injected lens before you read any noisy result.
  • The noise-only distribution is reported next to every lensed result, with the same threshold.

Sources

  1. Takahashi and Nakamura 2003, Sec. 2
  2. Ajith 2011, Sec. IV
  3. Cutler and Flanagan 1994, Eqs. 41–42

Keep reading

What this page links to directly

Gravitational-wave lensing and frequency fringes · Reading path

  1. ArticleWhat a detector hears when one chirp takes two paths
  2. ArticleWhy a lens delays a gravitational wave
  3. ArticleThe exact amplification factor of a point-mass lens
  4. ArticleCan a detector tell a lensed chirp from an ordinary one?
  5. You are hereRecompute point-lens amplification and test a lens search
  6. ArticleHow to read the O3 search for lensed gravitational waves
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