You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A method to compute the conformal spin up to 10 (#74)
* Added functions to compress the tensor network in a single direction
* Added function to calculate conformal spin
* format
* Added generic QR_R,L and the function to calculate spin up to 8
* format
* Deleted junction, added conformal dimension
* changed the corresponding dependent function in symmetric loop tnr
* Deleted garbages
* Format
* Trying to add the loop optimization to transfer MPO
* It seems that preserving translational symmetry is very important. So it may be better to only performing loop in a unit cell...
* The planar_opt is still the best
* format
* The 1x4 case is extremely precise
The loop optimization of the transfer MPO can indeed reduce the truncation error by 1/10, however, the final spectrum becomes worse when loop is added. Still need to find the reason
* Reorganized some functions in cft_data
* back truncation of the virtual bond
* Change back
* Changed another configuration
Now the cost decreases to O(D^6) and can calculate spins from -5 to 5 now!
* Deleted garbage
* Deleted some export
# Function to construct MPS Ψ_B from MPS Ψ_A. Using a large cut-off dimension in SVD but a small cut-off dimension in loop to increase the precision of initialization.
@@ -387,20 +227,20 @@ function right_cache(tensor_list)
387
227
return cache
388
228
end
389
229
390
-
# Function to perform the optimization loop for the LoopTNR scheme. Sweeping from left to right, we optimize the tensors in the loop by minimizing the cost function.
230
+
# A general function to optimize the truncation error of an MPS on a ring.
231
+
# Sweeping from left to right, we optimize the tensors in the loop by minimizing the cost function.
391
232
# Here cache of right-half-chain is used to minimize the number of multiplications to accelerate the sweeping.
392
233
# The transfer matrix on the left is updated after each optimization step.
393
234
# The cache technique is from Chenfeng Bao's thesis, see http://hdl.handle.net/10012/14674.
NB =length(psiB) # Number of tensors in the MPS Ψ_B
399
240
psiBpsiB =ΨBΨB(psiB)
400
241
psiBpsiA =ΨBΨA(psiB, psiA)
401
242
psiApsiA =ΨAΨA(psiA)
402
243
C =to_number(psiApsiA) # Since C is not changed during the optimization, we can compute it once and use it in the cost function.
403
-
404
244
cost = Float64[Inf]
405
245
sweep =0
406
246
crit =true
@@ -411,7 +251,19 @@ function loop_opt!(scheme::LoopTNR, loop_criterion::stopcrit,
411
251
left_BA =id(codomain(psiBpsiA[1])) # Initialize the left transfer matrix for ΨBΨA
412
252
413
253
t_start =time()
414
-
for pos_psiB in1:8
254
+
255
+
if sweep ==0
256
+
tNt =tr(psiBpsiB[1]*right_cache_BB[1])
257
+
tdw =tr(psiBpsiA[1]*right_cache_BA[1])
258
+
wdt =conj(tdw)
259
+
cost_this =real((C + tNt - wdt - tdw) / C)
260
+
if verbosity >1
261
+
@infov3"Initial cost: $cost_this"
262
+
end
263
+
push!(cost, cost_this)
264
+
end
265
+
266
+
for pos_psiB in1:NB
415
267
pos_psiA = (pos_psiB -1) ÷2+1# Position in the MPS Ψ_A
416
268
417
269
N =tN(left_BB, right_cache_BB[pos_psiB]) # Compute the half of the matrix N for the current position in the loop, right cache is used to minimize the number of multiplications
@@ -434,31 +286,34 @@ function loop_opt!(scheme::LoopTNR, loop_criterion::stopcrit,
434
286
end
435
287
end
436
288
sweep +=1
437
-
crit =loop_criterion(sweep, cost)
438
289
439
290
tNt =tr(left_BB)
440
291
tdw =tr(left_BA)
441
292
wdt =conj(tdw)
442
293
cost_this =real((C + tNt - wdt - tdw) / C)
443
294
push!(cost, cost_this)
444
-
295
+
crit =loop_criterion(sweep, cost)
445
296
if verbosity >1
446
297
@infov3"Sweep: $sweep, Cost: $(cost[end]), Time: $(time() - t_start)s"# Included the time taken for the sweep
0 commit comments