return result.equivalent();
}
public Tensor renameIndicesAndBuidKroneckers(Tensor tensor) {
if (tensor instanceof SimpleTensor || tensor instanceof Product) {
Indices indices = tensor.getIndices();
IndexMappingDirectAllowingUnmapped im = new IndexMappingDirectAllowingUnmapped();
IndexMappingDirectAllowingUnmapped renameUsedIndices = null;
IndexGenerator ig;
ig = new IndexGenerator(TensorUtils.getAllIndicesBuilder(tensor).append(usedIndicesNames).asArray());
for (int i = 0; i < indices.size(); ++i) {
int index = indices.get(i);
if (checked.contains(inverseIndexState(index)))
if (usedIndicesNames.length == 0 || Arrays.binarySearch(usedIndicesNames, getNameWithType(index)) < 0) {
// uncontracted.add(inverseIndexState(index));
int newIndex = getRawStateInt(index) | ig.generate(getType(index));
uncontracted.add(getNameWithType(index));