From ecf76b88d57393472ad18d1a904e3a18ada3e589 Mon Sep 17 00:00:00 2001 From: mtfishman Date: Fri, 10 May 2024 15:27:00 -0400 Subject: [PATCH] Start using ITensorMPS.jl --- Project.toml | 4 +++- .../01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl | 3 ++- examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl | 3 ++- examples/03_partition_2d_heisenberg.jl | 3 ++- src/ITensorParallel.jl | 7 ++++--- test/Project.toml | 1 + 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 0373628..de26d93 100644 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,7 @@ Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" Folds = "41a02a25-b8f0-4f67-bc48-60067656b558" +ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" @@ -15,7 +16,8 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" Accessors = "0.1.26" Compat = "4.8" Folds = "0.2.8" -ITensors = "0.3.58" +ITensorMPS = "0.1" +ITensors = "0.3.58, 0.4, 0.5, 0.6" MPI = "0.20" julia = "1.6" diff --git a/examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl b/examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl index 6098f68..ddefc8e 100644 --- a/examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl +++ b/examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl @@ -4,8 +4,9 @@ rmprocs(setdiff(procs(), 1)) addprocs(2) @show nprocs() -@everywhere using ITensors +@everywhere using ITensorMPS @everywhere using ITensorParallel +@everywhere using ITensors using Random include(joinpath(pkgdir(ITensors), "examples", "src", "electronk.jl")) diff --git a/examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl b/examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl index 9fa3300..6468d18 100644 --- a/examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl +++ b/examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl @@ -1,7 +1,8 @@ using MPI MPI.Init() -using ITensors +using ITensorMPS using ITensorParallel +using ITensors using Random include(joinpath(pkgdir(ITensors), "examples", "src", "electronk.jl")) diff --git a/examples/03_partition_2d_heisenberg.jl b/examples/03_partition_2d_heisenberg.jl index df3f719..0c778d7 100644 --- a/examples/03_partition_2d_heisenberg.jl +++ b/examples/03_partition_2d_heisenberg.jl @@ -1,5 +1,6 @@ -using ITensors +using ITensorMPS using ITensorParallel +using ITensors function heisenberg_2d(nx, ny) lattice = square_lattice(nx, ny; yperiodic=false) diff --git a/src/ITensorParallel.jl b/src/ITensorParallel.jl index bad9968..ea008a0 100644 --- a/src/ITensorParallel.jl +++ b/src/ITensorParallel.jl @@ -4,16 +4,17 @@ using Accessors using Compat using Distributed using Folds -using MPI +using ITensorMPS using ITensors using ITensors.NDTensors +using MPI using ITensors: Algorithm, @Algorithm_str -using ITensors.ITensorMPS: AbstractSum +using ITensorMPS: AbstractSum import Base: eltype, length, size import ITensors: product -import ITensors.ITensorMPS: +import ITensorMPS: disk, linkind, lproj, diff --git a/test/Project.toml b/test/Project.toml index f645986..c9f946c 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -2,6 +2,7 @@ ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" +ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensorParallel = "0fccfcd2-f061-4985-9740-339d3f86bfce" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"