Jashcraf / poke

Poke (pronounced poh-keh) is a Polarization Ray Tracing and Gaussian Beamlet module for Python
BSD 3-Clause "New" or "Revised" License
32 stars 6 forks source link

Propagated complex parameter (Qpinv) mistakenly used to calculate amplitude instead of Source complex parameter (Qinv) #108

Open DavidLanders95 opened 1 month ago

DavidLanders95 commented 1 month ago

Equation (8) of Hybrid propagation physics for the design and modeling of astronomical observatories: a coronagraphic example

image

shows the the source complex parameter $Q_1 ^{-1}$ is used to calculate the change in amplitude, but this line in beamlets.py uses Qpinv instead.

https://github.com/Jashcraf/poke/blob/035345a7e95e2493590a72e8589d788414e245e9/poke/beamlets.py#L763

Which value of $Q^{-1}$ should it be? I think $Q_1 ^{-1}$ is the correct value when I have compared to the analytic result of gaussian amplitude propagation as described by Goodman.

By the way, really glad somebody made gaussian beam propagation open source, your papers and work make it much easier to implement.

Jashcraf commented 1 month ago

Hi there thanks for opening this issue!

I think you're right on the money with this, the literature certainly suggests that this should be Qinv instead of Qpinv like Poke does on line 763. I suppose this is a great example of why variable names are important, I must have written the wrong one by accident and not noticed when I went to double-check!

Interestingly, despite this bug I haven't noticed any errors in the fields I've been simulating. Let me try play around with it a bit and I'll get back to you.

Honestly this is a great motivator to finally add tests to the poke.beamlets module! Happy to hear that my work makes these physics a little easier to implement :) I had some difficulty getting started and I wanted to try to make it easier for everyone else.