Skip to content

Commit 1b0de08

Browse files
authored
Merge pull request #2 from tensor4all/1-implantation-of-strictlynested-=-false-is-something-wrong
strictlynested=false: Back up Iset and Jset before each half sweep an…
2 parents 478a940 + b1eb6a7 commit 1b0de08

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/tensorci2.jl

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -784,20 +784,18 @@ function sweep2site!(
784784

785785
n = length(tci)
786786

787-
extraIset = [MultiIndex[] for _ in 1:n]
788-
extraJset = [MultiIndex[] for _ in 1:n]
789-
if !strictlynested
790-
extraIset = tci.Iset
791-
extraJset = tci.Jset
792-
if length(tci.Iset_history) > 0
793-
extraIset = union.(extraIset, tci.Iset_history[end])
794-
extraJset = union.(extraJset, tci.Jset_history[end])
787+
for iter in iter1:iter1+niter-1
788+
789+
extraIset = [MultiIndex[] for _ in 1:n]
790+
extraJset = [MultiIndex[] for _ in 1:n]
791+
if !strictlynested && length(tci.Iset_history) > 0
792+
extraIset = tci.Iset_history[end]
793+
extraJset = tci.Jset_history[end]
795794
end
796-
end
795+
796+
push!(tci.Iset_history, deepcopy(tci.Iset))
797+
push!(tci.Jset_history, deepcopy(tci.Jset))
797798

798-
push!(tci.Iset_history, deepcopy(tci.Iset))
799-
push!(tci.Jset_history, deepcopy(tci.Jset))
800-
for iter in iter1:iter1+niter-1
801799
flushpivoterror!(tci)
802800
if forwardsweep(sweepstrategy, iter) # forward sweep
803801
for bondindex in 1:n-1

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ include("test_tensortrain.jl")
1919
include("test_conversion.jl")
2020
include("test_contraction.jl")
2121
include("test_integration.jl")
22-
include("test_globalsearch.jl")
22+
include("test_globalsearch.jl")

0 commit comments

Comments
 (0)