, k, l)[source]

connect two ports of a single n-port network’s s-matrix.

Specifically, connect port k to port l on A. This results in a (n-2)-port network. This function operates on, and returns s-matrices. The function innerconnect() operates on Network types.


The algorithm used to calculate the resultant network is called a ‘sub-network growth’, can be found in 1. The original paper describing the algorithm is given in 2.

  • A (numpy.ndarray) – S-parameter matrix of A, shape is fxnxn

  • k (int) – port index on A (port indices start from 0)

  • l (int) – port index on A


C – new S-parameter matrix

Return type




Compton, R.C.; , “Perspectives in microwave circuit analysis,” Circuits and Systems, 1989., Proceedings of the 32nd Midwest Symposium on , vol., no., pp.716-718 vol.2, 14-16 Aug 1989. URL:


Filipsson, Gunnar; , “A New General Computer Algorithm for S-Matrix Calculation of Interconnected Multiports,” Microwave Conference, 1981. 11th European , vol., no., pp.700-704, 7-11 Sept. 1981. URL: