diff --git a/Project.toml b/Project.toml index cb96d7e..f76b384 100644 --- a/Project.toml +++ b/Project.toml @@ -7,6 +7,7 @@ version = "0.4.7" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949" FastMPOContractions = "f6e391d2-8ffa-4d7a-98cd-7e70024481ca" +ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" @@ -19,13 +20,14 @@ Aqua = "0.8.9" EllipsisNotation = "1" FastMPOContractions = "0.2.2" HubbardAtoms = "0.1.0" -ITensors = "0.6" +ITensorMPS = "0.3.2" +ITensors = "0.7" JET = "0.9.12" OrderedCollections = "1" -Quantics = "0.3" +Quantics = "0.4" QuanticsGrids = "0.3.2" SparseIR = "1.0.19" -TCIITensorConversion = "0.1" +TCIITensorConversion = "0.2" TensorCrossInterpolation = "0.9.7" julia = "1.10" diff --git a/src/TCIAlgorithms.jl b/src/TCIAlgorithms.jl index 66889b9..fa9fbd1 100644 --- a/src/TCIAlgorithms.jl +++ b/src/TCIAlgorithms.jl @@ -6,6 +6,8 @@ import TensorCrossInterpolation: using TCIITensorConversion using ITensors +using ITensorMPS: ITensorMPS +using ITensorMPS: MPO, MPS, linkdims, linkinds using Quantics using OrderedCollections: OrderedDict, OrderedSet diff --git a/src/itensor.jl b/src/itensor.jl index 86e2742..9bcd49c 100644 --- a/src/itensor.jl +++ b/src/itensor.jl @@ -41,7 +41,7 @@ function ProjMPSContainer(::Type{T}, projttcont::ProjTTContainer{T}, sites) wher end # Conversion Functions -ITensors.MPS(projΨ::ProjMPS) = projΨ.data +ITensorMPS.MPS(projΨ::ProjMPS) = projΨ.data function ProjTensorTrain{T}(projΨ::ProjMPS) where {T} return ProjTensorTrain{T}( @@ -211,7 +211,7 @@ end # Quantics Functions function Quantics.makesitediagonal(projmps::ProjMPS, site::Index) mps_diagonal = Quantics.makesitediagonal(MPS(projmps), site) - sites_diagonal = siteinds(all, mps_diagonal) + sites_diagonal = ITensors.SiteTypes.siteinds(all, mps_diagonal) projmps_diagonal = ProjMPS(mps_diagonal, sites_diagonal) prjsiteinds = Dict{Index{Int},Int}() @@ -230,10 +230,12 @@ end function Quantics.makesitediagonal(projmps::ProjMPS, tag::String) mps_diagonal = Quantics.makesitediagonal(MPS(projmps), tag) - sites_diagonal = siteinds(all, mps_diagonal) + sites_diagonal = ITensors.SiteTypes.siteinds(all, mps_diagonal) projmps_diagonal = ProjMPS(mps_diagonal, sites_diagonal) - target_positions = Quantics.findallsiteinds_by_tag(siteinds(MPS(projmps)); tag=tag) + target_positions = Quantics.findallsiteinds_by_tag( + ITensors.SiteTypes.siteinds(MPS(projmps)); tag=tag + ) prjsiteinds = Dict{Index{Int},Int}() for (p, s) in zip(projmps.projector, projmps.sites) for (p_, s_) in zip(p, s) @@ -256,7 +258,7 @@ end function Quantics.extractdiagonal(projmps::ProjMPS, tag::String) mps_diagonal = Quantics.extractdiagonal(MPS(projmps), tag) - sites_diagonal = siteinds(all, mps_diagonal) + sites_diagonal = ITensors.SiteTypes.siteinds(all, mps_diagonal) projmps_diagonal = ProjMPS(mps_diagonal, sites_diagonal) sites_diagonal_set = Set(Iterators.flatten(sites_diagonal)) diff --git a/src/projtensortrain.jl b/src/projtensortrain.jl index 63f977a..5134608 100644 --- a/src/projtensortrain.jl +++ b/src/projtensortrain.jl @@ -245,9 +245,9 @@ function add( # HS: TCI.add does not use a relative tolerance. # For the moment, we need to use ITensors.add instead a_MPS = MPS(a.data) - b_MPS = MPS(b.data; sites=siteinds(a_MPS)) + b_MPS = MPS(b.data; sites=ITensors.SiteTypes.siteinds(a_MPS)) ab_MPS = +(a_MPS, b_MPS; alg="directsum") - truncate!(ab_MPS; maxdim=maxbonddim, cutoff=tolerance^2) + ITensors.truncate!(ab_MPS; maxdim=maxbonddim, cutoff=tolerance^2) ab = reshape(ProjTensorTrain(TensorTrain{T,3}(MPO([x for x in ab_MPS]))), a.sitedims) return project(ab, a.projector | b.projector) end diff --git a/test/itensor_tests.jl b/test/itensor_tests.jl index 88c14aa..9dc2901 100644 --- a/test/itensor_tests.jl +++ b/test/itensor_tests.jl @@ -6,6 +6,7 @@ using Quantics import TCIAlgorithms: Projector, project, ProjTensorTrain, LazyMatrixMul, makeprojectable using ITensors +using ITensorMPS @testset "itensor" begin @testset "ProjMPS" begin