Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlevy committed Oct 19, 2023
1 parent 742498c commit 2dd83f8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/base/test_decomp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,20 @@ end
@test blockdim(u, b) == blockdim(i, b) || blockdim(u, b) >= min_blockdim
end
end

@testset "factorize with mindim" begin
l = Index(8, "l")
s1 = Index(2, "s1")
s2 = Index(2, "s2")
r = Index(2, "r")

phi = randomITensor(l, s1, s2, r)

U, B = factorize(phi, (l, s1); ortho="left", mindim=8, which_decomp="eigen")

@test norm(U * B - phi) < 1E-5
@test dim(commonind(U, B)) <= 4
end
end

nothing

0 comments on commit 2dd83f8

Please sign in to comment.