z_to_s_matrix
z_to_s_matrix(z_matrix, impedances=50.0)Convert a Z-matrix (impedance matrix) to an S-matrix (scattering matrix).
Uses the travelling-wave S-parameter convention:
where and is the (possibly complex) diagonal reference-impedance matrix.
When all reference impedances are real, this reduces to the standard formula .
Note
The |v_0|/v_0 phase correction factor from the full
travelling-wave definition is omitted. This is exact for lossless
reference media and an excellent approximation for low-loss ports.
Args
- z_matrix (ZMatrix): The impedance matrix to convert.
- impedances (complex | float | dict[str, complex | float]): Reference impedance(s). If a single number, all terminals use the same impedance. If a dict, maps terminal names to their reference impedances. Defaults to 50.0.
Returns
SMatrix: The converted scattering matrix.