Skip to content

Conversation

tylerflex
Copy link
Collaborator

Requires a merge of frontend PR

@tylerflex tylerflex marked this pull request as draft July 25, 2025 01:00
@tylerflex tylerflex marked this pull request as ready for review September 2, 2025 19:35
Copy link
Contributor

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Here my comments:

  1. I know it's topologically the same thing, but this is a very strange looking waveguide crossing 😆 Might be quite confusing to readers to have the ports arranged like that..
  2. You actually don't use autograd numpy other than for setting up to (undifferentiated) linspaces - I guess it works, which is nice. But I'd be careful and just use autograd numpy throughout?
  3. Before Cell 15: Typo: optimizer.th
  4. Cell 18: You set beta_min = beta_max = 20, so no beta scheduling. Is that intentional? If it is, it probably should be commented.
  5. Cell 18: params get appended to params_history and are always mutated in-place, meaning that the final params_history will contain the same parameters for each entry. Should be params_history.append(params.copy()).
  6. import tidy3d.web as web unused. Similarly, there are a couple of other formatting issues, should run ruff format && ruff check --fix. CI is failing.

@tylerflex
Copy link
Collaborator Author

I know it's topologically the same thing, but this is a very strange looking waveguide crossing 😆 Might be quite confusing to readers to have the ports arranged like that..

can you help me make it look better? how would you change it?

@tylerflex
Copy link
Collaborator Author

You actually don't use autograd numpy other than for setting up to (undifferentiated) linspaces - I guess it works, which is nice. But I'd be careful and just use autograd numpy throughout?

sounds good, fixed

Before Cell 15: Typo: optimizer.th

fixed

Cell 18: You set beta_min = beta_max = 20, so no beta scheduling. Is that intentional? If it is, it probably should be commented.

yea it seems to work alright, will add a comment

Cell 18: params get appended to params_history and are always mutated in-place, meaning that the final params_history will contain the same parameters for each entry. Should be params_history.append(params.copy()).

fixed

import tidy3d.web as web unused. Similarly, there are a couple of other formatting issues, should run ruff format && ruff check --fix. CI is failing.

thanks, fixed this too

Will change to a "Plus" setup and will re-run but the queue is horrible today so it's like an iteration every 45 minutes..

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Spell Check Report

AntennaCharacteristics.ipynb:

Cell 61, Line 1: 'TerminalComponentModelerData'
  > The dictionary stored in the `data` attribute of the `TerminalComponentModelerData` instance contains all the monitor data. Use the respective port name as the dictionary key to access the data associated with the desired port excitation.

Autograd26Smatrix.ipynb:

Cell 8, Line 5: 'staticd'
  > We first define the overall geometry as a `td.Box` and also the number of pixels in x and y staticd on our design region resolution.
Cell 16, Line 3: 'parmeterization'
  > Below we'll import a helper function to set this up automatically by looking at a base `Simulation` object and a parmeterization corresponding to the design region `Structure`.
Cell 34, Line 7: 'beginnning'
  > # we will just have the same projection strength for beginnning and end in this case
Cell 41, Line 1: 'top-left', 'top-right'
  > The field plots below show the device operating at the central design frequency. We can clearly see the crossover behavior: light entering the top-left port is efficiently routed to the bottom-right port, and light from the bottom-left is routed to the top-right.

EdgeFeedPatchAntennaBenchmark.ipynb:

Cell 45, Line 1: 'TerminalComponentModelerData'
  > The downloaded data is a `TerminalComponentModelerData` object. Use the `smatrix()` command to obtain the S-matrix.

WPDHarmonicSuppression1.ipynb:

Cell 2, Line 1: 'roll-off'
  > The power divider is a key component in modern wireless communications systems. It is usually subject to key performance metrics such as low insertion loss, minimal crosstalk between output ports, and a small footprint. In addition, low pass or bandpass filters are typically incorporated in order to suppress unwanted harmonics and noise in wireless signals. These filters should have a sharp response, quantified by the roll-off rate (ROR), and a wide stopband.
