Skip to content

y_to_s_matrix

y_to_s_matrix(y_matrix, impedances=50.0)

Convert a Y-matrix (admittance matrix) to an S-matrix (scattering matrix).

Uses the travelling-wave S-parameter convention:

S=F−1(I−ZrY)(I+ZrY)−1FS = F^{-1} (I - Z_r Y) (I + Z_r Y)^{-1} F

where F=diag(Re(Zr,i))F = \text{diag}(\sqrt{\text{Re}(Z_{r,i})}).

This is a direct conversion (more efficient than Y→Z→S).

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

  • y_matrix (YMatrix): The admittance 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.