Tensor product


In mathematics, the tensor product of two vector spaces and is itself a vector space, endowed with the operation of bilinear composition, denoted by, from ordered pairs in the Cartesian product to in a way that generalizes the outer product.
Essentially the difference between a tensor product of two vectors and an ordered pair of vectors is that if one vector is multiplied by a nonzero scalar and the other is multiplied by the reciprocal of that scalar, the result is a different ordered pair of vectors, but the same tensor product of two vectors.
The tensor product of and is the vector space generated by the symbols, with and, in which the relations of bilinearity are imposed for the product operation, and no other relations are assumed to hold. The tensor product space is thus the "freest" such vector space, in the sense of having the fewest constraints.
The tensor product of vector spaces has dimension equal to the product of the dimensions of the two factors:
In particular, this distinguishes the tensor product from the direct sum vector space, whose dimension is the sum of the dimensions of the two summands:
More generally, the tensor product can be extended to other categories of mathematical objects in addition to vector spaces, such as to matrices, tensors, algebras, topological vector spaces, and modules. In each such case the tensor product is characterized by a similar universal property: it is the freest bilinear operation. The general concept of a "tensor product" is captured by monoidal categories; that is, the class of all things that have a tensor product is a monoidal category.

Intuitive motivation and the concrete tensor product

The intuitive motivation for the tensor product relies on the concept of tensors more generally. In particular, a tensor is an object that can be considered a special type of multilinear map, which takes in a certain number of vectors and outputs a scalar. Such objects are useful in a number of areas of application, such as Riemannian geometry, famous for its use in Albert Einstein's general theory of relativity in modern physics, where the metric tensor is a fundamental concept. In particular, the metric tensor takes in two vectors, conceived of roughly as small arrows emanating from a specific point within a curved space, or manifold, and returns a local dot product of them relative to that particular point—an operation that encodes some information about the vectors' lengths as well as the angle between them. As the dot product is a scalar, the metric tensor is thus seen to deserve its name. There is one metric tensor at each point of the manifold, and variation in the metric tensor thus encodes how distance and angle concepts, and so the laws of analytic geometry, vary throughout the manifold.
One can think of the tensor product of two vector spaces, and, as representing the set of all tensors that take a vector from and a vector from and output a scalar within their common base field. The two spaces may be the same—above, they are vectors in the tangent space at a point: roughly the flat space a tiny piece of the manifold "looks like" near a particular point, and thus the metric tensor lives in the tensor product of that space with itself. But the two spaces may also be different.
If we have a basis for each of the vector spaces, and the vector spaces are finite-dimensional, we can represent the vectors in terms of components under those basis vectors:
where each column vector stands for the components in the particular basis—i.e., .
A tensor is then a map that works as above, returning a scalar and is linear in both of its arguments. Such a tensor can be represented using a matrix multiplication:
where the superscript denotes the matrix transpose, which sends the vector to its dual vector.
Given two vectors, we can form a tensor of their own from them rather naturally using the outer product, which is denoted and equals. This tensor comes out as the matrix
and this matrix corresponds to the tensor by the prior construction, which is reminiscent of how it corresponds to a linear map. These tensors themselves generate a vector space by adding them together and multiplying them by scalars in the usual ways that we do for matrices and functions, and the collection of all such tensors so formed is the tensor product of the two vector spaces themselves. In fact, this space is equivalent to the space of maps represented by every possible matrix of the above size, as can be seen by noting that the simple tensor products have a "1" in the -th position and "0"s everywhere else, which allows them to be multiplied by any number and then added up to get a matrix with arbitrary entries.
The purpose of the succeeding sections is to find a definition that is equivalent to this where it is applicable but that does not require a specific choice of basis and that can also more easily be applied to infinite-dimensional settings where the usual basis concepts may be ill-behaved. Not requiring a specific basis is useful from a theoretical point of view since while every vector space has a basis, not all bases are necessarily constructible, and moreover that result itself depends on the acceptance of the axiom of choice, which may be rejected in some systems of mathematics. Also, it is useful to find an abstract construction for analysis from the point of view of category theory—the theory of the very zoomed-out "big picture of maths" and how all mathematical objects relate to each other in a very general sense. A very important real-life use for having such a definition can be found in quantum mechanics: the tensor product in this form allows us to talk of the wave function of a system of two particles as an abstract Hilbert space vector without having to specify a particular basis of observables.

