From 2dd83f82d3095c2544f8a6b354d828a92a176e51 Mon Sep 17 00:00:00 2001 From: Ryan Levy Date: Thu, 19 Oct 2023 14:23:23 -0400 Subject: [PATCH] Add test --- test/base/test_decomp.jl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/base/test_decomp.jl b/test/base/test_decomp.jl index 68601f35a1..1de45f80f3 100644 --- a/test/base/test_decomp.jl +++ b/test/base/test_decomp.jl @@ -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