Currently many of the kernels are already using foreachblock as a primitive to loop over all blocks. However, that primitive, as well as the blocks machinery still has to specialize on each symmetry type, as the sectors are used as keys to identify the blocks.
It could be interesting to play around with an alternative approach that bypasses this completely, and just refers to blocks as the 'nth' block, where n is defined as the TensorKitSectors.findindex. In that case, we can still compare, but since the Int is the same type for all symmetries, we could (hopefully) just (pre)compile a single method for all symmetry types.
(Used for all factorizations, projections, matrix functions, ...)
Currently many of the kernels are already using
foreachblockas a primitive to loop over all blocks. However, that primitive, as well as theblocksmachinery still has to specialize on each symmetry type, as the sectors are used as keys to identify the blocks.It could be interesting to play around with an alternative approach that bypasses this completely, and just refers to blocks as the 'nth' block, where
nis defined as theTensorKitSectors.findindex. In that case, we can still compare, but since theIntis the same type for all symmetries, we could (hopefully) just (pre)compile a single method for all symmetry types.(Used for all factorizations, projections, matrix functions, ...)