python
复制代码
A=np.array([[1,4],[6,2]])
B=np.array([[3,1],[4,8]])
np.linalg.det(np.kron(A,B))
Out[9]: 193599.99999999985
np.linalg.inv(np.kron(A,B))
Out[10]:
array([[-0.03636364, 0.00454545, 0.07272727, -0.00909091],
[ 0.01818182, -0.01363636, -0.03636364, 0.02727273],
[ 0.10909091, -0.01363636, -0.01818182, 0.00227273],
[-0.05454545, 0.04090909, 0.00909091, -0.00681818]])
np.kron(np.linalg.inv(A),np.linalg.inv(B))
Out[11]:
array([[-0.03636364, 0.00454545, 0.07272727, -0.00909091],
[ 0.01818182, -0.01363636, -0.03636364, 0.02727273],
[ 0.10909091, -0.01363636, -0.01818182, 0.00227273],
[-0.05454545, 0.04090909, 0.00909091, -0.00681818]])