diff --git a/Project.toml b/Project.toml index 87f07d4e..85058ebe 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TensorKit" uuid = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec" authors = ["Jutho Haegeman"] -version = "0.12.1" +version = "0.12.2" [deps] HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721" diff --git a/src/fusiontrees/iterator.jl b/src/fusiontrees/iterator.jl index c770bc10..e14ef562 100644 --- a/src/fusiontrees/iterator.jl +++ b/src/fusiontrees/iterator.jl @@ -5,7 +5,12 @@ function fusiontrees(uncoupled::NTuple{N,I}, coupled::I, isdual::NTuple{N,Bool}) where {N,I<:Sector} return FusionTreeIterator{I,N}(uncoupled, coupled, isdual) end -function fusiontrees(uncoupled::Tuple{I,Vararg{I}}, coupled::I=one(I)) where {I<:Sector} +function fusiontrees(uncoupled::Tuple{Vararg{I}}, coupled::I) where {I<:Sector} + isdual = ntuple(n -> false, length(uncoupled)) + return fusiontrees(uncoupled, coupled, isdual) +end +function fusiontrees(uncoupled::Tuple{I,Vararg{I}}) where {I<:Sector} + coupled = one(I) isdual = ntuple(n -> false, length(uncoupled)) return fusiontrees(uncoupled, coupled, isdual) end diff --git a/test/spaces.jl b/test/spaces.jl index de972cdd..48a6c74c 100644 --- a/test/spaces.jl +++ b/test/spaces.jl @@ -290,8 +290,10 @@ println("------------------------------------") @test @constinferred(dims(P)) == map(dim, (V1, V2, V3, V4)) @test @constinferred(dim(P)) == prod(dim, (V1, V2, V3, V4)) @test @constinferred(dim(P, 2)) == dim(V2) + @test @constinferred(dim(one(P))) == 1 @test first(@constinferred(sectors(P))) == (Trivial(), Trivial(), Trivial(), Trivial()) + @test first(@constinferred(sectors(one(P)))) == () cube(x) = x^3 @test @constinferred(cube(V1)) == V1 ⊗ V1 ⊗ V1 N = 3 @@ -302,6 +304,8 @@ println("------------------------------------") @test isempty(blocksectors(P ⊗ ℂ^0)) @test isempty(@constinferred(sectors(P ⊗ ℂ^0))) @test @constinferred(blockdim(P, first(blocksectors(P)))) == dim(P) + @test @constinferred(blockdim(P, Trivial())) == dim(P) + @test @constinferred(blockdim(one(P), Trivial())) == 1 @test Base.IteratorEltype(P) == Base.IteratorEltype(typeof(P)) == Base.IteratorEltype(P.spaces) @test Base.IteratorSize(P) == Base.IteratorSize(typeof(P)) == @@ -340,6 +344,9 @@ println("------------------------------------") ProductSpace{ComplexSpace}(()) @test @constinferred(dims(P)) == map(dim, (V1, V2, V3)) @test @constinferred(dim(P)) == prod(dim, (V1, V2, V3)) + @test @constinferred(dim(one(P))) == 1 + @test first(@constinferred(sectors(one(P)))) == () + @test @constinferred(blockdim(one(P), Irrep[SU₂](0))) == 1 for s in @constinferred(sectors(P)) @test hassector(P, s) @test @constinferred(dims(P, s)) == dim.((V1, V2, V3), s)