Skip to content

Commit fe1a585

Browse files
authored
change to smallset in tests to always include a non-abelian sector when possible (#98)
* change to smallset * no need to randomise sth random + be cryptic * code suggestion * undo code suggestion * code suggestion v2
1 parent c697bb2 commit fe1a585

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

test/testsuite.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,16 @@ end
7777
function smallset(::Type{I}, size::Int = 5, maxdim::Real = 10) where {I <: Sector}
7878
sectors = collect(Iterators.take(values(I), 10 * size))
7979
sectors = shuffle!(filter!(s -> dim(s) < maxdim, sectors))
80-
return resize!(sectors, min(size, length(sectors)))
80+
result = sectors[1:min(size, length(sectors))]
81+
# make sure a sector with dim > 1 is included when possible, so that
82+
# non-abelian sectors are tested consistently
83+
if FusionStyle(I) isa MultipleFusion
84+
i = findfirst(>(1) dim, sectors)
85+
if !isnothing(i) && (i > length(result)) # no changes if set to have multiple fusion but actually abelian
86+
result[end] = sectors[i]
87+
end
88+
end
89+
return result
8190
end
8291

8392
function randsector(::Type{I}) where {I <: Sector}

0 commit comments

Comments
 (0)