diff --git a/src/infinitemps.jl b/src/infinitemps.jl index 5f3e713..dd7a75f 100644 --- a/src/infinitemps.jl +++ b/src/infinitemps.jl @@ -100,21 +100,21 @@ function ITensorMPS.findfirstsiteind(ψ::InfiniteCanonicalMPS, i::Index) end function ITensorMPS.findsites(ψ::InfiniteCanonicalMPS, is::Union{<:Tuple,<:Vector}) - return sort([ITensors.findfirstsiteind(ψ, i) for i in is]) + return sort([ITensorMPS.findfirstsiteind(ψ, i) for i in is]) end function ITensorMPS.findsites(ψ::InfiniteMPS, is::Union{<:Tuple,<:Vector}) - return sort([ITensors.findfirstsiteind(ψ, i) for i in is]) + return sort([ITensorMPS.findfirstsiteind(ψ, i) for i in is]) end function ITensorMPS.findsites(ψ::InfiniteMPS, T::MPO) s = [noprime(filterinds(T[x]; plev=1)[1]) for x in 1:length(T)] - return sort([ITensors.findfirstsiteind(ψ, i) for i in s]) + return sort([ITensorMPS.findfirstsiteind(ψ, i) for i in s]) end ITensorMPS.findsites(ψ::InfiniteCanonicalMPS, T::MPO) = findsites(ψ.AL, T) #Kept for historical reason function ITensorMPS.findsites(ψ::InfiniteMPS, T::ITensor) s = filterinds(T; plev=0) - return sort([ITensors.findfirstsiteind(ψ, i) for i in s]) + return sort([ITensorMPS.findfirstsiteind(ψ, i) for i in s]) end ITensorMPS.findsites(ψ::InfiniteCanonicalMPS, T::ITensor) = findsites(ψ.AL, T) @@ -230,7 +230,7 @@ function ITensorMPS.findfirstsiteind(h::ITensor, i::Index, ncell::Int64) end function ITensorMPS.findsites(h::ITensor; ncell::Int64=1) s = filterinds(h; plev=0) - return sort([ITensors.findfirstsiteind(h, i, ncell) for i in s]) + return sort([ITensorMPS.findfirstsiteind(h, i, ncell) for i in s]) end ## HDF5 support for the InfiniteCanonicalMPS type diff --git a/src/models/models.jl b/src/models/models.jl index 1cdfcc2..2a85796 100644 --- a/src/models/models.jl +++ b/src/models/models.jl @@ -32,8 +32,8 @@ function InfiniteSum{ITensor}(model::Model, s::CelledVector; kwargs...) end # Get the first site with nontrivial support of the OpSum -first_site(opsum::OpSum) = minimum(ITensorMPS.sites(opsum)) -last_site(opsum::OpSum) = maximum(ITensorMPS.sites(opsum)) +first_site(opsum::OpSum) = minimum(ITensors.sites(opsum)) +last_site(opsum::OpSum) = maximum(ITensors.sites(opsum)) function set_site(o::Op, s::Int) return Op(ITensorMPS.which_op(o), s; ITensorMPS.params(o)...) @@ -66,7 +66,7 @@ function InfiniteSum{MPO}(opsum::OpSum, s::CelledVector) nrange = 0 # Maximum operator support opsums = [OpSum() for _ in 1:n] for o in ITensorMPS.terms(opsum) - js = sort(ITensorMPS.sites(o)) + js = sort(ITensors.sites(o)) j1 = first(js) nrange = max(nrange, last(js) - j1 + 1) opsums[j1] += o @@ -243,7 +243,7 @@ function infinite_terms(opsum::OpSum; kwargs...) # contains the terms with support starting on that # site of the unit cell, i.e. `opsum_cell[i]` # stores all terms starting on site `i`. - opsum_cell_dict = groupreduce(minimum ∘ ITensorMPS.sites, +, opsum) + opsum_cell_dict = groupreduce(minimum ∘ ITensors.sites, +, opsum) nsites = maximum(keys(opsum_cell_dict)) # check that we don't have terms we will ignore dropped = filter(x -> x <= 0, keys(opsum_cell_dict)) @@ -299,7 +299,7 @@ function finite_terms(model::Model, n::Int; kwargs...) _finite_terms = OpSum[] for j in 1:n term_j = _infite_terms[j] - filtered_term_j = filter_terms(s -> all(≤(n), s), term_j; by=ITensorMPS.sites) + filtered_term_j = filter_terms(s -> all(≤(n), s), term_j; by=ITensors.sites) push!(_finite_terms, filtered_term_j) end return _finite_terms