Linear algebra (numpy.linalg)

Matrix and vector products

dot
vdot
inner
outer
tensordot
einsum
linalg.matrix_power(M, n) Raise a square matrix to the (integer) power n.
kron

Decompositions

linalg.cholesky(a) Cholesky decomposition.
linalg.qr(a[, mode]) Compute the qr factorization of a matrix.
linalg.svd(a[, full_matrices, compute_uv]) Singular Value Decomposition.

Matrix eigenvalues

linalg.eig(a) Compute the eigenvalues and right eigenvectors of a square array.
linalg.eigh(a[, UPLO]) Return the eigenvalues and eigenvectors of a Hermitian or symmetric matrix.
linalg.eigvals(a) Compute the eigenvalues of a general matrix.
linalg.eigvalsh(a[, UPLO]) Compute the eigenvalues of a Hermitian or real symmetric matrix.

Norms and other numbers

linalg.norm(x[, ord]) Matrix or vector norm.
linalg.cond(x[, p]) Compute the condition number of a matrix.
linalg.det(a) Compute the determinant of an array.
linalg.slogdet(a) Compute the sign and (natural) logarithm of the determinant of an array.
trace

Solving equations and inverting matrices

linalg.solve(a, b) Solve a linear matrix equation, or system of linear scalar equations.
linalg.tensorsolve(a, b[, axes]) Solve the tensor equation a x = b for x.
linalg.lstsq(a, b[, rcond]) Return the least-squares solution to a linear matrix equation.
linalg.inv(a) Compute the (multiplicative) inverse of a matrix.
linalg.pinv(a[, rcond]) Compute the (Moore-Penrose) pseudo-inverse of a matrix.
linalg.tensorinv(a[, ind]) Compute the ‘inverse’ of an N-dimensional array.

Exceptions

linalg.LinAlgError Generic Python-exception-derived object raised by linalg functions.