Index <book-index.html>__

# 8.4 Computation of Eigenvalues and Eigenvectors¶

In this section we show you some of FriCAS’s facilities for computing and eigenvalue manipulating eigenvalues and eigenvectors, also called eigenvector characteristic values and characteristic vectors, characteristic:value respectively. characteristic:vector

Let’s first create a matrix with integer entries.

m1 := matrix [ [1,2,1],[2,1,-2],[1,-2,4] ]


 [12121-21-24]

Type: Matrix Integer

To get a list of the rational eigenvalues, use the operation eigenvalues.

leig := eigenvalues(m1)



Type: List Union(Fraction Polynomial Integer,SuchThat(Symbol,Polynomial Integer))

Given an explicit eigenvalue, eigenvector computes the eigenvectors corresponding to it.

eigenvector(first(leig),m1)


 [[0-121]]

Type: List Matrix Fraction Polynomial Fraction Integer

The operation eigenvectors returns a list of pairs of values and vectors. When an eigenvalue is rational, FriCAS gives you the value explicitly; otherwise, its minimal polynomial is given, (the polynomial of lowest degree with the eigenvalues as roots), together with a parametric representation of the eigenvector using the eigenvalue. This means that if you ask FriCAS to solve the minimal polynomial, then you can substitute these roots polynomial:minimal into the parametric form of the corresponding eigenvectors. minimal polynomial

You must be aware that unless an exact eigenvalue has been computed, the eigenvector may be badly in error.

eigenvectors(m1)



Type: List Record(eigval: Union(Fraction Polynomial Integer,SuchThat(Symbol,Polynomial Integer)),eigmult: NonNegativeInteger,eigvec: List Matrix Fraction Polynomial Integer)

Another possibility is to use the operation radicalEigenvectors tries to compute explicitly the eigenvectors in terms of radicals. radical

radicalEigenvectors(m1)



Type: List Record(radval: Expression Integer,radmult: Integer,radvect: List Matrix Expression Integer)

Alternatively, FriCAS can compute real or complex approximations to the approximation eigenvectors and eigenvalues using the operations realEigenvectors or complexEigenvectors. They each take an additional argument to specify the precision required. precision In the real case, this means that each approximation will be within of the actual result. In the complex case, this means that each approximation will be within of the actual result in each of the real and imaginary parts.

The precision can be specified as a Float if the results are desired in floating-point notation, or as Fraction Integer if the results are to be expressed using rational (or complex rational) numbers.

realEigenvectors(m1,1/1000)


 [[outval=5,outmult=1,outvect=[[0-121]]],[outval=57172048,outmult=1,outvect=[[5717204821]]],[outval=-36692048,outmult=1,outvect=[[-3669204821]]]]

Type: List Record(outval: Fraction Integer,outmult: Integer,outvect: List Matrix Fraction Integer)

If an n by n matrix has n distinct eigenvalues (and therefore n eigenvectors) the operation eigenMatrix gives you a matrix of the eigenvectors.

eigenMatrix(m1)


 [21+12-21+12022-12111]

Type: Union(Matrix Expression Integer,...)

m2 := matrix [ [-5,-2],[18,7] ]


 [-5-2187]

Type: Matrix Integer

eigenMatrix(m2)


 “failed”

Type: Union(“failed”,...)

If a symmetric matrix matrix:symmetric has a basis of orthonormal eigenvectors, then basis:orthonormal orthonormalBasis computes a list of these vectors. orthonormal basis

m3 := matrix [ [1,2],[2,1] ]


 [1221]

Type: Matrix Integer

orthonormalBasis(m3)


 [[-1212],[1212]]

Type: List Matrix Expression Integer

Index <book-index.html>__