@@ -2,15 +2,13 @@ struct BimoduleSector{Name} <: Sector
22 i:: Int
33 j:: Int
44 label:: Int
5+ function BimoduleSector {:A4} (i:: Int , j:: Int , label:: Int )
6+ i <= 12 && j <= 12 || throw (DomainError (" object outside the matrix A4" ))
7+ return label <= _numlabels (BimoduleSector{:A4 }, i, j) ? new {:A4} (i, j, label) : throw (DomainError (" label outside category A4($i , $j )" ))
8+ end
59end
610BimoduleSector {Name} (data:: NTuple{3,Int} ) where {Name} = BimoduleSector {Name} (data... )
7- # TODO : place bound on what BimoduleSectors can be made
8- # currently you can define A4Object(anyint, anyint, anyint)
911const A4Object = BimoduleSector{:A4 }
10- # function A4Object(i::Int, j::Int, label::Int)
11- # i <= 12 && j <= 12 || throw(DomainError("object outside the matrix"))
12- # return BimoduleSector{A4Object}(i, j, label)
13- # end
1412
1513# Utility implementations
1614# -----------------------
2523Base. IteratorSize (:: Type{SectorValues{<:BimoduleSector}} ) = Base. SizeUnknown ()
2624
2725# TODO : generalize?
28- # TODO : numlabels?
2926function Base. iterate (iter:: SectorValues{A4Object} , (I, label)= (1 , 1 ))
3027 I > 12 * 12 && return nothing
3128 i, j = CartesianIndices ((12 , 12 ))[I]. I
@@ -49,8 +46,8 @@ function TensorKitSectors.:⊗(a::A4Object, b::A4Object)
4946 if (a_l == a. label && b_l == b. label)]
5047end
5148
52- function _numlabels (:: Type{A4Object } , i, j)
53- return Ncache = _get_Ncache (A4Object )
49+ function _numlabels (:: Type{T } , i, j) where {T <: BimoduleSector }
50+ return length ( _get_dual_cache (T)[ 2 ][i,j] )
5451end
5552
5653# Data from files
@@ -284,4 +281,4 @@ function TensorKitSectors.Fsymbol(a::I, b::I, c::I, d::I, e::I,
284281 return get (colordict, (a. label, b. label, c. label, d. label, e. label, f. label)) do
285282 return colordict[(a. label, b. label, c. label, d. label, e. label, f. label)]
286283 end
287- end
284+ end
0 commit comments