eig

tenpy.linalg.np_conserved.eig(a, sort=None)[source]

Calculate eigenvalues and eigenvectors for a non-hermitian matrix.

W, V = eig(a) yields \(a V = V diag(w)\).

Parameters:
  • a (Array) – The hermitian square matrix to be diagonalized.

  • sort ({‘m>’, ‘m<’, ‘>’, ‘<’, None}) – How the eigenvalues should are sorted within each charge block. Defaults to None, which is same as ‘<’. See argsort() 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 eigenvalue W[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}\).