Macaulay2 » Documentation
Packages » Macaulay2Doc » matrices » Matrix » eigenvectors
next | previous | forward | backward | up | index | toc

# eigenvectors -- find eigenvectors of a matrix over real or complex numbers

- Usage:
    `(eigvals, eigvecs) = eigenvectors M`
- Inputs:
  - M, a matrix, or a MutableMatrix over RR or CC, which is a square n by n matrix
- Optional inputs:
  - Hermitian => ..., default value false, whether to assume the matrix is symmetric or Hermitian
- Outputs:
  - eigvals, a vertical list, a list of the eigenvalues of M
  - eigvecs, a matrix, or a mutable matrix, if M is one), whose columns are the corresponding eigenvectors of M

## Description

The resulting matrix is over CC, and contains the eigenvectors of M. The LAPACK and Eigen libraries are used to compute eigenvectors of real and complex matrices.

Recall that if v is a non-zero vector such that Mv = av, for a scalar a, then v is called an eigenvector corresponding to the eigenvalue a.

    i1 : M = matrix{{1, 2}, {5, 7}}

    o1 = | 1 2 |
         | 5 7 |

                  2       2
    o1 : Matrix ZZ  <-- ZZ

    i2 : eigenvectors M

    o2 = ({-.358899}, | -.827138 -.262266 |)
          {8.3589  }  | .561999  -.964996 |

    o2 : Sequence

If the matrix is symmetric (over RR) or Hermitian (over CC), this information should be provided as an optional argument Hermitian=>true. In this case, the resulting eigenvalues will be returned as real numbers, and if M is real, the matrix of eigenvectors will be real.

    i3 : M = matrix {{1, 2}, {2, 1}}

    o3 = | 1 2 |
         | 2 1 |

                  2       2
    o3 : Matrix ZZ  <-- ZZ

    i4 : (e,v) = eigenvectors(M, Hermitian=>true)

    o4 = ({-1}, | -.707107 .707107 |)
          {3 }  | .707107  .707107 |

    o4 : Sequence

    i5 : class \ e

    o5 = {RR}
         {RR}

    o5 : VerticalList

    i6 : v

    o6 = | -.707107 .707107 |
         | .707107  .707107 |

                    2         2
    o6 : Matrix RR    <-- RR
                  53        53

## Caveat

The eigenvectors are approximate.

## See also

- eigenvalues -- find eigenvalues of a matrix
- SVD -- singular value decomposition of a matrix

### Menu

- eigenvectors(...,Hermitian=>...) -- whether to assume the matrix is symmetric or Hermitian

## Ways to use eigenvectors:

- `eigenvectors(Matrix)`
- `eigenvectors(MutableMatrix)`

## For the programmer

The object eigenvectors is a method function with options.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/eigenvectors-doc.m2:42:0.