Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Documentation  / Mathematica / Built-in Functions  / Advanced Documentation / Linear Algebra / Matrix Computations /

 

Eigensystem Computations

The solution of the eigenvalue problem is one of the major areas for matrix computations. It has many applications in physics, chemistry, and engineering. For an matrix the eigenvalues are the roots of its characteristic polynomial, . The set of roots, , are called the spectrum of the matrix. For each eigenvalue, , the vectors, , that satisfy

are described as eigenvectors. The matrix of the eigenvectors, , if it exists and is non-singular, may be used as a similarity transformation to form a diagonal matrix with the eigenvalues on the diagonal elements. Many important applications of eigenvalues involve the diagonalization of matrices in this way.

Mathematica has various functions for computing eigenvalues and eigenvectors.

Eigenvalues and eigenvectors.

Here is a sample 2Cross2 matrix.

In[1]:=

This computes the eigenvalues.

In[2]:=

Out[2]=

This computes the eigenvectors.

In[3]:=

Out[3]=

You can compute both the eigenvalues and eigenvectors with Eigensystem.

In[4]:=

Out[4]=

You can confirm that the first eigenvalue and its eigenvector satisfy the definition.

In[5]:=

Out[5]=

You should note that Eigenvectors and Eigensystem return a list of eigenvectors. This means that if you want a matrix with columns that are the eigenvectors you must take a transpose. Here, the eigenvalues and their corresponding eigenvectors are shown to meet the definition of the eigenvectors.

In[6]:=

Out[6]=

You can also obtain the characteristic polynomial of the test matrix.

In[7]:=

Out[7]=

This finds the roots of the characteristic polynomial; they are seen to match the eigenvalues of the matrix.

In[8]:=

Out[8]=

Eigenvalue computations work for sparse matrices as well as for dense matrices. In the following example, one of the eigenvalues is zero.

In[9]:=

Out[10]//MatrixForm=

In[11]:=

Out[11]=

An eigenvalue being zero means that the null space of the matrix is not empty.

In[12]:=

Out[12]=

Certain applications of eigenvalues do not require all of the eigenvalues to be computed. Mathematica provides a mechanism for obtaining only some eigenvalues.

This is particularly useful if the matrix is very large. Here is a 10000Cross10000 sparse matrix.

In[13]:=

Out[13]=

This is the largest eigenvalue.

In[14]:=

Out[14]=

Options for Eigensystem.

Eigensystem has four options that allow users more control. The Cubics, Quartics, and ZeroTest options are used by symbolic techniques and are discussed in the section Symbolic and Exact Matrices. The Method option allows knowledgeable users to choose methods that are particularly appropriate for their problems; the default setting of Automatic means that Eigensystem makes a choice of a method that is generally suitable.

Eigensystem Properties

This section describes certain properties of eigensystem computations. It should be remembered that because the eigenvalues of an matrix can be associated with the roots of an degree polynomial, there will always be eigenvalues.

Even if a matrix only contains real numbers, its eigenvalues may not be real.

In[1]:=

Out[2]=

The eigenvalues of a matrix may be repeated; eigenvalues that are not repeated are called simple. In this example, the repeated eigenvalue has as many eigenvectors as the number of times it is repeated; this is a semisimple eigenvalue.

In[3]:=

Out[4]=

The repeated eigenvalue may have fewer eigenvectors than the number of times it is repeated. In this case it is referred to as a defective eigenvalue and the matrix is referred to as a defective matrix.

In[5]:=

Out[6]=

A matrix may have a zero eigenvalue, but can still have a complete set of eigenvectors.

In[7]:=

Out[8]=

A matrix may have a zero eigenvalue, but not have a complete set of eigenvectors.

In[9]:=

Out[10]=

If a matrix is real and symmetric all of the eigenvalues are real, and there is an orthonormal basis of eigenvectors.

In[11]:=

Out[12]=

The eigenvectors are an orthonormal basis.

In[13]:=

Out[13]=

A symmetric real matrix that has positive eigenvalues is known as positive definite.

In[14]:=

Out[15]=

A symmetric real matrix that has nonzero eigenvalues is known as positive semidefinite.

In[16]:=

Out[17]=

If a matrix is complex and hermitian (i.e. equal to its conjugate transpose), all of the eigenvalues are real and there is an orthonormal basis of eigenvectors.

In[18]:=

Out[19]=

The eigenvectors are an orthonormal basis.

In[20]:=

Out[20]=

A hermitian matrix that has positive eigenvalues is known as positive definite.

In[21]:=

Out[22]=

Diagonalizing a Matrix

One of the uses of eigensystem computations is to provide a similarity transformation that diagonalizes a matrix.

In[1]:=

Out[3]//MatrixForm=

Similarity transformations preserve a number of useful properties of a matrix such as determinant, rank, and trace.

