LA Ch8 Exs Prob 6 by 김지윤

326 days ago by jykim

v1=vector([0, 0, 0, -1]);v2=vector([0,1, 0, 0]);v3=vector([0, 0, 1, 0]);v4=vector([-1, 0, 0, 0]) A=column_matrix([v1, v2, v3, v4]) print "A=" print A print print "eigenvalue of A" print A.eigenvalues() print print "eigenvector of A" print A.right_eigenvectors() z1= A.right_eigenvectors()[1][1][2]/A.right_eigenvectors()[1][1][2].norm() z2= A.right_eigenvectors()[1][1][1]/A.right_eigenvectors()[1][1][1].norm() z3= A.right_eigenvectors()[1][1][0]/A.right_eigenvectors()[1][1][0].norm() z4= A.right_eigenvectors()[0][1][0]/A.right_eigenvectors()[0][1][0].norm() P=column_matrix([z4,z3,z2,z1]) print print "P=" print P print print "D=" print P.transpose()*A*P 
       
A=
[ 0  0  0 -1]
[ 0  1  0  0]
[ 0  0  1  0]
[-1  0  0  0]

eigenvalue of A
[-1, 1, 1, 1]

eigenvector of A
[(-1, [
(1, 0, 0, 1)
], 1), (1, [
(1, 0, 0, -1),
(0, 1, 0, 0),
(0, 0, 1, 0)
], 3)]

P=
[ 1/2*sqrt(2)  1/2*sqrt(2)            0            0]
[           0            0            1            0]
[           0            0            0            1]
[ 1/2*sqrt(2) -1/2*sqrt(2)            0            0]

D=
[-1  0  0  0]
[ 0  1  0  0]
[ 0  0  1  0]
[ 0  0  0  1]
A=
[ 0  0  0 -1]
[ 0  1  0  0]
[ 0  0  1  0]
[-1  0  0  0]

eigenvalue of A
[-1, 1, 1, 1]

eigenvector of A
[(-1, [
(1, 0, 0, 1)
], 1), (1, [
(1, 0, 0, -1),
(0, 1, 0, 0),
(0, 0, 1, 0)
], 3)]

P=
[ 1/2*sqrt(2)  1/2*sqrt(2)            0            0]
[           0            0            1            0]
[           0            0            0            1]
[ 1/2*sqrt(2) -1/2*sqrt(2)            0            0]

D=
[-1  0  0  0]
[ 0  1  0  0]
[ 0  0  1  0]
[ 0  0  0  1]