Skip to content

Commit

Permalink
Fix bug in fusion tree iterator for multiple fusion case (#193)
Browse files Browse the repository at this point in the history
* fix bug in fusiontree iterator

* patch update
  • Loading branch information
Jutho authored Jan 1, 2025
1 parent 00eb107 commit 6aa0c7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 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.14"
version = "0.14.1"

[deps]
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
Expand Down
29 changes: 17 additions & 12 deletions src/fusiontrees/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,26 @@ function _fusiontree_iterate(uncoupledsectors::NTuple{N}, coupled::I, out, lines
vertexiterN = c dual(b)
outstateN = states[end]
vertexstateN = states[end - 1]
n = vertices[end]
while isnothing(rest)
n = vertices[end]
n < Nsymbol(a, b, c) && return out, lines, (restvertices..., n + 1), states
nextline = iterate(vertexiterN, vertexstateN)
while isnothing(nextline)
nextout = iterate(outiterN, outstateN)
nextout === nothing && return nothing
b, outstateN = nextout
vertexiterN = c dual(b)
nextline = iterate(vertexiterN)
if n < Nsymbol(a, b, c)
n += 1
# reset the first part of the fusion tree
rest = _fusiontree_iterate(Base.front(uncoupledsectors), a)
else
nextline = iterate(vertexiterN, vertexstateN)
while isnothing(nextline)
nextout = iterate(outiterN, outstateN)
nextout === nothing && return nothing
b, outstateN = nextout
vertexiterN = c dual(b)
nextline = iterate(vertexiterN)
end
a, vertexstateN = nextline
n = 1
rest = _fusiontree_iterate(Base.front(uncoupledsectors), a)
end
a, vertexstateN = nextline
rest = _fusiontree_iterate(Base.front(uncoupledsectors), a)
end
n = 1
restout, restlines, restvertices, reststates = rest
out = (restout..., b)
lines = (restlines..., a)
Expand Down

2 comments on commit 6aa0c7b

@lkdvos
Copy link
Collaborator

@lkdvos lkdvos commented on 6aa0c7b Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • Fix an issue with fusiontree iterators for symmetries with multiple fusion.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/122291

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.1 -m "<description of version>" 6aa0c7b0e8738b26debd930689d83b62fd75e5e3
git push origin v0.14.1

Please sign in to comment.