next | previous | forward | backward | up | top | index | toc | home

eigenvalues -- find eigenvalues of a matrix over RR or CC

Synopsis

Description

The resulting matrix is over CC, and contains the eigenvalues of M. The lapack library is used to compute eigenvectors of real and complex matrices.
i1 : M = matrix{{1.0, 2.0}, {5.0, 7.0}}

o1 = | 1        2.000000 |
     | 5.000000 7.000000 |

              2        2
o1 : Matrix RR  <--- RR
i2 : eigenvalues M

o2 = | -0.358899 |
     | 8.358899  |

              2        1
o2 : Matrix CC  <--- CC
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 matrix of eigenvalues is defined over RR, not CC.
i3 : M = matrix{{1.0, 2.0}, {2.0, 1.0}}

o3 = | 1        2.000000 |
     | 2.000000 1        |

              2        2
o3 : Matrix RR  <--- RR
i4 : eigenvalues(M, Hermitian=>true)

o4 = | -1       |
     | 3.000000 |

              2        1
o4 : Matrix RR  <--- RR
If the matrix you wish to use is defined over ZZ or QQ, then first move it to RR.
i5 : M = matrix(QQ,{{1,2/17},{2,1}})

o5 = | 1 2/17 |
     | 2 1    |

              2        2
o5 : Matrix QQ  <--- QQ
i6 : M = substitute(M,RR)

o6 = | 1        0.117647 |
     | 2.000000 1        |

              2        2
o6 : Matrix RR  <--- RR
i7 : eigenvalues M

o7 = | 1.485071 |
     | 0.514929 |

              2        1
o7 : Matrix CC  <--- CC

Caveat

The eigenvalues are approximate.

See also

Ways to use eigenvalues :