dpnp.linalg.eigh
- dpnp.linalg.eigh(a, UPLO='L')[source]
Return the eigenvalues and eigenvectors of a complex Hermitian (conjugate symmetric) or a real symmetric matrix.
Returns two objects, a 1-D array containing the eigenvalues of a, and a 2-D square array or matrix (depending on the input type) of the corresponding eigenvectors (in columns).
For full documentation refer to
numpy.linalg.eigh
.- Returns:
w ((…, M) dpnp.ndarray) – The eigenvalues in ascending order, each repeated according to its multiplicity.
v ((…, M, M) dpnp.ndarray) – The column
v[:, i]
is the normalized eigenvector corresponding to the eigenvaluew[i]
.
Limitations
Parameter a is supported as
dpnp.ndarray
ordpctl.tensor.usm_ndarray
. Input array data types are limited by supported DPNP Data types.See also
dpnp.eig
eigenvalues and right eigenvectors for non-symmetric arrays.
dpnp.eigvals
eigenvalues of non-symmetric arrays.
Examples
>>> import dpnp as dp >>> a = dp.array([[1, -2j], [2j, 5]]) >>> a array([[ 1.+0.j, -0.-2.j], [ 0.+2.j, 5.+0.j]]) >>> w, v = dp.linalg.eigh(a) >>> w; v array([0.17157288, 5.82842712]), array([[-0.92387953-0.j , -0.38268343+0.j ], # may vary [ 0. +0.38268343j, 0. -0.92387953j]]))