From 9fb4e040df91c31980e0cc831ec993429b00ce20 Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Fri, 17 May 2024 00:05:24 -0400 Subject: [PATCH] Use `random_mps` (#23) --- Project.toml | 2 +- examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl | 2 +- examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl | 2 +- examples/Project.toml | 4 ++++ test/Project.toml | 4 ++++ test/test_partition.jl | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 1f93bed..48bb136 100644 --- a/Project.toml +++ b/Project.toml @@ -16,7 +16,7 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" Accessors = "0.1.26" Compat = "4.8" Folds = "0.2.8" -ITensorMPS = "0.1.7" +ITensorMPS = "0.1.7, 0.2" 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 dd3682b..356d2b5 100644 --- a/examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl +++ b/examples/01_parallel_mpo_sum_2d_hubbard_conserve_momentum.jl @@ -98,7 +98,7 @@ function main(; # sequential vs. threaded. itensor_rng = Xoshiro() Random.seed!(itensor_rng, seed) - psi0 = randomMPS(itensor_rng, sites, state; linkdims=10) + psi0 = random_mps(itensor_rng, sites, state; linkdims=10) else psi0 = MPS(sites, state) end 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 26196db..8a6ae9f 100644 --- a/examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl +++ b/examples/02_mpi_mpo_sum_2d_hubbard_conserve_momentum.jl @@ -75,7 +75,7 @@ function main(; # sequential vs. threaded. itensor_rng = Xoshiro() Random.seed!(itensor_rng, seed) - psi0 = randomMPS(itensor_rng, sites, state; linkdims=10) + psi0 = random_mps(itensor_rng, sites, state; linkdims=10) else psi0 = MPS(sites, state) end diff --git a/examples/Project.toml b/examples/Project.toml index dd55b29..4cfc84f 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -6,3 +6,7 @@ ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Strided = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" + +[compat] +ITensorMPS = "0.2.2" +ITensors = "0.6.7" diff --git a/test/Project.toml b/test/Project.toml index def603b..7a8f424 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -10,3 +10,7 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Strided = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +ITensorMPS = "0.2.2" +ITensors = "0.6.7" diff --git a/test/test_partition.jl b/test/test_partition.jl index 7f9f17b..18e988c 100644 --- a/test/test_partition.jl +++ b/test/test_partition.jl @@ -25,7 +25,7 @@ using Test @test length(os_partition_manual) == length(os_partition_auto) s = siteinds("S=1/2", nx * ny) - ψ = randomMPS(s, j -> isodd(j) ? "↑" : "↓"; linkdims=10) + ψ = random_mps(s, j -> isodd(j) ? "↑" : "↓"; linkdims=10) H = MPO(os, s) @test maxlinkdim(H) == 3 * (ny + 1) - 1