From 1e07b3cb267d5dc097a1a92d246bb75a6d06694c Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Thu, 16 May 2024 22:28:11 -0400 Subject: [PATCH] Use `random_mps` (#11) --- Project.toml | 2 +- README.md | 2 +- examples/Project.toml | 4 ++++ examples/hubbard_1d_spin_conservation.jl | 2 +- examples/hubbard_2d_spin_conservation.jl | 2 +- examples/spinless_fermion.jl | 2 +- test/Project.toml | 4 ++++ test/electron.jl | 4 ++-- 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index f7dd129..9dbfef3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ITensorGaussianMPS" uuid = "2be41995-7c9f-4653-b682-bfa4e7cebb93" authors = ["Matthew Fishman and contributors"] -version = "0.1.9" +version = "0.1.10" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" diff --git a/README.md b/README.md index 17588e2..8582026 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ println("\nFree fermion starting energy") @show inner(ψ0, H, ψ0) # Random starting state -ψr = randomMPS(s, n -> n ≤ Nf ? "1" : "0") +ψr = random_mps(s, n -> n ≤ Nf ? "1" : "0") println("\nRandom state starting energy") @show inner(ψr, H, ψr) diff --git a/examples/Project.toml b/examples/Project.toml index 5f87a9b..d03d029 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -2,3 +2,7 @@ ITensorGaussianMPS = "2be41995-7c9f-4653-b682-bfa4e7cebb93" ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" + +[compat] +ITensorMPS = "0.2.2" +ITensors = "0.6.7" diff --git a/examples/hubbard_1d_spin_conservation.jl b/examples/hubbard_1d_spin_conservation.jl index f7df6e5..82a9327 100644 --- a/examples/hubbard_1d_spin_conservation.jl +++ b/examples/hubbard_1d_spin_conservation.jl @@ -87,7 +87,7 @@ H = MPO(os_interacting, s) #@show norm(prod(H) - prod(H_noninteracting)) # Random starting state -ψr = randomMPS(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") +ψr = random_mps(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") println("Random starting state energy") @show flux(ψr) diff --git a/examples/hubbard_2d_spin_conservation.jl b/examples/hubbard_2d_spin_conservation.jl index 23d316c..809611b 100644 --- a/examples/hubbard_2d_spin_conservation.jl +++ b/examples/hubbard_2d_spin_conservation.jl @@ -82,7 +82,7 @@ end H = MPO(os, s) # Random starting state -ψr = randomMPS(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") +ψr = random_mps(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") println("\nRandom starting state energy") @show flux(ψr) diff --git a/examples/spinless_fermion.jl b/examples/spinless_fermion.jl index 6f80608..0055873 100644 --- a/examples/spinless_fermion.jl +++ b/examples/spinless_fermion.jl @@ -53,7 +53,7 @@ end H = MPO(os, s) # Random starting state -ψr = randomMPS(s, n -> n ≤ Nf ? "1" : "0") +ψr = random_mps(s, n -> n ≤ Nf ? "1" : "0") println("\nRandom state starting energy") @show flux(ψr) diff --git a/test/Project.toml b/test/Project.toml index 73d5956..e829e75 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -3,3 +3,7 @@ ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2" ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +ITensorMPS = "0.2.2" +ITensors = "0.6.7" diff --git a/test/electron.jl b/test/electron.jl index 03f19b9..b35bc7e 100644 --- a/test/electron.jl +++ b/test/electron.jl @@ -106,7 +106,7 @@ end H = MPO(os_interacting, s) # Random starting state - ψr = randomMPS(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") + ψr = random_mps(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") @test flux(ψr) == QN(("Nf", Nf, -1), ("Sz", 0)) @test flux(ψ0) == QN(("Nf", Nf, -1), ("Sz", 0)) @@ -255,7 +255,7 @@ end H = MPO(os_interacting, s) # Random starting state - ψr = randomMPS(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") + ψr = random_mps(s, n -> n ≤ Nf ? (isodd(n) ? "↑" : "↓") : "0") @show flux(ψr), flux(ψ0) #@test flux(ψr) == QN(("Nf", Nf, -1), ("Sz", 0)) #@test flux(ψ0) == QN(("Nf", Nf, -1), ("Sz", 0))