From 0168c1923c382cd23250a65fc37038eb01b0016c Mon Sep 17 00:00:00 2001 From: mtfishman Date: Tue, 2 Apr 2024 18:29:38 -0400 Subject: [PATCH] More fixes --- .../contraction_sequence/contraction_sequence.jl | 2 +- examples/treetensornetworks/comb_tree.jl | 2 +- test/test_treetensornetworks/Project.toml | 4 ++++ test/test_treetensornetworks/test_expect.jl | 12 +++++++----- test/test_treetensornetworks/test_position.jl | 10 ++++++---- 5 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 test/test_treetensornetworks/Project.toml diff --git a/examples/contraction_sequence/contraction_sequence.jl b/examples/contraction_sequence/contraction_sequence.jl index 34eb097d..7f737df0 100644 --- a/examples/contraction_sequence/contraction_sequence.jl +++ b/examples/contraction_sequence/contraction_sequence.jl @@ -1,6 +1,6 @@ using NamedGraphs using ITensors -using ITensorNetworks +using ITensorNetworks: randomITensorNetwork using Random Random.seed!(1234) diff --git a/examples/treetensornetworks/comb_tree.jl b/examples/treetensornetworks/comb_tree.jl index 85d628e6..dbb0651f 100644 --- a/examples/treetensornetworks/comb_tree.jl +++ b/examples/treetensornetworks/comb_tree.jl @@ -1,6 +1,6 @@ using NamedGraphs using ITensors -using ITensorNetworks +using ITensorNetworks: TTN using ITensorUnicodePlots g = named_comb_tree((5, 2)) diff --git a/test/test_treetensornetworks/Project.toml b/test/test_treetensornetworks/Project.toml new file mode 100644 index 00000000..bc880f8b --- /dev/null +++ b/test/test_treetensornetworks/Project.toml @@ -0,0 +1,4 @@ +[deps] +Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" +ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7" +NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19" diff --git a/test/test_treetensornetworks/test_expect.jl b/test/test_treetensornetworks/test_expect.jl index 37dc9f7c..82db353a 100644 --- a/test/test_treetensornetworks/test_expect.jl +++ b/test/test_treetensornetworks/test_expect.jl @@ -1,6 +1,9 @@ -using ITensors -using ITensorNetworks -using Test +@eval module $(gensym()) +using Graphs: vertices +using ITensors.ITensorMPS: MPS +using ITensorNetworks: TTN, expect, random_mps, siteinds +using NamedGraphs: named_comb_tree +using Test: @test, @testset @testset "MPS expect comparison with ITensors" begin N = 25 @@ -28,5 +31,4 @@ end res = expect("Sz", state) @test all([isapprox(res[v], magnetization[v]; atol=1e-8) for v in vertices(s)]) end - -nothing +end diff --git a/test/test_treetensornetworks/test_position.jl b/test/test_treetensornetworks/test_position.jl index 9e8f96bb..f1c1e0a8 100644 --- a/test/test_treetensornetworks/test_position.jl +++ b/test/test_treetensornetworks/test_position.jl @@ -1,6 +1,8 @@ -using ITensors -using ITensorNetworks -using ITensorNetworks: position, environments +@eval module $(gensym()) +using Graphs: vertices +using ITensors: ITensors +using ITensorNetworks: ITensorNetworks, ProjTTN, TTN, environments, position, siteinds +using NamedGraphs: named_comb_tree using Test @testset "ProjTTN position" begin @@ -44,4 +46,4 @@ using Test ITensors.disable_auto_fermion() end end -nothing +end