From 1a4f858c6c08612fb0f3dead54f43532a222a7f1 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Mon, 22 Jun 2026 11:12:58 +0200 Subject: [PATCH 1/5] change to smallset --- test/testsuite.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/testsuite.jl b/test/testsuite.jl index 659f26d..4b6372e 100644 --- a/test/testsuite.jl +++ b/test/testsuite.jl @@ -77,7 +77,14 @@ end function smallset(::Type{I}, size::Int = 5, maxdim::Real = 10) where {I <: Sector} sectors = collect(Iterators.take(values(I), 10 * size)) sectors = shuffle!(filter!(s -> dim(s) < maxdim, sectors)) - return resize!(sectors, min(size, length(sectors))) + result = sectors[1:min(size, length(sectors))] + # 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(s -> dim(s) > 1, result) + is = findall(s -> dim(s) > 1, sectors) + !isempty(is) && (result[end] = sectors[rand(is)]) # no changes if set to have multiple fusion but actually abelian + end + return result end function randsector(::Type{I}) where {I <: Sector} From 453b5ab34e6dcbc440ffbb57a5392564c0c344c2 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Mon, 22 Jun 2026 14:57:59 +0200 Subject: [PATCH 2/5] no need to randomise sth random + be cryptic --- test/testsuite.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testsuite.jl b/test/testsuite.jl index 4b6372e..d00f337 100644 --- a/test/testsuite.jl +++ b/test/testsuite.jl @@ -80,9 +80,9 @@ function smallset(::Type{I}, size::Int = 5, maxdim::Real = 10) where {I <: Secto result = sectors[1:min(size, length(sectors))] # 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(s -> dim(s) > 1, result) - is = findall(s -> dim(s) > 1, sectors) - !isempty(is) && (result[end] = sectors[rand(is)]) # no changes if set to have multiple fusion but actually abelian + 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 return result end From 43f9281985b905e28413e2a8d77a77a03ba64176 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Mon, 22 Jun 2026 15:14:23 +0200 Subject: [PATCH 3/5] code suggestion --- test/testsuite.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsuite.jl b/test/testsuite.jl index d00f337..1df55da 100644 --- a/test/testsuite.jl +++ b/test/testsuite.jl @@ -80,7 +80,7 @@ function smallset(::Type{I}, size::Int = 5, maxdim::Real = 10) where {I <: Secto result = sectors[1:min(size, length(sectors))] # 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 i = findfirst(>(1) ∘ dim, sectors) !isnothing(i) && (result[end] = sectors[i]) # no changes if set to have multiple fusion but actually abelian end From 4e1f0d06f45ea49adbe491546791799ef39b74e2 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Mon, 22 Jun 2026 16:43:21 +0200 Subject: [PATCH 4/5] undo code suggestion --- test/testsuite.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsuite.jl b/test/testsuite.jl index 1df55da..d00f337 100644 --- a/test/testsuite.jl +++ b/test/testsuite.jl @@ -80,7 +80,7 @@ function smallset(::Type{I}, size::Int = 5, maxdim::Real = 10) where {I <: Secto result = sectors[1:min(size, length(sectors))] # make sure a sector with dim > 1 is included when possible, so that # non-abelian sectors are tested consistently - if FusionStyle(I) isa MultipleFusion + 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 From 98d5415f92d5de774437d8fae387a7dfcbaa9474 Mon Sep 17 00:00:00 2001 From: Boris De Vos Date: Mon, 22 Jun 2026 17:27:59 +0200 Subject: [PATCH 5/5] code suggestion v2 --- test/testsuite.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/testsuite.jl b/test/testsuite.jl index d00f337..cfddeb4 100644 --- a/test/testsuite.jl +++ b/test/testsuite.jl @@ -80,9 +80,11 @@ function smallset(::Type{I}, size::Int = 5, maxdim::Real = 10) where {I <: Secto result = sectors[1:min(size, length(sectors))] # 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 i = findfirst(>(1) ∘ dim, sectors) - !isnothing(i) && (result[end] = sectors[i]) # no changes if set to have multiple fusion but actually abelian + if !isnothing(i) && (i > length(result)) # no changes if set to have multiple fusion but actually abelian + result[end] = sectors[i] + end end return result end