Skip to content

Commit

Permalink
Fix more namespace issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Oct 26, 2024
1 parent 11cd841 commit cd6afc4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/abstractinfinitemps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,26 +186,26 @@ function ITensors.dag(ψ::AbstractInfiniteMPS)
return typeof(ψ)(ψdag, translator(ψ); reverse=ψ.reverse)
end

ITensors.linkinds::AbstractInfiniteMPS, n1n2) = linkinds(ψ, Pair(n1n2...))
ITensorMPS.linkinds::AbstractInfiniteMPS, n1n2) = linkinds(ψ, Pair(n1n2...))

function ITensors.linkinds::AbstractInfiniteMPS, n1n2::Pair{<:Integer,<:Integer})
function ITensorMPS.linkinds::AbstractInfiniteMPS, n1n2::Pair{<:Integer,<:Integer})
return commoninds(ψ[n1n2[1]], ψ[n1n2[2]])
end

function ITensors.linkind::AbstractInfiniteMPS, n1n2::Pair{<:Integer,<:Integer})
function ITensorMPS.linkind::AbstractInfiniteMPS, n1n2::Pair{<:Integer,<:Integer})
return commonind(ψ[n1n2[1]], ψ[n1n2[2]])
end

function ITensors.siteind::AbstractInfiniteMPS, n::Integer)
function ITensorMPS.siteind::AbstractInfiniteMPS, n::Integer)
return uniqueind(ψ[n], ψ[n - 1], ψ[n + 1])
end

function ITensors.siteinds::AbstractInfiniteMPS, n::Integer)
function ITensorMPS.siteinds::AbstractInfiniteMPS, n::Integer)
return uniqueinds(ψ[n], ψ[n - 1], ψ[n + 1])
end

# TODO: return a Dictionary or IndexSetNetwork?
function ITensors.siteinds::AbstractInfiniteMPS, r::AbstractRange)
function ITensorMPS.siteinds::AbstractInfiniteMPS, r::AbstractRange)
return [siteind(ψ, n) for n in r]
end

Expand All @@ -216,9 +216,9 @@ function siterange(ψ::AbstractInfiniteMPS, c::Cell)
return start:stop
end

ITensors.siteinds::AbstractInfiniteMPS, c::Cell) = siteinds(ψ, siterange(ψ, c))
ITensorMPS.siteinds::AbstractInfiniteMPS, c::Cell) = siteinds(ψ, siterange(ψ, c))

function ITensors.siteinds::AbstractInfiniteMPS)
function ITensorMPS.siteinds::AbstractInfiniteMPS)
return CelledVector(siteinds(ψ, Cell(1)), translator(ψ))
end
infsiteinds::AbstractInfiniteMPS) = siteinds(ψ)
Expand All @@ -238,12 +238,12 @@ end

(::Colon)(n::Int, f::typeof(nsites)) = UnitRangeToFunction(n, f)

function ITensors.linkinds(f::typeof(only), ψ::AbstractInfiniteMPS)
function ITensorMPS.linkinds(f::typeof(only), ψ::AbstractInfiniteMPS)
N = nsites(ψ)
return CelledVector([f(commoninds(ψ[n], ψ[n + 1])) for n in 1:N], translator(ψ))
end

function ITensors.siteinds(f::typeof(only), ψ::AbstractInfiniteMPS)
function ITensorMPS.siteinds(f::typeof(only), ψ::AbstractInfiniteMPS)
N = nsites(ψ)
return CelledVector([f(uniqueinds(ψ[n], ψ[n - 1], ψ[n + 1])) for n in 1:N], translator(ψ))
end

0 comments on commit cd6afc4

Please sign in to comment.