Skip to content

Commit cfb70bf

Browse files
committed
diagonal indexing
1 parent de9bd92 commit cfb70bf

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/tensors/diagonal.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,12 @@ end
166166

167167
# Indexing and getting and setting the data at the subblock level
168168
#-----------------------------------------------------------------
169-
@inline function Base.getindex(
170-
d::DiagonalTensorMap, f₁::FusionTree{I, 1}, f₂::FusionTree{I, 1}
169+
Base.@propagate_inbounds function subblock(
170+
d::DiagonalTensorMap, (f₁, f₂)::Tuple{FusionTree{I, 1}, FusionTree{I, 1}}
171171
) where {I <: Sector}
172172
s = f₁.uncoupled[1]
173173
s == f₁.coupled == f₂.uncoupled[1] == f₂.coupled || throw(SectorMismatch())
174174
return block(d, s)
175-
# TODO: do we want a StridedView here? Then we need to allocate a new matrix.
176-
end
177-
178-
function Base.setindex!(
179-
d::DiagonalTensorMap, v, f₁::FusionTree{I, 1}, f₂::FusionTree{I, 1}
180-
) where {I <: Sector}
181-
return copy!(getindex(d, f₁, f₂), v)
182175
end
183176

184177
function Base.getindex(d::DiagonalTensorMap)

0 commit comments

Comments
 (0)