jax.lax.linalg.eig(x, *, compute_left_eigenvectors=True, compute_right_eigenvectors=True)[source]#

Eigendecomposition of a general matrix.

Nonsymmetric eigendecomposition is at present only implemented on CPU.

  • x (Union[Array, ndarray, bool_, number, bool, int, float, complex]) – A batch of square matrices with shape [..., n, n].

  • compute_left_eigenvectors (bool) – If true, the left eigenvectors will be computed.

  • compute_right_eigenvectors (bool) – If true, the right eigenvectors will be computed.

Return type:



The eigendecomposition of x, which is a tuple of the form (w, vl, vr) where w are the eigenvalues, vl are the left eigenvectors, and vr are the right eigenvectors. vl and vr are optional and will only be included if compute_left_eigenvectors or compute_right_eigenvectors respectively are True.

If the eigendecomposition fails, then arrays full of NaNs will be returned for that batch element.