Generalized Eigenvalue Solver for Symmetric or Hermitian Matrix#

HEGV (symmetric or HErmitian Generalized eigenValue solver) computes the eigenvalues and, optionally, eigenvectors of a batched symmetric or Hermitian-definite generalized eigenvalue problem:

\[\begin{split}\begin{aligned} A V = B V \Lambda \quad & (\text{Eig type} = 1), \\ A B V = V \Lambda \quad & (\text{Eig type} = 2), \\ B A V = V \Lambda \quad & (\text{Eig type} = 3). \end{aligned}\end{split}\]

where:

  • \(A\) is an \(M \times M\) symmetric or Hermitian matrix,

  • \(B\) is an \(M \times M\) symmetric or Hermitian positive-definite matrix,

  • \(\Lambda\) is an \(M \times M\) diagonal matrix containing the eigenvalues, and

  • \(V\) is an \(M \times M\) matrix whose columns are the eigenvectors. For Eig type 1 and 2, the eigenvectors are \(B\)-orthogonal; for Eig type 3, they are \(B^{-1}\)-orthogonal.

Device API#

The cuSolverDx hegv device functions are as follows (see Execution Methods):

// Compute eigenvalues, and optionally the eigenvectors
__device__ void execute(data_type* A, data_type* B, precision_of_data_type* lambda, data_type* workspace, status_type* info);
// Compute eigenvalues, and optionally the eigenvectors with runtime leading dimensions
__device__ void execute(data_type* A, data_type* B, const unsigned int ldb, precision_of_data_type* lambda, data_type* workspace, status_type* info);
__device__ void execute(data_type* A, const unsigned int lda, data_type* B, precision_of_data_type* lambda, data_type* workspace, status_type* info);
__device__ void execute(data_type* A, const unsigned int lda, data_type* B, const unsigned int ldb, precision_of_data_type* lambda, data_type* workspace, status_type* info);

Note that eigenvalues of a symmetric or Hermitian matrix are always real values, which is the reason why in the hegv functions lambda is of precision_of_data_type* instead of data_type*.

Parameters:

  • A: Batched \(M \times M\) Hermitian matrix, with leading dimension \(\mathrm{lda} \geq M\).

  • On entry, the matrix data in the triangle selected by the FillMode operator is the stored triangular part of \(A\).

  • On exit:

    • if the job operator is job::overwrite_vectors, A contains the eigenvectors \(V\) of the generalized problem. The columns of \(V\) are \(B\)-orthogonal when EigType is 1 or 2 (\(V^H B V = I\)), and \(B^{-1}\)-orthogonal when EigType is 3 (\(V^H B^{-1} V = I\)).

    • If only eigenvalues are requested, i.e., job::no_vectors, the processed triangle of A, including the diagonal, is destroyed and the other triangle is unchanged.

  • B: Batched \(M \times M\) symmetric or Hermitian positive-definite matrix, with leading dimension \(\mathrm{ldb} \geq M\).

    • On entry, the same fill mode as A must be applied to B.

    • On exit, the triangle of B containing the matrix is overwritten by the triangular factor \(U\) or \(L\) from the Cholesky factorization \(B = U^H U\) or \(B = L L^H\).

  • lambda: Array of size \(M\) per batch containing the eigenvalues.

  • workspace: Temporary buffer preallocated by the user. The required size can be obtained via workspace_size. Note that depending on the size and configuration of the problem, the workspace size could be zero. Use a nullptr if the required workspace size is zero.

  • info: Status of the function for each batch. info = 0 if the function succeeds for the batch.

    • If info = i > 0 and \(i \leq M\), then the standard eigensolve failed to find all of the eigenvalues, and i off-diagonal elements of the intermediate tridiagonal matrix have not converged to zero.

    • If Cholesky factorization of B fails, info = M + i where i is the index of the leading principal minor of B that is not positive definite. The factorization of B is not completed and no eigenvalues or eigenvectors are computed.

Supported Configurations#

  1. Arrangement: Layouts of A and B can independently use column-major or row-major layouts using the Arrangement<Arr, Brr> operator (see Arrangement operator).

  2. Leading Dimensions: Leading dimensions for A and B can be set independently using the LeadingDimension<LDA, LDB> operator (see LeadingDimension operator).

  3. Fill mode: A and B have to be the same FillMode (lower or upper). The operator is required to be defined for hegv.

  4. EigType: \(\mathrm{EigType} \in \{1,2,3\}\), as described above (see EigType Operator).

  5. Job: job being either job::no_vectors, or job::overwrite_vectors, see Job operator. job::all_vectors, job::some_vectors, and job::multiply_vectors are not allowed for the hegv function; doing that will result in a compile-time error.