Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions src/TCIAlgorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions src/itensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}(
Expand Down Expand Up @@ -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}()
Expand All @@ -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)
Expand All @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions src/projtensortrain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/itensor_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Quantics
import TCIAlgorithms: Projector, project, ProjTensorTrain, LazyMatrixMul, makeprojectable

using ITensors
using ITensorMPS

@testset "itensor" begin
@testset "ProjMPS" begin
Expand Down