import numpy as np # 创建一个复数矩阵 A = np.array([[1+2j, 2-1j], [3+4j, 4+0j]]) Q, R = np.linalg.qr(A) print("Q =\n", Q) print("R =\n", R)