Inlinear algebra, theouter product of twocoordinate vectors is the matrix whose entries are all products of an element in the first vector with an element in the second vector. If the two coordinate vectors have dimensionsn andm, then their outer product is ann ×m matrix. More generally, given twotensors (multidimensional arrays of numbers), their outer product is a tensor. The outer product of tensors is also referred to as theirtensor product, and can be used to define thetensor algebra.
The outer product contrasts with:
Thedot product (a special case of "inner product"), which takes a pair of coordinate vectors as input and produces ascalar
their outer product, denoted is defined as the matrix obtained by multiplying each element of by each element of:[1]
Or, in index notation:
Denoting thedot product by if given an vector then If given a vector then
If and are vectors of the same dimension bigger than 1, then.
The outer product is equivalent to amatrix multiplication provided that is represented as acolumn vector and as a column vector (which makes a row vector).[2][3] For instance, if and then[4]
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 componentA[2, 2, 4] = 11 and has a componentB[8, 88] = 13, then the component of formed by the outer product isC[2, 2, 4, 8, 88] = 143.
The outer product and Kronecker product are closely related; in fact the same symbol is commonly used to denote both operations.
If and, we have:
In the case of column vectors, the Kronecker product can be viewed as a form ofvectorization (or flattening) of the outer product. In particular, for two column vectors and, we can write:
(The order of the vectors is reversed on the right side of the equation.)
Another similar identity that further highlights the similarity between the operations is
where the order of vectors needs not be flipped. The middle expression uses matrix multiplication, where the vectors are considered as column/row matrices.
Given a pair of matrices of size and of size, consider thematrix 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 column-by-row outer products:
This expression has duality with the more common one as a matrix built with row-by-columninner product entries (ordot product):
This relation is relevant[6] in the application of theSingular Value Decomposition (SVD) (andSpectral Decomposition as a special case). 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 withspectral norm in decreasing order. This explains the fact why, in general, the last terms contribute less, which motivates the use of thetruncated SVD as an approximation. The first term is theleast squares fit of a matrix to an outer product of vectors.
Ifu andv are both nonzero, then the outer product matrixuvT always hasmatrix rank 1. Indeed, the columns of the outer product are all proportional tou. Thus they are alllinearly 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".)
LetV andW be twovector spaces. The outer product of and is the element.
IfV is aninner product space, then it is possible to define the outer product as a linear mapV →W. In this case, the linear map is an element of thedual space ofV, as this maps linearly a vector into its underlying field, of which is an element. The outer productV →W is then given by
This shows why a conjugate transpose ofv is commonly taken in the complex case.
In some programming languages, given a two-argument functionf (or a binary operator), the outer product,f, of two one-dimensional arrays,A andB, is a two-dimensional arrayC such thatC[i, j] = f(A[i], B[j]). This is syntactically represented in various ways: inAPL, as the infix binary operator∘.f; inJ, as the postfix adverbf/; inR, as the functionouter(A,B,f) or the special%o%;[7] inMathematica, asOuter[f,A,B]. InMATLAB, the functionkron(A,B) is used for this product. These often generalize to multi-dimensional arguments, and more than two arguments.
In thePython libraryNumPy, the outer product can be computed with functionnp.outer().[8] In contrast,np.kron results in a flat array. The outer product of multidimensional arrays can be computed usingnp.multiply.outer.
As the outer product is closely related to theKronecker product, some of the applications of the Kronecker product use outer products. These applications are found in quantum theory,signal processing, andimage compression.[9]
Supposes,t,w,z ∈C so that(s,t) and(w,z) are inC2. Then the outer product of these complex 2-vectors is an element ofM(2,C), the 2 × 2 complex matrices:
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 alogical vector, a special case of alogical matrix. The logical operationand 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 ofbinary relations, and is called arectangular relation or across-vector.[12]
^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.ISBN978-981-4335-31-7.
^Élie Cartan (1937)Lecons sur la theorie des spineurs, translated 1966:The Theory of Spinors, Hermann, Paris