Eigensystem

Eigensystem[m]

gives a list {values,vectors} of the eigenvalues and eigenvectors of the square matrix m.

Eigensystem[{m,a}]

gives the generalized eigenvalues and eigenvectors of m with respect to a.

Eigensystem[m,k]

gives the eigenvalues and eigenvectors for the first k eigenvalues of m.

Eigensystem[{m,a},k]

gives the first k generalized eigenvalues and eigenvectors.

Details and Options

  • Eigensystem finds numerical eigenvalues and eigenvectors if m contains approximate real or complex numbers.
  • For approximate numerical matrices m, the eigenvectors are normalized. »
  • For exact or symbolic matrices m, the eigenvectors are not normalized. »
  • All the nonzero eigenvectors given are independent. If the number of eigenvectors is equal to the number of nonzero eigenvalues, then corresponding eigenvalues and eigenvectors are given in corresponding positions in their respective lists. The eigenvalues correspond to rows in the eigenvector matrix.
  • If there are more eigenvalues than independent eigenvectors, then each extra eigenvalue is paired with a vector of zeros. »
  • If they are numeric, eigenvalues are sorted in order of decreasing absolute value.
  • The eigenvalues and eigenvectors satisfy the matrix equation m.Transpose[vectors]==Transpose[vectors].DiagonalMatrix[values]. »
  • The generalized finite eigenvalues and eigenvectors satisfy m.Transpose[vectors]==a.Transpose[vectors].DiagonalMatrix[values]. »
  • Ordinary eigenvalues are always finite; generalized eigenvalues can be infinite. Infinite generalized eigenvalues correspond to those for which . »
  • When matrices m and a have a dimension shared null space, then of their generalized eigenvalues will be Indeterminate and will be paired with zero vectors in the generalized eigenvector list. »
  • {vals,vecs}=Eigensystem[m] can be used to set vals and vecs to be the eigenvalues and eigenvectors, respectively. »
  • For numeric eigenvalues, Eigensystem[m,k] gives the k eigenvalues that are largest in absolute value and corresponding eigenvectors.
  • Eigensystem[m,-k] gives the k eigenvalues that are smallest in absolute value and corresponding eigenvectors.
  • Eigensystem[m,spec] is equivalent to applying Take[,spec] to each element of Eigensystem[m].
  • Eigensystem[m,UpTo[k]] gives k eigenvalues and corresponding eigenvectors, or as many as are available.
  • SparseArray objects and structured arrays can be used in Eigensystem.
  • Eigensystem has the following options and settings:
  • Cubics Falsewhether to use radicals to solve cubics
    Method Automaticselect a method to use
    Quartics Falsewhether to use radicals to solve quartics
    ZeroTestAutomatictest for when expressions are zero
  • The ZeroTest option only applies to exact and symbolic matrices.
  • Explicit Method settings for approximate numeric matrices include:
  • "Arnoldi"Arnoldi iterative method for finding a few eigenvalues
    "Banded"direct banded matrix solver for Hermitian matrices
    "Direct"direct method for finding all eigenvalues
    "FEAST"FEAST iterative method for finding eigenvalues in an interval (applies to Hermitian matrices only)
  • The "Arnoldi" method is also known as a Lanczos method when applied to symmetric or Hermitian matrices.
  • The "Arnoldi" and "FEAST" methods take suboptions Method->{"name",opt1->val1,}, which can be found in the Method subsection.

Examples

open allclose all

Basic Examples  (5)

Eigenvalues and eigenvectors computed with machine precision:

Eigenvalues and vectors of an arbitrary-precision matrix:

Exact eigenvalues and eigenvectors:

Symbolic eigenvalues and eigenvectors:

Set vals and vecs to be the eigenvalues and eigenvectors, respectively:

Scope  (19)

Basic Uses  (6)

Find the eigensystem of a machine-precision matrix:

Approximate 18-digit precision eigenvalues and eigenvectors:

Eigensystem of a complex matrix:

Exact eigensystem:

The eigenvalues and eigenvectors of large numerical matrices are computed efficiently:

Eigensystem of a CenteredInterval matrix:

Find an eigensystem for a random representative mrep of m:

Verify that, after reordering and scaling of vectors, vals contain rvals and vecs contain rvecs:

