In
linear algebra
Linear algebra is the branch of mathematics concerning linear equations such as:
:a_1x_1+\cdots +a_nx_n=b,
linear maps such as:
:(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n,
and their representations in vector spaces and through matrices.
...
, the outer product of two
coordinate vector
In linear algebra, a coordinate vector is a representation of a vector as an ordered list of numbers (a tuple) that describes the vector in terms of a particular ordered basis. An easy example may be a position such as (5, 2, 1) in a 3-dimensiona ...
s is a
matrix
Matrix most commonly refers to:
* ''The Matrix'' (franchise), an American media franchise
** ''The Matrix'', a 1999 science-fiction action film
** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchis ...
. If the two vectors have dimensions ''n'' and ''m'', then their outer product is an ''n'' × ''m'' matrix. More generally, given two
tensors
In mathematics, a tensor is an algebraic object that describes a multilinear relationship between sets of algebraic objects related to a vector space. Tensors may map between different objects such as vectors, scalars, and even other tenso ...
(multidimensional arrays of numbers), their outer product is a tensor. The outer product of tensors is also referred to as their
tensor product
In mathematics, the tensor product V \otimes W of two vector spaces and (over the same field) is a vector space to which is associated a bilinear map V\times W \to V\otimes W that maps a pair (v,w),\ v\in V, w\in W to an element of V \otimes W ...
, and can be used to define the
tensor algebra
In mathematics, the tensor algebra of a vector space ''V'', denoted ''T''(''V'') or ''T''(''V''), is the algebra of tensors on ''V'' (of any rank) with multiplication being the tensor product. It is the free algebra on ''V'', in the sense of being ...
.
The outer product contrasts with:
* The
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
(a special case of "inner product"), which takes a pair of coordinate vectors as input and produces a
scalar
Scalar may refer to:
*Scalar (mathematics), an element of a field, which is used to define a vector space, usually the field of real numbers
* Scalar (physics), a physical quantity that can be described by a single element of a number field such ...
* The
Kronecker product
In mathematics, the Kronecker product, sometimes denoted by ⊗, is an operation on two matrices of arbitrary size resulting in a block matrix. It is a generalization of the outer product (which is denoted by the same symbol) from vectors to ...
, which takes a pair of matrices as input and produces a block matrix
*
Standard matrix multiplication
Definition
Given two vectors of size
and
respectively
their outer product, denoted
is defined as the
matrix
obtained by multiplying each element of
by each element of
:
Or in index notation:
Denoting the
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
by
if given an
vector
then
If given a
vector
then
If
and
are vectors of the same dimension bigger than 1, then
.
The outer product
is equivalent to a
matrix multiplication
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the s ...
provided that
is represented as a
column vector
In linear algebra, a column vector with m elements is an m \times 1 matrix consisting of a single column of m entries, for example,
\boldsymbol = \begin x_1 \\ x_2 \\ \vdots \\ x_m \end.
Similarly, a row vector is a 1 \times n matrix for some n, c ...
and
as a
column vector (which makes
a row vector).
For instance, if
and
then
For
complex
Complex commonly refers to:
* Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe
** Complex system, a system composed of many components which may interact with each ...
vectors, it is often useful to take the
conjugate transpose
In mathematics, the conjugate transpose, also known as the Hermitian transpose, of an m \times n complex matrix \boldsymbol is an n \times m matrix obtained by transposing \boldsymbol and applying complex conjugate on each entry (the complex con ...
of
denoted
or
:
Contrast with Euclidean inner product
If
then one can take the matrix product the other way, yielding a scalar (or
matrix):
which is the standard
inner product
In mathematics, an inner product space (or, rarely, a Hausdorff space, Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation (mathematics), operation called an inner product. The inner product of two ve ...
for
Euclidean vector space
Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean s ...
s,
better known as the
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
. The dot product is the
trace
Trace may refer to:
Arts and entertainment Music
* ''Trace'' (Son Volt album), 1995
* ''Trace'' (Died Pretty album), 1993
* Trace (band), a Dutch progressive rock band
* ''The Trace'' (album)
Other uses in arts and entertainment
* ''Trace'' ...
of the outer product. 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
and
, their outer product
is a tensor with dimensions
and entries
For example, if
is of order 3 with dimensions
and
is of order 2 with dimensions
then their outer product
is of order 5 with dimensions
If
has a component and
has a component , then the component of
formed by the outer product is .
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
and
, we have:
In the case of column vectors, the Kronecker product can be viewed as a form of
vectorization
Vectorization may refer to:
Computing
* Array programming, a style of computer programming where operations are applied to whole arrays instead of individual elements
* Automatic vectorization, a compiler optimization that transforms loops to vec ...
(or flattening) of the outer product. In particular, for two column vectors
and
, we can write:
Note that the order of the vectors is reversed in the right side of the equation.
Another similar identity that further highlights the similarity between the operations is
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
and
of size
, consider the
matrix product
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the s ...
defined as usual as a matrix of size
.
Now let
be the
-th column vector of
and let
be the
-th row vector of
. Then
can be expressed as a sum of column-by-row outer products:
Note the duality of this expression with the more common one as a matrix built with row-by-column
inner product
In mathematics, an inner product space (or, rarely, a Hausdorff space, Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation (mathematics), operation called an inner product. The inner product of two ve ...
entries (or
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
):
This relation is relevant 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 (
) and right (
) singular vectors, scaled by the corresponding nonzero singular value
:
This result implies that
can be expressed as a sum of rank-1 matrices with
spectral norm
In mathematics, a matrix norm is a vector norm in a vector space whose elements (vectors) are matrices (of given dimensions).
Preliminaries
Given a field K of either real or complex numbers, let K^ be the -vector space of matrices with m ro ...
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:
The outer product of tensors satisfies the additional
associativity
In mathematics, the associative property is a property of some binary operations, which means that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement f ...
property:
Rank of an outer product
If u and v are both nonzero, then the outer product matrix uv
T always has
matrix rank
In linear algebra, the rank of a matrix is the dimension of the vector space generated (or spanned) by its columns. p. 48, § 1.16 This corresponds to the maximal number of linearly independent columns of . This, in turn, is identical to the dime ...
1. Indeed, the columns of the outer product are all proportional to the first column. Thus they are all
linearly dependent
In the theory of vector spaces, a set of vectors is said to be if there is a nontrivial linear combination of the vectors that equals the zero vector. If no such linear combination exists, then the vectors are said to be . These concepts are ...
on that one column, hence the matrix is of rank one.
("Matrix rank" should not be confused with "
tensor order
In mathematics, a tensor is an algebraic object that describes a multilinear relationship between sets of algebraic objects related to a vector space. Tensors may map between different objects such as vectors, scalars, and even other tenso ...
", or "tensor degree", which is sometimes referred to as "rank".)
Definition (abstract)
Let and be two
vector space
In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called ''vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but can ...
s. The outer product of
and
is the element
.
If is an
inner product space
In mathematics, an inner product space (or, rarely, a Hausdorff pre-Hilbert space) is a real vector space or a complex vector space with an operation called an inner product. The inner product of two vectors in the space is a scalar, often den ...
, then it is possible to define the outer product as a linear map . In which case, the linear map
is an element of the
dual space
In mathematics, any vector space ''V'' has a corresponding dual vector space (or just dual space for short) consisting of all linear forms on ''V'', together with the vector space structure of pointwise addition and scalar multiplication by const ...
of . The outer product is then given by
This shows why a conjugate transpose of 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 of
f
and two one-dimensional arrays
A
and
B
is a two-dimensional array
C
such that
C, j
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline (t ...
= f(A B
. 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%; in
Mathematica
Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, data manipulation, network analysis, time series analysis, NLP, optimizat ...
, as
Outer, A, B
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline (t ...
/syntaxhighlight>. 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
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (pro ...
library NumPy, the outer product can be computed with function np.outer()
. 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
In mathematics, the Kronecker product, sometimes denoted by ⊗, is an operation on two matrices of arbitrary size resulting in a block matrix. It is a generalization of the outer product (which is denoted by the same symbol) from vectors to ...
, some of the applications of the Kronecker product use outer products. These applications are found in quantum theory, signal processing
Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, and scientific measurements. Signal processing techniq ...
, and image compression
Image compression is a type of data compression applied to digital images, to reduce their cost for storage or transmission. Algorithms may take advantage of visual perception and the statistical properties of image data to provide superior r ...
.
Spinors
Suppose so that and are in . Then the outer product of these complex 2-vectors is an element of , the 2 × 2 complex matrices:
The determinant
In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix. It characterizes some properties of the matrix and the linear map represented by the matrix. In particular, the determinant is nonzero if and ...
of this matrix is because of the commutative property
In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name of ...
of C.
In the theory of spinors in three dimensions
In mathematics, the spinor concept as specialised to three dimensions can be treated by means of the traditional notions of dot product and cross product. This is part of the detailed algebraic discussion of the rotation group SO(3).
Formulation
T ...
, these matrices are associated with isotropic vector
In mathematics, given a vector space ''X'' with an associated quadratic form ''q'', written , a null vector or isotropic vector is a non-zero element ''x'' of ''X'' for which .
In the theory of real bilinear forms, definite quadratic forms a ...
s due to this null property. Élie Cartan
Élie Joseph Cartan (; 9 April 1869 – 6 May 1951) was an influential French mathematician who did fundamental work in the theory of Lie groups, differential systems (coordinate-free geometric formulation of PDEs), and differential geometry. ...
described this construction in 1937, but it was introduced by Wolfgang Pauli
Wolfgang Ernst Pauli (; ; 25 April 1900 – 15 December 1958) was an Austrian theoretical physicist and one of the pioneers of quantum physics. In 1945, after having been nominated by Albert Einstein, Pauli received the Nobel Prize in Physics fo ...
in 1927 so that M(2, C) has come to be called Pauli algebra
In mathematical physics and mathematics, the Pauli matrices are a set of three complex matrices which are Hermitian, involutory and unitary. Usually indicated by the Greek letter sigma (), they are occasionally denoted by tau () when used in ...
.
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
A logical matrix, binary matrix, relation matrix, Boolean matrix, or (0, 1) matrix is a matrix with entries from the Boolean domain Such a matrix can be used to represent a binary relation between a pair of finite sets.
Matrix representation ...
. The logical operation and
or AND may refer to:
Logic, grammar, and computing
* Conjunction (grammar), connecting two words, phrases, or clauses
* Logical conjunction in mathematical logic, notated as "∧", "⋅", "&", or simple juxtaposition
* Bitwise AND, a boolea ...
takes the place of multiplication. The outer product of two logical vectors and is given by the logical matrix . This type of matrix is used in the study of binary relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over Set (mathematics), sets and is a new set of ordered pairs consisting of ele ...
s, and is called a rectangular relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over sets and is a new set of ordered pairs consisting of elements in and ...
or a cross-vector.[Ki Hang Kim (1982) ''Boolean Matrix Theory and Applications'', page 37, ]Marcel Dekker
Marcel Dekker was a journal and encyclopedia publishing company with editorial boards found in New York City. Dekker encyclopedias are now published by CRC Press, part of the Taylor and Francis publishing group.
History
Initially a textbook pu ...
See also
* Dyadics In mathematics, specifically multilinear algebra, a dyadic or dyadic tensor is a second order tensor, written in a notation that fits in with vector algebra.
There are numerous ways to multiply two Euclidean vectors. The dot product takes in two v ...
* Householder transformation
In linear algebra, a Householder transformation (also known as a Householder reflection or elementary reflector) is a linear transformation that describes a reflection about a plane or hyperplane containing the origin. The Householder transformati ...
* Norm (mathematics)
In mathematics, a norm is a function from a real or complex vector space to the non-negative real numbers that behaves in certain ways like the distance from the origin: it commutes with scaling, obeys a form of the triangle inequality, and is ze ...
* Scatter matrix : ''For the notion in quantum mechanics, see scattering matrix.''
In multivariate statistics and probability theory, the scatter matrix is a statistic that is used to make estimates of the covariance matrix, for instance of the multivariate norma ...
* Ricci calculus
In mathematics, Ricci calculus constitutes the rules of index notation and manipulation for tensors and tensor fields on a differentiable manifold, with or without a metric tensor or connection. It is also the modern name for what used to be cal ...
Products
* Cartesian product
In mathematics, specifically set theory, the Cartesian product of two sets ''A'' and ''B'', denoted ''A''×''B'', is the set of all ordered pairs where ''a'' is in ''A'' and ''b'' is in ''B''. In terms of set-builder notation, that is
: A\ti ...
* Cross product
In mathematics, the cross product or vector product (occasionally directed area product, to emphasize its geometric significance) is a binary operation on two vectors in a three-dimensional oriented Euclidean vector space (named here E), and is ...
* Exterior product
In mathematics, specifically in topology,
the interior of a subset of a topological space is the union of all subsets of that are open in .
A point that is in the interior of is an interior point of .
The interior of is the complement of th ...
* Hadamard product
Duality
* Complex conjugate
In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, (if a and b are real, then) the complex conjugate of a + bi is equal to a - ...
* Conjugate transpose
In mathematics, the conjugate transpose, also known as the Hermitian transpose, of an m \times n complex matrix \boldsymbol is an n \times m matrix obtained by transposing \boldsymbol and applying complex conjugate on each entry (the complex con ...
* Transpose
In linear algebra, the transpose of a matrix is an operator which flips a matrix over its diagonal;
that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other notations).
The tr ...
* Bra–ket notation for outer product
References
Further reading
*
{{DEFAULTSORT:Outer Product
Bilinear maps
Operations on vectors
Higher-order functions
Articles with example Python (programming language) code