-
Notifications
You must be signed in to change notification settings - Fork 65
FXC-3724 support multimodal waveports #2846
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
Conversation
837a080 to
c685b6b
Compare
40bcc17 to
e9ca7aa
Compare
9aa1b9b to
7a5edfc
Compare
7a5edfc to
c8f2694
Compare
3893644 to
fa79e77
Compare
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.
Additional Comments (1)
-
tests/test_plugins/smatrix/test_terminal_component_modeler.py, line 799-817 (link)logic: This code block is duplicated from lines780-798. The duplicate should be removed.
9 files reviewed, 5 comments
Diff CoverageDiff: origin/develop...HEAD, staged and unstaged changes
Summary
|
bb34bd1 to
25f3ea4
Compare
weiliangjin2021
left a comment
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.
Looks quite solid. One question: consider that the transmission line supports 2 modes, and only mode_index=1 is involved in a modeling. Previously, I can setup a modeler by setting mode_index=1 in Waveport definition. Currently, with num_modes=2, simulations for both mode indices will be performed, unless one specify run_only parameters. Maybe it can be helpful to provide a convenient function to setup the previous behavior?
f0cf1fe to
ecb4d0e
Compare
b7a312c to
65f5eae
Compare
daquinteroflex
left a comment
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.
Looks good just a few comments
weiliangjin2021
left a comment
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.
Just one comment.
0f024f8 to
f44909b
Compare
George-Guryev-flxcmp
left a comment
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.
Looks solid — great work! Just one note on de-embedding: in its current state, it doesn’t support multimode waveport de-embedding due to a dimensionality mismatch.
f44909b to
356fd49
Compare
356fd49 to
6adb1d0
Compare
Greptile Overview
Updated On: 2025-10-16 20:12:05 UTC
Greptile Summary
This PR implements multimodal waveport support in the S-matrix component modeler, enabling waveguide ports to handle multiple propagating modes simultaneously. The changes refactor the WavePort class to use
MicrowaveModeSpecinstead of manual impedance calculations, introduce a network indexing system that creates separate entries for each port-mode combination, and update the analysis pipeline to work withNetworkIndexidentifiers rather than simple port references.Key architectural changes include replacing the single
mode_indexfield with a multimodal approach, switching fromTerminalPortTypetoNetworkIndexfor port identification, and implementing caching optimizations for voltage/current calculations to avoid redundant computations across modes of the same port. The refactoring leverages existing microwave components for transmission line calculations while maintaining backward compatibility with lumped ports.Important Files Changed
Changed Files
tidy3d/plugins/smatrix/ports/wave.pytidy3d/plugins/smatrix/component_modelers/terminal.pytidy3d/plugins/smatrix/analysis/terminal.pytidy3d/plugins/smatrix/data/terminal.pytidy3d/plugins/smatrix/component_modelers/base.pytidy3d/plugins/smatrix/analysis/antenna.pytests/test_plugins/smatrix/test_terminal_component_modeler.pytests/test_plugins/smatrix/terminal_component_modeler_def.pytests/utils.pyConfidence score: 3/5
Sequence Diagram
sequenceDiagram participant User participant TerminalComponentModeler participant WavePort participant MicrowaveModeSpec participant Simulation participant TerminalComponentModelerData participant SMatrixCalculation User->>TerminalComponentModeler: "Create modeler with multimodal wave ports" TerminalComponentModeler->>WavePort: "Initialize with MicrowaveModeSpec" WavePort->>MicrowaveModeSpec: "Configure num_modes > 1" User->>TerminalComponentModeler: "Generate simulation dictionary" TerminalComponentModeler->>TerminalComponentModeler: "Build network_dict mapping" Note over TerminalComponentModeler: Maps each mode to unique NetworkIndex loop For each mode in each WavePort TerminalComponentModeler->>WavePort: "Create source for mode_index" WavePort->>Simulation: "Add ModeSource with specific mode" TerminalComponentModeler->>WavePort: "Create monitors for mode" WavePort->>Simulation: "Add MicrowaveModeMonitor" end User->>TerminalComponentModeler: "Run simulations" loop For each simulation task TerminalComponentModeler->>Simulation: "Execute FDTD simulation" Simulation->>TerminalComponentModelerData: "Return SimulationData" end User->>TerminalComponentModelerData: "Calculate S-matrix" TerminalComponentModelerData->>SMatrixCalculation: "Process multimodal data" loop For each port and mode combination SMatrixCalculation->>WavePort: "Compute voltage/current for mode" WavePort->>SMatrixCalculation: "Return modal V/I data" SMatrixCalculation->>SMatrixCalculation: "Convert to wave amplitudes" end SMatrixCalculation->>TerminalComponentModelerData: "Return complete S-matrix" TerminalComponentModelerData->>User: "Provide multimodal S-parameters"