Subsets of Eigenvalues  (5)

Compute the three largest eigenvalues and their corresponding eigenvectors:

Visualize the three vectors, using the eigenvalue as a label:

Eigensystem corresponding to the three smallest eigenvalues:

Find the eigensystem corresponding to the four largest eigenvalues, or as many as there are if fewer:

Repeated eigenvalues are considered when extracting a subset of the eigensystem:

Zero vectors are used when there are more eigenvalues than independent eigenvectors:

Generalized Eigenvalues  (4)

Compute machine-precision generalized eigenvalues and eigenvectors:

Generalized exact eigensystem:

Compute the result at finite precision:

Compute a symbolic generalized eigensystem:

Find the two smallest generalized eigenvalues and corresponding generalized eigenvectors:

Special Matrices  (4)

Eigensystems of sparse matrices:

Eigensystems of structured matrices:

The units of a QuantityArray object are in the eigenvalues, leaving the eigenvectors dimensionless:

The eigenvectors of IdentityMatrix form the standard basis for a vector space:

Eigenvectors of HilbertMatrix:

If the matrix is first numericized, the eigenvectors (but not eigenvalues) change significantly:

Options  (10)

Cubics  (1)

A 3×3 Vandermonde matrix:

In general, for exact 3×3 matrices the result will be given in terms of Root objects:

To get the result in terms of radicals, use the Cubics option:

Note that the result with Root objects is better suited to subsequent numerical evaluation:

Method  (8)

"Arnoldi"  (5)

The Arnoldi method can be used for machine- and arbitrary-precision matrices. The implementation of the Arnoldi method is based on the "ARPACK" library. It is most useful for large sparse matrices.