Cell 2, Line 3: '-part', 'Moloudian'
  > In this 3-part notebook series, we will simulate various stages of the design process of a Wilkinson power divider (WPD) created by Moloudian et al in [1].
Cell 2, Line 4: 'roll-off'
  > * In part one (this notebook), we start with a simple low pass filter design and improve its filter response in order to achieve a higher roll-off rate (ROR).
Cell 6, Line 1: 'FreqRange'
  > The target cutoff frequency of the low pass filter is 1.8 GHz (within the GSM band) and the simulation will cover 0.1 to 8 GHz.  The `bandwidth` of the simulation is defined using the `FreqRange` utility class.
Cell 25, Line 1: 'quarter-wavelength'
  > By default, the simulation boundary is open (PML) on all sides. We add quarter-wavelength padding on all sides to ensure the boundaries do not encroach on the near-field.
Cell 42, Line 1: 'TerminalComponentModelerData'
  > The `TerminalComponentModelerData` instance returned by `tidy3d.web.run()` stores the monitor data for each port in a dictionary in the `data` attribute. Use the corresponding port name to access it.
Cell 44, Line 1: 'stopbands'
  > The in-plane field magnitude is plotted below at `f_min` and `f0`, showing a clear difference between the pass- and stopbands.
Cell 53, Line 1: 'Roll-off'
  > #### Roll-off rate
Cell 54, Line 1: 'roll-off'
  > The roll-off rate (ROR) is a figure of merit that quantifies the sharpness of the filter response. It is calculated by
Cell 86, Line 1: 'stopbands'
  > As before, we plot the field amplitude profile within the pass- and stopbands.
Cell 93, Line 1: 'Roll-off'
  > #### Roll-off rate

WPDHarmonicSuppression2.ipynb:

Cell 2, Line 1: 'roll-off'
  > The power divider is a key component in modern wireless communications systems. It is usually subject to key performance metrics such as low insertion loss, minimal crosstalk between output ports, and a small footprint. In addition, low pass or bandpass filters are typically incorporated in order to suppress unwanted harmonics and noise in wireless signals. These filters should have a sharp response, quantified by the roll-off rate (ROR), and a wide stopband.
Cell 2, Line 3: '-part', 'Moloudian'
  > In this 3-part notebook series, we will simulate various stages of the design process of a Wilkinson power divider (WPD) created by Moloudian et al in [1].
Cell 38, Line 1: 'TerminalComponentModelerData'
  > The simulation monitor data is stored as `dict` values in the `data` attribute of the `TerminalComponentModelerData` instance. Use the port name as the key to access the data associated with the respective port excitation.
Cell 40, Line 1: 'stopbands'
  > The field amplitude profiles at the minimum and middle frequency points are shown below. The points lie respectively within the pass- and stopbands.
Cell 45, Line 1: 'rolloff'
  > The insertion and return losses are plotted below. While the modified filter presents a sharp rolloff and a deep resonance above 2 GHz, the signal suppression is less than ideal at higher frequencies (>5 GHz).
Cell 57, Line 1: 're-use'
  > We will re-use the monitor defined in the previous section. The lumped ports are shifted slightly to account for the new substrate size.

WPDHarmonicSuppression3.ipynb:

Cell 2, Line 1: 'roll-off'
  > The power divider is a key component in modern wireless communications systems. It is usually subject to key performance metrics such as low insertion loss, minimal crosstalk between output ports, and a small footprint. In addition, low pass or bandpass filters are typically incorporated in order to suppress unwanted harmonics and noise in wireless signals. These filters should have a sharp response, quantified by the roll-off rate (ROR), and a wide stopband.
Cell 2, Line 3: '-part', 'Moloudian'
  > In this 3-part notebook series, we will simulate various stages of the design process of a Wilkinson power divider (WPD) created by Moloudian et al in [1].
