Outer product

From testwiki
Revision as of 10:05, 20 November 2024 by imported>Ennomien (link block matrix)
(diff) โ† Older revision | Latest revision (diff) | Newer revision โ†’ (diff)
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 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 Template:Nowrap[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

Template:Linear algebra

  1. โ†‘ Template:Cite book
  2. โ†‘ Template:Cite book
  3. โ†‘ 3.0 3.1 Template:Cite web
  4. โ†‘ James M. Ortega (1987) Matrix Theory: A Second Course, page 7, Plenum Press Template:ISBN
  5. โ†‘ Template:Cite book
  6. โ†‘ Template:Cite book
  7. โ†‘ Template:Cite web
  8. โ†‘ Template:Cite web
  9. โ†‘ Template:Cite book
  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