Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
annamariadziubyna committed Jun 21, 2021
1 parent df034a9 commit bc334d9
Showing 1 changed file with 26 additions and 32 deletions.
58 changes: 26 additions & 32 deletions test/network_interface.jl
@@ -1,40 +1,34 @@
@testset "fuse_projectors correctly fuses projectors - 2x2 matrix." begin
projectors = ([1 1; 0 1], [1 0; 1 1])
expected_fused = [1 0; 0 1]
expected_transitions = [[1 1; 0 1], [1 0; 1 1]]
fused, transitions = fuse_projectors(projectors)
@test expected_fused == fused
@test expected_transitions == values(transitions)
end
@testset "fuse_projectors correctly fuses projectors." begin
projectors1 = ([1 1; 0 1], [1 0; 1 1])
expected_fused1 = [1 0; 0 1]
expected_transitions1 = [[1 1; 0 1], [1 0; 1 1]]
fused1, transitions1 = fuse_projectors(projectors1)
@test expected_fused1 == fused1
@test expected_transitions1 == values(transitions1)

@testset "fuse_projectors correctly fuses projectors - another 2x2 matrix." begin
projectors = ([1 1; 0 0], [1 0; 0 1])
expected_fused = [1 0; 0 1]
expected_transitions = [[1 1; 0 0], [1 0; 0 1]]
fused, transitions = fuse_projectors(projectors)
@test expected_fused == fused
@test expected_transitions == values(transitions)
end
projectors2 = ([1 1; 0 0], [1 0; 0 1])
expected_fused2 = [1 0; 0 1]
expected_transitions2 = [[1 1; 0 0], [1 0; 0 1]]
fused2, transitions2 = fuse_projectors(projectors2)
@test expected_fused2 == fused2
@test expected_transitions2 == values(transitions2)

@testset "fuse_projectors correctly fuses projectors - 3x3 matrix." begin
projectors = ([1 1 1; 0 0 0; 1 1 1], [1 0 0; 0 1 0; 0 0 1])
expected_fused = [1 0 0; 0 1 0; 0 0 1]
expected_transitions = [[1 1 1; 0 0 0; 1 1 1], [1 0 0; 0 1 0; 0 0 1]]
fused, transitions = fuse_projectors(projectors)
@test expected_fused == fused
@test expected_transitions == values(transitions)
end
projectors3 = ([1 1 1; 0 0 0; 1 1 1], [1 0 0; 0 1 0; 0 0 1])
expected_fused3 = [1 0 0; 0 1 0; 0 0 1]
expected_transitions3 = [[1 1 1; 0 0 0; 1 1 1], [1 0 0; 0 1 0; 0 0 1]]
fused3, transitions3 = fuse_projectors(projectors3)
@test expected_fused3 == fused3
@test expected_transitions3 == values(transitions3)

@testset "fuse_projectors correctly fuses projectors - another 3x3 matrix." begin
projectors = ([1 1 1; 0 0 0; 1 1 0], [1 0 1; 0 1 0; 0 0 1])
expected_fused = [1 0 0; 0 1 0; 0 0 1]
expected_transitions = [[1 1 1; 0 0 0; 1 1 0], [1 0 1; 0 1 0; 0 0 1]]
fused, transitions = fuse_projectors(projectors)
@test expected_fused == fused
@test expected_transitions == values(transitions)
projectors4 = ([1 1 1; 0 0 0; 1 1 0], [1 0 1; 0 1 0; 0 0 1])
expected_fused4 = [1 0 0; 0 1 0; 0 0 1]
expected_transitions4 = [[1 1 1; 0 0 0; 1 1 0], [1 0 1; 0 1 0; 0 0 1]]
fused4, transitions4 = fuse_projectors(projectors4)
@test expected_fused4 == fused4
@test expected_transitions4 == values(transitions4)
end

@testset "build_tensor_with_fusing correctly builds tensors with fusing" begin
@testset "build_tensor_with_fusing correctly builds tensors with fusing." begin
# Model's parameters
J12 = -1.0
h1 = 0.5
Expand Down

0 comments on commit bc334d9

Please sign in to comment.