Skip to content

Commit 33c38cf

Browse files
CompatHelper: bump compat for ITensors to 0.7, (keep existing compat) (#93)
1 parent fc1078a commit 33c38cf

14 files changed

+54
-53
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ SplitApplyCombine = "03a91e81-4c3e-53e1-a0a4-9c0c8f19dd66"
1919
[compat]
2020
Compat = "3, 4"
2121
HDF5 = "0.15, 0.16, 0.17"
22-
ITensorMPS = "0.2.2"
23-
ITensors = "0.6.8"
22+
ITensorMPS = "0.3"
23+
ITensors = "0.7"
2424
Infinities = "0.1"
2525
IterTools = "1"
2626
KrylovKit = "0.5, 0.6, 0.7, 0.8"

examples/development/vumps/transfer_matrix_spectrum_arpack.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function energy_local(ψ1, ψ2, h)
7575
return (noprime* h) * dag(ϕ))[]
7676
end
7777

78-
function ITensors.expect(ψ, o)
78+
function ITensorMPS.expect(ψ, o)
7979
return (noprime* op(o, filterinds(ψ, "Site")...)) * dag(ψ))[]
8080
end
8181

examples/vumps/transfer_matrix_spectrum.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function energy_local(ψ1, ψ2, h)
7676
return inner(ϕ, apply(h, ϕ))
7777
end
7878

79-
function ITensors.expect::ITensor, o::String)
79+
function ITensorMPS.expect::ITensor, o::String)
8080
return inner(ψ, apply(op(o, filterinds(ψ, "Site")...), ψ))
8181
end
8282

examples/vumps/vumps_heisenberg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ energy_finite_total, ψfinite = dmrg(Hfinite, ψfinite; nsweeps, maxdim, cutoff)
7979

8080
energy_exact_finite = reference(model, Observable("energy"); N=Nfinite)
8181

82-
function ITensors.expect::ITensor, o::String)
82+
function ITensorMPS.expect::ITensor, o::String)
8383
return inner(ψ, apply(op(o, filterinds(ψ, "Site")...), ψ))
8484
end
8585

examples/vumps/vumps_hubbard_extended.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ bsfinite = [(nfinite, nfinite + 1), (nfinite + 1, nfinite + 2)]
114114
hfinite(b) = ITensor(model, [sfinite[b[1]], sfinite[b[2]]]; model_params...)
115115
energy_finite = map(b -> expect_two_site(ψfinite, hfinite(b), b), bsfinite)
116116

117-
Nup_finite = ITensors.expect(ψfinite, "Nup")[nfinite:(nfinite + 1)]
118-
Ndn_finite = ITensors.expect(ψfinite, "Ndn")[nfinite:(nfinite + 1)]
119-
Sz_finite = ITensors.expect(ψfinite, "Sz")[nfinite:(nfinite + 1)]
117+
Nup_finite = ITensorMPS.expect(ψfinite, "Nup")[nfinite:(nfinite + 1)]
118+
Ndn_finite = ITensorMPS.expect(ψfinite, "Ndn")[nfinite:(nfinite + 1)]
119+
Sz_finite = ITensorMPS.expect(ψfinite, "Sz")[nfinite:(nfinite + 1)]
120120

121121
energy_exact = reference(model, Observable("energy"); U=model_params.U / model_params.t)
122122

examples/vumps/vumps_ising.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ end
7777

7878
energy_local(ψ1, ψ2, h::MPO) = energy_local(ψ1, ψ2, prod(h))
7979

80-
function ITensors.expect(ψ, o)
80+
function ITensorMPS.expect(ψ, o)
8181
return (noprime* op(o, filterinds(ψ, "Site")...)) * dag(ψ))[]
8282
end
8383

src/ITensorInfiniteMPS.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ using KrylovKit: eigsolve, linsolve, exponentiate
2323

2424
import Base: getindex, length, setindex!, +, -, *
2525

26-
import ITensors: AbstractMPS,
26+
using ITensorMPS: AbstractMPS
27+
import ITensors:
2728

