Skip to content

Commit beb11df

Browse files
committed
Fix EME port modes symmetry expansion
1 parent 994bdc2 commit beb11df

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
### Fixed
1818
- Arrow lengths are now scaled consistently in the X and Y directions, and their lengths no longer exceed the height of the plot window.
1919
- Bug in `PlaneWave` defined with a negative `angle_theta` which would lead to wrong injection.
20+
- `EMESimulationData.port_modes_tuple` is now symmetry-expanded.
2021

2122
## [2.9.0rc1] - 2025-06-10
2223

tidy3d/components/eme/data/sim_data.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,21 @@ class EMESimulationData(AbstractYeeGridSimulationData):
3939
None, title="S Matrix", description="Scattering matrix of the EME simulation."
4040
)
4141

42-
port_modes: Optional[EMEModeSolverData] = pd.Field(
42+
port_modes_raw: Optional[EMEModeSolverData] = pd.Field(
4343
None,
4444
title="Port Modes",
4545
description="Modes associated with the two ports of the EME device. "
46-
"The scattering matrix is expressed in this basis.",
46+
"The scattering matrix is expressed in this basis. "
47+
"Note: these modes are not symmetry expanded; use 'port_modes' instead.",
4748
)
4849

50+
@property
51+
def port_modes(self):
52+
"""Modes associated with the two ports of the EME device.
53+
The scattering matrix is expressed in this basis.
54+
Note: these modes are symmetry expanded."""
55+
return self.port_modes_raw.symmetry_expanded_copy
56+
4957
def _extract_mode_solver_data(
5058
self, data: EMEModeSolverData, eme_cell_index: int, sweep_index: Optional[int] = None
5159
) -> ModeSolverData:
@@ -89,7 +97,13 @@ def _extract_mode_solver_data(
8997
"certain derived quantities, like the flux."
9098
)
9199
grid_expanded = self.simulation.discretize_monitor(monitor=monitor)
92-
return ModeSolverData(**update_dict, monitor=monitor, grid_expanded=grid_expanded)
100+
return ModeSolverData(
101+
**update_dict,
102+
monitor=monitor,
103+
grid_expanded=grid_expanded,
104+
symmetry=data.symmetry,
105+
symmetry_center=data.symmetry_center,
106+
)
93107

94108
@cached_property
95109
def port_modes_tuple(self) -> tuple[ModeSolverData, ModeSolverData]:

0 commit comments

Comments
 (0)