Skip to content

Commit 0ff9d4b

Browse files
Now it's a data composition error
1 parent 66316f0 commit 0ff9d4b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tidy3d/plugins/smatrix/component_modelers/terminal.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ def _check_port_impedance_sign(Z_numpy: np.ndarray):
383383

384384
return _check_port_impedance_sign(Z_numpy)
385385

386+
def _compute_F(Z_numpy: np.array):
387+
"""Helper to convert port impedance matrix to F, which is used for
388+
computing generalized scattering parameters."""
389+
from tidy3d.plugins.smatrix.utils import _compute_F
390+
391+
return _compute_F(Z_numpy)
392+
386393
@cached_property
387394
def port_reference_impedances(self) -> PortDataArray:
388395
from tidy3d.plugins.smatrix.data.data import SMatrixData, TerminalComponentModelerData
@@ -391,6 +398,15 @@ def port_reference_impedances(self) -> PortDataArray:
391398
data = TerminalComponentModelerData(simulation=self, data=a).port_reference_impedances
392399
return data
393400

401+
def _port_reference_impedances(self, batch_data) -> PortDataArray:
402+
from tidy3d.plugins.smatrix.data.data import SMatrixData, TerminalComponentModelerData
403+
404+
a = SMatrixData(a=self.batch_data)
405+
data = TerminalComponentModelerData(simulation=self, data=a)._port_reference_impedances(
406+
batch_data=batch_data
407+
)
408+
return data
409+
394410
@staticmethod
395411
def s_to_z(
396412
s_matrix: TerminalPortDataArray, reference: Union[complex, PortDataArray]

0 commit comments

Comments
 (0)