CONTRACTION function

Contraction of two tensors