Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Apr 2, 2024
1 parent 7752f1e commit 0168c19
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/contraction_sequence/contraction_sequence.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using NamedGraphs
using ITensors
using ITensorNetworks
using ITensorNetworks: randomITensorNetwork
using Random

Random.seed!(1234)
Expand Down
2 changes: 1 addition & 1 deletion examples/treetensornetworks/comb_tree.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using NamedGraphs
using ITensors
using ITensorNetworks
using ITensorNetworks: TTN
using ITensorUnicodePlots

g = named_comb_tree((5, 2))
Expand Down
4 changes: 4 additions & 0 deletions test/test_treetensornetworks/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7"
NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19"
12 changes: 7 additions & 5 deletions test/test_treetensornetworks/test_expect.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
10 changes: 6 additions & 4 deletions test/test_treetensornetworks/test_position.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -44,4 +46,4 @@ using Test
ITensors.disable_auto_fermion()
end
end
nothing
end

0 comments on commit 0168c19

Please sign in to comment.