feat: visibility-space iterative LM engine (interferometer phase 2a)#625
Merged
Conversation
Adds al.pc.IterFitDpsiSrcInterferometer: the joint source+dpsi Levenberg-Marquardt loop for interferometer data, run entirely in the real-space normal-equation space (F = A^T Wtilde A via the sparse operator, D = A^T dirty_image, precomputed d^H C^-1 d) so no per-candidate NUFFT is needed and cost scales with real-space pixels. Re-traces through the corrected lens (InputPotential) each accepted step; optional gauge constraints via the shared KKT step; Laplace evidence with complex-noise normalization. Chi2 identity certified against the direct visibility chi2 in tests. Adds IterDpsiSrcInvInterferometerAnalysis + docs entries. Phase 2a of #623 (parent epic #618). Cao et al. 2025 citations maintained. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The real-space mask must stay filled (it defines the sparse operator's FFT extent) but the corrections are only constrained on the arcs: dpsi_mask restricts the dpsi mesh to an arc-tracing sub-mask, with the correction response rows embedded back into the full real-space row space. Improves the one-shot recovery (corr 0.35, peak 0.13" on the synthetic validation) and mirrors the imaging convention. Part of #623. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2a of the interferometer potential-correction extension (#623; parent epic #618): the visibility-space iterative LM engine,
al.pc.IterFitDpsiSrcInterferometer, plusIterDpsiSrcInvInterferometerAnalysis.Scaling design per the sparse-operator requirement: the Levenberg–Marquardt loop runs entirely in the real-space normal-equation space. The penalized objective, gradient and Hessian are expressed through the joint curvature
F = Aᵀ(TᴴC⁻¹T)A(rebuilt per accepted step via the sparse operator's FFT machinery from the re-traced mapper + correction-response triplets), the data vectorD = Aᵀ·dirty_imageand the once-precomputed scalardᴴC⁻¹d:P(x) = ½(dᴴC⁻¹d − 2xᵀD + xᵀFx) + ½xᵀRxso no per-candidate NUFFT is required — cost scales with real-space mask pixels, independent of the visibility count. Each accepted step re-ray-traces the real-space grid through the corrected lens (macro model +
InputPotentialfrom the current δψ) and re-evaluates the source gradients from the current pixelized source reconstruction (PixSrcFactoryITP), exactly mirroring the imaging engine's feedback loop. Optional gauge constraints (⟨δψ,1⟩ = ⟨δψ,x⟩ = ⟨δψ,y⟩ = 0) via the shared KKT step; Laplace evidence with the complex-noise normalization.Cites Cao et al. 2025 (https://github.com/caoxiaoyue/lensing_potential_correction; cite via https://github.com/caoxiaoyue/potential_correction_paper); methodology per the B1938+666 papers (Powell et al. 2025; Vegetti et al. 2026).
Phase 2b (next): the
autolens_workspace_testlayer (visibility subhalo-recovery regression +jax_likelihood_functions/interferometer/potential_correction.py).API Changes
Added only:
al.pc.IterFitDpsiSrcInterferometerandal.pc.IterDpsiSrcInvInterferometerAnalysis+ docs entries.See full details below.
Test Plan
test_autolens/potential_correctionsuite: 51 passed.test_autolenssuite run before commit (execution contract).Full API Changes (for automation & release notes)
Added
al.pc.IterFitDpsiSrcInterferometer(dataset, lens_start, dpsi_pixelization, src_pixelization, gauge_constraints=False, ..., n_iter=20, tol=1e-6)—solve_joint_optimization(),log_evidence(s, dpsi); requiresdataset.apply_sparse_operator().al.pc.IterDpsiSrcInvInterferometerAnalysis(...)—af.Analysisover the engine (failed inversions → logged −1e30 penalty).docs/api/potential_correction.rstentries.Migration
Generated by the PyAutoLabs agent workflow.