2829
include("ITensors.jl")
2930
include("ITensorNetworks.jl")

src/ITensorNetworks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ end
8282

8383
ITensors.inds(tn::ITensorNetwork, ij::Pair{<:Integer,<:Integer}) = inds(tn)[ij]
8484

85-
function ITensors.linkinds(tn::ITensorNetwork, ij::Pair{<:Integer,<:Integer})
85+
function ITensorMPS.linkinds(tn::ITensorNetwork, ij::Pair{<:Integer,<:Integer})
8686
i, j = ij
8787
@assert i j
8888
return inds(tn, ij)

src/abstractinfinitemps.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,26 +186,26 @@ function ITensors.dag(ψ::AbstractInfiniteMPS)
186186
return typeof(ψ)(ψdag, translator(ψ); reverse=ψ.reverse)
187187
end
188188

189-
ITensors.linkinds::AbstractInfiniteMPS, n1n2) = linkinds(ψ, Pair(n1n2...))
189+
ITensorMPS.linkinds::AbstractInfiniteMPS, n1n2) = linkinds(ψ, Pair(n1n2...))
190190

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

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

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

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

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

@@ -216,9 +216,9 @@ function siterange(ψ::AbstractInfiniteMPS, c::Cell)
216216
return start:stop
217217
end
218218

219-
ITensors.siteinds::AbstractInfiniteMPS, c::Cell) = siteinds(ψ, siterange(ψ, c))
219+
ITensorMPS.siteinds::AbstractInfiniteMPS, c::Cell) = siteinds(ψ, siterange(ψ, c))
220220

221-
function ITensors.siteinds::AbstractInfiniteMPS)
221+
function ITensorMPS.siteinds::AbstractInfiniteMPS)
222222
return CelledVector(siteinds(ψ, Cell(1)), translator(ψ))
223223
end
224224
infsiteinds::AbstractInfiniteMPS) = siteinds(ψ)
@@ -238,12 +238,12 @@ end
238238

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

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

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

src/infinitecanonicalmps.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ function infsiteinds(
166166
return infsiteinds(s, translator)
167167
end
168168

169-
function ITensors.linkinds::InfiniteMPS)
169+
function ITensorMPS.linkinds::InfiniteMPS)
170170
N = nsites(ψ)
171171
return CelledVector([linkinds(ψ, (n, n + 1)) for n in 1:N], translator(ψ))
172172
end
@@ -266,14 +266,14 @@ function finite_mps(ψ::InfiniteCanonicalMPS, range::AbstractRange)
266266
set_ortho_lims!(ψ_finite, (N + 1):(N + 1))
267267
return ψ_finite
268268
end
269-
function ITensors.expect::InfiniteCanonicalMPS, o::String, n::Int)
269+
function ITensorMPS.expect::InfiniteCanonicalMPS, o::String, n::Int)
270270
s = siteinds(only, ψ.AL)
271271
O = op(o, s[n])
272272
ϕ = ψ.AL[n] * ψ.C[n]
273273
return inner(ϕ, apply(O, ϕ))
274274
end
275275

276-
function ITensors.expect::InfiniteCanonicalMPS, h::MPO)
276+
function ITensorMPS.expect::InfiniteCanonicalMPS, h::MPO)
277277
l = linkinds(ITensorInfiniteMPS.only, ψ.AL)
278278
r = linkinds(ITensorInfiniteMPS.only, ψ.AR)
279279
s = siteinds(ITensorInfiniteMPS.only, ψ)
@@ -298,6 +298,6 @@ function ITensors.expect(ψ::InfiniteCanonicalMPS, h::MPO)
298298
return temp_O[]
299299
end
300300

301-
function ITensors.expect::InfiniteCanonicalMPS, h::InfiniteSum)
301+
function ITensorMPS.expect::InfiniteCanonicalMPS, h::InfiniteSum)
302302
return [expect(ψ, h[j]) for j in 1:nsites(ψ)]
303303
end

0 commit comments

Comments
 (0)