I was testing ZNElement{N, p} within TensorKit, and I noticed that you cannot use ZNElement{N} which defaults to ZNElement{N, 0}.
The first issue is in defining
V = Vect[Z4Element](0 => 1, 1 => 1)
where there are no SectorValues for ZNElement{N}. I can define this:
function Base.iterate(::SectorValues{ZNElement{N}}, i = 0) where {N} # p = 0 case
return i == N ? nothing : (ZNElement{N}(i), i + 1)
end
function Base.getindex(::SectorValues{ZNElement{N}}, i::Int) where {N}
return 1 <= i <= N ? ZNElement{N}(i - 1) : throw(BoundsError(values(ZNElement{N}), i))
end
findindex(::SectorValues{ZNElement{N}}, c::ZNElement{N}) where {N} = c.n + 1
and get the space to be made, but then the next issue is
The issue here is then that the type of V is GradedSpace{Z4Element, NTuple{4, Int64}}, while the sector types are Z4Element{0}. I thought to solve this by just defining appropriate Base.:(==)'s:
Base.:(==)(::Type{ZNElement{N}}, ::Type{ZNElement{N,0}}) where {N} = true
Base.:(==)(::Type{ZNElement{N,0}}, ::Type{ZNElement{N}}) where {N} = true
But then the ultimate issue is
ERROR: MethodError: Cannot `convert` an object of type
FusionTree{Z4Element{0},1,0,0} to an object of type
FusionTree{Z4Element,1,0,0}
I think this can be fixed by defining
Base.getindex(::SpaceTable, ::Type{ZNElement{N}}) where {N} = Vect[ZNElement{N, 0}]
but I'm wondering if all this hassle is worth being able to default to the trivial cocycle. So this issue is more to see whether we should remove constructors allowing no selection of cocycle, or if the solution I've gotten here above is worth implementing.
I was testing
ZNElement{N, p}within TensorKit, and I noticed that you cannot useZNElement{N}which defaults toZNElement{N, 0}.The first issue is in defining
where there are no
SectorValuesforZNElement{N}. I can define this:and get the space to be made, but then the next issue is
The issue here is then that the type of
VisGradedSpace{Z4Element, NTuple{4, Int64}}, while the sector types areZ4Element{0}. I thought to solve this by just defining appropriateBase.:(==)'s:But then the ultimate issue is
I think this can be fixed by defining
but I'm wondering if all this hassle is worth being able to default to the trivial cocycle. So this issue is more to see whether we should remove constructors allowing no selection of cocycle, or if the solution I've gotten here above is worth implementing.