From 00d18cde183c6e553f20128f225dc24cbd784bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez=20Ram=C3=ADrez?= Date: Thu, 14 Mar 2024 18:20:14 +0100 Subject: [PATCH] Fix `truncate!` when `maxdim` is bigger than the size of the index --- src/Ansatz/Chain.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ansatz/Chain.jl b/src/Ansatz/Chain.jl index 1a48e36..eab4d42 100644 --- a/src/Ansatz/Chain.jl +++ b/src/Ansatz/Chain.jl @@ -319,7 +319,7 @@ function truncate!(qtn::Chain, bond; threshold::Union{Nothing,Real} = nothing, m spectrum = parent(tensor) extent = if !isnothing(maxdim) - 1:maxdim + 1:min(size(TensorNetwork(qtn), vind), maxdim) elseif !isnothing(threshold) findall(>(threshold) ∘ abs, spectrum) else