Skip to content

feat: visibility-space iterative LM engine (interferometer phase 2a)#625

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/potential-correction-interferometer
Jul 17, 2026
Merged

feat: visibility-space iterative LM engine (interferometer phase 2a)#625
Jammy2211 merged 2 commits into
mainfrom
feature/potential-correction-interferometer

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Phase 2a of the interferometer potential-correction extension (#623; parent epic #618): the visibility-space iterative LM engine, al.pc.IterFitDpsiSrcInterferometer, plus IterDpsiSrcInvInterferometerAnalysis.

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 vector D = Aᵀ·dirty_image and the once-precomputed scalar dᴴC⁻¹d:

P(x) = ½(dᴴC⁻¹d − 2xᵀD + xᵀFx) + ½xᵀRx

so 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 + InputPotential from 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_test layer (visibility subhalo-recovery regression + jax_likelihood_functions/interferometer/potential_correction.py).

API Changes

Added only: al.pc.IterFitDpsiSrcInterferometer and al.pc.IterDpsiSrcInvInterferometerAnalysis + docs entries.
See full details below.

Test Plan

  • 5 new tests: χ² identity certification (the normal-equation χ² ≡ the directly-computed visibility χ² at the optimized state — the load-bearing check of the NUFFT-free loop), finite optimized state with cost beating the zero state, gauge constraints satisfied to 1e-6, finite Laplace evidence, loud missing-sparse-operator / missing-state errors.
  • Full test_autolens/potential_correction suite: 51 passed.
  • Full test_autolens suite 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); requires dataset.apply_sparse_operator().
  • al.pc.IterDpsiSrcInvInterferometerAnalysis(...)af.Analysis over the engine (failed inversions → logged −1e30 penalty).
  • docs/api/potential_correction.rst entries.

Migration

  • None — additive only.

Generated by the PyAutoLabs agent workflow.

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>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 17, 2026
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>
@Jammy2211
Jammy2211 merged commit 9b3683e into main Jul 17, 2026
4 of 5 checks passed
@Jammy2211
Jammy2211 deleted the feature/potential-correction-interferometer branch July 17, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant