Skip to content

Bugfix: fields and powers of beamlets in a medium - #175

Merged
StackEnjoyer merged 1 commit into
masterfrom
fix/gaussian-field-in-media
Oct 26, 2026
Merged

StackEnjoyer merged 1 commit into
masterfrom
fix/gaussian-field-in-media

Conversation

@TacHawkes

Copy link
Copy Markdown
Collaborator

Bugfixes

  • Changes results: electric_field(gauss, r, z) of a GaussianBeamlet was √n too large in a medium of index n
  • Changes results: beamlet_hit_field(::GaussianBeamletHit) was √n too large in a medium, also the PlaneField of the OpticsBase extension built from it
  • Changes results: optical_power(agb) and intensity(agb, r, z) of an AstigmaticGaussianBeamlet used Z₀ instead of Z₀/n, i.e. were n times too small in a medium; e.g. the transmitted child of a plate beamsplitter (n = 1.5) gave P0/3 instead of P0/2
  • Detector readouts (optical_power(pd), intensity(pd)) do not change: Feature: detector field of astigmatic beamlets as a 3D vector, Poynthing flux definition #161 already compensated the hit field of stigmatic beamlets, which the functions above bypassed

All field functions now return the physical field in V/m with the irradiance n|E|²/(2Z₀). The E0 of a GaussianBeamlet stays normalized to its power; the field of a segment in a medium is E0/√n.

Doc changes

  • Docstrings of GaussianBeamlet E0, electric_field, optical_power, beamlet_hit_field, GaussianBeamletHit

Internal changes

  • New test/TestBeamletFieldInMedia.jl: plate beamsplitter (substrate arm, normal and tilted), thick glass plate, detector in glass and in air; both beamlet models agree and against the analytic peak field √(4Z₀P/(nπw²))

Agent skill

  • components/beams-and-sources.md updated

…ty and power of astigmatic beamlets use the medium
@TacHawkes TacHawkes added this to the v0.14.0 milestone Oct 25, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T07:40:20.834872Z 349aaa0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.82%. Comparing base (008144c) to head (349aaa0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   90.30%   90.82%   +0.52%     
==========================================
  Files          86       86              
  Lines        4610     4612       +2     
==========================================
+ Hits         4163     4189      +26     
+ Misses        447      423      -24     

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

@StackEnjoyer
StackEnjoyer merged commit d66504c into master Oct 26, 2026
7 checks passed
@StackEnjoyer
StackEnjoyer deleted the fix/gaussian-field-in-media branch October 26, 2026 10:00
@StackEnjoyer

Copy link
Copy Markdown
Owner

Please create a bug issue in the future

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.

2 participants