Baby step towards the abstract tensor product: the free vector space

The first step we will consider involves introducing something called a "free vector space" over a given set. The thrust behind this idea basically consists of what we said in the last point: since a tensor can be written by the double sum
the most natural way to approach this problem is somehow to figure out how we can "forget" about the specific choice of bases and that are used here. In mathematics, the way we "forget" about representational details of something is to establish an identification that tells us that two different things that are to be considered representations of the same thing are in fact such, i.e. which, given those says either "yes, they are" or "no, they aren't", and then "lump together" all representations as constituting the "thing represented" without reference to any one in particular by packaging them all together into a single set. In formal terms, we first build an equivalence relation, and then take the quotient set by that relation.
But before we can do that, we first need to develop what we are going to take the equivalence relation over. The way we do that is to approach this the other way around, from the "bottom up": since we are not guaranteed a, at least constructible, basis when starting from arbitrary vector spaces, we might instead try to start by guaranteeing we have one—that is, we will start first by considering a "basis", on its own, as given, and then building the vector space on top. To that end, we accomplish the following: suppose that is some set, which we could call an abstract basis set. Now consider all formal expressions of the form
of arbitrary, but finite, length and for which are scalars and are members of. Intuitively, this is a linear combination of the basis vectors in the usual sense of expanding an element of a vector space. We call this a "formal expression" because technically it is illegal to multiply since there is no defined multiplication operation by default on an arbitrary set and arbitrary field of scalars. Instead, we will "pretend" that this refers to something, and then will go about manipulating it according to the rules we expect for a vector space, e.g. the sum of two such strings using the same sequence of members of is
where we have used the associative, commutative, and distributive laws to rearrange the first sum into the second. Continuing this way for scalar multiples and all different-length combinations of vectors allows us to build up a vector addition and scalar multiplication on this set of formal expressions, and we call it the free vector space over, writing. Note that the elements of, considered as length-one formal expressions with coefficient 1 out front, form a Hamel basis for this space.
The tensor product expression is then abstracted by considering that if and represent "abstract basis vectors" from two sets and, i.e. that "" and "", then pairs of these in the Cartesian product, i.e. are taken as standing for the tensor products. With such an identification, we can thus define the tensor product of two free vector spaces and as being something that is isomorphic to.

Using the free vector space to "forget" about the basis

The above definition will work for any vector space in which we can specify a basis, since we can just rebuild it as the free vector space over that basis: the above construction exactly mirrors how you represent vectors via the Hamel basis construction by design. In effect, we haven't gained anything... until we do this.
Now, we are not assuming access to bases for vector spaces and that we want to form the tensor product of. Instead, we will take all of and as "basis" to build up the tensors. This is the next best thing and the one thing we are guaranteed to be able to do, regardless of any concerns in finding a specific basis; this corresponds to adding together arbitrary outer products of arbitrary vectors in the last part of the "Intuitive motivation" section. The only difference here is that if we use the free vector space construction and form the obvious, it will have many redundant versions of what should be the same tensor; going back to our basisful case if we consider the example where in the standard basis, we may consider that the tensor formed by the vectors and, i.e.
could also be represented by other sums, such as the sum using individual basic tensors, e.g.
These, while equal expressions in the concrete case, would correspond to distinct elements of the free vector space, namely
in the first case and
in the second case. Thus we must condense them—this is where the equivalence relation comes into play. The trick to building it is to note that given any vector in a vector space, it is always possible to represent it as the sum of two other vectors and not equal to the original. If nothing else, let be any vector and then take —which also shows that if we are given one vector and then a second vector, we can write the first vector in terms of the second together with a suitable third vector.
This is useful to us because the outer product satisfies the following linearity properties, which can be proven by simple algebra on the corresponding matrix expressions:
If we want to relate the outer product to, say,, we can use the first relation above together with a suitable expression of as a sum of some vector and some scalar multiple of.
Equality between two concrete tensors is then obtained if using the above rules will permit us to rearrange one sum of outer products into the other by suitably decomposing vectors—regardless of if we have a set of actual basis vectors. Applying that to our example above, we see that of course we have
for which substitution in
gives us
and judicious use of the distributivity properties lets us rearrange to the desired form. Likewise, there is a corresponding "mirror" manipulation in terms of the free vector space elements and,, etc., and this finally leads us to the formal definition of the tensor product.

