Skip to content

Commit 313df53

Browse files
committed
use sum in dim of GradedSpace
1 parent b114f64 commit 313df53

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/spaces/gradedspace.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ Base.hash(V::GradedSpace, h::UInt) = hash(V.dual, hash(V.dims, h))
9292
field(::Type{<:GradedSpace}) =
9393
InnerProductStyle(::Type{<:GradedSpace}) = EuclideanInnerProduct()
9494
function dim(V::GradedSpace)
95-
T = Base.promote_op(*, Int, real(sectorscalartype(sectortype(V))))
96-
return reduce(+, dim(V, c) * dim(c) for c in sectors(V);
97-
init=zero(T))
95+
return sum(dim(V, c) * dim(c) for c in sectors(V))
9896
end
9997
function dim(V::GradedSpace{I, <:AbstractDict}, c::I) where {I <: Sector}
10098
return get(V.dims, isdual(V) ? dual(c) : c, 0)

0 commit comments

Comments
 (0)