c = product.remove(positionsOfMatrices.toArray());
c = multiply(c, calculatedTraces.build());
iterator.set(simplifications.transform(c));
}
}
return simplifications.transform(iterator.result());
}
private Tensor traceOfProduct(Tensor tensor) {
Tensor oldTensor = tensor, newTensor;
while (true) {