# Outer product

In linear algebra, an **outer product** is the tensor product of two vectors, a special case of the Kronecker product of matrices. The outer product of two coordinate vectors and , denoted , is a matrix such that . The outer product for general tensors is also called the tensor product.

The outer product contrasts with the inner product, which takes as input a pair of vectors and produces a scalar.

The outer product is also a related function in some computer programming languages.

## Definition (matrix multiplication)

The outer product **u** ⊗ **v** is equivalent to a matrix multiplication **uv**^{T}, provided that **u** is represented as a *m* × 1 column vector and **v** as a *n* × 1 column vector (which makes **v**^{T} a row vector).^{[1]} For instance, if *m* = 4 and *n* = 3, then

Or in index notation:

For complex vectors, it is customary to use the conjugate transpose of **v** (denoted **v**^{H}):

### Contrast with inner product

If *m* = *n*, then one can take the matrix product the other way, yielding a scalar (or 1 × 1 matrix):

which is the standard inner product for Euclidean vector spaces, better known as the dot product. The inner product is the trace of the outer product.

### Rank of an outer product

If **u** and **v** are both nonzero then the outer product matrix **uv**^{T} always has matrix rank 1, as can be easily seen by multiplying it with a vector **x**:

which is just a scalar **v**^{T}**x** multiplied by a vector **u**.

("Matrix rank" should not be confused with "tensor order", or "tensor degree", which is sometimes referred to as "rank".)

## Definition (vectors and tensors)

### Vector multiplication

Given the vectors

their outer product **u** ⊗ **v** is defined as the *m* × *n* matrix **A** obtained by multiplying each element of **u** by each element of **v**:^{[2]}^{[3]}

For complex vectors, outer product can be defined as above, or with the complex conjugate of **v** (denoted **v**^{∗} or **v̅**). Namely, matrix **A** is obtained by multiplying each element of **u** by the complex conjugate of each element of **v**.

### Tensor multiplication

The outer product on tensors is typically referred to as the tensor product. Given a tensor **a** of order *q* with dimensions (*i*_{1}, ..., *i*_{q}), and a tensor **b** of order *r* with dimensions (*j*_{1}, ..., *j*_{r}), their outer product **c** is of order *q* + *r* with dimensions (*k*_{1}, ..., *k*_{q+r}) which are the *i* dimensions followed by the *j* dimensions. It is denoted in coordinate-free notation using ⊗ and components are defined in index notation by:^{[4]}

similarly for higher order tensors:

For example, if **A** is of order 3 with dimensions (3, 5, 7) and **B** is of order 2 with dimensions (10, 100), their outer product **c** is of order 5 with dimensions (3, 5, 7, 10, 100). If **A** has a component *A*_{[2, 2, 4]} = 11 and **B** has a component *B*_{[8, 88]} = 13, then the component of **C** formed by the outer product is *C*_{[2, 2, 4, 8, 88]} = 143.

To understand the matrix definition of outer product in terms of the definition of tensor product:

- The vector
**v**can be interpreted as an order-1 tensor with dimension*M*, and the vector**u**as an order-1 tensor with dimension*N*. The result is an order-2 tensor with dimension (*M*,*N*). - The order of the result of an inner product between two tensors of order
*q*and*r*is the greater of*q*+*r*− 2 and 0. Thus, the inner product of two matrices has the same order as the outer product (or tensor product) of two vectors. - It is possible to add arbitrarily many leading or trailing
*1*dimensions to a tensor without fundamentally altering its structure. These*1*dimensions would alter the character of operations on these tensors, so any resulting equivalences should be expressed explicitly. - The inner product of two matrices
**V**with dimensions (*d*,*e*) and**U**with dimensions (*e*,*f*) is , where*i*= 1, 2, ...,*d*and*k*= 1, 2, ...,*f*. For the case where*e*= 1, the summation is trivial (involving only a single term). - The outer product of two matrices
**V**with dimensions (*m*,*n*) and**U**with dimensions (*p*,*q*) is , where*s*= 1, 2, ...,*mp*− 1,*mp*and*t*= 1, 2, ...,*nq*− 1,*nq*.

## Definition (abstract)

Let *V* and *W* be two vector spaces, and let *W*^{∗} be the dual space of *W*.
Given a vector *x* ∈ *V* and *y*^{∗} ∈ *W*^{∗}, then the tensor product *y*^{∗} ⊗ *x* corresponds to the map *A* : W → *V* given by

Here *y*^{∗}(*w*) denotes the value of the linear functional *y*^{∗} (which is an element of the dual space of *W*) when evaluated at the element *w* ∈ *W*. This scalar in turn is multiplied by *x* to give as the final result an element of the space *V*.

If *V* and *W* are finite-dimensional, then the space of all linear transformations from *W* to *V*, denoted Hom(*W*, *V*), is generated by such outer products; in fact, the rank of a matrix is the minimal number of such outer products needed to express it as a sum (this is the **tensor rank** of a matrix). In this case Hom(*W*, *V*) is isomorphic to *W*^{∗} ⊗ *V*.

### Contrast with duality pairing

If *W* = *V*, then one can pair the covector *w*^{∗} ∈ *V*^{∗} with the vector *v* ∈ *V* via the map (*w*^{∗}, *v*) ↦ *w*^{∗}(*v*), which is the duality pairing between *V* and its dual.

## In programming languages

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 R, as the function outer(A, B, *f*); in Mathematica, as Outer[*f*,A,B]. These often generalize to multi-dimensional arguments, and more than two arguments.

## Applications

The outer product is useful in computing physical quantities (e.g., the tensor of inertia), and performing transform operations in digital signal processing and digital image processing. It is also useful in statistical analysis for computing the covariance and auto-covariance matrices for two random variables.

## See also

### Products

### Duality

## References

- ↑ Lipschutz, S.; Lipson, M. (2009).
*Linear Algebra*. Schaum’s Outlines (4th ed.). McGraw-Hill. ISBN 978-0-07-154352-1. - ↑ "Kronecker Product".
*Wolfram MathWorld*. - ↑ Lerner, R. G.; Trigg, G. L. (1991).
*Encyclopaedia of Physics*(2nd ed.). VHC. ISBN 0-89573-752-3. - ↑ Riley, K. F.; Hobson, M. P.; Bence, S. J. (2010).
*Mathematical Methods for Physics and Engineering*. Cambridge University Press. ISBN 978-0-521-86153-3.