Skip to content

Commit 752df93

Browse files
committed
Use for projectors of T2/4/6 the already updated T1/3/5 in triangular CTMRG
1 parent f64a6cb commit 752df93

File tree

2 files changed

+48
-40
lines changed

2 files changed

+48
-40
lines changed

varipeps/contractions/definitions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,7 +3464,7 @@ def _prepare_defs(cls):
34643464
}
34653465

34663466
triangular_ctmrg_T_proj_150_left: Definition = {
3467-
"tensors": [["tensor", "tensor_conj", "T3a_trunc", "C4", "C5", "C6", "T6b"]],
3467+
"tensors": [["tensor", "tensor_conj", "T3a", "C4", "C5", "C6", "T6b"]],
34683468
# "tensors": [["tensor", "tensor_conj", "C3", "C4", "C5", "C6", "T6b"]],
34693469
"network": [
34703470
[
@@ -3480,7 +3480,7 @@ def _prepare_defs(cls):
34803480
}
34813481

34823482
triangular_ctmrg_T_proj_150_right: Definition = {
3483-
"tensors": [["tensor", "tensor_conj", "T6a", "C1", "C2", "C3", "T3b_trunc"]],
3483+
"tensors": [["tensor", "tensor_conj", "T6a", "C1", "C2", "C3", "T3b"]],
34843484
# "tensors": [["tensor", "tensor_conj", "T6a", "C1", "C2", "C3", "C4"]],
34853485
"network": [
34863486
[
@@ -3560,7 +3560,7 @@ def _prepare_defs(cls):
35603560
}
35613561

35623562
triangular_ctmrg_T_proj_270_left: Definition = {
3563-
"tensors": [["tensor", "tensor_conj", "T1a_trunc", "C2", "C3", "C4", "T4b"]],
3563+
"tensors": [["tensor", "tensor_conj", "T1a", "C2", "C3", "C4", "T4b"]],
35643564
# "tensors": [["tensor", "tensor_conj", "C1", "C2", "C3", "C4", "T4b"]],
35653565
"network": [
35663566
[
@@ -3576,7 +3576,7 @@ def _prepare_defs(cls):
35763576
}
35773577

35783578
triangular_ctmrg_T_proj_270_right: Definition = {
3579-
"tensors": [["tensor", "tensor_conj", "T4a", "C5", "C6", "C1", "T1b_trunc"]],
3579+
"tensors": [["tensor", "tensor_conj", "T4a", "C5", "C6", "C1", "T1b"]],
35803580
# "tensors": [["tensor", "tensor_conj", "T4a", "C5", "C6", "C1", "C2"]],
35813581
"network": [
35823582
[
@@ -3592,7 +3592,7 @@ def _prepare_defs(cls):
35923592
}
35933593

35943594
triangular_ctmrg_T_proj_30_left: Definition = {
3595-
"tensors": [["tensor", "tensor_conj", "T5a_trunc", "C6", "C1", "C2", "T2b"]],
3595+
"tensors": [["tensor", "tensor_conj", "T5a", "C6", "C1", "C2", "T2b"]],
35963596
# "tensors": [["tensor", "tensor_conj", "C5", "C6", "C1", "C2", "T2b"]],
35973597
"network": [
35983598
[
@@ -3608,7 +3608,7 @@ def _prepare_defs(cls):
36083608
}
36093609

36103610
triangular_ctmrg_T_proj_30_right: Definition = {
3611-
"tensors": [["tensor", "tensor_conj", "T2a", "C3", "C4", "C5", "T5b_trunc"]],
3611+
"tensors": [["tensor", "tensor_conj", "T2a", "C3", "C4", "C5", "T5b"]],
36123612
# "tensors": [["tensor", "tensor_conj", "T2a", "C3", "C4", "C5", "C6"]],
36133613
"network": [
36143614
[

varipeps/ctmrg/triangular_absorption.py

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -411,16 +411,6 @@ def do_absorption_step_triangular(
411411

412412
smallest_S_list.append(smallest_S_T)
413413

414-
proj_30, proj_150, proj_270, smallest_S_T = calc_T_30_150_270_projectors(
415-
*_get_triangular_ctmrg_2x2_structure(peps_tensors, view), config, state
416-
)
417-
418-
T_30_projectors[(x, y)] = proj_30
419-
T_150_projectors[(x, y)] = proj_150
420-
T_270_projectors[(x, y)] = proj_270
421-
422-
smallest_S_list.append(smallest_S_T)
423-
424414
for x, iter_rows in working_unitcell.iter_all_rows(only_unique=True):
425415
for y, view in iter_rows:
426416
new_t = view[0, 0][0][0].copy()
@@ -442,69 +432,87 @@ def do_absorption_step_triangular(
442432
config,
443433
)
444434

445-
new_t.T2a = _post_process_CTM_tensors(
435+
new_t.T3a = _post_process_CTM_tensors(
446436
jnp.tensordot(
447-
T_30_projectors.get_projector(x, y, -1, -1)[0],
448-
new_t.T2a,
437+
T_330_projectors.get_projector(x, y, -1, 0)[0],
438+
new_t.T3a,
449439
((1,), (0,)),
450440
),
451441
config,
452442
)
453-
new_t.T2b = _post_process_CTM_tensors(
443+
new_t.T3b = _post_process_CTM_tensors(
454444
jnp.tensordot(
455-
new_t.T2b,
456-
T_30_projectors.get_projector(x, y, 0, 0)[1],
445+
new_t.T3b,
446+
T_330_projectors.get_projector(x, y, 0, 0)[1],
457447
((3,), (0,)),
458448
),
459449
config,
460450
)
461451

462-
new_t.T3a = _post_process_CTM_tensors(
452+
new_t.T5a = _post_process_CTM_tensors(
463453
jnp.tensordot(
464-
T_330_projectors.get_projector(x, y, -1, 0)[0],
465-
new_t.T3a,
454+
T_210_projectors.get_projector(x, y, 0, 0)[0],
455+
new_t.T5a,
466456
((1,), (0,)),
467457
),
468458
config,
469459
)
470-
new_t.T3b = _post_process_CTM_tensors(
460+
new_t.T5b = _post_process_CTM_tensors(
471461
jnp.tensordot(
472-
new_t.T3b,
473-
T_330_projectors.get_projector(x, y, 0, 0)[1],
462+
new_t.T5b,
463+
T_210_projectors.get_projector(x, y, -1, -1)[1],
474464
((3,), (0,)),
475465
),
476466
config,
477467
)
478468

479-
new_t.T4a = _post_process_CTM_tensors(
469+
view[0, 0] = new_t
470+
471+
for x, iter_rows in working_unitcell.iter_all_rows(only_unique=True):
472+
for y, view in iter_rows:
473+
proj_30, proj_150, proj_270, smallest_S_T = calc_T_30_150_270_projectors(
474+
*_get_triangular_ctmrg_2x2_structure(peps_tensors, view), config, state
475+
)
476+
477+
T_30_projectors[(x, y)] = proj_30
478+
T_150_projectors[(x, y)] = proj_150
479+
T_270_projectors[(x, y)] = proj_270
480+
481+
smallest_S_list.append(smallest_S_T)
482+
483+
for x, iter_rows in working_unitcell.iter_all_rows(only_unique=True):
484+
for y, view in iter_rows:
485+
new_t = view[0, 0][0][0].copy()
486+
487+
new_t.T2a = _post_process_CTM_tensors(
480488
jnp.tensordot(
481-
T_270_projectors.get_projector(x, y, 0, 0)[0],
482-
new_t.T4a,
489+
T_30_projectors.get_projector(x, y, -1, -1)[0],
490+
new_t.T2a,
483491
((1,), (0,)),
484492
),
485493
config,
486494
)
487-
new_t.T4b = _post_process_CTM_tensors(
495+
new_t.T2b = _post_process_CTM_tensors(
488496
jnp.tensordot(
489-
new_t.T4b,
490-
T_270_projectors.get_projector(x, y, 0, -1)[1],
497+
new_t.T2b,
498+
T_30_projectors.get_projector(x, y, 0, 0)[1],
491499
((3,), (0,)),
492500
),
493501
config,
494502
)
495503

496-
new_t.T5a = _post_process_CTM_tensors(
504+
new_t.T4a = _post_process_CTM_tensors(
497505
jnp.tensordot(
498-
T_210_projectors.get_projector(x, y, 0, 0)[0],
499-
new_t.T5a,
506+
T_270_projectors.get_projector(x, y, 0, 0)[0],
507+
new_t.T4a,
500508
((1,), (0,)),
501509
),
502510
config,
503511
)
504-
new_t.T5b = _post_process_CTM_tensors(
512+
new_t.T4b = _post_process_CTM_tensors(
505513
jnp.tensordot(
506-
new_t.T5b,
507-
T_210_projectors.get_projector(x, y, -1, -1)[1],
514+
new_t.T4b,
515+
T_270_projectors.get_projector(x, y, 0, -1)[1],
508516
((3,), (0,)),
509517
),
510518
config,

0 commit comments

Comments
 (0)