Skip to content

Commit baf6ca5

Browse files
authored
Merge pull request #33 from tensor4all/32-bug-in-ci-canonicalization-with-compression
Fix a bug in makecanonical with compression
2 parents 97d1248 + a1cd88f commit baf6ca5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tensorci2.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ function makecanonical!(
431431
abstol::Float64=0.0,
432432
maxbonddim::Int=typemax(Int)
433433
) where {F,ValueType}
434-
sweep1site!(tci, f, :forward; reltol, abstol, maxbonddim, updatetensors=false)
434+
# The first half-sweep is performed exactly without compression.
435+
sweep1site!(tci, f, :forward; reltol=0.0, abstol=0.0, maxbonddim=typemax(Int), updatetensors=false)
435436
sweep1site!(tci, f, :backward; reltol, abstol, maxbonddim, updatetensors=false)
436437
sweep1site!(tci, f, :forward; reltol, abstol, maxbonddim, updatetensors=true)
437438
end

0 commit comments

Comments
 (0)