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

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.5%): Missing lines 406,409-410,412
  • tidy3d/components/microwave/mode_spec.py (100%)
  • tidy3d/components/types/base.py (100%)
  • tidy3d/constants.py (100%)

Summary

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

tidy3d/components/microwave/data/monitor_data.py

Lines 402-416

  402         elif (
  403             low_f_TE_frac >= self.monitor.mode_spec.qtem_polarization_threshold
  404             and low_f_TM_frac >= self.monitor.mode_spec.qtem_polarization_threshold
  405         ):
! 406             return "quasi-TEM"
  407         elif mean_TE_frac >= self.monitor.mode_spec.tem_polarization_threshold:
  408             return "TE"
! 409         elif mean_TM_frac >= self.monitor.mode_spec.tem_polarization_threshold:
! 410             return "TM"
  411         else:
! 412             return "Hybrid"
  413 
  414     def _group_index_post_process(self, frequency_step: float) -> Self:
  415         """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
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.

4 participants