Skip to content

Add ComplexZernike - #234

Merged
dlfivefifty merged 1 commit into
masterfrom
complexzernike
Oct 13, 2026
Merged

dlfivefifty merged 1 commit into
masterfrom
complexzernike

Conversation

@dlfivefifty

Copy link
Copy Markdown
Member

Adds ComplexZernike(a, b): the same ordering and radial parts as Zernike(a, b), but with sin(|m|θ) replaced by exp(-im*|m|*θ) and cos(|m|θ) by exp(im*|m|*θ). So the entry of degree ℓ and mode m is

r^|m| * jacobip((ℓ-|m|) ÷ 2, b, |m|+a, 2r^2-1) * exp(im*m*θ)

Following Laurent, the first type parameter is the (complex) element type, with a and b stored as reals: ComplexZernike() isa ComplexZernike{ComplexF64,Float64}.

Supported: evaluation (complexzernikez, normalizedcomplexzernikez), Normalized, transforms/expand, x .* C and y .* C, conversion to and from Zernike, conversion between parameters, lowering with Weighted, laplacian (weighted and unweighted), abslaplacian and sum. Plotting is not supported.

Implementation

  • New AbstractZernike supertype. Operators that act on each Fourier mode through the radial part (conversion, lowering, Laplacians, sum) are shared between Zernike and ComplexZernike. They now build Jacobi with real parameters even for complex element types.
  • Zernike and ComplexZernike are related by a block-diagonal matrix that mixes the ±|m| entries of each block. Between the normalized bases it is unitary.
  • Transforms reuse ZernikeTransform and then mix the Fourier modes of the coefficients.
  • Jacobi matrices are the Zernike ones conjugated by the mixing matrix. For Normalized(ComplexZernike()), X is real symmetric and Y is Hermitian.

Fixes to Zernike

  • AbstractQuasiArray{T}(::Zernike) dropped the parameters, so Zernike(0.1,0.2) \ f hung for complex f.

Notes

test/test_disk.jl passes locally, including a new ComplexZernike testset.

🤖 Generated with Claude Code

`ComplexZernike(a, b)` is ordered the same as `Zernike(a, b)` but with
`sin(|m|θ)` replaced by `exp(-im*|m|*θ)` and `cos(|m|θ)` by `exp(im*|m|*θ)`.
It supports evaluation, `Normalized`, transforms/`expand`, Jacobi matrices,
conversion to and from `Zernike`, lowering, the Laplacian, the fractional
Laplacian and `sum`. Operators that act on each Fourier mode are shared with
`Zernike` via a new `AbstractZernike` supertype.

Also fixes `AbstractQuasiArray{T}(::Zernike)` dropping the parameters, which
made `Zernike(0.1,0.2) \ f` hang for complex `f`.

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

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.11321% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.99%. Comparing base (d5106e6) to head (dfcb26a).

Files with missing lines Patch % Lines
src/disk.jl 98.11% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #234      +/-   ##
==========================================
+ Coverage   96.90%   96.99%   +0.08%     
==========================================
  Files           8        8              
  Lines        1100     1165      +65     
==========================================
+ Hits         1066     1130      +64     
- Misses         34       35       +1     

☔ 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 1d82aa5 into master Oct 13, 2026
6 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