eigh
full name: tenpy.linalg.np_conserved.eigh
parent module:
tenpy.linalg.np_conservedtype: function
- tenpy.linalg.np_conserved.eigh(a, UPLO='L', sort=None)[source]
Calculate eigenvalues and eigenvectors for a hermitian matrix.
W, V = eigh(a)yields \(a = V diag(w) V^{\dagger}\). Assumes that a is hermitian,a.conj().transpose() == a.- Parameters:
a (
Array) – The hermitian square matrix to be diagonalized.UPLO ({'L', 'U'}) – Whether to take the lower (‘L’, default) or upper (‘U’) triangular part of a.
sort ({‘m>’, ‘m<’, ‘>’, ‘<’,
None}) – How the eigenvalues should are sorted within each charge block. Defaults toNone, which is same as ‘<’. Seeargsort()for details.
- Returns:
W (1D ndarray) – The eigenvalues, sorted within the same charge blocks according to sort.
V (
Array) – Unitary matrix;V[:, i]is normalized eigenvector with eigenvalueW[i]. The first label is inherited from A, the second label is'eig'.
Notes
Requires the legs to be contractible. If a is not blocked by charge, a blocked copy is made via a permutation
P, \(a' = P a P^{-1} = V' W' (V')^{\dagger}\). The eigenvectors V are then obtained by the reverse permutation, \(V = P^{-1} V'\) such that \(a = V W V^{\dagger}\).