return parent.getDerivative(resOrder);
}
private void initializeSymmetries() {
StructureOfIndices baseStructure = structuresOfIndices[0];
StructureOfIndices[] partition = new StructureOfIndices[1 + ArraysUtils.sum(orders)];
partition[0] = parent.structuresOfIndices[0];
int i, j, k = 0;
for (i = 0; i < orders.length; ++i)
for (j = 0; j < orders[i]; ++j)
partition[++k] = structuresOfIndices[i + 1].getInverted();
int[][] mapping = baseStructure.getPartitionMappings(partition);
//adding field symmetries
List<Symmetry> fieldSymmetries = parent.symmetries.getInnerSymmetries().getBasisSymmetries();
for (k = 1; k < fieldSymmetries.size(); ++k)
symmetries.addUnsafe(fieldSymmetries.get(k).convert(mapping[0], baseStructure.size()));
//adding block symmetries
IntArrayList aggregator = new IntArrayList();
j = 1;
int a, b, cycle[];
for (i = 0; i < orders.length; ++i) {
if (orders[i] >= 2) {
//adding symmetries for indices from each slot
cycle = Combinatorics.createBlockCycle(structuresOfIndices[i + 1].size(), 2);
aggregator.addAll(mapping[j]);
aggregator.addAll(mapping[j + 1]);
symmetries.addUnsafe(
new Symmetry(Combinatorics.convertPermutation(cycle, aggregator.toArray(), baseStructure.size()), false));
if (orders[i] >= 3) {
for (k = 2; k < orders[i]; ++k)
aggregator.addAll(mapping[j + k]);
cycle = Combinatorics.createBlockCycle(structuresOfIndices[i + 1].size(), orders[i]);
symmetries.addUnsafe(
new Symmetry(Combinatorics.convertPermutation(cycle, aggregator.toArray(), baseStructure.size()), false));
}
aggregator.clear();
}
j += orders[i];
}