Outer product

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description Script error: No such module "Distinguish". In linear algebra, the outer product of two coordinate 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 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:

Definition

Given two vectors of size m×1 and n×1 respectively

𝐮=[u1u2um],𝐯=[v1v2vn]

their outer product, denoted 𝐮𝐯, is defined as the m×n matrix 𝐀 obtained by multiplying each element of 𝐮 by each element of 𝐯:[1]

𝐮𝐯=𝐀=[u1v1u1v2u1vnu2v1u2v2u2vnumv1umv2umvn]

Or, in index notation:

(𝐮𝐯)ij=uivj

Denoting the dot product by , if given an n×1 vector 𝐰, then (𝐮𝐯)𝐰=(𝐯𝐰)𝐮. If given a 1×m vector 𝐱, then 𝐱(𝐮𝐯)=(𝐱𝐮)𝐯T.

If 𝐮 and 𝐯 are vectors of the same dimension bigger than 1, then det(𝐮𝐯)=0.

The outer product 𝐮𝐯 is equivalent to a matrix multiplication 𝐮𝐯T, provided that 𝐮 is represented as a m×1 column vector and 𝐯 as a n×1 column vector (which makes 𝐯T a row vector).[2][3] For instance, if m=4 and n=3, then[4]

𝐮𝐯=𝐮𝐯T=[u1u2u3u4][v1v2v3]=[u1v1u1v2u1v3u2v1u2v2u2v3u3v1u3v2u3v3u4v1u4v2u4v3].

For complex vectors, it is often useful to take the conjugate transpose of 𝐯, denoted 𝐯 or (𝐯T)*:

𝐮𝐯=𝐮𝐯=𝐮(𝐯T)*.

Contrast with Euclidean inner product

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

𝐮,𝐯=𝐮T𝐯

which is the standard inner product for Euclidean vector spaces,[3] better known as the dot product. The dot product is the trace of the outer product.[5] Unlike the dot product, the outer product is not commutative.

Multiplication of a vector 𝐰 by the matrix 𝐮𝐯 can be written in terms of the inner product, using the relation (𝐮𝐯)𝐰=𝐮𝐯,𝐰.

The outer product of tensors

Given two tensors 𝐮,𝐯 with dimensions (k1,k2,,km) and (l1,l2,,ln), their outer product 𝐮𝐯 is a tensor with dimensions (k1,k2,,km,l1,l2,,ln) and entries

(𝐮𝐯)i1,i2,im,j1,j2,,jn=ui1,i2,,imvj1,j2,,jn

For example, if 𝐀 is of order 3 with dimensions (3,5,7) and 𝐁 is of order 2 with dimensions (10,100), then their outer product 𝐂 is of order 5 with dimensions (3,5,7,10,100). If 𝐀 has a component Template:Math and 𝐁 has a component Template:Math, then the component of 𝐂 formed by the outer product is Template:Math.

Connection with the Kronecker product

The outer product and Kronecker product are closely related; in fact the same symbol is commonly used to denote both operations.

If 𝐮=[123]T and 𝐯=[45]T, we have:

𝐮Kron𝐯=[458101215],𝐮outer𝐯=[458101215]

In the case of column vectors, the Kronecker product can be viewed as a form of vectorization (or flattening) of the outer product. In particular, for two column vectors 𝐮 and 𝐯, we can write:

𝐮Kron𝐯=vec(𝐯outer𝐮)

