Demonstration 1.
Create the singular matrices for each eigenvalue (we will choose to do two with “random” choices for the eigenvalue). Row-reducing these matrices will exhibit their nonzero nullity.
📚 The CoCalc Library - books, templates and other resources
Important: to view this notebook properly you will need to execute the cell above, which assumes you have an Internet connection. It should already be selected, or place your cursor anywhere above to select. Then press the "Run" button in the menu bar above (the right-pointing arrowhead), or press Shift-Enter on your keyboard.
ParseError: KaTeX parse error: \newcommand{\lt} attempting to redefine \lt; use \renewcommand
A matrix with “nice” eigenvalues.
Eigenvalues are the roots of the characteristic polynomial (Theorem EMRCP), which should be obvious from the factored version, including their (algebraic) multiplicities. Of course, it can be very easy to get these in Sage.
Create the singular matrices for each eigenvalue (we will choose to do two with “random” choices for the eigenvalue). Row-reducing these matrices will exhibit their nonzero nullity.
Examine the eigenspace for the eigenvalue using Sage's right kernel command and the pivot basis.
Use a basis for the eigenspace to create eigenvectors of A
for the eigenvalue at will.
We can check this. Compare with
Here's an easy check:
Can you make more eigenvectors?
Continuing with A
from above, we can get eigen-stuff quickly from Sage, once we understand what is really happening (according to the definitions).
As always we want the “right” versions of the relevant commands. Eigenspaces are in the second parts of pairs, where the first part of each pair is the eigenvalue. Notice that they are vector spaces (with bases, etc). The basis vectors are Sage's version of a basis, with vectors from an echelonized matrix, typically with lots of zeros and ones in the first part of the vectors.
The eigenmatrix
commands return pair of matrices. The first is a diagonal matrix with the eigenvalues on the diagonal. The second is a square matrix with linearly independent eigenvectors in the columns, and the order of the eigenvectors is the same as the order of the eigenvalues. That is, the eigenvector in column i
of the second matrix is a basis vector for the eigenspace of the eigenvalue in column i
of the first matrix.
Sometimes the dimension of an eigenspace (the geometric multiplicity) is strictly less than the number of times the eigenvalue appears as a root of the characteristic polynomial. This is the case with C
next, but was not the case with A
above.
A totally random matrix is unlikely to have a characteristic polynomial that factors if we restrict ourseves to the rationals. But we can find all the roots over the set of all algebraic numbers. (This is the set of all real roots of all possible polynomials with integer coefficients.)
If we make a “block diagonal” matrix, then the characteristic polynomial will definitely factor some
Finally a large example, illustrating how fast Sage is at making characteristic polynomials and at factoring.
This is such a common operation, that Sage has a shorthand method for the , namely .fcp()
.
Nothing short of amazing!
If we use CDF
(Complex Double Field) for the number system of the entries of our matrix, we get (good) approximate values for eigenvalues. (If we are OK with the approximate nature, these routines are very, very fast.)
This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.