Skip to content

Commit 194a66b

Browse files
authored
Merge pull request #367 from QuantumKitHub/ld-sv
2 parents 4e22032 + 1717210 commit 194a66b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/tensors/abstracttensor.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ end
224224
# tensor characteristics: work on instances and pass to type
225225
#------------------------------------------------------------
226226
InnerProductStyle(t::AbstractTensorMap) = InnerProductStyle(typeof(t))
227-
storagetype(t::AbstractTensorMap) = storagetype(typeof(t))
227+
storagetype(t) = storagetype(typeof(t))
228+
storagetype(T::Type) = throw(MethodError(storagetype, T))
228229
blocktype(t::AbstractTensorMap) = blocktype(typeof(t))
229230

230231
numout(t::AbstractTensorMap) = numout(typeof(t))

src/tensors/sectorvector.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Base.size(v::SectorVector, args...) = size(parent(v), args...)
3737
Base.similar(v::SectorVector) = SectorVector(similar(v.data), v.structure)
3838
Base.similar(v::SectorVector, ::Type{T}) where {T} = SectorVector(similar(v.data, T), v.structure)
3939
Base.similar(v::SectorVector, V::ElementarySpace) = SectorVector{eltype(v), sectortype(V), storagetype(v)}(undef, V)
40+
Base.similar(v::SectorVector, ::Type{T}, V::ElementarySpace) where {T} = SectorVector(similar(v.data, T, reduceddim(V)), V)
4041

4142
Base.copy(v::SectorVector) = SectorVector(copy(v.data), v.structure)
4243

0 commit comments

Comments
 (0)