In linear algebra, the outer product of two coordinate vectors is a matrix. If the two vectors have dimensions n and m, then their outer product is an n × m matrix. More generally, given two tensors (multidimensional arrays of numbers), their outer product is a tensor. The outer product of tensors is also referred to as their tensor product, and can be used to define the tensor algebra.
The outer product contrasts with:
The dot product (also known as the "inner product"), which takes a pair of coordinate vectors as input and produces a scalar
The Kronecker product, which takes a pair of matrices as input and produces a block matrix
Given two tensors with dimensions and , their outer product is a tensor with dimensions and entries
For example, if is of order 3 with dimensions and is of order 2 with dimensions then their outer product is of order 5 with dimensions If has a component A[2, 2, 4] = 11 and has a component B[8, 88] = 13, then the component of formed by the outer product is C[2, 2, 4, 8, 88] = 143.
Given a pair of matrices of size and of size , consider the matrix product defined as usual as a matrix of size .
Now let be the -th column vector of and let be the -th row vector of . Then can be expressed as a sum of colunm-by-row outer products:
Note the duality of this expression with the more common one as a matrix built with row-by-column inner product entries (or dot product):
This relation is relevant in the application of the Singular Value Decomposition (SVD). In particular, the decomposition can be interpreted as the sum of outer products of each left () and right () singular vectors, scaled by the corresponding nonzero singular value :
This result implies that can be expressed as a sum of rank-1 matrices with spectral norm in decreasing order. This explains the fact why, in general, the last terms contribute less, which motivates the use of the Truncated SVD as an approximation.
If u and v are both nonzero, then the outer product matrix uvT always has matrix rank 1. Indeed, the columns of the outer product are all proportional to the first column. Thus they are all linearly dependent on that one column, hence the matrix is of rank one.
("Matrix rank" should not be confused with "tensor order", or "tensor degree", which is sometimes referred to as "rank".)
Let V and W be two vector spaces. The outer product of and is the element .
If V is an inner product space, then it is possible to define the outer product as a linear map V → W. In which case, the linear map is an element of the dual space of V. The outer product V → W is then given by
This shows why a conjugate transpose of v is commonly taken in the complex case.
In some programming languages, given a two-argument function f (or a binary operator), the outer product of f and two one-dimensional arrays A and B is a two-dimensional array C such that C[i, j] = f(A[i], B[j]). This is syntactically represented in various ways: in APL, as the infix binary operator ∘.f; in J, as the postfix adverb f/; in R, as the function outer(A,B,f) or the special %o%; in Mathematica, as Outer[f,A,B]. In MATLAB, the function kron(A,B) is used for this product. These often generalize to multi-dimensional arguments, and more than two arguments.
In the Python library NumPy, the outer product can be computed with function np.outer(). In contrast, np.kron results in a flat array. The outer product of multidimensional arrays can be computed using np.multiply.outer.
The block form of outer products is useful in classification. Concept analysis is a study that depends on certain outer products:
When a vector has only zeros and ones as entries, it is called a logical vector, a special case of a logical matrix. The logical operation and takes the place of multiplication. The outer product of two logical vectors (ui) and (vj) is given by the logical matrix . This type of matrix is used in the study of binary relations, and is called a rectangular relation or a cross-vector.
^Steeb, Willi-Hans; Hardy, Yorick (2011). "Applications (Chapter 3)". Matrix Calculus and Kronecker Product: A Practical Approach to Linear and Multilinear Algebra (2 ed.). World Scientific. ISBN981-4335-31-2.
^Élie Cartan (1937) Lecons sur la theorie des spineurs, translated 1966: The Theory of Spinors, Hermann, Paris