Skip to content

Commit

Permalink
fix empty bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jutho committed Jan 26, 2024
1 parent 72c3842 commit 053c907
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 6 additions & 1 deletion src/fusiontrees/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions test/spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) ==
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 053c907

Please sign in to comment.