Skip to content

feat: visibility-space potential corrections — sparse-operator route (interferometer phase 1) - #624

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/potential-correction-interferometer
Jul 17, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/potential-correction-interferometer

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of extending the potential-correction (gravitational imaging) subpackage to interferometer data (#623; parent epic #618): al.pc.FitDpsiSrcInterferometer jointly inverts visibilities for the pixelized source and pixelized potential corrections δψ, plus DpsiSrcInvInterferometerAnalysis for evidence-based hyper-parameter sampling. This reaches toward the technique's benchmark regime — the JVAS B1938+666 detections (Powell et al. 2025, Nat. Astron. 9, 1714; Vegetti et al. 2026) were made in visibility space.

The sparse-operator (w-tilde) route is the primary implementation, per the scaling requirement: the joint curvature [f | G]ᵀ·(TᴴC⁻¹T)·[f | G] (source mapping block f, correction response G = −D_s·D_ψ) is assembled through the dataset's InterferometerSparseOperator FFT machinery from extent-indexed COO triplets — one curvature_matrix_diag_from call over the concatenated blocks — and the data vector against the dirty image, so cost scales with real-space mask pixels, independent of the visibility count. χ² costs a single forward NUFFT of the reconstructed image. The dense transform_mapping_matrix route (real/imag row-stacked) is retained behind use_sparse_operator=False as the small-n_vis parity reference. Evidence uses the complex-noise normalization (noise_normalization_complex_from) with per-component χ².

The δψ mesh builds from the dataset's real-space mask via the existing PairRegularDpsiMesh; source gradients remain image-plane; dense_util's xp kernels are consumed unchanged (data-agnostic). Requires dataset.apply_sparse_operator() for the sparse route (loud InversionException otherwise — no silent fallback).

Phase 2 (follow-up on #623): the iterative LM engine's interferometer seam and the autolens_workspace_test scripts (visibility subhalo-recovery regression + jax_likelihood_functions/interferometer/potential_correction.py).

Cites Cao et al. 2025 (https://github.com/caoxiaoyue/lensing_potential_correction; cite via https://github.com/caoxiaoyue/potential_correction_paper).

API Changes

Added only — nothing removed or changed: al.pc.FitDpsiSrcInterferometer and al.pc.DpsiSrcInvInterferometerAnalysis, plus docs entries.
See full details below.

Test Plan

  • 4 new tests: sparse route ≡ dense route on the interferometer_7 fixture (curvature, data vector, evidence — the load-bearing parity), end-to-end finite evidence with correct block shapes, hand-computed dense evidence terms (solution/χ²/noise normalization), and the loud missing-sparse-operator error.
  • Full test_autolens/potential_correction suite: 46 passed.
  • Full test_autolens suite run before commit (execution contract).
Full API Changes (for automation & release notes)

Added

  • al.pc.FitDpsiSrcInterferometer(dataset, lens_start, source_start, dpsi_pixelization, src_pixelization, src_image_mesh=None, settings_inversion=None, use_sparse_operator=True, preloads=None) — visibility-space joint source+δψ inversion; log_evidence, solve_src_dpsi, best_fit_source/best_fit_dpsi, model_visibilities, sparse (curvature_matrix_diag_from w-tilde) and dense (operated_mapping_matrix) routes.
  • al.pc.DpsiSrcInvInterferometerAnalysis(...) — af.Analysis with the visibility evidence as likelihood (failed inversions → logged −1e8 penalty).
  • docs/api/potential_correction.rst entries for both.

Migration

  • None — additive only.

Generated by the PyAutoLabs agent workflow.

Adds al.pc.FitDpsiSrcInterferometer — the joint source+dpsi inversion
of interferometer visibilities — with the sparse-operator (w-tilde)
route as the primary implementation (joint curvature via the dataset's
InterferometerSparseOperator FFT machinery from extent-indexed COO
triplets; data vector via the dirty image; chi2 via one forward NUFFT;
scales with real-space pixels, independent of visibility count) and
the dense transform_mapping_matrix route as the small-n_vis parity
reference. Adds DpsiSrcInvInterferometerAnalysis + docs entries.
Sparse route verified identical to the dense route on the
interferometer_7 fixture.

Phase 1 of #623 (parent epic #618). Ported and
extended from Cao et al. 2025
(https://github.com/caoxiaoyue/lensing_potential_correction); cite via
https://github.com/caoxiaoyue/potential_correction_paper.

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
@Jammy2211
Jammy2211 merged commit a9805ce into main Jul 17, 2026
4 of 5 checks passed
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant