Ch-8-Prob-6-New-강산

1840 days ago by matrix

A= matrix(QQ,3,3,[1,2,2,2,1,-2,2,-2,1]) print A.eigenvectors_left() 
       
[(-3, [
(1, -1, -1)
], 1), (3, [
(1, 0, 1),
(0, 1, -1)
], 2)]
[(-3, [
(1, -1, -1)
], 1), (3, [
(1, 0, 1),
(0, 1, -1)
], 2)]
x1 = vector([1,-1,-1]) x2 = vector([1,0,1]) x3 = vector([0,1,-1]) z1 = 1/sqrt(3)*x1 y2 = x2 y3 = x3-((x3*y2)/(y2.norm())^2)*y2 z2 = 1/y2.norm()*y2 z3 = 1/y3.norm()*y3 P = column_matrix([z1,z2,z3]) print P.transpose()*P 
       
[1 0 0]
[0 1 0]
[0 0 1]
[1 0 0]
[0 1 0]
[0 0 1]
D = P.transpose()*A*P print D 
       
[-3  0  0]
[ 0  3  0]
[ 0  0  3]
[-3  0  0]
[ 0  3  0]
[ 0  0  3]