Skip to content

Commit 6b528c9

Browse files
committed
introduce rounddim for prettiness
1 parent c22b215 commit 6b528c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bimodulesector.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,15 @@ function TensorKit.blocksectors(W::TensorMapSpace{S,N₁,N₂}) where
289289
end
290290
end
291291

292+
function rounddim(c::I) where {I<:BimoduleSector}
293+
_dim = dim(c)
294+
if _dim floor(_dim)
295+
return floor(_dim)
296+
else
297+
return _dim
298+
end
299+
end
300+
292301
function dim(V::GradedSpace{<:BimoduleSector})
293302
T = Base.promote_op(*, Int, real(sectorscalartype(sectortype(V))))
294303
return reduce(+, dim(V, c) * rounddim(c) for c in sectors(V); init=zero(T))

0 commit comments

Comments
 (0)