Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Scipy implements a number of algorithms for calcualting the eigendecomposition:

A=VΛV−1A = V \Lambda V^{-1}

where

  • VV is the matrix whose columns are the eigenvectors

  • Λ\Lambda is a diagonal matrix with the eigenvalues on the diagonal

Variants only calculate the eigenvalues (faster) or take advantage of symmetries / sparsity, and numerical stability.

MethodTypeUse Case
eigDense (general matrix)Computes all eigenvalues and eigenvectors of a square matrix.
eigvalsDense (general matrix)Computes only eigenvalues of a square matrix (faster than eig).
eighDense (symmetric/Hermitian)Computes eigenvalues and eigenvectors for symmetric or Hermitian matrices (numerically stable).
eigvalshDense (symmetric/Hermitian)Computes only eigenvalues of symmetric or Hermitian matrices (faster than eigh).
eigshSparse (symmetric/Hermitian)Computes a subset of eigenvalues and eigenvectors for sparse symmetric or Hermitian matrices.
eigsSparse (general matrix)Computes a subset of eigenvalues and eigenvectors for sparse general (non-symmetric) matrices.

Eigendecomposition is sometimes called diagonalization.

Example: Find the fundamental vibrational modes of a square membrane.

The vibrational modes are solutions to the Laplace equation:

∇2u=0u=0 on boundary\nabla^2 u = 0 \quad u=0 \ on \ boundary
<Figure size 640x480 with 2 Axes>
<Figure size 640x480 with 2 Axes>
<Figure size 640x480 with 2 Axes>
<Figure size 640x480 with 2 Axes>