cupy.linalg.eigvalsh¶
-
cupy.linalg.
eigvalsh
(a, UPLO='L')[source]¶ Calculates eigenvalues of a symmetric matrix.
This method calculates eigenvalues a given symmetric matrix. Note that
cupy.linalg.eigh()
calculates both eigenvalues and eigenvectors.- Parameters
a (cupy.ndarray) – A symmetric 2-D square matrix
(M, M)
or a batch of symmetric 2-D square matrices(..., M, M)
.UPLO (str) – Select from
'L'
or'U'
. It specifies which part ofa
is used.'L'
uses the lower triangular part ofa
, and'U'
uses the upper triangular part ofa
.
- Returns
Returns eigenvalues as a vector
w
. For batch input,w[k]
is a vector of eigenvalues of matrixa[k]
.- Return type
Warning
This function calls one or more cuSOLVER routine(s) which may yield invalid results if input conditions are not met. To detect these invalid results, you can set the linalg configuration to a value that is not ignore in
cupyx.errstate()
orcupyx.seterr()
.See also