Anisotropic EME bends - #462
Conversation
|
This is great! I love the convergence plot. Thanks for finding the bug and helping address it.
|
|
I wonder if there is a better way to use mode sorting / filtering to find the well-guided quasi-TE mode, which could be cleaner than just taking the max transmission |
|
Actually it would be excellent to explicitly show the permittivity tensor somewhere along the bend for both cases of |
|
Really nice verification thanks @FilipeFcp ! I don't have much to say beyond Casey's comments. Maybe no need to run 20 cells as the convergence seems pretty clear already beyond like 4.
Is PermittivityMonitor supported in some way in EME? But generally yeah I think this is a good idea, maybe take a 3-cell simulation and plot the diagonal components of the permittivity at the 3 locations. Or even plot eps_xx, eps_xy, eps_xz (first row of the tensor) to show how it becomes tensorial in the "lab" frame and just stays the same in the "co-rotating" frame. |
|
Permittivitymonitor is fully supported in eme . Or you can probably use sim.epsilon, and you even get subpixel if tidy3d-extras is installed! |
Spell Check ReportAnisotropicBendsEME.ipynb: Checked 1 notebook(s). Found spelling errors in 1 file(s). |
|
This is the results running with the new version. |
caseyflex
left a comment
There was a problem hiding this comment.
looks pretty good, a few more suggestions
- it says "store_coeffs=True, # needed to access the full S-matrix". I don't think that is true, the full s-matrix should always be stored.
- sorting by keff is not something I'm super confident in. You already do a standalone mode solve first to show the guided mode, which is good. Maybe we can show some metrics for all the modes, like the
fill_fraction_box,te_fraction,keff,neff, etc. So that we are confident in the filtering approach
|
Thanks Casey, these are good points. Is the fill factor from this new release? I didn’t find it in the documentation when I first created this notebook. It’s very handy. |
yes it's very handy! It's been around for a while. the |
|
@caseyflex and @momchil-flex, I think this is as good as it gets. I tested convergence for both EME and FDTD, and the results appear to be converged. The main issue I was running into was precision. I had naively assumed that |
|
Thanks Filipe, this is much improved. I think we should do one more pass before merging, mainly because the Main required fixes:
LiNbO3 = td.material_library["LiNbO3"]"Zelmon1997" In the material API, optical axis index 1 means the extraordinary axis is along global y; global z would be
Smaller cleanup:
Overall, I think the revised numerical results look much smoother, and the double precision / relaxed |
|
So this is AI, but it's based off the recommendations I gave you here and on slack, some of which presumably were important while you were making sure this was converged, and showing the correct mode. So maybe not every point is strictly needed, but some of it could certainly be helpful. can you have your AI agent take a look? |
|
I did go ahead and approve it, so you can use your judgement about which ones of those you care about. |
|
But thanks for your efforts on this - it is a nice notebook and will be great to have |
momchil-flex
left a comment
There was a problem hiding this comment.
Looks good to me, except I still think we can take this chance to educate users a little more about what's happening.
Currently bend_medium_frame is not discussed at all. Even though the new default setting of "global" works for this example out of the box, I think it's worth mentioning that this is only the case starting 2.11, and that before this argument was introduced (and in many other EME solvers), the default is effectively the "co_rotating" setting. In that setting, you will always get the N=1 result here, regardless of how many EME cells you put.
This comment from before is related and still not addressed, and I think it would be worth it.
Actually it would be excellent to explicitly show the permittivity tensor somewhere along the bend for both cases of bend_medium_frame. So we can have a very explicit discussion of the two use cases
|
Hi all, I think I have addressed all of your comments. Since this will likely be read more by AI than by humans from now on, I decided to keep all the convergence tests and be a bit more verbose in explaining everything. |
caseyflex
left a comment
There was a problem hiding this comment.
Thanks Filipe this looks really good to me! A really nice feature showcase and a good teaching opportunity for how users can debug EME simulations.
Hi guys,
These are the results and a sketch of an example notebook. The final formatting and text were mainly done with Claude Code, with some guidance. I think it looks reasonable.
I think we should wait for the next API release before publishing this right? So I will remove the solver version part latter.
Note
Low Risk
Documentation and example-only changes with no production solver or API code in this PR.
Overview
Adds a new EME example for anisotropic bent waveguides, alongside the existing EME solver and isotropic bends notebooks.
The EME docs toctree in
eme.rstnow linksAnisotropicBendsEME, so this workflow shows up in the published EME feature section. The notebook is meant to ship after the next API release; solver-version notes in the draft may be trimmed before publish.Reviewed by Cursor Bugbot for commit 1ebeedb. Bugbot is set up for automated code reviews on this repo. Configure here.