Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Sep 10, 2024
1 parent c9c8a08 commit a487c9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/integration/ITensorNetworks_test.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testset "ITensorNetworks" begin
using ITensors: ITensors, ITensor, Index, array
using ITensorNetworks: ITensorNetwork
using ITensorNetworks: ITensorNetwork, vertices

i = Index(2, "i")
j = Index(3, "j")
Expand All @@ -19,7 +19,7 @@

itn = convert(ITensorNetwork, tn)
@test itn isa ITensorNetwork
@test issetequal(arrays(itn), array.([a, b, c]))
@test issetequal(map(v -> array(itn[v]), vertices(itn)), array.([a, b, c]))

# TODO test Quantum
end
5 changes: 4 additions & 1 deletion test/integration/ITensors_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
@test itensor isa ITensor
@test size(itensor) == (2, 3, 4)
@test array(itensor) == parent(tensor)
@test all(splat(==), zip(map(x -> replace(x, "\"" => ""), string.(tags.(ITensors.inds(itensor)))), ["i", "j", "k"]))
@test all(
splat(==),
zip(map(x -> replace(x, "\"" => ""), string.(ITensors.tags.(ITensors.inds(itensor)))), ["i", "j", "k"]),
)

tn = rand(TensorNetwork, 4, 3)
itensors = convert(Vector{ITensor}, tn)
Expand Down

0 comments on commit a487c9e

Please sign in to comment.