Skip to content

Commit 6920494

Browse files
committed
Add JordanMPOTensor space checks
1 parent 9b322fd commit 6920494

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/operators/jordanmpotensor.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ struct JordanMPOTensor{E,S,
5555
TB,
5656
TC,
5757
TD}
58-
# TODO: add space and size checks
5958
return new{E,S,TA,TB,TC,TD}(V, A, B, C, D)
6059
end
6160
end
@@ -74,16 +73,16 @@ function JordanMPOTensor(V::TensorMapSumSpace{S,2,2},
7473
D::SparseBlockTensorMap{TD,E,S,1,1}) where {E,S,TA,TB,TC,TD}
7574
allVs = eachspace(V)
7675
VA = space(allVs[2:(end - 1), 1, 1, 2:(end - 1)])
77-
VA == space(A) || throw(SpaceMismatch())
76+
VA == space(A) || throw(SpaceMismatch("A-block has incompatible spaces"))
7877

7978
VB = removeunit(space(allVs[2:(end - 1), 1, 1, end]), 4)
80-
VB == space(B) || throw(SpaceMismatch())
79+
VB == space(B) || throw(SpaceMismatch("B-block has incompatible spaces"))
8180

8281
VC = removeunit(space(allVs[1, 1, 1, 2:(end - 1)]), 1)
83-
VC == space(C) || throw(SpaceMismatch())
82+
VC == space(C) || throw(SpaceMismatch("C-block has incompatible spaces"))
8483

8584
VD = removeunit(removeunit(space(allVs[1, 1, 1, end:end]), 4), 1)
86-
VD == space(D) || throw(SpaceMismatch())
85+
VD == space(D) || throw(SpaceMismatch("D-block has incompatible spaces"))
8786

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

0 commit comments

Comments
 (0)