Tensor contraction is an operation on a tensor performed by setting unlike indices equal and summing according to the Einstein
summation convention. Contraction reduces the tensor
rank by 2. For example, for a tensor of tensor
rank two,
When
is interpreted as a matrix, the contraction is the same
as the matrix trace.
Sometimes, two tensors are contracted using an upper index of one tensor and a lower of the other tensor.
In this context, contraction occurs after forming their tensor
product.