如何用Python编写矩阵的酉变换
给定矩阵集,假设共轭IV的转置将获得UB:如何用Python编写矩阵的酉变换,python,numpy,matrix,transformation,Python,Numpy,Matrix,Transformation,给定矩阵集,假设共轭IV的转置将获得UB: IV_transpose*UB(IV)=UB 然而,我得到了不同的输出。请看代码 angle=60 UB = np.array([ [1,0,0,0], [0,math.cos(4*math.radians(angle)),math.sin(4*math.radians(angle)),0], [0, math.sin(4 * math.radians(angle)), -math.cos(4 *math.radia
IV_transpose*UB(IV)=UB
然而,我得到了不同的输出。请看代码
angle=60
UB = np.array([
[1,0,0,0],
[0,math.cos(4*math.radians(angle)),math.sin(4*math.radians(angle)),0],
[0, math.sin(4 * math.radians(angle)), -math.cos(4
*math.radians(angle)),0],[0,0,0,-1]])
IV = [[1.0],[1.0],[0.0],[0.0]]
IVT=np.conj(IV).T
UBIV=np.matmul(UB,IV)
output=np.matmul(IVT,UBIV)
print (output)
print (UB)
这是我的输出:
IV_transpose*UB(IV)=[[ 0.5]]
UB=
[[ 1. 0. 0. 0. ]
[ 0. -0.5 -0.8660254 0. ]
[ 0. -0.8660254 0.5 0. ]
[ 0. 0. 0. -1. ]]
我的问题是为什么IV_转置*UB(IV)=UB
。
如何使其平等?
谢谢。Di您跟踪
IVT
、UBIV
等的数组形状吗?dosUB(IV)
是什么意思<代码>UBIV@IVT生成一个4x4阵列,其编号与UB
相同,但排列方式不同。是。我通知他们有不同的数组形状UB
是Bob在60度时的旋转IV
是初始化向量。应使用UB
旋转IV
。IV
的转置乘以UB(IV)
将得到UB
的结果,不是吗?