I would like to write generic code that works for any sectortype and returns a space. I have an issue with the Trivial sector:
function make_space(s::Sector)
return Vect[sectortype(s)]([s=>1])
end
make_space(U1Irrep(0)) # Rep[U₁](…) of dim 1:\n0 => 1
make_space(SU2Irrep(0)) # Rep[SU₂](…) of dim 1:\n0 => 1
make_space(Trivial()) # MethodError
I use this logic in QuantumKitHub/PEPSKit.jl#263
Is this expected behavior or should I submit a fix?