@@ -42,18 +42,11 @@ function _su_bondx!(
4242) where {T<: Number ,S<: ElementarySpace }
4343 Nr, Nc = size (peps)
4444 @assert 1 <= row <= Nr && 1 <= col <= Nc
45- row2, col2 = row, _next (col, Nc)
46- T1, T2 = peps. vertices[row, col], peps. vertices[row2, col2]
45+ cp1 = _next (col, Nc)
4746 # absorb environment weights
48- for ax in (2 , 4 , 5 )
49- T1 = absorb_weight (T1, row, col, ax, peps. weights)
50- end
51- for ax in (2 , 3 , 4 )
52- T2 = absorb_weight (T2, row2, col2, ax, peps. weights)
53- end
54- # absorb bond weight
55- T1 = absorb_weight (T1, row, col, 3 , peps. weights; sqrtwt= true )
56- T2 = absorb_weight (T2, row2, col2, 5 , peps. weights; sqrtwt= true )
47+ T1, T2 = peps. vertices[row, col], peps. vertices[row, cp1]
48+ T1 = _absorb_weight (T1, row, col, " tbl" , peps. weights)
49+ T2 = _absorb_weight (T2, row, cp1, " trb" , peps. weights)
5750 #= QR and LQ decomposition
5851
5952 2 1 1 2
@@ -72,17 +65,18 @@ function _su_bondx!(
7265 bL, Y = rightorth (T2, ((5 , 1 ), (2 , 3 , 4 )); alg= LQpos ())
7366 #= apply gate
7467
75- -2 -3
68+ -2 -3
7669 ↑ ↑
7770 |----gate---|
7871 ↑ ↑
7972 1 2
8073 ↑ ↑
8174 -1← aR -← 3 -← bL ← -4
8275 =#
83- @tensor tmp[- 1 - 2 ; - 3 - 4 ] := gate[- 2 , - 3 , 1 , 2 ] * aR[- 1 , 1 , 3 ] * bL[3 , 2 , - 4 ]
84- # SVD
85- aR, s, bL, ϵ = tsvd! (tmp; trunc= truncation_scheme (alg, space (T1, 3 )))
76+ @tensor tmp[- 1 - 2 ; - 3 - 4 ] := gate[- 2 - 3 ; 1 2 ] * aR[- 1 1 3 ] * bL[3 2 - 4 ]
77+ aR, s, bL, ϵ = tsvd! (
78+ tmp; trunc= truncation_scheme (alg, space (T1, 3 )), alg= TensorKit. SVD ()
79+ )
8680 #=
8781 -2 -1 -1 -2
8882 | ↗ ↗ |
@@ -97,11 +91,11 @@ function _su_bondx!(
9791 T1 = absorb_weight (T1, row, col, ax, peps. weights; invwt= true )
9892 end
9993 for ax in (2 , 3 , 4 )
100- T2 = absorb_weight (T2, row2, col2 , ax, peps. weights; invwt= true )
94+ T2 = absorb_weight (T2, row, cp1 , ax, peps. weights; invwt= true )
10195 end
10296 # update tensor dict and weight on current bond
10397 # (max element of weight is normalized to 1)
104- peps. vertices[row, col], peps. vertices[row2, col2 ] = T1, T2
98+ peps. vertices[row, col], peps. vertices[row, cp1 ] = T1, T2
10599 peps. weights[1 , row, col] = s / norm (s, Inf )
106100 return ϵ
107101end
@@ -181,17 +175,17 @@ function simpleupdate(
181175 check_int:: Int = 500 ,
182176)
183177 time_start = time ()
184- N1, N2 = size (peps)
178+ Nr, Nc = size (peps)
185179 if bipartite
186- @assert N1 == N2 == 2
180+ @assert Nr == Nc == 2
187181 end
188182 # exponentiating the 2-site Hamiltonian gate
189183 gate = get_gate (alg. dt, ham)
190184 wtdiff = 1.0
191185 wts0 = deepcopy (peps. weights)
192186 for count in 1 : (alg. maxiter)
193187 time0 = time ()
194- peps = su_iter (gate, peps, alg; bipartite= bipartite )
188+ peps = su_iter (gate, peps, alg; bipartite)
195189 wtdiff = compare_weights (peps. weights, wts0)
196190 converge = (wtdiff < alg. tol)
197191 cancel = (count == alg. maxiter)
@@ -210,9 +204,7 @@ function simpleupdate(
210204 )
211205 cancel ? (@warn message) : (@info message)
212206 end
213- if converge || cancel
214- break
215- end
207+ converge && break
216208 end
217209 return peps, wtdiff
218210end
0 commit comments