def test_rand_float_matrix(A): assume(np.isfinite(A).all()) M = Matrix(A) P = M @ M.pinv() Q = M.pinv() @ M assert P.is_sim(P @ P) assert Q.is_sim(Q @ Q)
def test_rand_int_matrix(A): M = Matrix(A) P = M @ M.pinv() Q = M.pinv() @ M assert P.is_sim(P @ P) assert Q.is_sim(Q @ Q)