Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello philsol: May I ask what meaning is this code or which paper is it from? #4

Open
Hd-Edison opened this issue Jan 4, 2023 · 10 comments

Comments

@Hd-Edison
Copy link

Hello philsol:
May I ask what meaning is this code or which paper is it from? It's in philsol-master/examples/example_KTP_waveguide.ipynb.

      def n_guide(lam):
          A = 2.17954368571 
          B = np.log(2.17954368571 / 1.75292972992) / 0.7
          return A * np.exp(- B * (lam - 0.3)) 

     And thanks for your work.                     Hd-Edison
@philmain28
Copy link
Owner

philmain28 commented Jan 12, 2023

Ah yes it might not be clear from the description but it is an algorithm to track a mode over a wide range of wavelengths in a highly multimode structure. To get the full picture look at the cell below. These kind of trick can be quite important for structures like the one shown in

https://github.com/philmain28/philsol/blob/ea0cffa7fe75824b37f664e20b40b1dde0c2facc/examples/Hollow_Core_Fibre.ipynb

Anyway the steps in the algorithm are something like this:

  • Calculate n at the extremes of the range
  • Come up with a simple fitting function between them
  • Use the fit to come up with an accurate initial guess to pass to the eigensolver
  • Solve for enough modes that you can be sure you caught the one you are interested it
  • Calculate the overlap between modes that are adjacent in wavelength to check you have the mode you are interested in (this is related to the concept of adiabatic taper transition only with wavelength rather than width)

If you plot the refractive index without the sorting you will see the problem which is being solved.

@Hd-Edison
Copy link
Author

Thanks for your reply!
I've read [Hollow_Core_Fibre.ipynb], however I am lack of knowledge in this area, so there are still plenty of questions in my mind, so may I ask which book or paper you refered to when you were writting these codes? It will help me a lot, thank you.

@philmain28
Copy link
Owner

philmain28 commented Jan 30, 2023

The structure used in that particular notebook has now been published, you can read about it here.

The physics behind them are pretty interesting (and not super well established). They guide using antiresonance effects (like photonic crystal waveguides etc) rather than potential confinement (waves in a box). In general the examples are a mishmash of my research interests (quantum optics) and the people around me at the time (fibre optics). My thesis might give a bit more context or if nothing else give some useful references. I'm not sure there is much published on the computational methods because a lot of this stuff is relatively old hat/not containing enough physics to be interesting. That's kind of the point of phisol because a lot of research groups are using expensive commercial solvers for problems that are relatively straight forward/solved.

If you point me towards the problem you are trying to solve maybe I can be a bit more helpful but some nice (graduate level) texts on all things about waveguides are:

Comprehensive:
snyder and love optical waveguide theory

More general photonics but including waveguides:
gaponenko (more accessible)
joannopoulos

@Hd-Edison
Copy link
Author

Thanks for your meticulous reply!
In fact, I'm trying to write some python code that can set a mode source and waveguides, then caculate the E and H field of the light propagation, but I find I'm so lack of knowledge, lol
The book Introduction to Nanophotonics has so many pages, it may takes me hundres of hours to read it, lol
And the information you shared do helped me a lot, thank you again

@Hd-Edison
Copy link
Author

Hello, [philmain28]:
Sorry to bother you again, After a month I'm still confused about the codes below, what is the meaning of the number '1.75292972992',
and what is the meaning of the number '0.7', does it means 1 minus 0.3 because the sweep range is 0.3um to 1um?

def n_guide(lam):
A = 2.17954368571
B = np.log(2.17954368571 / 1.75292972992) / 0.7
return A * np.exp(- B * (lam - 0.3))

Because of my poor English reading, I just can't figure it myself.
Thank you Hd-Edison

@philmain28
Copy link
Owner

philmain28 commented Mar 14, 2023

Yes you are correct they come from the data points that the fitting function is being drawn through which is something like:

$$(n_{guess}, \lambda ) = (2.18, 0.3), (1.75,1)$$

Then it is just a case of doing the algebra with the exponential fit function

$$n_{guess}= A \exp[-B*(\lambda - \lambda_0)],$$

to find what A, B and $\lambda_0$. $\lambda_0$ is a free parameter and you can set it to whatever you like but if you set it to 0.3 it make the maths easy because the exponent goes to 1. Once you have A you can substitute the other point in and rearrange to get B.

@Hd-Edison
Copy link
Author

I wonder what 'B' means?

@philmain28
Copy link
Owner

Sorry I was playing around with the way the maths is displayed.

@philmain28
Copy link
Owner

If I get a bit of time at some point I will try and make a demo with more fundamentals in it.

@Hd-Edison
Copy link
Author

Thank you for guiding me so patiently and clearing up a big confusion in my mind!😃😃😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants