Skip to content

Commit 5e67713

Browse files
authored
Add utility functions for obtaining all physical/virtualspaces (#287)
1 parent 18765ee commit 5e67713

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/states/infinitemps.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,12 @@ Base.checkbounds(::Type{Bool}, ψ::InfiniteMPS, i::Integer) = true
249249
site_type(::Type{<:InfiniteMPS{A}}) where {A} = A
250250
bond_type(::Type{<:InfiniteMPS{<:Any,B}}) where {B} = B
251251

252+
left_virtualspace::InfiniteMPS) = left_virtualspace.(ψ.AL)
252253
left_virtualspace::InfiniteMPS, n::Integer) = left_virtualspace.AL[n])
254+
right_virtualspace::InfiniteMPS) = right_virtualspace.(ψ.AL)
253255
right_virtualspace::InfiniteMPS, n::Integer) = right_virtualspace.AL[n])
256+
physicalspace::InfiniteMPS) = physicalspace.(ψ.AL)
254257
physicalspace::InfiniteMPS, n::Integer) = physicalspace.AL[n])
255-
physicalspace::InfiniteMPS) = PeriodicArray(map(Base.Fix1(physicalspace, ψ), 1:length(ψ)))
256258

257259
# TensorKit.space(ψ::InfiniteMPS{<:MPSTensor}, n::Integer) = space(ψ.AC[n], 2)
258260
# function TensorKit.space(ψ::InfiniteMPS{<:GenericMPSTensor}, n::Integer)

0 commit comments

Comments
 (0)