-
Notifications
You must be signed in to change notification settings - Fork 11
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
Radiative losses examples with ModeSolver #188
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @FilipeFcp for the great benchmark. It works very well. Some comments:
-
"imaginay" -> "imaginary"
-
"if the exact value are important" -> " if the exact values are important"
-
"Losses in bended optical fiber" -> "Losses in a bent optical fiber"
-
"Bend Si waveguide" -> "Bent Si waveguide"
-
"known beforehand.To automatically" -> "known beforehand. To automatically"
-
The comment above cell[12] seems unfinished.
-
The comment below [24] seems unfinished too. Missing period in the end of the sentence.
-
Add plot titles or axis labels for [13] and [15]
-
Add plt.show() in all cells with plots to get rid of the text print out.
-
When defining the first mode solver, we can add a few comments and discussions and use this opportunity to educate users on the details of the setup such as
- Add comments about num_pml in ModeSpec. Explain the default boundary is PEC and for lossy modes, PML needs to be used.
- Also comment on the necessity of using double precision since the loss is very small and want to have high accuracy.
- PML layers are added inside the domain so the mode solving plane needs to be sufficiently large.
The use of isMode
function is a great idea! A lot of users are looking to do filtering by something like this so it's a very good reference.
Oh yeah don't forget to add the notebook to the Also the metadata like other tutorial notebooks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @FilipeFcp! Very nice and useful tutorial!
- I recommend including cell [1] before the "Defining the simulation domain" header to make it uniform with our other notebooks.
- Not critical, but I wonder why naming that function as
mode_solver_substrate
:) - Suppress the text output in cell [3], [10], and [17].
- Here, should the parenthesis come just after
E.y.max() - E.y.min()
?
center = (
E.y.min() + (E.y.max() - E.y.min() / 2),
E.z.min() + (E.z.max() - E.z.min()) / 2,
)
- In the simulation size convergence test you are adding an extra size to the mode plane, but the simulation size is constant in 6 at
y
andz
directions. So, at some point the mode plane will be larger than the simulation domain and theextra_size
will not make difference on results, is that correct? - I suggest setting the mode plane size directly (maybe making it squared) instead of setting an
extra_size
so that users don't need to calculate it by themselves. Unless you are reproducing the paper methodology. - Something is missing here "index. however, for the imaginay part, a". Additionally, replace "however" with "However".
- "tune the simulation size" -> "tune the mode plane size"
- We need axis labels in plots from cells [13], [15], and [22].
- In [19] and [21]:
ax.set_xlabel("Loss (dB/cm)")
->ax.set_ylabel("Loss (dB/cm)")
- This sentence seems not so clear "It is possible to note that, the results are converging for values around. For resolutions up to x, a value difference of about x can be seen.". And the sentence after it seems duplicated.
- "We will benchmark the losses for a 30 mm bend radius" -> "We will benchmark the losses for a 30 um bend radius"
Hi @tomflexcompute and @e-g-melo, Thanks for the comments. Sorry, I was working on the last part of the notebook and thought I had already revised the second part, so some text was left incomplete. Anyway, I believe I’ve addressed all the comments. Just to confirm the last point from @e-g-melo: it is indeed 30 mm (or 30,000 µm). Thank you all! |
Hey, thanks for this! I'm surprised by this slow convergence of the substrate loss with resolution. Our backend test for the same thing gets
For the bend waveguide, I think you should use SiN instead of Si. Silicon is too good at confining the light, and you need way too small of a bend radius to get some losses. I don't even know if the mode solver is expected to produce meaningful results if the size of the mode plane is larger than the bend radius, although it seems to be doing well. I think it may be fine as long as the mode is well-localized to the waveguide region. But still, this study is usually much more relevant for lower-index waveguides? For the optical fiber, is there some value we can compare to? |
Hi @momchil-flex, The function I used is the same, I just changed the number of PMLs and plane size for running the benchmark. For a resolution of 40, with the parameters that I used, the result is 3.098014e-08. My goal was to see if we could get closer to 2.91e-8, which is the value that the methods described in the paper seem to converge to; that is why I changed the size and number of PMLs. In my opinion it is a bit picky to try to get that close to the paper value, but sometimes it seems that users can be excessively concerned with numerical error for these low quantities. My idea was just to show that it does converge if we fine-tune the parameters, so the only issue is discretization, which no numerical method can completely avoid. I will try with the SiN waveguide. I was not sure how meaningful the results would be for a high bend radius, but since they follow some constancy, it looked ok to me. For the fiber value, there are some analytical formulations. I will take a look and see if we can at least agree on the order of magnitude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @FilipeFcp!
A final comment: In the mode plane size convergence chart the x-label should be "mode plane size (um)".
I see. Pretty finicky huh. Sounds good then.
Thanks.
Yeah, that would be good. |
Yeah actually I think we are going to validate this out in future releases (at some point). I just realized there was a recent user error because of this. If the coordinates shifted such that the center of the mode plane is at the radial distance happen to contain a coordinate at 0, there will be a division by zero error in the bend transformation. |
@FilipeFcp all looks good but I think metadata is still missing? |
Hi all, I made some final adjustments and additional tests. I found a paper with an analytical solution for the fiber losses, and after some fine-tuning, the results seem to match quite well. @momchil-flex, since the fiber example already deals with low-index contrast, do you think it would be okay to keep the Si waveguide instead of the SiN one? That way, we would have one example with a high-confined and one with a low-confined waveguide. |
I have actually added a PR in our upcoming release which will prohibit the bend radius to be smaller than half the mode plane size along the radial direction. This will break your example, right? I did this because this can error in some cases. One user hit such an error. |
Yes, it will. I will change them to SiN. |
@momchil-flex I switched to SiN. The size is 20 µm, and the minimum bend radius is also 20 µm, so I believe it shouldn't be a problem. |
Thank you @e-g-melo |
Thanks @FilipeFcp ! I think this notebook is looking really good now. Just a few last comments on the SiN part:
|
@FilipeFcp, I will use this image for the GUI version. Maybe you could also include it. |
Very nice! @FilipeFcp you can add it to the notebook as well as metadata just like the regular example notebook. |
@momchil-flex That is true, the z-size can be smaller. This is a extreme case, the k_eff is at the order of |
391793d
to
9637aed
Compare
Hi all,
Here are some examples and benchmarks using the ModeSolver to calculate radiative losses. I tried to address some concerns that I have seen from users, such as convergence issues and precision. I believe the message is that the results converge and the ModeSolver captures the general behavior of the losses; however, if you want to be picky with precision, especially for low losses, high resolution and plane size are needed.
Let me know your thoughts.