|
NumericAL
A header-only C++20 lexer built on REAL
|
The eigenvalues and eigenvectors of a complex Hermitian matrix. More...
#include <factorizations.hpp>
Public Member Functions | |
| hermitian_eigen (const matrix< std::complex< double > > &input, eigen_method method=eigen_method::divide_and_conquer) | |
Diagonalises input. | |
| hermitian_eigen (const matrix< std::complex< double > > &a, const matrix< std::complex< double > > &b, eigen_method method=eigen_method::divide_and_conquer) | |
Diagonalises the pencil A − λ B, A x = λ B x, as scipy.linalg.eigh(a, b): B = L Lᴴ and the Hermitian L⁻¹ A L⁻ᴴ diagonalised, its eigenvectors y the pencil's L⁻ᴴ y, B-orthonormal (Xᴴ B X = I). Each matrix's lower triangle alone is read, of the diagonal its real part. | |
| const vector< double > & | values () const noexcept |
| The eigenvalues, ascending. | |
| const matrix< std::complex< double > > & | vectors () const &noexcept |
| The eigenvectors as columns, ordered to match values. | |
| matrix< std::complex< double > > | vectors () && |
| The eigenvectors, moved out of an expiring decomposition. | |
Private Member Functions | |
| hermitian_eigen (const detail::definite_pencil< std::complex< double > > &pencil, eigen_method method) | |
| The pencil's eigenpairs: its standard form's, the vectors carried back. | |
Private Attributes | |
| std::size_t | n_ |
| The matrix order. | |
| vector< double > | values_ |
| Eigenvalues, ascending. | |
| matrix< std::complex< double > > | vectors_ |
| Eigenvectors as columns. | |
The eigenvalues and eigenvectors of a complex Hermitian matrix.
The matrix is reduced to a real symmetric tridiagonal by Householder reflections and unit phases (the method of LAPACK's zheevd), which the divide and conquer of symmetric_eigen diagonalises (implicit QL, zheev's, on request). The eigenvalues are real and returned in ascending order, with vectors j-th column the eigenvector of values [j] (A = V Λ Vᴴ, V unitary). Only the lower triangle is read and the imaginary part of the diagonal is ignored, as numpy.linalg.eigh reads a matrix by default.
Definition at line 6850 of file factorizations.hpp.
|
inlineexplicit |
Diagonalises input.
| [in] | input | A complex Hermitian matrix (its lower triangle is read). |
| [in] | method | The algorithm for the tridiagonal: eigen_method::divide_and_conquer or eigen_method::tridiagonal_ql. |
| argument_error | If method is eigen_method::jacobi, which has no complex form here. |
| dimension_error | If input is not square. |
| non_finite_error | If an entry is infinite or NaN. |
| convergence_error | If an iteration (implicit QL or the secular equation) did not converge within its bound (not observed). |
Definition at line 6865 of file factorizations.hpp.
|
inline |
Diagonalises the pencil A − λ B, A x = λ B x, as scipy.linalg.eigh(a, b): B = L Lᴴ and the Hermitian L⁻¹ A L⁻ᴴ diagonalised, its eigenvectors y the pencil's L⁻ᴴ y, B-orthonormal (Xᴴ B X = I). Each matrix's lower triangle alone is read, of the diagonal its real part.
| [in] | a | A complex Hermitian matrix. |
| [in] | b | A complex Hermitian positive-definite matrix of its order. |
| [in] | method | The algorithm for the tridiagonal, as for one matrix. |
| argument_error | If method is eigen_method::jacobi. |
| dimension_error | If a or b is not square, or their orders differ. |
| non_finite_error | If an entry read is infinite or NaN. |
| not_positive_definite_error | If b is not positive definite. |
| convergence_error | If an iteration did not converge within its bound (not observed). |
Definition at line 6928 of file factorizations.hpp.
|
inlineprivate |
The pencil's eigenpairs: its standard form's, the vectors carried back.
Definition at line 6956 of file factorizations.hpp.
The eigenvalues, ascending.
Definition at line 6936 of file factorizations.hpp.
The eigenvectors, moved out of an expiring decomposition.
Definition at line 6948 of file factorizations.hpp.
|
inlinenoexcept |
The eigenvectors as columns, ordered to match values.
Definition at line 6942 of file factorizations.hpp.
|
private |
The matrix order.
Definition at line 6964 of file factorizations.hpp.
Eigenvalues, ascending.
Definition at line 6965 of file factorizations.hpp.
Eigenvectors as columns.
Definition at line 6966 of file factorizations.hpp.