As mentioned in ITensor/BlockSparseArrays.jl#52
I think it could be reasonable to make functionality like:
GradedUnitRanges.blockmergesortperm
GradedUnitRanges.blockmergesort
GradedUnitRanges.blocksortperm
GradedUnitRanges.blocksort (not defined yet but probably should be).
part of the public interface of GradedUnitRanges.jl, since sorting by sector and merging common sectors is a pretty common operation. However, maybe they should be renamed to:
GradedUnitRanges.sectormergesortperm
GradedUnitRanges.sectormergesort
GradedUnitRanges.sectorsortperm
GradedUnitRanges.sectorsort
to make it clearer that the sorting/merging is done by sector. I don't think there is a need for GradedUnitRanges.blockpermute(a::AbstractBlockedUnitRange, indices::AbstractVector{<:Block{1}}) since if I understand what you mean by that, that is already defined through indexing syntax like a[indices], or to get it as a new axis you can do only(axes(a[indices])) as I suggest in the comment above.