@@ -278,19 +278,6 @@ function TensorKit.blocksectors(W::TensorMapSpace{S,N₁,N₂}) where
278278 end
279279end
280280
281- # TODO : is this needed?
282- # function TensorKit.scalar(t::AbstractTensorMap{T,S,0,0}) where {T,
283- # S<:GradedSpace{<:BimoduleSector}}
284- # _vector = findall(!iszero, t.data) # should have 0 or 1 elements, since only one of the blocks could be non-zero
285- # if isempty(_vector)
286- # return zero(scalartype(t))
287- # end
288- # unit = one(A4Object(only(_vector), only(_vector), 1))
289- # return only(block(t, unit))
290- # end
291-
292- # TODO : definition for zero of GradedSpace?
293-
294281function dim (V:: GradedSpace{<:BimoduleSector} )
295282 T = Base. promote_op (* , Int, real (sectorscalartype (sectortype (V))))
296283 return reduce (+ , dim (V, c) * dim (c) for c in sectors (V); init= zero (T))
@@ -316,9 +303,6 @@ function rightoneunit(S::GradedSpace{<:BimoduleSector})
316303 allequal (a. j for a in sectors (S)) ||
317304 throw (ArgumentError (" sectors of $S do not have the same rightone" ))
318305
319- allequal (a. i for a in sectors (S)) ||
320- throw (ArgumentError (" sectors of $S are not all equal" ))
321-
322306 sector = rightone (first (sectors (S)))
323307 return spacetype (S)(sector => 1 )
324308end
@@ -332,9 +316,6 @@ function leftoneunit(S::GradedSpace{<:BimoduleSector})
332316 allequal (a. i for a in sectors (S)) ||
333317 throw (ArgumentError (" sectors of $S do not have the same leftone" ))
334318
335- allequal (a. j for a in sectors (S)) ||
336- throw (ArgumentError (" sectors of $S are not all equal" ))
337-
338319 sector = leftone (first (sectors (S)))
339320 return spacetype (S)(sector => 1 )
340321end
@@ -381,4 +362,3 @@ function TensorKit.scalar(t::AbstractTensorMap{T,S,0,0}) where {T,
381362 isempty (inds) && return zero (scalartype (t))
382363 return only (last (Bs[only (inds)]))
383364end
384-
0 commit comments