Skip to content

add selective simulation capabilities to TerminalComponentModeler #2573

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

Merged
merged 1 commit into from
Jul 31, 2025

Conversation

dmarek-flex
Copy link
Contributor

@dmarek-flex dmarek-flex commented Jun 13, 2025

Follows the same approach as the ComponentModeler where users can choose to run_only a subset of simulations and also may provide element_mappings to fill in unknown entries in the S matrix using other known entries.

The major difference is that the coords used in the final matrix DataArray are flattened so I can mix different types of Ports (Lumped and Wave), where some support modes and others do not.

Greptile Summary

Extends TerminalComponentModeler with selective simulation capabilities, enabling users to compute only specific S-matrix columns and derive missing elements through mapping relationships.

  • Added run_only parameter to TerminalComponentModeler for selectively computing S-matrix columns, reducing simulation time
  • Implemented element_mappings feature to derive unknown S-matrix elements from known entries
  • Modified matrix indexing to support mixed port types (Lumped and Wave) through flattened coordinates
  • Added comprehensive test coverage in test_terminal_component_modeler.py validating selective simulations and mappings
  • Updated port naming convention in test definitions to clearly distinguish between 'coax' and 'wave' port types

@dmarek-flex dmarek-flex self-assigned this Jun 13, 2025
@dmarek-flex dmarek-flex added the RF label Jun 13, 2025
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

@dmarek-flex dmarek-flex linked an issue Jun 13, 2025 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Jun 13, 2025

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/plugins/smatrix/component_modelers/base.py (100%)
  • tidy3d/plugins/smatrix/component_modelers/modal.py (100%)
  • tidy3d/plugins/smatrix/component_modelers/terminal.py (100%)

Summary

  • Total: 137 lines
  • Missing: 0 lines
  • Coverage: 100%

@dmarek-flex dmarek-flex force-pushed the dmarek/enable-select-excitations branch from a7b7db5 to 27d92c1 Compare June 13, 2025 20:33
@dmarek-flex dmarek-flex force-pushed the dmarek/enable-select-excitations branch from 27d92c1 to 53d5cea Compare June 19, 2025 14:35
@dmarek-flex dmarek-flex force-pushed the dmarek/enable-select-excitations branch from 53d5cea to 4d28758 Compare July 17, 2025 21:24
Copy link
Collaborator

@weiliangjin2021 weiliangjin2021 left a comment

Choose a reason for hiding this comment

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

All look good to me.

@dmarek-flex dmarek-flex force-pushed the dmarek/enable-select-excitations branch from 4d28758 to 99c824b Compare July 23, 2025 15:05
@dmarek-flex
Copy link
Contributor Author

Going to be conflicts with #2663, so I might wait for that to merge first.

FYI @daquinteroflex

@daquinteroflex
Copy link
Collaborator

daquinteroflex commented Jul 24, 2025

Actually I'd argue it's probably better to merge this if it's ready and continue the refactor using this

@dmarek-flex dmarek-flex requested review from daquinteroflex and dbochkov-flexcompute and removed request for yaugenst-flex July 24, 2025 17:53
@dmarek-flex dmarek-flex force-pushed the dmarek/enable-select-excitations branch 2 times, most recently from 58b2a1f to 90948e6 Compare July 29, 2025 18:02
@dmarek-flex dmarek-flex enabled auto-merge July 29, 2025 18:09
@dmarek-flex dmarek-flex changed the base branch from develop to dmarek/rf-dev July 31, 2025 20:47
refactored common code into AbstractComponentModeler

add toggle for controlling how s matrix is calculated

added validation of run_only and element_mappings for modelers
@dmarek-flex dmarek-flex force-pushed the dmarek/enable-select-excitations branch from 90948e6 to 77339c3 Compare July 31, 2025 20:54
@dmarek-flex dmarek-flex merged commit a69622d into dmarek/rf-dev Jul 31, 2025
@dmarek-flex dmarek-flex deleted the dmarek/enable-select-excitations branch July 31, 2025 20:55
@dmarek-flex dmarek-flex restored the dmarek/enable-select-excitations branch July 31, 2025 21:04
@dmarek-flex dmarek-flex deleted the dmarek/enable-select-excitations branch August 8, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to not excite all ports in TerminalComponentModeler
4 participants