return null;
if (resultProducts.size() == 1)
return resultProducts.get(0);
return new Sum(resultProducts);
} else if (target.getClass() == SimpleTensor.class) {
SimpleTensor sp = (SimpleTensor) target;
if (sp.getName() != var.getName())
return null;
if (sp.getIndices().size() == 0)
return TensorNumber.createONE();
Product kroneckers = new Product();
Indices targetIndices = sp.getIndices();
Indices varIndices = var.getIndices();
for (int i = 0; i < sp.getIndices().size(); ++i)
kroneckers.add(CC.createMetricOrKronecker(targetIndices.get(i), varIndices.get(i)));
return kroneckers.equivalent();
} else if (target.getClass() == TensorField.class) {
TensorField field = (TensorField) target;
Tensor[] args = field.getArgs();