Repository navigation
Description
Overview
InterferometerSparseOperator builds W~ = Re(FᴴWF) from a single precision operator computed with noise_map.real only (dataset.py:362). That is exact only when every visibility has equal real and imaginary sigma. With unequal sigmas the sparse InversionInterferometerSparse curvature matrix silently disagrees with the dense path (5e-16 → 5e-10..3e-2 relative, geometry dependent), on the single-mapper route too. Simulated and real datasets satisfy the equality, so it is latent — but nothing guards it. Found during #499/#500.
Plan
- Raise a clear
DatasetExceptionfromInterferometer.apply_sparse_operatorwhen any visibility has unequal real/imag sigma, naming the cause and the dense-path workaround. - Unit test: unequal sigma raises; equal, non-uniform sigma passes.
- Docstring notes on
apply_sparse_operatorandInterferometerSparseOperator. - Assess (in the PR, no implementation) whether a general two-operator extension is worth doing.
Detailed implementation plan
Affected Repositories
- PyAutoArray (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoArray | main | clean (parallel worktree alongside numba-cpu-nnls-iteration-reduction — disjoint files) |
Suggested branch: feature/sparse-interferometer-unequal-sigma-guard
Implementation Steps
autoarray/dataset/interferometer/dataset.py— at the top ofapply_sparse_operator,if not np.allclose(self.noise_map.real, self.noise_map.imag): raise exc.DatasetException(...)with a message stating the W~ operator is built from the real-part sigma only and requiressigma_real == sigma_imagper visibility; suggest not callingapply_sparse_operator(dense mapping path) or equalising the sigmas.- Same file /
inversion_interferometer_util.py— docstring notes on the precondition. test_autoarray/dataset/interferometer/test_dataset.py—test__apply_sparse_operator__unequal_real_imag_noise_raisesand an equal-but-non-uniform sigma control that succeeds.- PR body: short assessment of the two-operator generalisation (real- and imag-weighted precision operators combined in
apply_operator).
Key Files
autoarray/dataset/interferometer/dataset.py— guard + docstringtest_autoarray/dataset/interferometer/test_dataset.py— tests
Original Prompt
Click to expand starting prompt
Sparse interferometer W~ path silently assumes equal real/imag noise sigma
Type: bug
Target: PyAutoArray
Repos:
- PyAutoArray
- workspaces
Difficulty: medium
Autonomy: supervised
Priority: normal
Status: formalised
Sparse interferometer W~ path silently assumes equal real/imag noise sigma
Type: bug
Target: PyAutoArray
Repos:
- PyAutoArray
Difficulty: medium
Autonomy: supervised
Priority: normal
Problem
InterferometerSparseOperator builds the real-space operator W~ = Re(F^H W F) from a single
NUFFT precision operator. That reduction is only exact when every visibility has equal real and
imaginary noise sigma. With sigma_real != sigma_imag the sparse InversionInterferometerSparse
curvature matrix disagrees with the dense InversionInterferometerMapping path even on the
single-mapper route: measured 5e-16 relative with equal sigmas vs 5e-10 to 3e-2 with unequal
sigmas (geometry dependent). Pre-existing, not introduced by #500. SimulatorInterferometer and
real datasets satisfy the equality, so it is latent — but nothing guards it.
Fix
- Raise a clear
InversionException(or inInterferometer.apply_sparse_operator) when the noise
map has unequal real/imag sigma for any visibility, with a unit test. Do this first. - Assess extending the operator to the general case (two precision operators, real- and
imag-weighted, combined inapply_operator) — only if the cost is modest; otherwise the guard stands.
Context
Found 2026-08-28 while shipping #499 / #500. The misc/jax_assertions/fit_interferometer_sparse_operator.py parity
scripts in both test workspaces document the limitation in their
docstrings and deliberately use equal-sigma noise maps; they need no change.
Activity
Jammy2211 commentedon Aug 28, 2026
Shipped
#503 —
Interferometer.apply_sparse_operatornow raisesDatasetExceptionwhen any visibility has unequal real/imag noise sigma, naming the count, the max relative difference and both workarounds; docstring preconditions onapply_sparse_operatorandInterferometerSparseOperator; two tests. Assessment in the PR: the general two-operator extension needs a second, pixel-sum-indexed kernel and is not worth it for any known dataset — not doing it.