Cell 23, Line 1: 'feedlines'
  > # WPD feedlines (top half only)
Cell 53, Line 1: 'TerminalComponentModelerData'
  > The simulation monitor data is stored as `dict` values in the `data` attribute of the `TerminalComponentModelerData` instance. Use the port name as the key to access the data associated with the respective port excitation.
Cell 58, Line 1: 'third-party'
  > As a basis for comparison, we implement a conventional WPD using the `scikit-rf` third-party package.
Cell 78, Line 1: 'Moloudian'
  > In this notebook, we simulated the full WPD design presented by Moloudian et al. in [1] and compared its performance to a conventional WPD. The improved WPD features much better signal rejection in the stopband while providing comparable performance at the operating frequency. As noted by the authors, harmonic suppression is a particularly useful feature in modern circuits featuring non-linear elements such as detectors, amplifiers, mixers, and phase shifters.

Checked 13 notebook(s). Found spelling errors in 6 file(s).
Generated by GitHub Action run: https://github.com/flexcompute/tidy3d-notebooks/actions/runs/17647319723

@groberts-flex
Copy link
Contributor

thanks Tyler, this is really cool! A couple of comments below

  1. leftover print of the tidy3d version in the import section
  2. cell 2: should we remove n_sio2 since it's unused?
  3. cell 3: "and a field monitor" -> "add a field monitor"
  4. cell 12: some commented code leftover for the element_mappings
  5. cell 13: looking at all the input/output for the various ports seems useful for debugging, but maybe ok to only plot one of them as an example in the notebook output for conciseness. If possible, it might be good to add a text label to one of them to identify each port index.
  6. cell 14: can probably get rid of the printed smatrix output
  7. cell 20: leftover print statement in objective

at cell 21, seeing that the output is broken which I'm assuming is due to all the flux in the backend and how the autograd stuff is running. When that part is updated and re-run, I'll add some more comments for the rest of the notebook

@tylerflex
Copy link
Collaborator Author

tylerflex commented Sep 4, 2025

Thanks @groberts-flex , I made all comments and fixed the element mappings too so it only solves from one port (since all results can just be rotated through the ports).

Sorry you saw this version, I had made some major changes after Yannick's initial reviews so it was a bit messy. but appreciate the help cleaning it up.

Once things are back up and running I will polish up and get things into final state.

@yaugenst-flex
Copy link
Contributor

oh another comment i just remember: we should use td.Structure.from_permittivity_array(eps_data=eps_data, geometry=design_region_geometry) instead of the custom medium + spatial data array coordinate wrangling

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown above [9]: "parmeterization"
[9]: functools.partial is unused now right?
[14]: Nit, but the dtype=float isn't necessary. It'll be promoted in the objective function, so not including this might improve readability a bit.
[15]: Remove commented out import.
[17]: Lots of ipywidgets warnings. Might be nice to just install that locally when running the notebook so it doesn't clutter the output here?
[26]: Any reason not to plot this over wavelength? Currently seems somewhat difficult to parse, especially since it's plotting normalized frequency. Also, a before/after plot would be nice..

@tylerflex tylerflex force-pushed the tyler/autograd_/smatrix branch from 3d0ed4d to deab19c Compare September 11, 2025 14:05
@tylerflex
Copy link
Collaborator Author

Thanks @yaugenst-flex , all suggestions have been addressed. notebook was re-run and for some reason the grey region just went away by itself. Squashed commits. Should be ok to merge now @daquinteroflex

@tylerflex tylerflex force-pushed the tyler/autograd_/smatrix branch from e27b3ab to 2d15618 Compare September 11, 2025 14:11
@tylerflex tylerflex changed the base branch from develop to pre/2.10 September 11, 2025 14:12
@tylerflex
Copy link
Collaborator Author

This PR will merge into pre/2.10 branch btw

@tylerflex tylerflex merged commit c716706 into pre/2.10 Sep 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants