private static Tensor extractNonComplexFactor(Tensor t) { Product p = (Product) t; if (p.getFactor().isMinusOne()) return p.get(1); else return null; }
partition[i] = sizeOfIndexless + partition[i]; if (!isUnitaryMatrixOrOne(product.get(partition[i]), unitaryMatrix)) continue out;
factor = tensor; else if (product.size() == 2)//case 2*a factor = product.get(1); else//case 2*a*b => factor = a*b factor = new Product(Complex.ONE, product.indexlessData, product.data, product.contentReference.getReferent(), product.indices);