Skip to content

change to smallset in tests to always include a non-abelian sector when possible#98

Merged
lkdvos merged 7 commits into
mainfrom
bd/smallset
Jun 22, 2026
Merged

change to smallset in tests to always include a non-abelian sector when possible#98
lkdvos merged 7 commits into
mainfrom
bd/smallset

Conversation

@borisdevos

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread test/testsuite.jl Outdated
Comment thread test/testsuite.jl Outdated
Comment thread test/testsuite.jl Outdated
Comment thread test/testsuite.jl
# 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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) && ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes, but we removed that check in the if statement :)

Comment thread test/testsuite.jl Outdated
Comment on lines +83 to +86
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

@lkdvos lkdvos Jun 22, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
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

@lkdvos lkdvos merged commit fe1a585 into main Jun 22, 2026
12 checks passed
@lkdvos lkdvos deleted the bd/smallset branch June 22, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants