def test_solve_discrete_lyapunov_complex():
    'Complex test, A is companion matrix'
    A = np.array([[0.5 + 0.3j, 0.1 + 0.1j],
                  [         1,          0]])
    B = np.eye(2)

    X = qme.solve_discrete_lyapunov(A, B)

    assert_allclose(np.dot(np.dot(A, X), A.conj().transpose()) - X, -B,
                    atol=1e-15)
dataset/ETHPy150Open QuantEcon/QuantEcon.py/quantecon/tests/test_matrix_eqn.py/test_solve_discrete_lyapunov_complex/original