Skip to content

Commit

Permalink
Add test_throws for empty emtpy case
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed May 16, 2024
1 parent 72941b5 commit f35d67c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/base/test_itensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,7 @@ end
B = randomITensor(i1, i2, k)
C = randomITensor(i1, i2, l)
D = ITensor(i1, i2, k)
F = ITensor(i1, i2, j)

S, s = directsum(A => index_op(j), B => index_op(k))
@test dim(s) == dim(j) + dim(k)
Expand All @@ -1819,6 +1820,8 @@ end
@test dim(s) == dim(j) + dim(k)
@test hassameinds(S, (i1, i2, s))

@test_throws ErrorException (F => index_op(j)) (D => index_op(k))

S, s = (D => index_op(k)) (A => index_op(j))
@test dim(s) == dim(j) + dim(k)
@test hassameinds(S, (i1, i2, s))
Expand Down

0 comments on commit f35d67c

Please sign in to comment.