Repository navigation
Bugfix: GaussianBeamlet w0 for tilted axes and M2, model limit - #212
Conversation
At the waist of a beamlet on a tilted axis the height of the divergence ray is rounding noise, and its slope was taken from the direction of that noise: w0 came out up to 4000 times too small exactly at the waist. The offsets and slopes of the waist and divergence rays are now transverse vectors, and the Lagrange invariant H = n (y_w . v_d - y_d . v_w) is exactly constant along a segment. H was replaced by lambda/pi when it differed by more than the absolute get_invariant_threshold(), which gave w0 / M2 for large M2 or lambda and never warned. H is now used as traced. Both beamlet models compare it with its start value within get_lagrange_tolerance() through one shared check, check_lagrange_invariants: a GaussianBeamlet that leaves its model stops tracing with a warning, check_invariant = false turns the check off. The lambda phase shift test of the detector traces a beamlet whose invariant drops to 3 % behind a ball-like lens and now passes check_invariant = false. The shared check is recorded as rule I2 in AGENTS.md. Fixes #209, fixes #210 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 #212 +/- ##
==========================================
+ Coverage 91.57% 91.85% +0.28%
==========================================
Files 86 86
Lines 4439 4434 -5
==========================================
+ Hits 4065 4073 +8
+ Misses 374 361 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Agent review, round 1: approve · 0 blocker, 0 should, 1 nit, 1 note · merges cleanly, 5480 tests pass Full review for agents (2 findings)Scope
Verified
FindingsF1 · nit ·
|
height_slope was its only reader. Review F1 of #212. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent response to review round 1 · 1 fixed, 1 noted · tests pass Full response for agentsFindingsF1 · fixed in 8484d0d
F2 · notedAgreed: the lens example of #210 stays inside Verified
|
|
Review round 2: approved for merge |
Bugfixes
gauss_parameters:w0up to 4000× too small exactly at a tilted waistgauss_parameters:w0came out asw0 / M2for largeM2or λGaussianBeamletstops with a warning once its Lagrange invariant leavesget_lagrange_tolerance()check_invariant = falseturns that check off;get_invariant_threshold()only limits the astigmatic complex invariantDoc changes
API.mdandcomponents/beams-and-sources.mdupdatedInternal changes
Closes #209, closes #210