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 matrix (mat ...
, 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 that describes the vector in terms of a particular ordered basis. Coordinates are always specified relative to an ordered basis. Bases and their a ...
s is a
matrix
Matrix or MATRIX may refer to:
Science and mathematics
* Matrix (mathematics), a rectangular array of numbers, symbols, or expressions
* Matrix (logic), part of a formula in prenex normal form
* Matrix (biology), the material in between a eukaryoti ...
. 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
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities a ...
(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
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...

, 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 over a field, algebra of tensors on ''V'' (of any rank) with multiplication being the tensor product. It is the free algebra on ''V'', ...
.
The outer product contrasts with:
* The
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' is often also used more generally to mean a symmetric bilinear form, for example for a pseudo-Euclidean space. is an algebraic operation that takes two equal-length seque ...
(also known as the "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 as ...
* The
Kronecker product
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and th ...
, which takes a pair of matrices as input and produces a block matrix
*
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'' is often also used more generally to mean a symmetric bilinear form, for example for a pseudo-Euclidean space. is an algebraic operation that takes two equal-length seque ...
by
if given an
vector
then
If given a
vector
then
If
and
are vectors of the same dimension, then
.
The outer product
is equivalent to a
matrix multiplication
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

provided that
is represented as a
column vector
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 ...
and
as a
column vector (which makes
a row vector).
For instance, if
and
then
:
For
complex
The UCL Faculty of Mathematical and Physical Sciences is one of the 11 constituent faculties of University College London
, mottoeng = Let all come who by merit deserve the most reward
, established =
, type = Public university, Public rese ...
vectors, it is often useful to take the
conjugate transpose
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
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
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
for
Euclidean vector space
Euclidean space is the fundamental space of classical geometry. Originally, it was the three-dimensional space
Three-dimensional space (also: 3-space or, rarely, tri-dimensional space) is a geometric setting in which three values (called ...
s,
better known as the
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' is often also used more generally to mean a symmetric bilinear form, for example for a pseudo-Euclidean space. is an algebraic operation that takes two equal-length seque ...
. The inner product is the
trace
Trace may refer to:
Arts and entertainment Music
* ''Trace'' (Son Volt album), 1995
* Trace (Died Pretty album), ''Trace'' (Died Pretty album), 1993
* Trace (band), a Dutch progressive rock band
* The Trace (album), ''The Trace'' (album)
Other ...
of the outer product. Unlike the
inner product
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
, 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 (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.
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 Validity (logic), valid rule ...
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
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 ...
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 space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are con ...
on that one column, hence the matrix is of rank one.
("Matrix rank" should not be confused with "
tensor order
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...
", or "tensor degree", which is sometimes referred to as "rank".)
Definition (abstract)
Let ''V'' and ''W'' be two
vector space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities a ...
s. The outer product of
and
is the element
.
If ''V'' is an
inner product space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
, then it is possible to define the outer product as a linear map ''V'' → ''W''. In which case, the linear map
is an element of the
dual space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no gen ...
of ''V''. The outer product ''V'' → ''W'' is then given by
:
This shows why a conjugate transpose of v 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
Machine learning (ML) is the study of computer algorithms that can improve automatically through experi ...
, as
Outer , A, B/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:
* Pythonidae
The Pythonidae, commonly known as pythons, are a family of nonvenomous snakes found in Africa, Asia, and Australia. Among its members are some of the largest snakes in the world. Ten genera and 42 species
...
library NumPy
NumPy (pronounced () or sometimes ()) is a library
A library is a collection of materials, books or media that are easily accessible for use and not just for display purposes. It is responsible for housing updated information in order to ...
, 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
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and th ...
, 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
Electrical engineering is an engineering discipline concerned with the study, design, and application of equipment, devices, and systems which use electricity, electronics, and electromagnetis ...

, and image compression
Image compression is a type of data compression
In signal processing
Signal processing is an electrical engineering
Electrical engineering is an engineering discipline concerned with the study, design, and application of equipment, ...
.
Spinors
Suppose ''s'', ''t'', ''w'', ''z'' ∈ C so that (''s'', ''t'') and (''w'', ''z'') are in C2. Then the outer product of these complex 2-vectors is an element of M(2, C), the 2 × 2 complex matrices:
:
The determinant
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

of this matrix is because of the commutative property
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...
of C.
In the theory of spinors in three dimensions, these matrices are associated with isotropic vectors due to this null property. Élie Cartan
Élie Joseph Cartan, ForMemRS
Fellowship of the Royal Society (FRS, ForMemRS and HonFRS) is an award granted by the judges of the Royal Society
The Royal Society, formally The Royal Society of London for Improving Natural Knowledge, is a ...
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
Theoretical physics is a branch of physics
Physics is the that studies , its , its and behavior through , and the related entities ...

in 1927 so that M(2, C) 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 (logic), and takes the place of multiplication. The outer product of two logical vectors (''u''i) and (''v''j) is given by the logical matrix . This type of matrix is used in the study of binary relations, and is called a rectangular relation or a cross-vector.[Ki Hang Kim (1982) ''Boolean Matrix Theory and Applications'', page 37, Marcel Dekker ]
See also
* Dyadics
* Householder transformation
* Norm (mathematics)
* Scatter matrix
* Ricci calculus
Products
* Cartesian product
* Cross product
* Exterior product
* Hadamard product (matrices), Hadamard product
Duality
* Complex conjugate
* Conjugate transpose
* Transpose
* Bra–ket notation#Outer products, Bra–ket notation for outer product
References
Further reading
*
{{DEFAULTSORT:Outer Product
Bilinear operators
Operations on vectors
Higher-order functions
Articles with example Python (programming language) code