The definition of the abstract tensor product

The abstract tensor product of two vector spaces and over a common base field is the quotient vector space
where is the equivalence relation of formal equality generated by assuming that, for each and taken as formal expressions in the free vector space, the following hold:
and then testing equivalence of generic formal expressions through suitable manipulations based thereupon. Arithmetic is defined on the tensor product by choosing representative elements, applying the arithmetical rules, and finally taking the equivalence class. Moreover, given any two vectors and, the equivalence class is denoted.

Properties

Notation

Elements of are often referred to as tensors, although this term refers to many other related concepts as well. If belongs to and belongs to, then the equivalence class of is denoted by, which is called the tensor product of with. In physics and engineering, this use of the symbol refers specifically to the outer product operation; the result of the outer product is one of the standard ways of representing the equivalence class. An element of that can be written in the form is called a pure or simple tensor. In general, an element of the tensor product space is not a pure tensor, but rather a finite linear combination of pure tensors. For example, if and are linearly independent, and and are also linearly independent, then cannot be written as a pure tensor. The number of simple tensors required to express an element of a tensor product is called the tensor rank, and for linear operators or matrices, thought of as tensors, it agrees with matrix rank.

Dimension

Given bases and for and respectively, the tensors form a basis for. Therefore, if and are finite-dimensional, the dimension of the tensor product is the product of dimensions of the original spaces; for instance is isomorphic to.

Tensor product of linear maps

The tensor product also operates on linear maps between vector spaces. Specifically, given two linear maps and between vector spaces, the tensor product of the two linear maps and is a linear map
defined by
In this way, the tensor product becomes a bifunctor from the category of vector spaces to itself, covariant in both arguments.
If and are both injective, surjective or continuous, then is injective, surjective or continuous, respectively.
By choosing bases of all vector spaces involved, the linear maps and can be represented by matrices. Then, depending on how the tensor is vectorized, the matrix describing the tensor product is the Kronecker product of the two matrices. For example, if, and above are all two-dimensional and bases have been fixed for all of them, and and are given by the matrices
respectively, then the tensor product of these two matrices is
The resultant rank is at most 4, and thus the resultant dimension is 4. Note that rank here denotes the tensor rank i.e. the number of requisite indices.
A dyadic product is the special case of the tensor product between two vectors of the same dimension.

Universal property

In the context of vector spaces, the tensor product and the associated bilinear map are characterized up to isomorphism by a universal property regarding bilinear maps. Informally, is the most general bilinear map out of.
This characterization can simplify proofs about the tensor product. For example, the tensor product is symmetric, meaning there is a canonical isomorphism:
To construct, say, a map from to, it suffices to give a bilinear map that maps to. Then the universal property of means factors into a map.
A map in the opposite direction is similarly defined, and one checks that the two linear maps and are inverse to one another by again using their universal properties.
The universal property is extremely useful in showing that a map to a tensor product is injective. For example, suppose we want to show that is isomorphic to. Since all simple tensors are of the form, and hence all elements of the tensor product are of the form by additivity in the first coordinate, we have a natural candidate for an isomorphism given by mapping to, and this map is trivially surjective.
Showing injectivity directly would involve somehow showing that there are no non-trivial relationships between and for, which seems daunting. However, we know that there is a bilinear map given by multiplying the coordinates together, and the universal property of the tensor product then furnishes a map of vector spaces which maps to, and hence is an inverse of the previously constructed homomorphism, immediately implying the desired result. Note that, a priori, it is not even clear that this inverse map is well-defined, but the universal property and associated bilinear map together imply this is the case.
Similar reasoning can be used to show that the tensor product is associative, that is, there are natural isomorphisms
Therefore, it is customary to omit the parentheses and write.
The category of vector spaces with tensor product is an example of a symmetric monoidal category.
The universal-property definition of a tensor product is valid in more categories than just the category of vector spaces. Instead of using multilinear maps, the general tensor product definition uses multimorphisms.

Tensor powers and braiding

