change to smallset in tests to always include a non-abelian sector when possible#98
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
| # make sure a sector with dim > 1 is included when possible, so that | ||
| # non-abelian sectors are tested consistently | ||
| if FusionStyle(I) isa MultipleFusion && !any(>(1) ∘ dim, result) | ||
| if FusionStyle(I) isa MultipleFusion |
There was a problem hiding this comment.
Why was this removed? If result already includes some non-abelian sector, this is not necessary, right? Also, maybe result already included the sector found by findfirst, and now you include it twice, which defeats the purpose of the shuffle above.
There was a problem hiding this comment.
Oh you are right, I somehow missed that result and sectors is indeed not the same. I think I just wanted to avoid searching the list twice, so findfirst just searches all sectors, and then I guess the point is that the clause should be !isnothing(i) && i > length(result) && ...
There was a problem hiding this comment.
The extra check i > length(result) is redundant, no? Because if i ≤ length(result), there would already be a non-abelian sector at sectors[i].
There was a problem hiding this comment.
yes, but we removed that check in the if statement :)
| if FusionStyle(I) isa MultipleFusion && !any(>(1) ∘ dim, result) | ||
| i = findfirst(>(1) ∘ dim, sectors) | ||
| !isnothing(i) && (result[end] = sectors[i]) # no changes if set to have multiple fusion but actually abelian | ||
| end |
There was a problem hiding this comment.
| if FusionStyle(I) isa MultipleFusion && !any(>(1) ∘ dim, result) | |
| i = findfirst(>(1) ∘ dim, sectors) | |
| !isnothing(i) && (result[end] = sectors[i]) # no changes if set to have multiple fusion but actually abelian | |
| end | |
| if FusionStyle(I) isa MultipleFusion | |
| i = findfirst(>(1) ∘ dim, sectors) | |
| if !isnothing(i) && i > length(result) | |
| result[end] = sectors[i]) | |
| end | |
| end |
No description provided.