feat(tidy3d-notebooks): GaussianBeam source gradient demonstration#472
Conversation
|
Cool demo, thanks!
|
2cb4551 to
e6711cb
Compare
|
Spell check passed successfully for 1 notebook(s). |
|
Thanks so much for the really helpful comments @marcorudolphflex I put together another version of the notebook and left some responses to a couple of the comments below:
Broke this up a bit and added more markdown between the sections for explanations. Also expanded out notebook intro to have more references and introductory pieces.
Good question! this ended up being too aggressive of a learning rate. I turned it down and things look better now. I ended up adding a few extra takeaways at the end of the notebook as the conclusion is a little nuanced. I think the story is still clear but let me know if it's not clear enough of a conclusion. I think a good takeaway for the time being at least is that you can optimize with the Gaussian beam parameters which was the motivation for the notebook. |
|
Looks great!
I also wondered if the effect/benefit would be even stronger with more iterations? But would not see that blocking. I like the new comparison plots! |
14b9af8 to
b6bc3ea
Compare
|
This took me a while to get updated, but ended up trying to simplify things a bit since after I ran for more iterations the effect was a little bit less clear. I ended up just doing a robustness optimization individually for source position and source tilt. And now I think things are clearer as you can see each of those robustness metrics improve over the baseline. |
Thanks for the effort on this!
|
|
Thanks for the review on this! I tried to get it to work better than baseline over smaller perturbations. There is a fundamental challenge here that is a little different than robust optimizations for geometries. If the source perturbation is small and ends up having a large overlap with the original source, then it limits how much the performance can actually drop. So I think the robust optimizations only show their benefit for fairly large perturbations which I think may not be as practical. To simplify this whole thing I just took out the robust part and optimized two different grating couplers, one single layer one and one with a bottom reflector. And framed things more that the co-optimization of the source with the geometry can be a useful tool especially as grating geometry grows in complexity and it gets harder to intuitively place the source. |
|
Thanks for updating this! Some comments from my side:
|
a0c8c61 to
6a05ac2
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6a05ac2. Configure here.
f4981b8 to
b9741a8
Compare
|
Thanks for the comments and review @marcorudolphflex! updated and re-ran the notebook, uploaded newest version here |
b9741a8 to
f9a596d
Compare
marcorudolphflex
left a comment
There was a problem hiding this comment.
Thanks for the effort, great demo!

This notebook demonstrates optimizing GaussianBeam source gradients for a grating coupler alongside geometric parameters to target designs that are robust to source/packaging misalignments.
Note
Low Risk
Documentation and example-only changes with no runtime library or production code paths affected.
Overview
Adds a new inverse-design notebook that jointly optimizes grating coupler geometry and Gaussian beam source parameters (lateral position, tilt, waist) with Tidy3D Autograd, aimed at designs that tolerate source or packaging misalignment.
The example runs two related 2D grating-coupler problems: a partially etched top grating with per-tooth widths, and a variant with a lower silicon reflector (period and duty cycle) separated by an SiO₂ gap. Both maximize coupling into the backward waveguide mode while updating beam settings in the same optimization loop.
Docs: registers
Autograd31GratingCouplerWithBeamOptimizationin the Inverse Design example toctree inautograd.rst.Reviewed by Cursor Bugbot for commit f9a596d. Bugbot is set up for automated code reviews on this repo. Configure here.