def _solve_discrete_lyapunov_bilinear(a, q):
 eye = np.eye(a.shape[0])
 aH = a.conj().transpose()
 aHI_inv = inv((aH + eye))
 b = np.dot((aH - eye), aHI_inv)
 c = (2 * np.dot(np.dot(inv((a + eye)), q), aHI_inv))
 return solve_lyapunov(b.conj().transpose(), (- c))

def _solve_discrete_lyapunov_bilinear ( a , q ) : eye = np . eye ( a . shape [ 0 ] ) aH = a . conj ( ) . transpose ( ) aHI_inv = inv ( ( aH + eye ) ) b = np . dot ( ( aH - eye ) , aHI_inv ) c = ( 2 * np . dot ( np . dot ( inv ( ( a + eye ) ) , q ) , aHI_inv ) ) return solve_lyapunov ( b . conj ( ) . transpose ( ) , ( - c ) )
solves the discrete lyapunov equation using a bilinear transformation .