Let be a non-negative integer. The th tensor power of the vector space is the -fold tensor product of with itself. That is
A permutation of the set determines a mapping of the th Cartesian power of as follows:
Let
be the natural multilinear embedding of the Cartesian power of into the tensor power of. Then, by the universal property, there is a unique isomorphism
such that
The isomorphism is called the braiding map associated to the permutation.

Product of tensors

For non-negative integers and a type tensor on a vector space is an element of
Here is the dual vector space.
There is a product map, called the product of tensors
It is defined by grouping all occurring "factors" together: writing for an element of and for an element of the dual space,
Picking a basis of and the corresponding dual basis of naturally induces a basis for . In terms of these bases, the components of a product of two tensors can be computed. For example, if and are two covariant tensors of orders and respectively, then the components of their tensor product are given by
Thus, the components of the tensor product of two tensors are the ordinary product of the components of each tensor. Another example: let be a tensor of type with components, and let be a tensor of type with components. Then
and
Tensors equipped with their product operation form an algebra, called the tensor algebra.

Evaluation map and tensor contraction

For tensors of type there is a canonical evaluation map
defined by its action on pure tensors:
More generally, for tensors of type, with, there is a map, called tensor contraction,
On the other hand, if is finite-dimensional, there is a canonical map in the other direction
where is any basis of, and is its dual basis. This map does not depend on the choice of basis.
The interplay of evaluation and coevaluation can be used to characterize finite-dimensional vector spaces without referring to bases.

Adjoint representation

The tensor product may be naturally viewed as a module for the Lie algebra by means of the diagonal action: for simplicity let us assume, then, for each,
where in is the transpose of, that is, in terms of the obvious pairing on,
There is a canonical isomorphism given by
Under this isomorphism, every in may be first viewed as an endomorphism of and then viewed as an endomorphism of. In fact it is the adjoint representation of.

Relation of tensor product to Hom

Given two finite dimensional vector spaces, over the same field, denote the dual space of as, and the -vector space of all linear maps from to as. There is an isomorphism,
defined by an action of the pure tensor on an element of,
Its "inverse" can be defined using a basis and its dual basis as in the section "Evaluation map and tensor contraction" above:
This result implies
which automatically gives the important fact that forms a basis for where are bases of and.
Furthermore, given three vector spaces,, the tensor product is linked to the vector space of all linear maps, as follows:
This is an example of adjoint functors: the tensor product is "left adjoint" to Hom.

Tensor products of modules over a ring

The tensor product of two modules and over a commutative ring is defined in exactly the same way as the tensor product of vector spaces over a field:
where now is the free -module generated by the cartesian product and is the -module generated by the same relations as above.
More generally, the tensor product can be defined even if the ring is non-commutative. In this case has to be a right--module and is a left--module, and instead of the last two relations above, the relation
is imposed. If is non-commutative, this is no longer an -module, but just an abelian group.
The universal property also carries over, slightly modified: the map defined by is a middle linear map ; that is, it satisfies:
The first two properties make a bilinear map of the abelian group. For any middle linear map of, a unique group homomorphism of satisfies, and this property determines within group isomorphism. See the main article for details.

Tensor product of modules over a non-commutative ring

Let A be a right R-module and B be a left R-module. Then the tensor product of A and B is an abelian group defined by
where is a free abelian group over and G is a subgroup of generated by relations
The universal property can be stated as follows. Let G be an abelian group with a map that is bilinear, in the sense that
Then there is a unique map such that for all and.
Furthermore, we can give a module structure under some extra conditions:
  1. If A is a -bimodule, then is a left S-module where.
  2. If B is a -bimodule, then is a right S-module where.
  3. If R is a commutative ring, then A and B are, is a left R-module, and by 2), is a right R-module, so we can conclude is a -bimodule.

    Computing the tensor product

For vector spaces, the tensor product is quickly computed since bases of of immediately determine a basis of, as was mentioned above. For modules over a general ring, not every module is free. For example, is not a free abelian group. The tensor product with is given by
More generally, given a presentation of some -module, that is, a number of generators together with relations
the tensor product can be computed as the following cokernel:
Here, and the map is determined by sending some in the th copy of to . Colloquially, this may be rephrased by saying that a presentation of gives rise to a presentation of. This is referred to by saying that the tensor product is a right exact functor. It is not in general left exact, that is, given an injective map of -modules, the tensor product
is not usually injective. For example, tensoring the map given by multiplication with, with yields the zero map, which is not injective. Higher Tor functors measure the defect of the tensor product being not left exact. All higher Tor functors are assembled in the derived tensor product.

Tensor product of algebras

Let be a commutative ring. The tensor product of -modules applies, in particular, if and are -algebras. In this case, the tensor product is an -algebra itself by putting
For example,
A particular example is when and are fields containing a common subfield. The tensor product of fields is closely related to Galois theory: if, say,, where is some irreducible polynomial with coefficients in, the tensor product can be calculated as
where now is interpreted as the same polynomial, but with its coefficients regarded as elements of. In the larger field, the polynomial may become reducible, which brings in Galois theory. For example, if is a Galois extension of, then
is isomorphic to the.

Eigenconfigurations of tensors

Square matrices with entries in a field represent linear maps of vector spaces, say, and thus linear maps of projective spaces over. If is nonsingular then is well-defined everywhere, and the eigenvectors of correspond to the fixed points of. The eigenconfiguration of consists of points in, provided is generic and is algebraically closed. The fixed points of nonlinear maps are the eigenvectors of tensors. Let be a -dimensional tensor of format with entries lying in an algebraically closed field of characteristic zero. Such a tensor defines polynomial maps and with coordinates
Thus each of the coordinates of is a homogeneous polynomial of degree in. The eigenvectors of are the solutions of the constraint
and the eigenconfiguration is given by the variety of the minors of this matrix.

Other examples of tensor products

Tensor product of Hilbert spaces

s generalize finite-dimensional vector spaces to countably-infinite dimensions. The tensor product is still defined; it is the tensor product of Hilbert spaces.

Topological tensor product

When the basis for a vector space is no longer countable, then the appropriate axiomatic formalization for the vector space is that of a topological vector space. The tensor product is still defined, it is the topological tensor product.

Tensor product of graded vector spaces

Some vector spaces can be decomposed into direct sums of subspaces. In such cases, the tensor product of two spaces can be decomposed into sums of products of the subspaces.

Tensor product of representations

Vector spaces endowed with an additional multiplicative structure are called algebras. The tensor product of such algebras is described by the Littlewood–Richardson rule.

Tensor product of quadratic forms

Tensor product of multilinear forms

Given two multilinear forms and on a vector space over the field their tensor product is the multilinear form
This is a special case of the product of tensors if they are seen as multilinear maps. Thus the components of the tensor product of multilinear forms can be computed by the Kronecker product.

Tensor product of sheaves of modules

Tensor product of line bundles

Tensor product of fields

Tensor product of graphs

It should be mentioned that, though called "tensor product", this is not a tensor product of graphs in the above sense; actually it is the category-theoretic product in the category of graphs and graph homomorphisms. However it is actually the Kronecker tensor product of the adjacency matrices of the graphs. Compare also the section Tensor product of linear maps above.

Monoidal categories

The most general setting for the tensor product is the monoidal category. It captures the algebraic essence of tensoring, without making any specific reference to what is being tensored. Thus, all tensor products can be expressed as an application of the monoidal category to some particular setting, acting on some particular objects.

Quotient algebras

A number of important subspaces of the tensor algebra can be constructed as quotients: these include the exterior algebra, the symmetric algebra, the Clifford algebra, the Weyl algebra, and the universal enveloping algebra in general.
The exterior algebra is constructed from the exterior product. Given a vector space, the exterior product is defined as
Note that when the underlying field of does not have characteristic 2, then this definition is equivalent to
The image of in the exterior product is usually denoted and satisfies, by construction,. Similar constructions are possible for , giving rise to, the th exterior power of. The latter notion is the basis of differential -forms.
The symmetric algebra is constructed in a similar manner, from the symmetric product
More generally
That is, in the symmetric algebra two adjacent vectors can be interchanged. The resulting objects are called symmetric tensors.

Tensor product in programming

Array programming languages

may have this pattern built in. For example, in APL the tensor product is expressed as ○.×. In J the tensor product is the dyadic form of */.
Note that J's treatment also allows the representation of some tensor fields, as a and b may be functions instead of constants. This product of two functions is a derived function, and if a and b are differentiable, then a */ b is differentiable.
However, these kinds of notation are not universally present in array languages. Other array languages may require explicit treatment of indices, and/or may not support higher-order functions such as the Jacobian derivative.