Skip to content

fix: conjugate U and Vh in the vectorial birefringence inverse filter - #601

Open
talonchandler wants to merge 1 commit into
mainfrom
fix/vector-inverse-conj
Open

talonchandler wants to merge 1 commit into
mainfrom
fix/vector-inverse-conj

Conversation

@talonchandler

Copy link
Copy Markdown
Collaborator

Same root cause as #598, split from #600 because it changes birefringence outputs and deserves its own release note.

What

One line in inplane_oriented_thick_pol3d_vector.apply_inverse_transfer_function: build the Tikhonov filter from conj(U) and conj(Vh). For the forward model the least-squares inverse needs the conjugates.

Why it matters here

Unlike the scalar thin models, nothing masks the error: this model's transfer function is complex and not Hermitian-symmetric (asymmetry 0.14 at 5-State, NA 0.5/1.2). The unconjugated operator is not the pseudoinverse (200% operator error against torch.linalg.pinv; the conjugated filter matches pinv to float32 roundoff), and the recovered f00 phase channel comes back sign-flipped (star-phantom Pearson r -0.74 before, +0.73 after; the f2-2/f22 anisotropy channels improve from r 0.33/0.29 to 0.73/0.71).

Tests

  • test_inverse_filter_is_tikhonov_pseudoinverse: the applied filter must equal the independently built Tikhonov pseudoinverse at sampled frequencies.
  • test_round_trip_recovers_phantom: forward then inverse recovers the star phantom with positive correlation per channel.

Impact

Any pipeline using this model sees changed output (that is the fix: the old phase channel had the wrong sign). Release notes should call this out for birefringence users.

The Tikhonov filter in inplane_oriented_thick_pol3d_vector was built as
einsum(U, S_reg, Vh); the least-squares inverse of the forward model
needs conj(U) and conj(Vh). The model's transfer function is complex and
not Hermitian-symmetric, so unlike the scalar thin models nothing masks
the error: the unconjugated operator is not the pseudoinverse (200%
operator error against torch.linalg.pinv; the conjugated filter matches
pinv to float32 roundoff) and the recovered f00 phase channel came back
sign-flipped (star-phantom Pearson r -0.74 before, +0.73 after).

Same root cause as #598, split from #600 because it changes
birefringence outputs and needs its own release note.

Adds an operator-level pseudoinverse test and a phantom round-trip test.
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