diff --git a/Project.toml b/Project.toml index 68e3100..ee8ccda 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BlockTensorKit" uuid = "5f87ffc2-9cf1-4a46-8172-465d160bd8cd" -version = "0.3.12" +version = "0.3.13" authors = ["Lukas Devos and contributors"] [deps] diff --git a/src/tensors/blocktensor.jl b/src/tensors/blocktensor.jl index 33e4765..3d2b6d9 100644 --- a/src/tensors/blocktensor.jl +++ b/src/tensors/blocktensor.jl @@ -164,7 +164,7 @@ Base.parent(t::BlockTensorMap) = t.data # handle this separately because the storagetype of `AbstractTensorMap` is # *always* Vector no matter the actual data storage type TK.storagetype(t::BlockTensorMap{AbstractTensorMap{E, S, N₁, N₂}}) where {E, S, N₁, N₂} = - foldl(TK.promote_storagetype, values(t.data)) + mapreduce(TK.storagetype, TK.promote_storagetype, values(t.data); init = TK.storagetype(eltype(t))) function Base.copyto!( dest::BlockTensorMap, Rdest::CartesianIndices, diff --git a/src/tensors/sparseblocktensor.jl b/src/tensors/sparseblocktensor.jl index a818f03..d919caf 100644 --- a/src/tensors/sparseblocktensor.jl +++ b/src/tensors/sparseblocktensor.jl @@ -171,7 +171,7 @@ Base.eltype(::Type{<:SparseBlockTensorMap{TT}}) where {TT} = TT # handle this separately because the storagetype of `AbstractTensorMap` is # *always* Vector no matter the actual data storage type TK.storagetype(t::SparseBlockTensorMap{AbstractTensorMap{E, S, N₁, N₂}}) where {E, S, N₁, N₂} = - foldl(TK.promote_storagetype, nonzero_values(t)) + mapreduce(TK.storagetype, TK.promote_storagetype, nonzero_values(t); init = TK.storagetype(eltype(t))) issparse(::SparseBlockTensorMap) = true nonzero_keys(t::SparseBlockTensorMap) = keys(t.data)