def convert(self, dest, Tout=False): N = dest(self.N) _, T_s2d, _ = convert(self.N.P, N.P, self.N) C = matrix_multiply(matrix_multiply(T_s2d, self.C), Hconj(T_s2d)) C[..., 0, 0] = C[..., 0, 0].real C[..., 1, 1] = C[..., 1, 1].real if Tout: return NoisyTwoport(N, C), T_s2d else: return NoisyTwoport(N, C)
def T(self, dest): N = dest(self.N) _, T_s2d, _ = convert(self.N.P, N.P, self.N) return T_s2d