Linear algebra
Matrix and vector products
Dot product of a and b. |
|
Compute the dot product of two or more arrays in a single function call. |
|
Return the dot product of two vectors. |
|
Computes the vector dot product. |
|
Computes the vector dot product. |
|
Returns the inner product of two arrays. |
|
Returns the outer product of two arrays. |
|
Matrix product of two arrays. |
|
Computes the matrix product. |
|
Matrix-vector dot product of two arrays. |
|
Vector-matrix dot product of two arrays. |
|
Compute tensor dot product along specified axes. |
|
Compute tensor dot product along specified axes. |
|
einsum(subscripts, *operands, out=None, dtype=None, order="K", casting="same_kind", optimize=False) |
|
einsum_path(subscripts, *operands, optimize="greedy") |
|
Raise a square matrix to the (integer) power n. |
|
Kronecker product of two arrays. |
|
Returns the cross product of 3-element vectors. |
Decompositions
Cholesky decomposition. |
|
Compute the outer product of two vectors. |
|
Compute the qr factorization of a matrix. |
|
Singular Value Decomposition. |
|
Returns the singular values of a matrix (or a stack of matrices) x. |
Matrix eigenvalues
Compute the eigenvalues and right eigenvectors of a square array. |
|
Return the eigenvalues and eigenvectors of a complex Hermitian (conjugate symmetric) or a real symmetric matrix. |
|
Compute the eigenvalues of a general matrix. |
|
Compute the eigenvalues of a complex Hermitian or real symmetric matrix. |
Norms and other numbers
Matrix or vector norm. |
|
Computes the matrix norm of a matrix (or a stack of matrices) x. |
|
Computes the vector norm of a vector (or batch of vectors) x. |
|
Compute the condition number of a matrix. |
|
Compute the determinant of an array. |
|
Return matrix rank of array using SVD method. |
|
Compute the sign and (natural) logarithm of the determinant of an array. |
|
Return the sum along diagonals of the array. |
|
Returns the sum along the specified diagonals of a matrix (or a stack of matrices) x. |
Solving linear equations
Solve a linear matrix equation, or system of linear scalar equations. |
|
Solve the tensor equation |
|
Return the least-squares solution to a linear matrix equation. |
|
Compute the (multiplicative) inverse of a matrix. |
|
Compute the (Moore-Penrose) pseudo-inverse of a matrix. |
|
Compute the 'inverse' of an N-dimensional array. |
Other matrix operations
Return specified diagonals. |
|
Returns specified diagonals of a matrix (or a stack of matrices) x. |
|
Transposes a matrix (or a stack of matrices) x. |
Exceptions
Generic Python-exception-derived object raised by LinAlg functions. |
Linear algebra on several matrices at once
Several of the linear algebra routines listed above are able to compute results for several matrices at once, if they are stacked into the same array.
This is indicated in the documentation via input parameter specifications such
as a : (..., M, M) {dpnp.ndarray, usm_ndarray}
. This means that if for
instance given an input array a.shape == (N, M, M)
, it is interpreted as a
"stack" of N matrices, each of size M-by-M. Similar specification applies to
return values, for instance the determinant has det : (...)
and will in
this case return an array of shape det(a).shape == (N,)
. This generalizes
to linear algebra operations on higher-dimensional arrays: the last 1 or 2
dimensions of a multidimensional array are interpreted as vectors or matrices,
as appropriate for each operation.