1. A non-transitory computer readable storage medium having a method encoded thereon, the method represented by computer readable programming code, the method comprising the steps of: generating at least one matrix representing a two-port, wherein the two-port comprises: a non-reactive multi-port modeled by an orthogonal matrix, wherein the orthogonal matrix is parameterized using an exponential map of skew-symmetric matrices having components restricted to an interval from −π to π, and at least one amplifier connected to the non-reactive multi-port; generating gain, noise, and stability functions of a system, wherein the system comprises: the two-port, a generator connected to one port of the two-port, the generator having a generator reflectance, and a load connected to the other port of the two-port, the load having a load reflectance, wherein the gain, noise, and stability functions are generated using the generated matrix, the generator reflectance, and the load reflectance, wherein the gain, noise, and stability functions are parameterized by the skew-symmetric matrices; and optimizing the gain, noise, and stability functions.