Repository navigation
feat: matrix-free interferometer data operator + Powell-preconditioned PCG (phase 1 of #638) - #645
Merged
Conversation
…ned PCG (phase 1 of #638) Adds inversion_interferometer_matrix_free_util (numpy/scipy only): a sparse mapping matrix from the slim triplets, MatrixFreeDataOperator applying F s = M^T W~ M s by one rfft2/irfft2 pair on the 2x padded extent grid and D = M^T d~, the Powell et al. (2021) preconditioner kappa0 M^T M + lambda H factorised by splu, and a scipy cg reconstruction. No fit wiring, no Settings flag, no JAX; parity tests against InversionInterferometerSparse. Closes #642 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 21, 2026
This was referenced Oct 26, 2026
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.
Closes #642. Phase 1 of #638. Community proposal: PyAutoLabs/.github#39 (@HRSAstro), reference snippets attached there.
Summary
Lands the matrix-free interferometer data term and solver as numpy/scipy library utilities with parity tests against the current sparse (w-tilde) path. No fit wiring, no Settings flag, no JAX in this phase.
New module
autoarray/inversion/inversion/interferometer/inversion_interferometer_matrix_free_util.py:sparse_mapping_matrix_from(inversion, mapper)— the mapper's mapping matrix as ascipy.sparse.csr_matrixfrom the existing slim triplets (equal tomapper.mapping_matrixexactly; a primary beam folds in via the triplets as on the sparse path).MatrixFreeDataOperator(from_inversion) — holds the w-tilde kernel, slim dirty image, mask and M/Mᵀ;wtilde_image_from(image_extent)applies W̃ by one FFT pair on the 2× padded extent grid (matchessparse_operator.apply_operatorexactly);curvature_matvec(s)= Mᵀ W̃ M s;data_vector= Mᵀ d̃;kappa0= W̃ zero-lag value.powell_preconditioner_from— P = κ₀ MᵀM + H (Powell et al. 2021), sparse LU factorised once.reconstruction_via_pcg_from— preconditioned CG on (F + H) s = D viascipy.sparse.linalg.cg.Autoarray regularization matrices already carry their coefficient, so H is any existing
regularization_matrixconverted to sparse (the sparse Matérn precision is phase 2). Module docstring records the deferred JAX questions (fixed iteration count vs while_loop, static-nnz triplets, LU replacement under jit) and the single-mapper limitation.API Changes
Additive only: one new utility module (not exported through
aa). No existing behaviour changes.See full details below.
Test Plan
test_autoarray/inversion/inversion/interferometer/test_matrix_free_util.py(10 tests, run on the nojax leg too), on a circular 12×12 mask, sub-size 2, 6×6 rectangular mesh, 40 random visibilities (DFT):mapper.mapping_matrixexactly (rectangular and Delaunay).curvature_matvecvscurvature_matrix @ v: 1.8e-15 (coefficient 1.0), 2.2e-16 (0.01);data_vector: 2.6e-16;wtilde_image_from==apply_operatorexactly.use_positive_only_solver=False): 3.6e-11 and 7.2e-10 for two Constant coefficients (Witness target 1e-8).pytest test_autoarray/inversion -q→ 1032 passed, 4 xfailed; nojax emulation 10 passed with no jax modules loaded.Heart YELLOW acknowledged by the human on 2026-10-21 (manifest drift 1 mismatch; release validation stale: source moved since rehearsal (PyAutoArray)).
Full API Changes (for automation & release notes)
Added
autoarray.inversion.inversion.interferometer.inversion_interferometer_matrix_free_util—sparse_mapping_matrix_from(inversion, mapper),MatrixFreeDataOperator(from_inversion,wtilde_image_from,curvature_matvec,data_vector,kappa0,params),powell_preconditioner_from(operator, regularization_matrix_sparse, coefficient),reconstruction_via_pcg_from(operator, regularization_matrix_sparse, coefficient, x0=None, rtol=1e-8, maxiter=5000).Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code