ArrayList<Tensor> kroneckers = new ArrayList<>();
int j, index, newIndex;
IndexGeneratorImpl generator = new IndexGeneratorImpl(TensorUtils.getAllIndicesNamesT(tensor).toArray());
for (int i = 0; i < factors.length; ++i) {
from.clear();
to.clear();
currentFactorIndices = IndicesFactory.createSimple(null, factors[i].getIndices());
for (j = currentFactorIndices.size() - 1; j >= 0; --j) {
index = currentFactorIndices.get(j);
if (freeIndices.contains(getNameWithType(index))) {