(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

𝐮Kron𝐯T=𝐮𝐯T=𝐮outer𝐯

where the order of vectors needs not be flipped. The middle expression uses matrix multiplication, where the vectors are considered as column/row matrices.

Connection with the matrix product

Given a pair of matrices 𝐀 of size m×p and 𝐁 of size p×n, consider the matrix product 𝐂=𝐀𝐁 defined as usual as a matrix of size m×n.

Now let 𝐚kcol be the k-th column vector of 𝐀 and let 𝐛krow be the k-th row vector of 𝐁. Then 𝐂 can be expressed as a sum of column-by-row outer products:

𝐂=𝐀𝐁=(k=1pAikBkj)1im1jn=[𝐚1col𝐚pcol][𝐛1row𝐛prow]=k=1p𝐚kcol𝐛krow

This expression has duality with the more common one as a matrix built with row-by-column inner product entries (or dot product): Cij=𝐚irow,𝐛jcol

This relation is relevant[6] in the application of the Singular Value Decomposition (SVD) (and Spectral Decomposition as a special case). In particular, the decomposition can be interpreted as the sum of outer products of each left (𝐮k) and right (𝐯k) singular vectors, scaled by the corresponding nonzero singular value σk:

𝐀=𝐔Σ𝐕𝐓=k=1rank(A)(𝐮k𝐯k)σk

This result implies that 𝐀 can be expressed as a sum of rank-1 matrices with spectral norm σk 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. The first term is the least squares fit of a matrix to an outer product of vectors.

Properties

The outer product of vectors satisfies the following properties:

(𝐮𝐯)T=(𝐯𝐮)(𝐯+𝐰)𝐮=𝐯𝐮+𝐰𝐮𝐮(𝐯+𝐰)=𝐮𝐯+𝐮𝐰c(𝐯𝐮)=(c𝐯)𝐮=𝐯(c𝐮)

The outer product of tensors satisfies the additional associativity property:

(𝐮𝐯)𝐰=𝐮(𝐯𝐰)

Rank of an outer product

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 u. 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".)

Definition (abstract)

Let Template:Mvar and Template:Mvar be two vector spaces. The outer product of 𝐯V and 𝐰W is the element 𝐯𝐰VW.

If Template:Mvar is an inner product space, then it is possible to define the outer product as a linear map Template:Math. In this case, the linear map 𝐱𝐯,𝐱 is an element of the dual space of Template:Mvar, as this maps linearly a vector into its underlying field, of which 𝐯,𝐱 is an element. The outer product Template:Math is then given by

(𝐰𝐯)(𝐱)=𝐯,𝐱𝐰.

This shows why a conjugate transpose of Template:Math is commonly taken in the complex case.

In programming languages

In some programming languages, given a two-argument function f (or a binary operator), the outer product, f, of 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%;[7] 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().[8] In contrast, np.kron results in a flat array. The outer product of multidimensional arrays can be computed using np.multiply.outer.

Applications

As the outer product is closely related to the Kronecker product, some of the applications of the Kronecker product use outer products. These applications are found in quantum theory, signal processing, and image compression.[9]

Spinors

Suppose Template:Math so that Template:Math and Template:Math are in Template:Math. Then the outer product of these complex 2-vectors is an element of Template:Math, the 2 × 2 complex matrices:

(swtwsztz).

The determinant of this matrix is Template:Math because of the commutative property of Template:Math.

In the theory of spinors in three dimensions, these matrices are associated with isotropic vectors due to this null property. Élie Cartan described this construction in 1937,[10] but it was introduced by Wolfgang Pauli in 1927[11] so that Template:Math has come to be called Pauli algebra.

Concepts

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 Template:Math and Template:Math is given by the logical matrix (aij)=(uivj). This type of matrix is used in the study of binary relations, and is called a rectangular relation or a cross-vector.[12]

See also

Products

Duality

References

Template:Reflist

Further reading

  • Script error: No such module "citation/CS1".

Script error: No such module "Navbox".

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. a b Script error: No such module "citation/CS1".
  4. James M. Ortega (1987) Matrix Theory: A Second Course, page 7, Plenum Press Template:ISBN
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "citation/CS1".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".
  10. Élie Cartan (1937) Lecons sur la theorie des spineurs, translated 1966: The Theory of Spinors, Hermann, Paris
  11. Pertti Lounesto (1997) Clifford Algebras and Spinors, page 51, Cambridge University Press Template:ISBN
  12. Ki-Hang Kim (1982) Boolean Matrix Theory and Applications, page 37, Marcel Dekker Template:ISBN