Linear algebra (numpy.linalg)¶
The NumPy linear algebra functions rely on BLAS and LAPACK to provide efficient low level implementations of standard linear algebra algorithms. Those libraries may be provided by NumPy itself using C versions of a subset of their reference implementations but, when possible, highly optimized libraries that take advantage of specialized processor functionality are preferred. Examples of such libraries are OpenBLAS, MKL (TM), and ATLAS. Because those libraries are multithreaded and processor dependent, environmental variables and external packages such as threadpoolctl may be needed to control the number of threads or specify the processor architecture.
Matrix and vector products¶
dot(a, b[, out]) |
Dot product of two arrays. |
vdot(a, b) |
Return the dot product of two vectors. |
inner(a, b) |
Inner product of two arrays. |
outer(a, b) |
Compute the outer product of two vectors. |
tensordot(a, b[, axes]) |
Compute tensor dot product along specified axes for arrays >= 1-D. |
einsum(subscripts, *operands[, out, optimize]) |
Evaluates the Einstein summation convention on the operands. |
linalg.multi_dot
matmul
einsum_path
linalg.matrix_power
kron
Norms and other numbers¶
linalg.norm(x[, ord, axis, keepdims]) |
Matrix or vector norm. |
trace(a[, offset, axis1, axis2, out]) |
Return the sum along diagonals of the array. |
linalg.cond
linalg.det
linalg.matrix_rank
linalg.slogdet
Solving equations and inverting matrices¶
linalg.solve
linalg.tensorsolve
linalg.lstsq
linalg.inv
linalg.pinv
linalg.tensorinv