Outer product

From testwiki
Jump to navigation Jump to search

Template:Short description Template: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 m and n, then their outer product is an m ร— n 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 column vectors, Template:Tmath of size mร—1 and Template:Tmath of size Template:Nobr ๐ฎ=[u1u2โ‹ฎum],๐ฏ=[v1v2โ‹ฎvn] their outer product Template:Nobr[1][2] sometimes denoted Template:Nobr is the matrix product of the column vector Template:Tmath times the row vector Template:Tmath. This is an mร—n matrix whose entries are each possible product of one element of Template:Tmath times one element of Template:Tmath:[3] ๐ฎโŠ—๐ฏ=๐ฎ๐ฏ๐–ณ=[u1u2…um][v1v2…vn]=[u1v1u1v2…u1vnu2v1u2v2…u2vnโ‹ฎโ‹ฎโ‹ฑโ‹ฎumv1umv2…umvn]. Or, in index notation, (๐ฎโŠ—๐ฏ)ij=uivj.

The outer product of two vectors always has rank Template:Tmath, and conversely every matrix of rank Template:Tmath can be written as an outer product.

For complex-valued vectors, it is common to define the outer product in terms of the conjugate transpose of Template:Nobr denoted Template:Nobr Template:Nobr or ๐ฏโˆ—: ๐ฎโŠ—๐ฏ=๐ฎ๐ฏโ€ . The conjugate transpose of a matrix results from taking the complex conjugate of each entry in the transpose of a matrix.

Contrast with Euclidean inner product

If m=n, then one can take the matrix product in the opposite order, of a row vector times a column vector, to obtain a scalar (or 1ร—1 matrix): โŸจ๐ฎ,๐ฏโŸฉ=๐ฎ๐–ณ๐ฏ=u1v1+u2v2+…+unvn. This is the standard inner product (or dot product) for the Euclidean vector space Template:Tmath.[2] The dot product is the trace of the outer product.[4] 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 ๐ฎ,๐ฏ of orders m and n, with dimensions (k1,k2,…,km) and (l1,l2,…,ln) respectively, their outer product ๐ฎโŠ—๐ฏ is a tensor of order m+n, with dimensions (k1,k2,…,km,l1,l2,…,ln), and entries (๐ฎโŠ—๐ฏ)i1,i2,…im,j1,j2,…,jn=ui1,i2,…,imvj1,j2,…,jn,

for the indices 1โ‰คi1โ‰คk1, 1โ‰คi2โ‰คk2…, 1โ‰คimโ‰คkm and 1โ‰คj1โ‰คl1, 1โ‰คj2โ‰คl2…, 1โ‰คjnโ‰คln. 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]๐–ณ and ๐ฏ=[45]๐–ณ, 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๐ฏ๐–ณ=๐ฎ๐ฏ๐–ณ=๐ฎโŠ—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)1โ‰คiโ‰คm1โ‰คjโ‰คn=[๐š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[5] 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: (๐ฎโŠ—๐ฏ)๐–ณ=(๐ฏโŠ—๐ฎ)(๐ฏ+๐ฐ)โŠ—๐ฎ=๐ฏโŠ—๐ฎ+๐ฐโŠ—๐ฎ๐ฎโŠ—(๐ฏ+๐ฐ)=๐ฎโŠ—๐ฏ+๐ฎโŠ—๐ฐ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 over the same field. The outer product of ๐ฏโˆˆV and ๐ฐโˆˆW is the element ๐ฏโŠ—๐ฐโˆˆVโŠ—W.

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 is then given by ๐ฏโŠ—๐ฐ:Wโ†’V๐ฑโ†ฆ(๐ฏโŠ—๐ฐ)(๐ฑ)=โŸจ๐ฐ,๐ฑโŸฉ๐ฏ

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%;[6] 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().[7] 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.[8]

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,[9] but it was introduced by Wolfgang Pauli in 1927[10] 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)=(uiโˆงvj). This type of matrix is used in the study of binary relations, and is called a rectangular relation or a cross-vector.[11]

See also

Products

Duality

References

Template:Reflist

Further reading

Template:Linear algebra

  1. โ†‘ Template:Cite book
  2. โ†‘ 2.0 2.1 Template:Cite web
  3. โ†‘ Template:Cite book
  4. โ†‘ Template:Cite book
  5. โ†‘ Template:Cite book
  6. โ†‘ Template:Cite web
  7. โ†‘ Template:Cite web
  8. โ†‘ Template:Cite book
  9. โ†‘ ร‰lie Cartan (1937) Lecons sur la theorie des spineurs, translated 1966: The Theory of Spinors, Hermann, Paris
  10. โ†‘ Pertti Lounesto (1997) Clifford Algebras and Spinors, page 51, Cambridge University Press Template:ISBN
  11. โ†‘ Ki-Hang Kim (1982) Boolean Matrix Theory and Applications, page 37, Marcel Dekker Template:ISBN