def _solve_discrete_lyapunov_direct(a, q):
lhs = kron(a, a.conj())<EOL>lhs = np.eye(lhs.shape[<NUM_LIT:0>]) - lhs<EOL>x = solve(lhs, q.flatten())<EOL>return np.reshape(x, q.shape)<EOL>
Solves the discrete Lyapunov equation directly.

This function is called by the `solve_discrete_lyapunov` function with
`method=direct`. It is not supposed to be called directly.