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. 1 2 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