In this section, we shall explore computation of eigenvalues and eigenvectors and related concepts in Sage. We shall also look applications of diagonalization in Sage.
Sage can compute eigenvalues and eigenvectors of a matrix and also of linear operator. If \(A\) is a square marix, then A.eignvalues() returns eigenvalues of the matrix \(A\text{.}\) Simplarly, A.eigenvectors_right() returns the eigenvectors along with the corresponding eigenvalue including the multiplicity of each eigenvalue. Apart from these two coammands, Sage also has A.eigenmatrix_right() which returns diagonal matrix of eigenvalues and the matrix whose columns of eigenvectors. Let us explore some example.
Sage can also find the characteristic polynomial of matrix with ease using two matrix method A.charpoly() and A.characteristic_polynomial() Let us look at the next example.
Clearly this polynomial cannot be factorized in the field of rational numbers. However, Sage provide an extended field QQbar in whihc we can find the rots of this polynomial.
For this example, let us also verify that (i) the sum of eigenvalues equals to the trace and (ii) the product of eigenvalues equals to the determinant.
Note that the eigenspace corresponding to the eigenvalue \(\lambda\) is the \(\text{kerne}(A-\lambda
I)\) and the gemetric multiplicity is the nullity of \((A-\lambda I)\text{.}\)
To find the eigenspace with respect to the eigenvalue \(\lambda\) can be obtained by appplying RREF to the matrix \((A-\lambda I)\) and solving the corresponding system of equations.
Clearly \(A\) is diagonalizable. We can also find the matrix \(P\) of eigenvectors and check if \(P^{-1}AP\) is the diagonal matrix whose diagonal entries are eigenvalues.
Clearly eigenvalues of \(T\text{,}\)\(A\) and \(B\) are same. This is not suprizing as \(A\) and \(B\) are similar matrices and similar matrices have the same determinant and eigenvalues.