Sage: Eigenstuff

This help sheet is very useful!

Suppose we want to find the eigenvalues and eigenvectors of the matrix
A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}
We can find the eigenvalues using

A = matrix([[2,1],[1,2]])

A list of eigenvalues, with corresponding eigenvectors and multiplicities, is obtained from

A = matrix([[2,1],[1,2]])

The code

A = matrix([[2,1],[1,2]])

produces two matrices: the first is a diagonal matrix with eigenvalues down the diagonal; the second is the transition matrix where the column vectors are eigenvectors. One way to use this function is

A = matrix([[2,1],[1,2]])
D,P = A.eigenmatrix_right()

which designates the diagonal matrix to be D and the transition matrix to be P.

This entry was posted in Sage, Uncategorized. Bookmark the permalink.

Leave a comment here

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s