Skip to content

Commit d2d761e

Browse files
committed
add tests
1 parent 498490a commit d2d761e

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

test/operators/mpo.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ end
8686

8787
@testset "InfiniteMPO" begin
8888
P =^2
89+
V =^2
8990
T = Float64
9091

91-
H1 = randn(T, P P)
92-
H1 += H1'
92+
H1 = randn(T, V P P V)
9393
H = InfiniteMPO([H1])
9494

9595
@test !isfinite(H)
@@ -98,6 +98,16 @@ end
9898
@test GeometryStyle(H) == InfiniteChainStyle()
9999
@test OperatorStyle(typeof(H)) == MPOStyle()
100100
@test OperatorStyle(H) == MPOStyle()
101+
102+
@test physicalspace(H, 1) == P
103+
@test left_virtualspace(H, 1) == V
104+
@test left_virtualspace(H, 4) == V
105+
@test right_virtualspace(H, 1) == V
106+
107+
multiH = MultilineMPO([H, H])
108+
@test physicalspace(multiH, 1, 1) == P
109+
@test left_virtualspace(multiH, 1, 1) == left_virtualspace(multiH, 2, 1) == V
110+
@test right_virtualspace(multiH, CartesianIndex(1, 2)) == V
101111
end
102112

103113
@testset "Adapt" for V in (ℂ^2, U1Space(-1 => 1, 0 => 1, 1 => 1))

0 commit comments

Comments
 (0)