<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>eigenvalues -- find eigenvalues of a matrix</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_eigenvalues_lp..._cm_sp__Hermitian_sp_eq_gt_sp..._rp.html">next</a> | <a href="_edit.html">previous</a> | <a href="_eigenvalues_lp..._cm_sp__Hermitian_sp_eq_gt_sp..._rp.html">forward</a> | <a href="_edit.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>eigenvalues -- find eigenvalues of a matrix</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>eigenvalues M</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>M</tt>, <span>a <a href="___Matrix.html">matrix</a></span>, or a <a href="___Mutable__Matrix.html" title="the class of all mutable matrices">MutableMatrix</a> over <a href="___R__R.html" title="the class of all real numbers">RR</a> or <a href="___C__C.html" title="the class of all complex numbers">CC</a>, which is a square n by n matrix</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Vertical__List.html">vertical list</a></span>, a list of the eigenvalues of <tt>M</tt></span></li> </ul> </div> </li> <li><div class="single"><a href="_using_spfunctions_spwith_spoptional_spinputs.html">Optional inputs</a>:<ul><li><span><a href="_eigenvalues_lp..._cm_sp__Hermitian_sp_eq_gt_sp..._rp.html">Hermitian => ...</a>, -- Hermitian=>true means assume the matrix is symmetric or Hermitian</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div>In this example we compute the eigenvalues of a matrix and display their classes.<table class="examples"><tr><td><pre>i1 : M = matrix {{1,2}, {5,7}} o1 = | 1 2 | | 5 7 | 2 2 o1 : Matrix ZZ <--- ZZ</pre> </td></tr> <tr><td><pre>i2 : eigenvalues M o2 = {-.358899} {8.3589 } o2 : VerticalList</pre> </td></tr> <tr><td><pre>i3 : class \ oo o3 = {CC} {CC} o3 : VerticalList</pre> </td></tr> </table> If the matrix is symmetric (over <a href="___R__R.html" title="the class of all real numbers">RR</a>) or Hermitian (over <a href="___C__C.html" title="the class of all complex numbers">CC</a>), this information may be provided as an optional argument <tt>Hermitian=>true</tt>, so the resulting eigenvalues will be in <a href="___R__R.html" title="the class of all real numbers">RR</a>, not <a href="___C__C.html" title="the class of all complex numbers">CC</a>.<table class="examples"><tr><td><pre>i4 : M = matrix {{1,2}, {2,1}} o4 = | 1 2 | | 2 1 | 2 2 o4 : Matrix ZZ <--- ZZ</pre> </td></tr> <tr><td><pre>i5 : eigenvalues(M, Hermitian=>true) o5 = {-1} {3 } o5 : VerticalList</pre> </td></tr> <tr><td><pre>i6 : class \ oo o6 = {RR} {RR} o6 : VerticalList</pre> </td></tr> </table> The lapack library is used to compute eigenvectors of real and complex matrices.</div> </div> <div class="single"><h2>Caveat</h2> <div>The eigenvalues are approximate.</div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_eigenvectors.html" title="find eigenvectors of a matrix over RR or CC">eigenvectors</a> -- find eigenvectors of a matrix over RR or CC</span></li> <li><span><a href="___S__V__D.html" title="singular value decomposition of a matrix">SVD</a> -- singular value decomposition of a matrix</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>eigenvalues</tt> :</h2> <ul><li>eigenvalues(Matrix)</li> <li>eigenvalues(MutableMatrix)</li> </ul> </div> </div> </body> </html>