The following suboptions can be specified for the method "Arnoldi":

  • "BasisSize"the size of the Arnoldi basis
    "Criteria"which criteria to use
    "MaxIterations"the maximum number of iterations
    "Shift"the Arnoldi shift
    "StartingVector"the initial vector to start iterations
    "Tolerance"the tolerance used to terminate iterations
  • Possible settings for "Criteria" include:

  • "Magnitude"based on Abs
    "RealPart"based on Re
    "ImaginaryPart"based on Im
    "BothEnds"a few eigenvalues from both ends of the symmetric real matrix spectrum
  • Compute the largest eigenpair using different "Criteria" settings. The matrix m has eigenvalues :

    By default, "Criteria"->"Magnitude" selects a largest-magnitude eigenpair:

    Find the largest real-part eigenpair:

    Find the largest imaginary-part eigenpair:

    Find two eigenpairs from both ends of the symmetric matrix spectrum:

    Use "StartingVector" to avoid randomness:

    Different starting vectors may converge to different eigenpairs:

    Use "Shift"->μ to shift the eigenvalues by transforming the matrix to . This preserves the eigenvectors but changes the eigenvalues by -μ. The method compensates for the changed eigenvalues. "Shift" is typically used to find eigenpairs when there are no criteria such as largest or smallest magnitude that can select them:

    Manually shift the matrix and adjust the resulting eigenvalue:

    Automatically shift and adjust the eigenvalue:

    "Banded"  (1)

    The banded method can be used for real symmetric or complex Hermitian machine-precision matrices. The method is most useful for finding all eigenpairs.

    Compute the two largest eigenpairs for a banded matrix:

    Check the solution:

    "FEAST"  (2)

    The FEAST method can be used for real symmetric or complex Hermitian machine-precision matrices. The method is most useful for finding eigenvalues in a given interval.

    The following suboptions can be specified for the method "FEAST":

  • "ContourPoints"select the number of contour points
    "Interval"an interval for finding eigenvalues
    "MaxIterations"the maximum number of refinement loops
    "NumberOfRestarts"the maximum number of restarts
    "SubspaceSize"the initial size of subspace
    "Tolerance"the tolerance to terminate refinement
    "UseBandedSolver"whether to use a banded solver
  • Compute eigenpairs in the interval :

    Use "Interval" to specify the interval:

    The interval end points are not included in the interval FEAST finds eigenvalues in.

    Check the solution:

    Quartics  (1)

    A 4×4 matrix:

    In general, for a 4×4 matrix, the result will be given in terms of Root objects:

    You can get the result in terms of radicals using the Cubics and Quartics options:

    Applications  (16)

    The Geometry of Eigensystem  (3)

    Eigenvectors with positive eigenvalues point in the same direction when acted on by the matrix:

    Eigenvectors with negative eigenvalues point in the opposite direction when acted on by the matrix:

    Consider the following matrix and its associated quadratic form q=TemplateBox[{x}, Transpose].a.x:

    The eigenvectors are the axes of the hyperbolas defined by :

    The sign of the eigenvalue corresponds to the sign of the right-hand side of the hyperbola equation:

    Here is a positive-definite quadratic form in 3 dimensions:

    Plot the surface :

    Get the symmetric matrix for the quadratic form, using CoefficientArrays:

    Numerically compute its eigenvalues and eigenvectors:

    Show the principal axes of the ellipsoid:

    Diagonalization  (5)

    Diagonalize the following matrix as m=p.d.TemplateBox[{p}, Inverse]. First, compute 's eigenvalues and eigenvectors:

    Construct a diagonal matrix from the eigenvalues and a matrix whose columns are the eigenvectors:

    Confirm the identity m=p.d.TemplateBox[{p}, Inverse]:

    Any function of the matrix can now be computed as f(m)=p.f(d).TemplateBox[{p}, Inverse]. For example, MatrixPower:

    Similarly, MatrixExp becomes trivial, requiring only exponentiating the diagonal elements of :

    Let be the linear transformation whose standard matrix is given by the matrix . Find a basis for TemplateBox[{}, Reals]^4 with the property that the representation of in that basis is diagonal:

    Find the eigenvalues and eigenvectors of :

    Let consist of the eigenvectors, and let be the matrix whose columns are the elements of :

    converts from -coordinates to standard coordinates. Its inverse converts in the reverse direction:

    Thus is given by TemplateBox[{b}, Inverse].a.b, which is diagonal:

    Note that this is simply the diagonal matrix whose entries are the eigenvalues:

    A real-valued symmetric matrix is orthogonally diagonalizable as s=o.d.TemplateBox[{o}, Transpose], with diagonal and real valued and orthogonal. Verify that the following matrix is symmetric and then diagonalize it:

    Compute the eigenvalues and eigenvectors:

    The matrix has the eigenvalues on the diagonal:

    For an orthogonal matrix, it is necessary to normalize the eigenvectors before placing them in columns:

    Verify that s=o.d.TemplateBox[{o}, Transpose]:

    A matrix is called normal if TemplateBox[{n}, ConjugateTranspose].n=n.TemplateBox[{n}, ConjugateTranspose]. Normal matrices are the most general kind of matrix that can be diagonalized by a unitary transformation. All real symmetric matrices are normal because both sides of the equality are simply :

    Show that the following matrix is normal, then diagonalize it:

    Confirm using NormalMatrixQ:

    Find the eigenvalues and eigenvectors:

    Unlike a real symmetric matrix, the diagonal matrix is complex valued:

    Normalizing the eigenvectors and putting them in columns gives a unitary matrix:

    Confirm the diagonalization n=u.d.TemplateBox[{u}, ConjugateTranspose]:

    The eigensystem of a nondiagonalizable matrix:

    The dimension of the span of all the eigenvectors is less than the number of eigenvalues:

    Estimate the probability that a random 4×4 matrix of ones and zeros is not diagonalizable:

    Differential Equations and Dynamical Systems  (4)

    Solve the system of ODEs , , . First, construct the coefficient matrix for the right-hand side:

    Find the eigenvalues and eigenvectors:

    Construct a diagonal matrix whose entries are the exponential of :

    Construct the matrix whose columns are the corresponding eigenvectors:

    The general solution is p.d.TemplateBox[{p}, Inverse].{TemplateBox[{1}, CTraditional],TemplateBox[{2}, CTraditional],TemplateBox[{3}, CTraditional]}, for three arbitrary starting values:

    Verify the solution using DSolveValue:

    Suppose a particle is moving in a planar force field and its position vector satisfies and , where and are as follows. Solve this initial problem for :

    First, compute the eigenvalues and corresponding eigenvectors of :

    The general solution of the system is . Use LinearSolve to determine the coefficients:

    Construct the appropriate linear combination of the eigenvectors:

    Verify the solution using DSolveValue:

    Produce the general solution of the dynamical system when is the following stochastic matrix:

    Find the eigenvalues and eigenvectors, using Chop to discard small numerical errors:

    The general solution is an arbitrary linear combination of terms of the form :

    Verify that satisfies the dynamical equation up to numerical rounding:

    The Lorenz equations:

    Find the Jacobian for the right-hand side of the equations:

    Find the equilibrium points:

    Find the eigenvalues and eigenvectors of the Jacobian at one in the first octant:

    A function that integrates backward from a small perturbation of pt in the direction dir:

    Show the stable curve for the equilibrium point on the right:

    Find the stable curve for the equilibrium point on the left:

    Show the stable curves along with a solution of the Lorenz equations:

    Physics  (4)

    In quantum mechanics, states are represented by complex unit vectors and physical quantities by Hermitian linear operators. The eigenvalues represent possible observations and the squared modulus of the components with respect to eigenvectors the probabilities of those observations. For the spin operator and state given, find the possible observations and their probabilities:

    Computing the eigensystem, the possible observations are :

    Normalize the eigenvectors in order to compute proper projections:

    The relative probabilities are for and for :

    In quantum mechanics, the energy operator is called the Hamiltonian , and a state with energy evolves according to the Schrödinger equation . Given the Hamiltonian for a spin-1 particle in constant magnetic field in the direction, find the state at time of a particle that is initially in the state representing :

    Computing the eigensystem, the energy levels are and :

    Normalize the eigenvectors:

    The state at time is the sum of each eigenstate evolving according to the Schrödinger equation:

    The moment of inertia is a real symmetric matrix that describes the resistance of a rigid body to rotating in different directions. The eigenvalues of this matrix are called the principal moments of inertia, and the corresponding eigenvectors (which are necessarily orthogonal) the principal axes. Find the principal moments of inertia and principal axis for the following tetrahedron:

    First compute the moment of inertia:

    Compute the principal moments and axes:

    Verify that the axes are orthogonal:

    The center of mass of the tetrahedron is at the origin:

    Visualize the tetrahedron and its principal axes:

    A generalized eigensystem can be used to find normal modes of coupled oscillations that decouple the terms. Consider the system shown in the diagram:

    By Hooke's law it obeys , . Substituting in the generic solution gives rise to the matrix equation , with the stiffness matrix and mass matrix as follows:

    Find the eigenfrequencies and normal modes if , , and :

    Solve the generalized eigenvalue value problem:

    The eigenfrequencies are the square roots of the eigenvalues:

    Construct the normal mode solutions as a generalized eigenvector times the corresponding exponential:

    Verify that both satisfy the differential equation for the system:

    Properties & Relations  (17)

    The eigenvectors returned for a numerical matrix are unit vectors:

    The eigenvectors returned for exact and symbolic matrices are typically not unit vectors:

    Eigensystem[m] is effectively equivalent to {Eigenvalues[m],Eigenvectors[m]}:

    If both eigenvectors and eigenvalues are needed, it is generally more efficient to just call Eigensystem:

    Any square matrix satisfies its similarity relation:

    Any pair of square matrices satisfies the generalized similarity relation for finite eigenvalues:

    An infinite generalized eigenvalue of corresponds to an eigenvector of that is in the kernel of :

    The vector is an eigenvector of with eigenvalue :

    It is also in the null space of :

    A matrix m has a complete set of eigenvectors iff DiagonalizableMatrixQ[m] is True:

    The following matrix is missing an eigenvector for the space , symbolized by :

    For a diagonalizable matrix, Eigensystem reduces function application to application to eigenvalues:

    Compute the matrix exponential using diagonalization:

    Compute the matrix exponential using MatrixExp:

    Note that this is not simply the exponential of each entry:

    For an invertible matrix , and TemplateBox[{m}, Inverse] have the same eigenvectors and reciprocal eigenvalues:

    Because eigenvalues are sorted by absolute value, this gives the same values but in the opposite order:

    For an analytic function , the eigenvectors of are also eigenvectors of with eigenvalue :

    For example, the has the same eigenvectors with squared eigenvalues:

    Similarly, the eigenvalues of are :

    The eigenvalues of a real symmetric matrix are real and its eigenvectors are orthogonal:

    This matrix is symmetric:

    By inspection, the eigenvalues are real:

    Confirm the eigenvectors are orthogonal to each other:

    The eigenvalues of a real antisymmetric matrix are imaginary and its eigenvectors are orthogonal:

    This matrix is antisymmetric:

    By inspection, the eigenvalues are imaginary:

    Confirm the eigenvectors are orthogonal to each other:

    The eigenvalues of a unitary matrix lie on the unit circle and its eigenvectors are orthogonal:

    Compute the eigenvalues and eigenvectors:

    Confirm that the eigenvalues lie on the unit circle:

    Confirm the eigenvectors are orthogonal to each other:

    The eigenvectors of any normal matrix are orthogonal:

    The eigenvalues can be arbitrary:

    But the eigenvectors are orthogonal:

    SingularValueDecomposition[m] is built from the eigensystems of m.TemplateBox[{m}, ConjugateTranspose] and TemplateBox[{m}, ConjugateTranspose].m:

    Compute the eigensystem of m.TemplateBox[{m}, ConjugateTranspose]:

    The columns of are the eigenvectors:

    Compute the eigensystem of TemplateBox[{m}, ConjugateTranspose].m:

    The columns of are the eigenvectors:

    Since has fewer rows than columns, the diagonal entries of are :

    Consider a matrix m with a complete set of eigenvectors:

    JordanDecomposition[m] returns matrices {s,j} built from eigenvalues and eigenvectors:

    The j matrix is diagonal with eigenvalue entries, possibly in a different order than from Eigensystem:

    The s matrix has the corresponding eigenvectors as its columns:

    SchurDecomposition[n,RealBlockDiagonalFormFalse] for a numerical normal matrix n:

    The matrices {q,t} are built from eigenvalues and eigenvectors:

    The t matrix is diagonal and with eigenvalue entries, possibly in a different order from Eigensystem:

    To verify that q has eigenvectors as columns, set the first entry of each vector to 1. to eliminate phase differences between q and v:

    If matrices share a dimension null space, of their generalized eigenvalues will be Indeterminate and the eigenvector list will be padded with zeros:

    Two generalized eigenvalues of are Indeterminate and produce zero vectors:

    The matrix has a one-dimensional null space:

    It lies in the null space of :

    Thus, one generalized eigenvalue of is Indeterminate and produces a zero vector:

    Possible Issues  (5)

    The general symbolic case very quickly gets very complicated:

    The expression sizes increase faster than exponentially:

    Not all matrices have a complete set of eigenvectors:

    Use JordanDecomposition for exact computation:

    Use SchurDecomposition for numeric computation:

    Construct a 10,000×10,000 sparse matrix:

    The eigenvector matrix is a dense matrix and too large to represent:

    Computing the few largest or smallest eigenvalues is usually possible:

    When eigenvalues are closely grouped the iterative method for sparse matrices may not converge:

    The iteration has not converged well after 1000 iterations:

    You can give the algorithm a shift near the expected value to speed up convergence:

    The end points given to an interval as specified for the FEAST method are not included.

    Set up a matrix with eigenvalues at 3 and 9 and find the eigenvalues and eigenvectors in the interval :

    Enlarge the to interval such that FEAST finds the eigenvalues 3 and 9 and their corresponding eigenvectors:

    Wolfram Research (1988), Eigensystem, Wolfram Language function, https://reference.wolfram.com/language/ref/Eigensystem.html (updated 2024).

    Text

    Wolfram Research (1988), Eigensystem, Wolfram Language function, https://reference.wolfram.com/language/ref/Eigensystem.html (updated 2024).

    CMS

    Wolfram Language. 1988. "Eigensystem." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Eigensystem.html.

    APA

    Wolfram Language. (1988). Eigensystem. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Eigensystem.html

    BibTeX

    @misc{reference.wolfram_2024_eigensystem, author="Wolfram Research", title="{Eigensystem}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Eigensystem.html}", note=[Accessed: 15-November-2024 ]}

    BibLaTeX

    @online{reference.wolfram_2024_eigensystem, organization={Wolfram Research}, title={Eigensystem}, year={2024}, url={https://reference.wolfram.com/language/ref/Eigensystem.html}, note=[Accessed: 15-November-2024 ]}