Skip to content

Commit ad84949

Browse files
committed
Add error messages
1 parent 622f4cb commit ad84949

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/operators/jordanmpotensor.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ function JordanMPOTensor(
7272
) where {E, S, TA, TB, TC, TD}
7373
allVs = eachspace(V)
7474
VA = space(allVs[2:(end - 1), 1, 1, 2:(end - 1)])
75-
VA == space(A) || throw(SpaceMismatch("A-block has incompatible spaces"))
75+
VA == space(A) || throw(SpaceMismatch(lazy"A-block has incompatible spaces:\n$VA\n$(space(A))"))
7676

7777
VB = removeunit(space(allVs[2:(end - 1), 1, 1, end]), 4)
78-
VB == space(B) || throw(SpaceMismatch("B-block has incompatible spaces"))
78+
VB == space(B) || throw(SpaceMismatch(lazy"B-block has incompatible spaces:\n$VB\n$(space(B))"))
7979

8080
VC = removeunit(space(allVs[1, 1, 1, 2:(end - 1)]), 1)
81-
VC == space(C) || throw(SpaceMismatch("C-block has incompatible spaces"))
81+
VC == space(C) || throw(SpaceMismatch(lazy"C-block has incompatible spaces:\n$VC\n$(space(C))"))
8282

8383
VD = removeunit(removeunit(space(allVs[1, 1, 1, end:end]), 4), 1)
84-
VD == space(D) || throw(SpaceMismatch("D-block has incompatible spaces"))
84+
VD == space(D) || throw(SpaceMismatch(lazy"D-block has incompatible spaces:\n$VD\n$(space(D))"))
8585

8686
return JordanMPOTensor{E, S, TA, TB, TC, TD}(V, A, B, C, D)
8787
end

0 commit comments

Comments
 (0)