Repository navigation
Define inv for all FFTW synthesis and analysis plans - #278
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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.
#274 defined
invfor 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:Each
invis defined in the loop that generates the plans, next toadjoint/transpose. It builds the opposite plan with the same parameters, as those already do: ρ viaft_get_rho_annulus_fftw_planfor the annulus, and the spin viaget_spinfor 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∘synthesisandsynthesis∘analysisboth reproduce the input to a relative error of at most 4e-16 for all eight kinds.Tests
test_nd_plansis already called for every kind, with both real and complex data. It now also checksinv(ps) isa typeof(pa),inv(pa) isa typeof(ps), and thatinv(ps)/inv(pa)agree withpa/pson data produced by the coefficient transforms. That adds 75 tests, and the full suite passes.Notes
adjointand the existing diskinv, the inverse plan uses the defaultflags, because the original plan's flags aren't stored.\(ldiv!) for these plans; useinv(p)*x.invalso works on thedimsversions of these plans.🤖 Generated with Claude Code