IndexGenerator ig = new IndexGenerator(TensorUtils.getAllIndices(target));
List<SimpleTensor> metrics = new ArrayList<>();
for (Map.Entry<Integer, IndexMappingBufferRecord> entry : indexMappingBuffer.getMap().entrySet()) {
IndexMappingBufferRecord record = entry.getValue();
//diff states mapping detected
if (record.diffStatesInitialized() && !record.isContracted()) {
fromIndex = entry.getKey().intValue();
toIndex = ig.generate(IndicesUtils.getType(fromIndex));
preprocess.add(fromIndex, toIndex);
byte states = record.getStates();
if ((states & 1) == 1)
metrics.add(CC.createMetric(fromIndex, toIndex));
else
metrics.add(CC.createMetric(0x80000000 | fromIndex, 0x80000000 | toIndex));
}