Skip to content

Commit 6dd5b51

Browse files
committed
Fix more namespace issues
1 parent 3345413 commit 6dd5b51

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/models/models.jl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ function InfiniteSum{ITensor}(model::Model, s::CelledVector; kwargs...)
3232
end
3333

3434
# Get the first site with nontrivial support of the OpSum
35-
first_site(opsum::OpSum) = minimum(ITensors.sites(opsum))
36-
last_site(opsum::OpSum) = maximum(ITensors.sites(opsum))
35+
first_site(opsum::OpSum) = minimum(ITensorMPS.sites(opsum))
36+
last_site(opsum::OpSum) = maximum(ITensorMPS.sites(opsum))
3737

3838
function set_site(o::Op, s::Int)
39-
return Op(ITensors.which_op(o), s; ITensors.params(o)...)
39+
return Op(ITensorMPS.which_op(o), s; ITensorMPS.params(o)...)
4040
end
4141

4242
function shift_site(o::Op, shift::Int)
43-
return set_site(o, ITensors.site(o) + shift)
43+
return set_site(o, ITensorMPS.site(o) + shift)
4444
end
4545

4646
function shift_sites(term::Scaled{C,Prod{Op}}, shift::Int) where {C}
47-
shifted_term = ITensors.coefficient(term)
48-
for o in ITensors.terms(term)
47+
shifted_term = ITensorMPS.coefficient(term)
48+
for o in ITensorMPS.terms(term)
4949
shifted_term *= shift_site(o, shift)
5050
end
5151
return shifted_term
@@ -55,7 +55,7 @@ end
5555
# By default, it shifts
5656
function shift_sites(opsum::OpSum, shift::Int)
5757
shifted_opsum = OpSum()
58-
for o in ITensors.terms(opsum)
58+
for o in ITensorMPS.terms(opsum)
5959
shifted_opsum += shift_sites(o, shift)
6060
end
6161
return shifted_opsum
@@ -65,8 +65,8 @@ function InfiniteSum{MPO}(opsum::OpSum, s::CelledVector)
6565
n = cell_length(s)
6666
nrange = 0 # Maximum operator support
6767
opsums = [OpSum() for _ in 1:n]
68-
for o in ITensors.terms(opsum)
69-
js = sort(ITensors.sites(o))
68+
for o in ITensorMPS.terms(opsum)
69+
js = sort(ITensorMPS.sites(o))
7070
j1 = first(js)
7171
nrange = max(nrange, last(js) - j1 + 1)
7272
opsums[j1] += o
@@ -222,7 +222,7 @@ function InfiniteBlockMPO(model::Model, s::CelledVector, translator::Function; k
222222
return mpos
223223
end
224224

225-
function ITensors.MPO(model::Model, s::Vector{<:Index}; kwargs...)
225+
function ITensorMPS.MPO(model::Model, s::Vector{<:Index}; kwargs...)
226226
opsum = opsum_finite(model, length(s); kwargs...)
227227
return splitblocks(linkinds, MPO(opsum, s))
228228
end
@@ -243,7 +243,7 @@ function infinite_terms(opsum::OpSum; kwargs...)
243243
# contains the terms with support starting on that
244244
# site of the unit cell, i.e. `opsum_cell[i]`
245245
# stores all terms starting on site `i`.
246-
opsum_cell_dict = groupreduce(minimum ITensors.sites, +, opsum)
246+
opsum_cell_dict = groupreduce(minimum ITensorMPS.sites, +, opsum)
247247
nsites = maximum(keys(opsum_cell_dict))
248248
# check that we don't have terms we will ignore
249249
dropped = filter(x -> x <= 0, keys(opsum_cell_dict))
@@ -286,7 +286,7 @@ end
286286

287287
function filter_terms(f, opsum::OpSum; by=identity)
288288
filtered_opsum = OpSum()
289-
for t in ITensors.terms(opsum)
289+
for t in ITensorMPS.terms(opsum)
290290
if f(by(t))
291291
filtered_opsum += t
292292
end
@@ -299,7 +299,7 @@ function finite_terms(model::Model, n::Int; kwargs...)
299299
_finite_terms = OpSum[]
300300
for j in 1:n
301301
term_j = _infite_terms[j]
302-
filtered_term_j = filter_terms(s -> all((n), s), term_j; by=ITensors.sites)
302+
filtered_term_j = filter_terms(s -> all((n), s), term_j; by=ITensorMPS.sites)
303303
push!(_finite_terms, filtered_term_j)
304304
end
305305
return _finite_terms

src/orthogonalize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function mixed_canonical(
113113
return InfiniteCanonicalMPS(ψᴸ, C, ψᴿ)
114114
end
115115

116-
ITensors.orthogonalize::InfiniteMPS, ::Colon; kwargs...) = mixed_canonical(ψ; kwargs...)
116+
ITensorMPS.orthogonalize::InfiniteMPS, ::Colon; kwargs...) = mixed_canonical(ψ; kwargs...)
117117

118118
#TODO put these functions somewhere else
119119
function ortho_overlap(AC, C)

0 commit comments

Comments
 (0)