TeamAtomECS / AtomECS

Cold atom simulation code
GNU General Public License v3.0
46 stars 11 forks source link

Simplifying GaussianBeam power calculation in `from_peak_intensity` #69

Closed minghuaw closed 1 year ago

minghuaw commented 2 years ago

There are two problems though the converted power in the current implementation is correct.

First question

https://github.com/TeamAtomECS/AtomECS/blob/f2a58047b5c8650c8b055f9ff0dba1cdd3296fda/src/laser/gaussian.rs#L71

Shouldn't the right hand side be multiplying e_radius by sqrt(2)?

https://github.com/TeamAtomECS/AtomECS/blob/f2a58047b5c8650c8b055f9ff0dba1cdd3296fda/src/laser/gaussian.rs#L72

Shouldn't the right hand side be like divide the product of peak_intensity, pi e^2_radius by 2 instead of multiplying it by 2?

Given that

Screen Shot 2021-12-16 at 7 33 07 PM (Edmund's optics, RP Photonics)

Rearranging would give

Screen Shot 2021-12-16 at 7 47 39 PM

Second question

According to the documentation

https://github.com/TeamAtomECS/AtomECS/blob/f2a58047b5c8650c8b055f9ff0dba1cdd3296fda/src/laser/gaussian.rs#L37

making the changes suggested in Q1 would give the same result because following the suggestion above would give

Screen Shot 2021-12-16 at 7 56 14 PM

And the current implementation is

Screen Shot 2021-12-16 at 8 00 19 PM

which gives the same result.

However, this leads to the problem of a small optimization where the square root and the multiply by two can be simply neglected.

ElliotB256 commented 2 years ago

I think it depends on what you define as the waist, and there are a few different definitions. The current components are defined in terms of the '1/e radius of intensity', r_0, such that I(r) = I_0 exp((-r / r_0)^2). A more common definition is the beam waist, w, taken such that this is the beam diameter over which the intensity is equal to I_0 exp(-2). They differ by a factor of 2 sqrt(2). I haven't yet had a chance to review your numbers, but hope to soon.

minghuaw commented 2 years ago

The problem is not really with the waist definition. It's essentially redundant operations (divide by sqrt(2), take the square and then multiply by 2, which cancels out).

BrianBostwick commented 1 year ago

This is the is the same issue that we just closed @ElliotB256, I am going to create a pull request for this now.

BrianBostwick commented 1 year ago

Also, we can probably close this issue as well now.