Skip to content

Conversation

@dmarek-flex
Copy link
Contributor

@dmarek-flex dmarek-flex commented Nov 12, 2025

Greptile Summary

  • Added RF-specific propagation characteristics to MicrowaveModeData including propagation constants (alpha, beta, gamma), phase/group velocities, wave impedance, effective relative permittivity, and distance_40dB attenuation metric
  • Introduced automatic mode classification system (TEM, quasi-TEM, TE, TM, Hybrid) with configurable polarization thresholds in MicrowaveModeSpec

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • The implementation adds new features without modifying existing behavior, includes comprehensive tests validating all new properties with physical accuracy checks, follows established code patterns, and properly handles edge cases like missing group_velocity data.
  • No files require special attention

Important Files Changed

Filename Overview
tidy3d/components/microwave/mode_spec.py Added tem_polarization_threshold and qtem_polarization_threshold fields with defaults 0.995 and 0.95 to control mode classification.
tidy3d/components/microwave/data/monitor_data.py Added properties for mode classification, propagation constants (alpha, beta, gamma), phase/group velocities, wave impedance, effective permittivity, and distance_40dB to MicrowaveModeDataBase class.
tests/test_components/test_microwave.py Added comprehensive tests for new RF-specific mode characteristics including validation of propagation constants, velocities, wave impedance, and mode classification.

Sequence Diagram

sequenceDiagram
    participant User
    participant ModeSolver
    participant MicrowaveModeSpec
    participant MicrowaveModeDataBase
    participant MicrowaveModeSolverData

    User->>ModeSolver: Create ModeSolver with MicrowaveModeSpec
    User->>MicrowaveModeSpec: Configure tem_polarization_threshold, qtem_polarization_threshold
    User->>ModeSolver: Call solve() or access .data
    ModeSolver->>MicrowaveModeSolverData: Generate mode data with field components and n_complex
    User->>MicrowaveModeSolverData: Access new properties (alpha, beta, gamma)
    MicrowaveModeSolverData->>MicrowaveModeDataBase: Calculate propagation constants from n_complex
    MicrowaveModeDataBase-->>User: Return PropagationConstantArray, PhaseConstantArray, AttenuationConstantArray
    User->>MicrowaveModeSolverData: Access phase_velocity, group_velocity
    MicrowaveModeDataBase-->>User: Return PhaseVelocityArray, GroupVelocityArray
    User->>MicrowaveModeSolverData: Access wave_impedance
    MicrowaveModeDataBase->>MicrowaveModeDataBase: Calculate from tangential E fields and complex_flux
    MicrowaveModeDataBase-->>User: Return ImpedanceFreqModeDataArray
    User->>MicrowaveModeSolverData: Access mode_classifications
    MicrowaveModeDataBase->>MicrowaveModeDataBase: Classify using wg_TE_fraction, wg_TM_fraction and thresholds
    MicrowaveModeDataBase-->>User: Return list of ModeClassification
Loading

@dmarek-flex dmarek-flex self-assigned this Nov 12, 2025
@dmarek-flex dmarek-flex added the RF label Nov 12, 2025
@dmarek-flex dmarek-flex force-pushed the dmarek/FXC-3791-Add-RF-specific-mode-characteristics branch from 66c4c60 to ae9c05c Compare November 19, 2025 18:59
@dmarek-flex dmarek-flex marked this pull request as ready for review November 19, 2025 19:20
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.

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

Diff Coverage

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

  • tidy3d/components/microwave/data/data_array.py (100%)
  • tidy3d/components/microwave/data/monitor_data.py (94.7%): Missing lines 410,413-414,416
  • tidy3d/components/microwave/mode_spec.py (100%)
  • tidy3d/components/types/base.py (100%)
  • tidy3d/constants.py (100%)

Summary

  • Total: 106 lines
  • Missing: 4 lines
  • Coverage: 96%

tidy3d/components/microwave/data/monitor_data.py

  406         elif (
  407             low_f_TE_frac >= self.monitor.mode_spec.qtem_polarization_threshold
  408             and low_f_TM_frac >= self.monitor.mode_spec.qtem_polarization_threshold
  409         ):
! 410             return "quasi-TEM"
  411         elif mean_TE_frac >= self.monitor.mode_spec.tem_polarization_threshold:
  412             return "TE"
! 413         elif mean_TM_frac >= self.monitor.mode_spec.tem_polarization_threshold:
! 414             return "TM"
  415         else:
! 416             return "Hybrid"
  417 
  418     def _group_index_post_process(self, frequency_step: float) -> Self:
  419         """Calculate group index and remove added frequencies used only for this calculation.

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.

Looks nice!

@dmarek-flex dmarek-flex added the rc3 3rd pre-release label Nov 20, 2025
@dmarek-flex dmarek-flex force-pushed the dmarek/FXC-3791-Add-RF-specific-mode-characteristics branch from 498e6b6 to cca3130 Compare November 20, 2025 20:08
@dmarek-flex dmarek-flex force-pushed the dmarek/FXC-3791-Add-RF-specific-mode-characteristics branch from cca3130 to 32b1a08 Compare November 21, 2025 14:25
Copy link
Contributor

@George-Guryev-flxcmp George-Guryev-flxcmp left a comment

Choose a reason for hiding this comment

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

Thank you for adding this convenience feature - everything looks great to me!

@dmarek-flex dmarek-flex added this pull request to the merge queue Nov 21, 2025
Merged via the queue into develop with commit 8b21844 Nov 21, 2025
45 checks passed
@dmarek-flex dmarek-flex deleted the dmarek/FXC-3791-Add-RF-specific-mode-characteristics branch November 21, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.10 rc3 3rd pre-release RF

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants