Skip to content

Commit 13e9ea9

Browse files
add getindex(::FiniteMPS, ::AbstractUnitRange)
1 parent 1ed8370 commit 13e9ea9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/states/finitemps.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ Base.@propagate_inbounds function Base.getindex(ψ::FiniteMPS, i::Int)
307307
end
308308
end
309309

310+
Base.@propagate_inbounds function Base.getindex::FiniteMPS, I::AbstractUnitRange)
311+
return Base.getindex.(Ref(ψ), I)
312+
end
313+
314+
310315
function Base.convert(::Type{TensorMap}, ψ::FiniteMPS)
311316
T = foldl.AR[2:end]; init=first.AC)) do x, y
312317
return _transpose_front(x * _transpose_tail(y))

0 commit comments

Comments
 (0)