Skip to content

Add oracle-validation example for cross-polarized transmittance - #121

Merged
garrekstemo merged 2 commits into
mainfrom
merge-anisotropic-fresnel-example
Jul 7, 2026
Merged

Add oracle-validation example for cross-polarized transmittance#121
garrekstemo merged 2 commits into
mainfrom
merge-anisotropic-fresnel-example

Conversation

@garrekstemo

Copy link
Copy Markdown
Owner

Summary

  • Adds 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.
  • Adds unit test coverage for the no-ŷ pass-through branch of _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.jl runs cleanly and all validation checks pass to ~1e-15

garrekstemo and others added 2 commits July 7, 2026 13:12
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

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.41%. Comparing base (f9a6a1d) to head (f5d2da7).

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.
📢 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.

@garrekstemo
garrekstemo merged commit b99a2e9 into main Jul 7, 2026
4 checks passed
@garrekstemo
garrekstemo deleted the merge-anisotropic-fresnel-example branch July 7, 2026 04:30
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