gds_fdtd.smatrix

gds_fdtd simulation toolbox.

The canonical S-matrix container. One representation for every solver:

  • f: frequency grid in Hz, shape (F,), ascending.

  • s: complex ndarray, shape (F, P, P, M, M) indexed as s[f, out_port, in_port, out_mode, in_mode]. Mode indices are 0-based internally; the public accessors take the package-wide 1-based mode ids.

  • port_names: list of P port names; row/column order follows this list.

  • Unmeasured entries (partial matrices) are NaN.

I/O: .npz always (numpy built-in); .h5 when h5py is installed. Checks: reciprocity, passivity, per-excitation power balance. Plotting lives in gds_fdtd.plotting; Lumerical .dat and Touchstone interop live in to_dat/to_touchstone below.

Classes

SMatrix(f, s, port_names[, name])

Multi-port, multi-mode scattering matrix on a frequency grid.