diff --git a/NDTensors/src/lib/Sectors/src/abstractcategory.jl b/NDTensors/src/lib/Sectors/src/abstractcategory.jl index e05a97d056..374650ccc8 100644 --- a/NDTensors/src/lib/Sectors/src/abstractcategory.jl +++ b/NDTensors/src/lib/Sectors/src/abstractcategory.jl @@ -83,9 +83,7 @@ function GradedAxes.fuse_blocklengths( end function GradedAxes.fuse_blocklengths( - ::SymmetryStyle, - l1::LabelledNumbers.LabelledInteger{<:Integer,<:Sectors.AbstractCategory}, - l2::LabelledNumbers.LabelledInteger{<:Integer,<:Sectors.AbstractCategory}, + ::SymmetryStyle, l1::LabelledNumbers.LabelledInteger, l2::LabelledNumbers.LabelledInteger ) fused = LabelledNumbers.label(l1) ⊗ LabelledNumbers.label(l2) v = @@ -96,14 +94,18 @@ function GradedAxes.fuse_blocklengths( end function GradedAxes.fuse_blocklengths( - ::AbelianGroup, - l1::LabelledNumbers.LabelledInteger{<:Integer,<:Sectors.AbstractCategory}, - l2::LabelledNumbers.LabelledInteger{<:Integer,<:Sectors.AbstractCategory}, + ::AbelianGroup, l1::LabelledNumbers.LabelledInteger, l2::LabelledNumbers.LabelledInteger ) fused = LabelledNumbers.label(l1) ⊗ LabelledNumbers.label(l2) return LabelledNumbers.labelled(l1 * l2, fused) end +function GradedAxes.fuse_blocklengths( + ::EmptyCategory, l1::LabelledNumbers.LabelledInteger, l2::LabelledNumbers.LabelledInteger +) + return LabelledNumbers.labelled(l1 * l2, sector()) +end + # cast to range to_graded_axis(c::AbstractCategory) = to_graded_axis(LabelledNumbers.labelled(1, c)) to_graded_axis(l::LabelledNumbers.LabelledInteger) = GradedAxes.gradedrange([l]) diff --git a/NDTensors/src/lib/Sectors/test/test_category_product.jl b/NDTensors/src/lib/Sectors/test/test_category_product.jl index 8f70741730..772fe524c1 100644 --- a/NDTensors/src/lib/Sectors/test/test_category_product.jl +++ b/NDTensors/src/lib/Sectors/test/test_category_product.jl @@ -540,6 +540,9 @@ end @test typeof(s) == typeof(sector(())) @test typeof(s) == typeof(sector((;))) # empty NamedTuple is cast to Tuple{} + g0 = gradedrange([s => 2]) + @test gradedisequal((@inferred fusion_product(g0, g0)), gradedrange([s => 4])) + @test (@inferred s × U1(1)) == sector(U1(1)) @test (@inferred s × sector(U1(1))) == sector(U1(1)) @test (@inferred s × sector(; A=U1(1))) == sector(; A=U1(1))