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 47 48 49 50 51 52 53 54
|
--- status: TODO
--- author(s):
--- notes:
document {
Key => {eigenvectors, (eigenvectors,Matrix), (eigenvectors,MutableMatrix)},
Headline => "find eigenvectors of a matrix over real or complex numbers",
Usage => "(eigvals, eigvecs) = eigenvectors M",
Inputs => {
"M" => Matrix => {"or a ", TO MutableMatrix, " over ", TO RR, " or ", TO CC, ", which is
a square n by n matrix"}
},
Outputs => {
"eigvals" => VerticalList => {{" a list of the eigenvalues of ", TT "M"}},
"eigvecs" => Matrix => {" or ", ofClass MutableMatrix, ", if ", TT "M", " is one),
whose columns are the corresponding eigenvectors of ", TT "M"}
},
"The resulting matrix is over ", TO "CC", ", and contains the eigenvectors of ", TT "M", ". The LAPACK and Eigen
libraries are used to compute eigenvectors of real and complex matrices.",
PARA{},
"Recall that if ", TT "v", " is a non-zero vector such that ", TT "Mv = av", ", for a scalar a, then
", TT "v", " is called an eigenvector corresponding to the eigenvalue ", TT "a", ".",
EXAMPLE {
"M = matrix{{1, 2}, {5, 7}}",
"eigenvectors M"
},
"If the matrix is symmetric (over ", TO "RR", ") or Hermitian (over ", TO "CC", "),
this information should be provided as an optional argument ",
TT "Hermitian=>true", ". In this case,
the resulting eigenvalues will be returned as real numbers, and if ", TT "M", " is real,
the matrix of eigenvectors will be real.",
EXAMPLE lines ///
M = matrix {{1, 2}, {2, 1}}
(e,v) = eigenvectors(M, Hermitian=>true)
class \ e
v
///,
Caveat => {"The eigenvectors are approximate."},
SeeAlso => {eigenvalues, SVD},
Subnodes => { TO [eigenvectors, Hermitian] },
}
document {
Key => [eigenvectors, Hermitian],
Headline => "whether to assume the matrix is symmetric or Hermitian",
Usage => "eigenvectors(M, Hermitian=>true)",
Consequences => {
"The resulting list of eigenvalues is defined over RR, not CC, and, if the
original matrix is defined over RR, the matrix of eigenvalues is too."
},
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 => {eigenvalues}
}
|