<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://lmagristella.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://lmagristella.github.io/" rel="alternate" type="text/html" /><updated>2026-08-29T19:36:28+00:00</updated><id>https://lmagristella.github.io/feed.xml</id><title type="html">Laurent Magri-Stella</title><subtitle>PhD student in numerical cosmology</subtitle><author><name>Laurent Magri-Stella</name></author><entry><title type="html">Live gravitational lensing scene composer</title><link href="https://lmagristella.github.io/random-science/live-gravitational-lensing-composer/" rel="alternate" type="text/html" title="Live gravitational lensing scene composer" /><published>2026-08-15T00:00:00+00:00</published><updated>2026-08-15T00:00:00+00:00</updated><id>https://lmagristella.github.io/random-science/live-gravitational-lensing-composer</id><content type="html" xml:base="https://lmagristella.github.io/random-science/live-gravitational-lensing-composer/"><![CDATA[<h1 id="a-new-lensing-tool-that-works-in-real-time">A new lensing tool that works in real time</h1>

<p>The <a href="/random-science/interactive-gravitational-lensing-applet/">original lensing applet</a> let you drag a galaxy around behind a fixed selection of precomputed lens models and shape: NFW halo geometries, a void, a Schwarzschild black hole, a binary black hole system. It’s cool to mess with, but the systems were always one of eight baked-in options: every deflection field had been ray-traced ahead of time and saved to disk.</p>

<p>This new app is different: you build the lens yourself, add point masses, isothermal spheres, NFW halos, triaxial halos, voids, or switch entirely to a Schwarzschild black hole, and EXCALIBUR (the same C++ relativistic ray-tracer behind the original applet) traces the whole deflection field on the spot, compiled to WebAssembly. Every scene you compose gets its own photons launched and integrated through curved spacetime on your machine.</p>

<h2 id="how-does-it-work">How does it work?</h2>

<p>Drag a mass slider, add a lens, switch to the black hole mode, and the image starts being built. The very first frame you see is deliberately low-resolution (computed almost instantly), and it keeps sharpening on its own in the background through a whole ladder of intermediate resolutions, each pass replacing what’s on screen the moment it’s ready.</p>

<h2 id="two-different-physics-regimes">Two different physics regimes</h2>

<p><strong>Multi-lens (weak field):</strong> any combination of the six lens profiles, added additively, each with its own position including the line of sight, so you can push a lens toward or away from the source and watch the response.</p>

<p><strong>Black hole (Schwarzschild):</strong> exact strong-field geodesics around a single black hole, including real photon-sphere bending and a captured-photon shadow.</p>

<h2 id="try-it">Try it</h2>

<p><a href="/assets/excalibur_lensing_live/" class="btn btn--primary btn--large" target="_blank">
  ▶ Open the app
</a></p>

<p>The <a href="/random-science/interactive-gravitational-lensing-applet/">original lensing gallery</a> is still there and unchanged if you want the five halo shape comparison this new sandbox doesn’t try to replace.</p>

<p>Laurent MAGRI-STELLA</p>]]></content><author><name>Laurent Magri-Stella</name></author><category term="random-science" /><category term="gravitational lensing" /><category term="applet" /><category term="education" /><category term="ray tracing" /><summary type="html"><![CDATA[A new lensing tool that works in real time]]></summary></entry><entry><title type="html">Interactive gravitational lensing applet</title><link href="https://lmagristella.github.io/random-science/interactive-gravitational-lensing-applet/" rel="alternate" type="text/html" title="Interactive gravitational lensing applet" /><published>2026-05-29T00:00:00+00:00</published><updated>2026-05-29T00:00:00+00:00</updated><id>https://lmagristella.github.io/random-science/interactive-gravitational-lensing-applet</id><content type="html" xml:base="https://lmagristella.github.io/random-science/interactive-gravitational-lensing-applet/"><![CDATA[<h1 id="gravitational-lensing-download-link-at-the-bottom-of-the-post">Gravitational lensing (DOWNLOAD LINK AT THE BOTTOM OF THE POST!)</h1>

<p>Gravitational lensing is an idea that is easy to describe but might be hard to visualize if you’re not already familiar with some context. If you put enough mass between you and a distant galaxy, spacetime curves just enough that the galaxy’s light gets smeared on our sky into arcs, multiple images in extreme cases, and even rings. This little app lets you grab that galaxy and drag it around to watch it happen.</p>

<h2 id="what-youre-looking-at">What you’re looking at</h2>

<p>Two panels, side by side:</p>

<ul>
  <li><strong>Left, the source plane.</strong> Where the galaxy <em>actually</em> is. A glowing blob you can move with the mouse (or the sliders).</li>
  <li><strong>Right, the lensed sky.</strong> What a telescope on Earth would <em>see</em> after a massive dark matter halo (at redshift 1, a few billion lightyears away from us) bends the light on its way to us (from redshift 2, a few more billions lightyears away).</li>
</ul>

<p>Drag the source toward the center and watch your galaxy get split into arcs, break into multiple images and, in some cases, form a perfect circle: an Einstein ring. Every pixel of the resulting images come from photons traced through the curved spacetime around an NFW halo using EXCALIBUR, then mapped back to the sky.</p>

<h2 id="the-knobs">The knobs</h2>

<p>Sliders reshape the background galaxy (position, size, ellipticity, Sérsic index, brightness). Checkboxes to show some physical quantities:</p>

<ul>
  <li><strong>r_s</strong> : the halo’s scale radius,</li>
  <li><strong>θ_E</strong> : the Einstein radius,</li>
  <li><strong>critical curve</strong> : the curve where magnification blows up (the bright arcs live here),</li>
  <li><strong>caustic curve</strong> : the critical curve’s projection in the source plane: have your galaxy cross it, and new images will appear or vanish.</li>
</ul>

<h2 id="the-fun-part-five-halos-same-mass">The fun part: five halos, same mass</h2>

<p>The buttons above the checkboxes allows you to switch between five lens geometries, all have the same mass, just shaped and oriented differently:</p>

<table>
  <thead>
    <tr>
      <th>Profile</th>
      <th>What it is</th>
      <th>What we can see</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Spherical</strong></td>
      <td>a round halo</td>
      <td>an Einstein ring</td>
    </tr>
    <tr>
      <td><strong>Elliptical</strong></td>
      <td>a rugby ball lying sideways</td>
      <td>a cross, caustic opens into a 4-cusp shape called an <strong>astroid</strong></td>
    </tr>
    <tr>
      <td><strong>Inclined</strong></td>
      <td>the same ball, tilted 45° from the line of sight</td>
      <td>the ellipse relaxes toward a circle</td>
    </tr>
    <tr>
      <td><strong>Cigar parallel to the line of sight</strong></td>
      <td>the same ball, pointed at our eye</td>
      <td>looks round on the sky but lenses stronger than its spherical cousin</td>
    </tr>
    <tr>
      <td><strong>Triaxial</strong></td>
      <td>three unequal axes, random tilt</td>
      <td>the messy, most realistic case</td>
    </tr>
  </tbody>
</table>

<p>The most interesting case in my opinion is the cigar: it projects to a perfect circle, identical in symmetry to the sphere yet its Einstein ring is noticeably bigger.</p>

<h2 id="why-bother-doing-this-">Why bother doing this ?</h2>

<p>In reality, lenses are lumpy, often not simply triaxial, and randomly oriented. Playing with these idealized cases helps building some basic intuition to visualize the phenomenon! (and honestly, it’s just fun to bend light with a computer mouse, plus it looks cool!)</p>

<p>Thanks for reading and have fun!
Laurent MAGRI-STELLA</p>

<h2 id="access">Access</h2>

<p><a href="/assets/excalibur_lensing_webapp/" class="btn btn--primary btn--large" target="_blank">
  ▶ Ouvrir l’applet interactive
</a></p>

<p><strong>Update:</strong> there’s now a second, live version of this tool — instead of picking between precomputed lens shapes, you compose your own scene (any mix of lenses, or a Schwarzschild black hole) and EXCALIBUR ray-traces it <em>in your browser</em>, on the spot, via WebAssembly. See <a href="/random-science/live-gravitational-lensing-composer/">the live composer post</a> for details.</p>]]></content><author><name>Laurent Magri-Stella</name></author><category term="random-science" /><category term="gravitational lensing" /><category term="applet" /><category term="education" /><category term="ray tracing" /><summary type="html"><![CDATA[Gravitational lensing (DOWNLOAD LINK AT THE BOTTOM OF THE POST!)]]></summary></entry></feed>