Skip to content

Commit dd33988

Browse files
add tests for make_time_mpo with non-square FiniteMPOHamiltonians
1 parent bc37174 commit dd33988

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/algorithms.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,4 +799,29 @@ end
799799
end
800800
end
801801
end
802+
803+
@testset "TaylorCluster for non-square Hamiltonians" begin
804+
# Make a MPOHamiltonian with very non-square Tensors
805+
# Make different orders and kinds of TaylorCluster time-evolution MPOs
806+
# Check the virtual dimensions match up between the MPOs
807+
808+
chain = fill(ℂ^2, 8)
809+
O = randn(ComplexF64, ℂ^2 ← ℂ^2)
810+
811+
ops1 = fill((1, 2) => O ⊗ O, 5)
812+
ops2 = [(2, 3) => O ⊗ O ⊗ O for i in 2:(length(chain) - 1)]
813+
ops3 = [(3, 5) => O ⊗ O ⊗ O for i in 3:(length(chain) - 2)]
814+
815+
H = FiniteMPOHamiltonian(chain, ops1..., ops2..., ops3...)
816+
817+
for N in 1:3
818+
for configuration in ((false, false), (false, true), (true, false), (true, true))
819+
O = make_time_mpo(H, 0.1, TaylorCluster(N, configuration...))
820+
for i in 1:(length(chain) - 1)
821+
@test right_virtualspace(O, i) == left_virtualspace(O, i + 1)
822+
end
823+
end
824+
end
825+
end
826+
802827
end

0 commit comments

Comments
 (0)