**Mathelirium** @mathelirium [2026-01-20](https://x.com/mathelirium/status/2013633501283639784/history)
Phase Retrieval: Recovering What You Can’t Measure
Lecture 1
One of the hardest inverse problems in science.
Do you know how your eye or a camera sensor actually sees an image? The sensor doesn’t record the wave itself. It records photon flux, which in wave language is intensity, a time-average of |field|². Phase still shapes what reaches the sensor through propagation and focusing, but at the pixel level the measurement is brightness.
So here’s the old, stubborn question behind a lot of optics, microscopy, astronomy, and wave imaging. If the object you care about is a complex field ψ(x), why does the world hand you only |ψ(x)|²? And when it does, what can you still recover about the phase that got erased at detection?
You have the field ψ(x) = r(x) exp(i θ(x))
Your detector stares at that and reports only
I(x) = |ψ(x)|² = r(x)².
The angle θ vanishes. So how do you get it back?
This lecture is the first, most basic approach one can think of...don’t try to make an intensity-only sensor magically phase-sensitive. Instead, force the phase to show up by interfering ψ with a known reference wave, and measure the intensity of the sum.
In the render, we do this with a normal image used as the amplitude r(x). The top-left panel is the only thing a sensor would give you directly...I(x) = |ψ|². The top-right panel is the interferogram Iᵤ(x;δ) = |ψ + R e^{iδ}|² as a phase knob δ(t) is swept, so fringes slide even though r(x) stays fixed. The bottom-left panel isolates the signed cross-term (the phase leak) that drives those fringes. And the bottom-right panel is the payoff: after reconstructing θ̂(x) from four phase-shifted interferograms, we form ψ̂(x) = r(x) exp(i θ̂(x)) and display Re(ψ̂). That last image is not a phase color wheel...it’s a reconstructed wave-image built using the recovered phase.
The gentle math breakdown
Intensity hides phase for a single field, but it cannot hide phase for a superposition. Add a known reference wave
R(x) = A(x) exp(i φ(x))
and interfere it with ψ by forming
u(x) = ψ(x) + R(x).
The detector measures
I\_u(x) = |u(x)|² = |ψ(x) + R(x)|².
Expand it
I\_u
\= (ψ + R)(ψ\* + R\*)
\= |ψ|² + |R|² + ψ R\* + ψ\* R
\= I + |R|² + 2 Re(ψ R\*).
That last term is where phase leaks back into something measurable.
Insert polar forms
ψ R\*
\= \[r exp(iθ)\] \[A exp(−iφ)\]
\= r A exp(i(θ − φ)).
So the cross-term becomes
2 Re(ψ R\*) = 2 r A cos(θ(x) − φ(x)),
and therefore
I\_u(x) = r(x)² + A(x)² + 2 r(x) A(x) cos(θ(x) − φ(x)).
Now introduce the phase knob. Shift only the reference by a known δ
R(x) → R(x) exp(i δ).
Then φ(x) → φ(x) + δ, so
I\_u(x; δ) = r² + A² + 2 r A cos(θ − φ − δ).
So a single intensity image deletes θ, but a controlled family of interferograms forces θ to show itself through a predictable cosine swing.
#PhaseRetrieval #Interference #Optics #ImagingScience #Holography #ComputationalImaging #SignalProcessing #Mathematics #Physics
Mathelirium ✓ @mathelirium · 5h
Now that we've seen a single random-walk MCMC get trapped in one valley and pretend that's the whole posterior, this scene shows one of the nicest fixes called Parallel Tempering.
Instead of one lonely chain at the true temperature, we run a ladder of copies at different "heat levels" on the same landscape. The cold chain still sees the sharp, deep wells, but the hotter chains see a flattened version where barriers are lower and it's easy to wander between basins.
Every few steps we let neighbouring temperatures swap states, so when a hot chain discovers a distant well it can hand that discovery back down to the cold chain. Visually you see faint hot blobs roaming the whole surface while the dark cold chain suddenly starts teleporting between wells it could never reach on its own. This is a geometry-aware algorithm.
#MCMC #ParallelTempering #BayesianInference #ComputationalStatistics #MonteCarlo #MultimodalPosteriors #HighDimensionalSpace
[Embedded video, paused at 0:51: animated 3D visualization titled "PARALLEL TEMPERING - HOT CHAINS, COLD POSTERIOR / Cold chain (β = 1) visiting multiple wells via swaps with hotter chains" — shows a 3D landscape with a wandering trajectory over multiple wells, a density histogram plot of target vs empirical distribution from the cold chain, a 2D scatter plot of posterior samples with cold chain path, and a step plot of which mode the cold chain occupies over time.]
Note from Claude Sonnet 5
An educational thread/animation explaining the Parallel Tempering MCMC algorithm for sampling multimodal posterior distributions. General computational statistics content, not directly tied to AI safety/alignment threads, though MCMC and posterior sampling techniques are occasionally relevant background for Bayesian ML methods.
mcmcbayesian inferencestatisticsmachine learningmonte carlotwittermath
[Partial preceding tweet, cut off at top]: "...generator companies. ..."
250 replies, 542 reposts, 6.9K likes, 1M views
Mathelirium @mathelirium · Nov 30
This Cortaderia-like plots of Collatz sequences grows out of an idea first explored by the British mathematician Edmund Harriss, who drew Collatz trees by letting each step bend clockwise or anticlockwise depending only on whether the next value was even or odd.
Here we keep that spirit of "let the rule draw itself" but turn up the resolution: instead of just checking parity, each number's curvature in the path is determined by its remainder when divided by a chosen value, and that remainder controls both how sharply the trajectory rotates and how much it rises or falls. By letting different modular choices sculpt the bend and elevation of every step, the same underlying Collatz dynamics blossom into radically different structures that look like fields of arithmetic wildflowers, revealing extra layers of texture in a problem that is still completely unresolved.
#CollatzConjecture #MathArt #ModularCurvature #NumberTheory #DataVisualization
[Image: "Collatz Sequence Curvature On Division by 89" — a swirling pink/purple/yellow plume of curved trajectory lines resembling a plant or feather, on black background]
Note from Claude Sonnet 5
A math-art tweet visualizing Collatz conjecture sequences as curved trajectories whose bend is set by remainder-mod-89, producing organic wildflower/plume-like images. Aesthetic mathematical content, no direct AI-safety relevance.
collatz conjecturemath artnumber theorydata visualizationtwitter
Mathelirium @mathelirium · 18h
Laniakea Supercluster
This is not a nebula but a map of galaxy motion around us from Cosmicflows-4 arxiv.org/abs/2209.11238 Silk lines trace how matter drifts under gravity... gold marks our basin pulling us in, teal shows neighboring streams. The stardust are real galaxy groups. 🤩🤩🤩
[Image: a data visualization resembling a glowing teal-and-gold nebula-like web of flowing lines converging on a bright orange-gold core, representing galaxy motion vectors around the Laniakea Supercluster, watermarked "@Mathelirium".]
Note from Claude Sonnet 5
A tweet sharing a data visualization of galaxy motion around the Laniakea Supercluster (based on the Cosmicflows-4 dataset), styled to look like a nebula. Astronomy/cosmology content, no direct AI relevance.
astronomycosmologylaniakeadata visualizationtwitter