If the matrix of eigenvectors is singular then the matrix cannot be diagonalized. This happens if the matrix is defective (i.e., there is an eigenvalue that does not have a complete set of eigenvectors) as in this example.

In[4]:=

Out[7]//MatrixForm=

The matrix of column eigenvectors is singular and so a similarity transformation that diagonalizes the original matrix does not exist.

In[8]:=

Out[8]=

Symbolic and Exact Matrices

As is typical for Mathematica, if a computation is done for a symbolic or exact matrix it will use symbolic computer algebra techniques and return a symbolic or exact result.

This is a sample 3Cross3 matrix of integers.

In[1]:=

This computes the eigenvalues; the result uses Root objects.

In[2]:=

Out[2]=

A machine-precision approximation to the result can be computed by using N.

In[3]:=

Out[3]=

The result can be returned in terms of radicals by setting the Cubics option to True.

In[4]:=

Out[4]=

Generalized Eigenvalues

For nCrossn matrices the generalized eigenvalues are the n roots of its characteristic polynomial, . For each generalized eigenvalue, , the vectors, , that satisfy

are described as generalized eigenvectors.

Generalized eigenvalues and eigenvectors.

Here are two 2Cross2 matrices.

In[1]:=

This computes the generalized eigenvalues.

In[3]:=

Out[3]=

If the two matrices share a common nonzero nullspace, there will be an indeterminate eigenvalue.

In[4]:=

These two matrices share a common one-dimensional nullspace.

In[6]:=

Out[6]=

In[7]:=

Out[7]=

One of the generalized eigenvalues is Indeterminate.

In[8]:=

Out[8]=

Methods

Eigenvalue computations are solved with a number of different techniques that are specialized to particular problems. You can select between these using the option Method. In this way a uniform interface is provided to all the functionality that Mathematica provides.

The default setting of the option Method is Automatic. As is typical for Mathematica, this means that the system will make an automatic choice of method to use. For eigenvalue computation when the input is an matrix of machine numbers and the number of eigenvalues requested is less than 20% of an Arnoldi method is used. Otherwise, if the input matrix is numerical then a method using LAPACK routines is used. If the matrix is symbolic then specialized symbolic routines are used.

The details of the different methods are now described.

LAPACK

LAPACK is the default method for computing the entire set of eigenvalues and eigenvectors. When the matrix is unsymmetric, dgeev is used for real matrices and zgeev is used for complex matrices. For symmetric matrices, dsyevr is used for real matrices and zheevr is used for complex matrices. For generalized eigenvalues the routine dggev is used for real matrices and zggev for complex matrices. More information on LAPACK is available in the references section.

It should be noted that the computation of eigenvalues for a symmetric matrix is faster because Mathematica detects this case and switches to the appropriate method.

In[1]:=

In[3]:=

Out[3]=

In[4]:=

Out[4]=

If the input matrix uses arbitrary-precision numbers, LAPACK algorithms extended for arbitrary-precision computation are used.

Arnoldi

The Arnoldi method is an iterative method used to compute a finite number of eigenvalues. The implementation of the Arnoldi method uses the ARPACK library. The most general problem that can be solved with this technique is to compute a few selected eigenvalues for

Because it is an iterative technique and only finds a few eigenvalues, it is often suitable for sparse matrices. One of the features of the technique is the ability to apply a shift Sigma and solve for a given eigenvector and eigenvalue (where ).

This is effective for finding eigenvalues near to Sigma.

The following sub-options can be given to the Arnoldi method.

Sub-options of the Arnoldi method.

Here is a 3Cross3 sparse matrix.

In[1]:=

This computes the largest eigenvalue, specifying that the Arnoldi method is used.

In[2]:=

Out[2]=

This computes the eigenvalue near to -1.

In[3]:=

Out[3]=

If a shift is given that matches an eigenvalue an error results.

In[4]:=

Out[4]=

This tries to find eigenvalues of a 1500Cross1500 tridiagonal matrix with 2 on the diagonal and -1 off the diagonal. The algorithm does not converge.

In[5]:=

Out[7]=

When the technique does not converge it returns a result, but this may not be very accurate. One way to accelerate the convergence would be to use the results generated as a shift.

In[8]:=

Out[8]=

An alternative way to get convergence is to increase the number of iterations.

In[9]:=

Out[9]=

Alternatively, the convergence may be achieved by increasing the Arnoldi basis size in addition to the number of iterations. In this example, the increased basis size makes the algorithm converge in a smaller number of iterations. Even though each iteration is more expensive, the overall computation is faster.

In[10]:=

Out[10]=

The Arnoldi algorithm with a basis size of 30 is still faster and less memory intensive than the dense eigenvalue computation.

In[11]:=

Out[12]=

For many large sparse systems that occur in practical computations the Arnoldi algorithm is able to converge quite quickly.

Symbolic Methods

Symbolic eigenvalue computations work by interpolating the characteristic polynomial.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information


 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: