Tensor contraction


In multilinear algebra, a tensor contraction is an operation on a tensor that arises from the natural pairing of a finite-dimensional vector space and its dual. In components, it is expressed as a sum of products of scalar components of the tensor caused by applying the summation convention to a pair of dummy indices that are bound to each other in an expression. The contraction of a single mixed tensor occurs when a pair of literal indices of the tensor are set equal to each other and summed over. In the Einstein notation this summation is built into the notation. The result is another tensor with order reduced by 2.
Tensor contraction can be seen as a generalization of the trace.

Abstract formulation

Let V be a vector space over a field k. The core of the contraction operation, and the simplest case, is the natural pairing of V with its dual vector space V. The pairing is the linear transformation from the of these two spaces to the field k:
corresponding to the bilinear form
where f is in V and v is in V. The map C defines the contraction operation on a tensor of type, which is an element of. Note that the result is a scalar. Using the natural isomorphism between and the space of linear transformations from V to V, one obtains a basis-free definition of the trace.
In general, a tensor of type is an element of the vector space
. Applying the natural pairing to the kth V factor and the lth V factor, and using the identity on all other factors, defines the contraction operation, which is a linear map which yields a tensor of type. By analogy with the case, the general contraction operation is sometimes called the trace.

Contraction in index notation

In tensor index notation, the basic contraction of a vector and a dual vector is denoted by
which is shorthand for the explicit coordinate summation
.
Since a general mixed dyadic tensor is a linear combination of decomposable tensors of the form, the explicit formula for the dyadic case follows: let
be a mixed dyadic tensor. Then its contraction is
A general contraction is denoted by labeling one covariant index and one contravariant index with the same letter, summation over that index being implied by the summation convention. The resulting contracted tensor inherits the remaining indices of the original tensor. For example, contracting a tensor T of type on the second and third indices to create a new tensor U of type is written as
By contrast, let
be an unmixed dyadic tensor. This tensor does not contract; if its base vectors are dotted the result is the contravariant metric tensor,
whose rank is 2.

Metric contraction

As in the previous example, contraction on a pair of indices that are either both contravariant or both covariant is not possible in general. However, in the presence of an inner product g, such contractions are possible. One uses the metric to raise or lower one of the indices, as needed, and then one uses the usual operation of contraction. The combined operation is known as metric contraction.

Application to tensor fields

Contraction is often applied to tensor fields over spaces. Since contraction is a purely algebraic operation, it can be applied pointwise to a tensor field, e.g. if T is a tensor field on Euclidean space, then in any coordinates, its contraction U at a point x is given by
Since the role of x is not complicated here, it is often suppressed, and the notation for tensor fields becomes identical to that for purely algebraic tensors.
Over a Riemannian manifold, a metric is available, and both metric and non-metric contractions are crucial to the theory. For example, the Ricci tensor is a non-metric contraction of the Riemann curvature tensor, and the scalar curvature is the unique metric contraction of the Ricci tensor.
One can also view contraction of a tensor field in the context of modules over an appropriate ring of functions on the manifold or the context of sheaves of modules over the structure sheaf; see the discussion at the end of this article.

Tensor divergence

As an application of the contraction of a tensor field, let V be a vector field on a Riemannian manifold. Let be the covariant derivative of V. In the case of Cartesian coordinates in Euclidean space, one can write
Then changing index β to α causes the pair of indices to become bound to each other, so that the derivative contracts with itself to obtain the following sum:
which is the divergence div V. Then
is a continuity equation for V.
In general, one can define various divergence operations on higher-rank tensor fields, as follows. If T is a tensor field with at least one contravariant index, taking the covariant differential and contracting the chosen contravariant index with the new covariant index corresponding to the differential results in a new tensor of rank one lower than that of T.

Contraction of a pair of tensors

One can generalize the core contraction operation in a slightly different way, by considering a pair of tensors T and U. The tensor product is a new tensor, which, if it has at least one covariant and one contravariant index, can be contracted. The case where T is a vector and U is a dual vector is exactly the core operation introduced first in this article.
In tensor index notation, to contract two tensors with each other, one places them side by side as factors of the same term. This implements the tensor product, yielding a composite tensor. Contracting two indices in this composite tensor implements the desired contraction of the two tensors.
For example, matrices can be represented as tensors of type with the first index being contravariant and the second index being covariant. Let be the components of one matrix and let be the components of a second matrix. Then their multiplication is given by the following contraction, an example of the contraction of a pair of tensors:
Also, the interior product of a vector with a differential form is a special case of the contraction of two tensors with each other.

More general algebraic contexts

Let R be a commutative ring and let M be a finite free module over R. Then contraction operates on the full tensor algebra of M in exactly the same way as it does in the case of vector spaces over a field.
More generally, let OX be a sheaf of commutative rings over a topological space X, e.g. OX could be the structure sheaf of a complex manifold, analytic space, or scheme. Let M be a locally free sheaf of modules over OX of finite rank. Then the dual of M is still well-behaved and contraction operations make sense in this context.