Skip to content

Commit

Permalink
add getindex(::FiniteMPS, ::AbstractUnitRange)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVanthilt committed Dec 20, 2024
1 parent 1ed8370 commit 13e9ea9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/states/finitemps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ Base.@propagate_inbounds function Base.getindex(ψ::FiniteMPS, i::Int)
end
end

Base.@propagate_inbounds function Base.getindex::FiniteMPS, I::AbstractUnitRange)
return Base.getindex.(Ref(ψ), I)
end


function Base.convert(::Type{TensorMap}, ψ::FiniteMPS)
T = foldl.AR[2:end]; init=first.AC)) do x, y
return _transpose_front(x * _transpose_tail(y))
Expand Down

0 comments on commit 13e9ea9

Please sign in to comment.