Skip to content

Define inv for all FFTW synthesis and analysis plans - #278

Merged
dlfivefifty merged 1 commit into
masterfrom
fftw-inv
Nov 24, 2026
Merged

dlfivefifty merged 1 commit into
masterfrom
fftw-inv

Conversation

@dlfivefifty

Copy link
Copy Markdown
Member

#274 defined inv for the disk synthesis and analysis plans. This PR defines it for all the FFTW grid plans: sph, sphv, disk, annulus, rectdisk, tri, tet and spinsph. The inverse of a synthesis plan is the analysis plan of the same size, and vice versa:

ps = plan_tri_synthesis(A)
inv(ps) isa typeof(plan_tri_analysis(A))   # true

Each inv is defined in the loop that generates the plans, next to adjoint/transpose. It builds the opposite plan with the same parameters, as those already do: ρ via ft_get_rho_annulus_fftw_plan for the annulus, and the spin via get_spin for spinsph. This replaces the two standalone disk definitions from #274, so the disk behaves as before.

Before adding this I checked that each pair really are inverses. For n = 10 and random data, analysis∘synthesis and synthesis∘analysis both reproduce the input to a relative error of at most 4e-16 for all eight kinds.

Tests

test_nd_plans is already called for every kind, with both real and complex data. It now also checks inv(ps) isa typeof(pa), inv(pa) isa typeof(ps), and that inv(ps)/inv(pa) agree with pa/ps on data produced by the coefficient transforms. That adds 75 tests, and the full suite passes.

Notes

🤖 Generated with Claude Code

inv of a synthesis plan is the analysis plan of the same size and
parameters, and vice versa. This generalises the disk-only definitions
from #274 to the sph, sphv, annulus, rectdisk, tri, tet and spinsph plans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.50%. Comparing base (abdbeff) to head (7778128).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #278      +/-   ##
==========================================
+ Coverage   77.48%   77.50%   +0.01%     
==========================================
  Files          17       17              
  Lines        3247     3249       +2     
==========================================
+ Hits         2516     2518       +2     
  Misses        731      731              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlfivefifty
dlfivefifty merged commit 4571ebf into master Nov 24, 2026
20 checks passed
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