File: eigenvalues-doc.m2

package info (click to toggle)
macaulay2 1.25.05%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 172,152 kB
  • sloc: cpp: 107,824; ansic: 16,193; javascript: 4,189; makefile: 3,899; lisp: 702; yacc: 604; sh: 476; xml: 177; perl: 114; lex: 65; python: 33
file content (46 lines) | stat: -rw-r--r-- 1,792 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- status: TODO
--- author(s): 
--- notes: 

document { 
     Key => {eigenvalues, (eigenvalues,Matrix), (eigenvalues,MutableMatrix)},
     Headline => "find eigenvalues of a matrix",
     Usage => "eigenvalues M",
     Inputs => {
	  "M" => Matrix => {" or a ", TO MutableMatrix, " over ", TO RR, " or ", TO CC, ", which is
	       a square n by n matrix"}
	  },
     Outputs => { VerticalList => {" a list of the eigenvalues of ", TT "M"} },
     "In this example we compute the eigenvalues of a matrix and display their classes.",
     EXAMPLE lines ///
     M = matrix {{1,2}, {5,7}}
     eigenvalues M
     class \ oo
     ///,
     "If the matrix is symmetric (over ", TO "RR", ") or Hermitian (over ", TO "CC", "),
     this information may be provided as an optional argument ",
     TT "Hermitian=>true", ", so
     the resulting eigenvalues will be in ", TO "RR", ", not ", TO "CC", ".",
     EXAMPLE lines ///
     M = matrix {{1,2}, {2,1}}
     eigenvalues(M, Hermitian=>true)
     class \ oo
     ///,
     "The LAPACK and Eigen libraries are used to compute eigenvectors of real and complex matrices.",
     Caveat => {"The eigenvalues are approximate."},
     SeeAlso => {eigenvectors, SVD},
     Subnodes => { TO [eigenvalues, Hermitian] },
     }
document { 
     Key => [eigenvalues, Hermitian],
     Headline => "whether to assume the matrix is symmetric or Hermitian",
     Usage => "eigenvalues(M, Hermitian=>true)",
     Consequences => {
	  "The resulting list of eigenvalues is defined over RR, not CC."
	  },     
     Caveat => {"The internal routine uses a different algorithm, only considering the
	  upper triangular elements.  So if the matrix is not symmetric or Hermitian,
	  the routine will give incorrect results."},
     SeeAlso => {eigenvectors}
     }