tidy3d.EMESimulation.smatrix_in_basis#
- EMESimulation.smatrix_in_basis(smatrix, port_modes, modes1=None, modes2=None, skip_gram_normalization=False)[source]#
Express a locally propagated S-matrix in another modal basis.
Pass the mode data for the left and right EME ports, typically
(mode_data[0], mode_data[-1])from the sequence used bypropagate(). Ifmodes1ormodes2isNone, that port is left unchanged.- Parameters:
smatrix (
EMESMatrixDataset) – Device S-matrix in the port-mode basis, as returned bypropagate(),propagate_from_overlaps(), orcompute_smatrix().port_modes (tuple[
ModeSimulationData|ModeSolverData, …]) – Mode results at the two EME ports.modes1 (
ElectromagneticFieldData,ModeSolverData, or) –ModeSimulationData, optional New modal bases at port 1 and port 2.modes2 (
ElectromagneticFieldData,ModeSolverData, or) –ModeSimulationData, optional New modal bases at port 1 and port 2.skip_gram_normalization (bool = False) – If
False(default), normalize the change of basis so it is correct even for bases that are not orthonormal (linear combinations of port modes, modes on a different grid, or custom fields). IfTrue, skip the Gram normalization and use the plain overlap contraction; this is correct only when the port and new bases each have identity self-overlap in this method’s overlap convention, and otherwise merely recovers the pre-normalization behavior (which may be incorrect).
- Returns:
S-matrix in the new basis.
- Return type: