Section8.4

]>
Book Contents Previous Section 8.3 Manipulating Symbolic Roots of a Polynomial Next Section 8.5 Solution of Linear and Polynomial Equations Book Index

## 8.4 Computation of Eigenvalues and Eigenvectors

In this section we show you some of Axiom'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] ]

[1 2 1 2 1-2 1-2 4]

Type: Matrix Integer

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

leig := eigenvalues(m1)

[5,(%K|%K 2-%K-5)]

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-1 2 1]]

Type: List Matrix Fraction Polynomial Fraction Integer

The operation eigenvectors returns a list of pairs of values and vectors. When an eigenvalue is rational, Axiom 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 Axiom 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)

[[eigval=5, eigmult=1, eigvec=[[0-1 2 1]]],[eigval=(%L|%L 2-%L-5),eigmult=1, eigvec=[[%L 2 1]]]]

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)

[[radval=21+1 2, radmult=1, radvect=[[21+1 2 2 1]]],[radval=-21+1 2, radmult=1, radvect=[[-21+1 2 2 1]]],[radval=5, radmult=1, radvect=[[0-1 2 1]]]]

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

Alternatively, Axiom 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-1 2 1]]],[outval=5717 2048, outmult=1, outvect=[[5717 2048 2 1]]],[outval=-3669 2048, outmult=1, outvect=[[-3669 2048 2 1]]]]

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+1 2-21+1 2 0 2 2-1 2 1 1 1]

Type: Union(Matrix Expression Integer,...)
m2 := matrix [ [-5,-2],[18,7] ]

[-5-2 18 7]

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] ]

[1 2 2 1]

Type: Matrix Integer
orthonormalBasis(m3)

[[-1 2 1 2],[1 2 1 2]]

Type: List Matrix Expression Integer
Book Contents Previous Section 8.3 Manipulating Symbolic Roots of a Polynomial Next Section 8.5 Solution of Linear and Polynomial Equations Book Index