Jordan Canonical Form; an algorithmic approach

1894 days ago by bigdata2016

A=matrix(QQ,[[1,0,0,0,0],[1,-1,0,0,-1],[1,-1,1,0,-1],[0,0,0,0,-1],[-1,1,0,0,1]]) p=A.characteristic_polynomial() show(A) html('<br>Characteristic Polynomial is $%s=%s$'%(latex(p),latex(p.factor()))) 
       


Characteristic Polynomial is

Characteristic Polynomial is
ev=A.eigenvectors_right() X1=ev[0][1][0] Y1=ev[1][1][0] html('Eigenvector of matrix A corresponding to the eigenvalue $%s$ is $x_1=%s$' %(ev[0][0][0], latex(X1)) ) print html('Eigenvector of matrix A corresponding to the eigenvalue $%s$ is $y_1=%s$' %(ev[1][0][0], latex(Y1)) ) 
       
Eigenvector of matrix A corresponding to the eigenvalue  is 

Eigenvector of matrix A corresponding to the eigenvalue  is 
Eigenvector of matrix A corresponding to the eigenvalue  is 

Eigenvector of matrix A corresponding to the eigenvalue  is 
EYE=identity_matrix(A.nrows()) X2=(A-ev[0][0][0]*EYE).solve_right(X1) Y2=(A-ev[1][0][0]*EYE).solve_right(Y1) html('Generalized eigenvector of matrix A corresponding to the eigenvalue $%s$ is $x_2=%s$' %(ev[0][0][0], latex(X2)) ) print html('Generalized eigenvector of matrix A corresponding to the eigenvalue $%s$ is $y_2=%s$' %(ev[1][0][0], latex(Y2)) ) 
       
Generalized eigenvector of matrix A corresponding to the eigenvalue  is 

Generalized eigenvector of matrix A corresponding to the eigenvalue  is 
Generalized eigenvector of matrix A corresponding to the eigenvalue  is 

Generalized eigenvector of matrix A corresponding to the eigenvalue  is 
Y3=(A-ev[1][0][0]*EYE).solve_right(Y2) html('Generalized eigenvector of matrix A corresponding to the eigenvalue $%s$ is $y_3=%s$' %(ev[1][0][0], latex(Y3)) ) 
       
Generalized eigenvector of matrix A corresponding to the eigenvalue  is 
Generalized eigenvector of matrix A corresponding to the eigenvalue  is 
P=[X1,X2,Y1,Y2,Y3] P=matrix(P) P=P.transpose() html('$P=%s$' %latex(P) ) 
       
html('Jordan Canonical Form of matrix $A$ is $J_A=%s$' %latex(P^(-1)*A*P)) 
       
Jordan Canonical Form of matrix  is 
Jordan Canonical Form of matrix  is