public static SimpleTensor simpleTensor(String name, SimpleIndices indices) {
NameDescriptor descriptor = CC.getNameManager().mapNameDescriptor(name, indices.getStructureOfIndices());
if (indices.size() == 0) {
assert indices == IndicesFactory.EMPTY_SIMPLE_INDICES;
NameDescriptorForSimpleTensor nst = (NameDescriptorForSimpleTensor) descriptor;
if (nst.getCachedSymbol() == null) {
SimpleTensor st;
nst.setCachedInstance(st = new SimpleTensor(descriptor.getId(), indices));
return st;
} else
return nst.getCachedSymbol();
}
return new SimpleTensor(descriptor.getId(),
UnsafeIndicesFactory.createOfTensor(descriptor.getSymmetries(),
indices));
}