API
Most of the user-facing methods are extensions of functions declared in LinearAlgebra: eigen!, schur!, ordschur!, eigvals!.
Additional exported functions are as follows.
Balancing
GenericSchur.balance! — Functionbalance!(A; scale=true, permute=true) => Abal, B::BalancerBalance a square matrix so that various operations are more stable.
If permute, then row and column permutations are found such that Abal has the block form [T₁ X Y; 0 C Z; 0 0 T₂] where T₁ and T₂ are upper-triangular. If scale, then a diagonal similarity transform using powers of 2 is found such that the 1-norm of the C block (or the whole of Abal, if not permuting) is near unity. The transformations are encoded into B so that they can be inverted for eigenvectors, etc. Balancing typically improves the accuracy of eigen-analysis.
Converting a real quasi-Schur to a true complex Schur object
GenericSchur.triangularize — Functiontriangularize(S::Schur{T}) => Schur{complex{T})convert a (standard-form) quasi-triangular real Schur factorization into a triangular complex Schur factorization.
Obtaining eigenvectors from a decomposition
LinearAlgebra.eigvecs — Methodeigvecs(S::Schur{Complex{<:AbstractFloat}}; left=false) -> MatrixCompute right or left eigenvectors from a Schur decomposition. Eigenvectors are returned as columns of a matrix, ordered to match S.values. The returned eigenvectors have unit Euclidean norm, and the largest elements are real.
Eigenvalue condition numbers
GenericSchur.eigvalscond — Functioneigvalscond(S::Schur,nsub::Integer) => RealEstimate the reciprocal of the condition number of the nsub leading eigenvalues of S. (Use ordschur to move a subspace of interest to the front of S.)
See the LAPACK User's Guide for details of interpretation.
eigvalscond(S::GeneralizedSchur, nsub) => pl, prcompute approx. reciprocal norms of projectors on left/right subspaces associated w/ leading nsub×nsub block of S. Use ordschur to select eigenvalues of interest.
An approximate bound on avg. absolute error of associated eigenvalues is ϵ * norm(vcat(A,B)) / pl. See LAPACK documentation for further details.
Subspace conditioning
GenericSchur.subspacesep — Functionsubspacesep(S::Schur,nsub::Integer) => RealEstimate the reciprocal condition of the separation angle for the invariant subspace corresponding to the leading block of size nsub of a Schur decomposition. (Use ordschur to move a subspace of interest to the front of S.)
See the LAPACK User's Guide for details of interpretation.
Circumventing normal dispatch
Mainly for testing purposes, one can invoke the generic methods implemented here for LAPACK-compatible matrix types with these methods.
GenericSchur.gschur! — Functiongschur!(A::StridedMatrix) -> F::Schur
Destructive version of gschur (q.v.).
gschur!(H::Hessenberg, Z) -> F::Schur
Compute the Schur decomposition of a Hessenberg matrix. Subdiagonals of H must be real. If Z is provided, it is updated with the unitary transformations of the decomposition.
GenericSchur.gschur — Functiongschur(A::StridedMatrix) -> F::Schur
Computes the Schur factorization of matrix A using a generic implementation. See LinearAlgebra.schur for usage.
GenericSchur.geigen! — Functiongeigen!(A, alg=QRIteration(); sortby=eigsortby) -> E::Eigen
Computes the eigen-decomposition of a Hermitian (or real symmetric) matrix A using a generic implementation. Currently alg may be QRIteration() or DivideAndConquer(). Otherwise, similar to LinearAlgebra.eigen!.
Locally defined exceptions
Note: these are currently peculiar to this package but replacement by upstream analogues will not be considered breaking.
GenericSchur.IllConditionException — TypeIllConditionExceptionException thrown when argument matrix or matrices are too ill-conditioned for the requested operation. The index field may indicate the block where near-singularity was detected.
GenericSchur.UnconvergedException — TypeUnconvergedExceptionException thrown when an iterative algorithm does not converge within the allowed number of steps.