Add oracle-validation example for cross-polarized transmittance - #121
Merged
Conversation
Checks the per-eigenmode T decomposition against closed-form physics the Berreman code was never fitted to, not just internal budget closure: 1. Air | uniaxial half-space (optic axis y): Tpp/Tss match the textbook per-axis Fresnel transmittances with n_o/n_e — including the per-mode n cos(theta_t) flux factors — to ~1e-15; cross terms exactly zero. 2. Calcite-like half-wave plate at 45 deg: transfer() Tps/Tpp match an exact Jones x Airy per-eigenmode etalon oracle to ~1e-15, with the classic sin^2(pi dn t / lambda) conversion envelope overlaid; both per-input budgets close to 1e-12 across the sweep. 3. Migration note for <= v3.2.1 readers: Tpp at the half-wave point is now the co-polarized share (~0.0004), not the total (~0.848), so Rpp+Rps+Tpp no longer reads 1 — the closed budget is four-channel. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The guard for a degenerate eigenmode span with no Ey content (no s-like direction to orient to) was the one line of the cross-polarization fix without coverage; pin its pass-through contract, including the backward -pair sign convention, with a direct unit test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
==========================================
+ Coverage 99.29% 99.41% +0.11%
==========================================
Files 15 15
Lines 853 853
==========================================
+ Hits 847 848 +1
+ Misses 6 5 -1 ☔ 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.
Summary
examples/anisotropic_fresnel_validation.jl, validating the per-eigenmode transmittance decomposition against closed-form physics (Fresnel per-axis T for a uniaxial half-space; a Jones × Airy etalon oracle for a half-wave plate at 45°) rather than just internal budget closure._orient_degenerate_pair, the one line of the cross-polarization fix that was previously untested.Test plan
julia --project=. -e 'using Pkg; Pkg.test()'passes (all suites, including the new test)julia --project=. examples/anisotropic_fresnel_validation.jlruns cleanly and all validation checks pass to ~1e-15