191191
192192# Base.isone(a::BimoduleSector) = leftone(a) == a == rightone(a)
193193
194+ function TensorKitSectors. allunits (:: Type{I} ) where {I <: BimoduleSector }
195+ s = size (I)
196+ return I[I (i, i, _get_dual_cache (I)[1 ][i]) for i in 1 : s]
197+ end
198+
194199function TensorKitSectors. unit (:: Type{<:BimoduleSector} )
195200 throw (ArgumentError (" one of Type BimoduleSector doesn't exist" ))
196201end
@@ -203,7 +208,7 @@ function TensorKitSectors.rightunit(a::BimoduleSector)
203208 return typeof (a)(a. j, a. j, _get_dual_cache (typeof (a))[1 ][a. j])
204209end
205210
206- function Base . conj (a:: BimoduleSector )
211+ function TensorKitSectors . dual (a:: BimoduleSector )
207212 return typeof (a)(a. j, a. i, _get_dual_cache (typeof (a))[2 ][a. i, a. j][a. label])
208213end
209214
@@ -345,6 +350,8 @@ function TensorKit.fuse(V₁::GradedSpace{I}, V₂::GradedSpace{I}) where {I<:Bi
345350 return typeof (V₁)(dims)
346351end
347352
353+ # TODO : these might not be necessary anymore after TensorKit#291
354+
348355# limited unitspace
349356function TensorKit. unitspace (S:: GradedSpace{<:BimoduleSector} )
350357 allequal (a. i for a in sectors (S)) && allequal (a. j for a in sectors (S)) ||
@@ -387,7 +394,8 @@ function leftunitspace(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
387394 return SumSpace (leftunitspace (first (S. spaces)))
388395end
389396
390- function TensorKit. insertrightunitspace (P:: ProductSpace{V,N} , :: Val{i} ;
397+
398+ function TensorKit. insertrightunit (P:: ProductSpace{V,N} , :: Val{i} ;
391399 conj:: Bool = false ,
392400 dual:: Bool = false ) where {i,V<: GradedSpace{I} ,N} where {I<: BimoduleSector }
393401 i > N && error (" cannot insert a sensible right unit onto $P at index $(i+ 1 ) " )
@@ -403,7 +411,7 @@ function TensorKit.insertrightunitspace(P::ProductSpace{V,N}, ::Val{i};
403411end
404412
405413# possible TODO : overwrite defaults at level of HomSpace and TensorMap?
406- function TensorKit. insertleftunitspace (P:: ProductSpace{V,N} , :: Val{i} ; # want no defaults?
414+ function TensorKit. insertleftunit (P:: ProductSpace{V,N} , :: Val{i} ; # want no defaults?
407415 conj:: Bool = false ,
408416 dual:: Bool = false ) where {i,V<: GradedSpace{I} ,N} where {I<: BimoduleSector }
409417 i > N && error (" cannot insert a sensible left unit onto $P at index $i " ) # do we want this to error in the diagonal case?
0 commit comments