Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Fix truncate! when maxdim is bigger than the size of the index
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Mar 14, 2024
1 parent b505360 commit 00d18cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Ansatz/Chain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00d18cd

Please sign in to comment.