Skip to content

Commit 4cf6117

Browse files
committed
Remove old code
1 parent 4f748a6 commit 4cf6117

File tree

2 files changed

+0
-218
lines changed

2 files changed

+0
-218
lines changed

varipeps/ctmrg/absorption.py

-150
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ class definition for details.
192192
T4_projector_top = left_projectors.get_projector(x, y, -1, 0).top
193193
T4_projector_bottom = left_projectors.get_projector(x, y, 0, 0).bottom
194194

195-
# T4_projector_top = jnp.eye(9).reshape(1, 3, 3, 9)
196-
# T4_projector_bottom = jnp.eye(9).reshape(9, 1, 3, 3)
197-
198195
if (
199196
working_tensor_obj.d > working_tensor_obj.chi
200197
or working_tensor_obj.d > working_tensor_obj.D[0] ** 2
@@ -764,48 +761,6 @@ def do_left_absorption_split_transfer(
764761
x, y, 0, 0
765762
).bottom_phys_bra
766763

767-
# T4_ket_projector_top = jnp.eye(3).reshape(1, 3, 3)
768-
# T4_bra_projector_top = jnp.eye(9).reshape(3, 3, 9)
769-
# T4_ket_projector_bottom = jnp.eye(3).reshape(3, 1, 3)
770-
# T4_bra_projector_bottom = jnp.eye(9).reshape(9, 3, 3)
771-
772-
# new_T4_tmp = apply_contraction_jitted(
773-
# "ctmrg_split_transfer_absorption_left_T4",
774-
# [working_tensor],
775-
# [working_tensor_obj],
776-
# [
777-
# T4_ket_projector_top,
778-
# T4_bra_projector_top,
779-
# T4_ket_projector_bottom,
780-
# T4_bra_projector_bottom,
781-
# ],
782-
# )
783-
#
784-
# # new_T4_tmp += new_T4_tmp.conj().transpose(0, 2, 1, 3)
785-
# # new_T4_tmp /= 2
786-
#
787-
# new_T4_tmp_list.append(_post_process_CTM_tensors(new_T4_tmp, config))
788-
#
789-
# new_T4_tmp_matrix = new_T4_tmp.reshape(
790-
# new_T4_tmp.shape[0] * new_T4_tmp.shape[1],
791-
# new_T4_tmp.shape[2] * new_T4_tmp.shape[3],
792-
# )
793-
# new_T4_bra, T4_S, new_T4_ket = gauge_fixed_svd(new_T4_tmp_matrix)
794-
#
795-
# new_T4_bra = new_T4_bra[:, : working_tensor_obj.interlayer_chi]
796-
# T4_S = jnp.sqrt(T4_S[: working_tensor_obj.interlayer_chi])
797-
# new_T4_ket = new_T4_ket[: working_tensor_obj.interlayer_chi, :]
798-
#
799-
# new_T4_bra = new_T4_bra * T4_S[jnp.newaxis, :]
800-
# new_T4_ket = T4_S[:, jnp.newaxis] * new_T4_ket
801-
#
802-
# new_T4_bra = new_T4_bra.reshape(
803-
# new_T4_tmp.shape[0], new_T4_tmp.shape[1], new_T4_bra.shape[1]
804-
# )
805-
# new_T4_ket = new_T4_ket.reshape(
806-
# new_T4_ket.shape[0], new_T4_tmp.shape[2], new_T4_tmp.shape[3]
807-
# )
808-
809764
new_T4_ket = apply_contraction_jitted(
810765
"ctmrg_split_transfer_absorption_left_T4_ket",
811766
[working_tensor],
@@ -942,41 +897,6 @@ def do_right_absorption_split_transfer(
942897
x, y, 0, 0
943898
).bottom_phys_bra
944899

945-
# new_T2_tmp = apply_contraction_jitted(
946-
# "ctmrg_split_transfer_absorption_right_T2",
947-
# [working_tensor],
948-
# [working_tensor_obj],
949-
# [
950-
# T2_ket_projector_top,
951-
# T2_bra_projector_top,
952-
# T2_ket_projector_bottom,
953-
# T2_bra_projector_bottom,
954-
# ],
955-
# )
956-
#
957-
# # new_T2_tmp += new_T2_tmp.conj().transpose(0, 2, 1, 3)
958-
# # new_T2_tmp /= 2
959-
#
960-
# new_T2_tmp_matrix = new_T2_tmp.reshape(
961-
# new_T2_tmp.shape[0] * new_T2_tmp.shape[1],
962-
# new_T2_tmp.shape[2] * new_T2_tmp.shape[3],
963-
# )
964-
# new_T2_bra, T2_S, new_T2_ket = gauge_fixed_svd(new_T2_tmp_matrix)
965-
#
966-
# new_T2_bra = new_T2_bra[:, : working_tensor_obj.interlayer_chi]
967-
# T2_S = jnp.sqrt(T2_S[: working_tensor_obj.interlayer_chi])
968-
# new_T2_ket = new_T2_ket[: working_tensor_obj.interlayer_chi, :]
969-
#
970-
# new_T2_bra = new_T2_bra * T2_S[jnp.newaxis, :]
971-
# new_T2_ket = T2_S[:, jnp.newaxis] * new_T2_ket
972-
#
973-
# new_T2_bra = new_T2_bra.reshape(
974-
# new_T2_tmp.shape[0], new_T2_tmp.shape[1], new_T2_bra.shape[1]
975-
# )
976-
# new_T2_ket = new_T2_ket.reshape(
977-
# new_T2_ket.shape[0], new_T2_tmp.shape[2], new_T2_tmp.shape[3]
978-
# )
979-
980900
new_T2_ket = apply_contraction_jitted(
981901
"ctmrg_split_transfer_absorption_right_T2_ket",
982902
[working_tensor],
@@ -1105,41 +1025,6 @@ def do_top_absorption_split_transfer(
11051025
x, y, 0, 0
11061026
).right_phys_bra
11071027

1108-
# new_T1_tmp = apply_contraction_jitted(
1109-
# "ctmrg_split_transfer_absorption_top_T1",
1110-
# [working_tensor],
1111-
# [working_tensor_obj],
1112-
# [
1113-
# T1_ket_projector_left,
1114-
# T1_bra_projector_left,
1115-
# T1_ket_projector_right,
1116-
# T1_bra_projector_right,
1117-
# ],
1118-
# )
1119-
#
1120-
# # new_T1_tmp += new_T1_tmp.conj().transpose(0, 2, 1, 3)
1121-
# # new_T1_tmp /= 2
1122-
#
1123-
# new_T1_tmp_matrix = new_T1_tmp.reshape(
1124-
# new_T1_tmp.shape[0] * new_T1_tmp.shape[1],
1125-
# new_T1_tmp.shape[2] * new_T1_tmp.shape[3],
1126-
# )
1127-
# new_T1_ket, T1_S, new_T1_bra = gauge_fixed_svd(new_T1_tmp_matrix)
1128-
#
1129-
# new_T1_ket = new_T1_ket[:, : working_tensor_obj.interlayer_chi]
1130-
# T1_S = jnp.sqrt(T1_S[: working_tensor_obj.interlayer_chi])
1131-
# new_T1_bra = new_T1_bra[: working_tensor_obj.interlayer_chi, :]
1132-
#
1133-
# new_T1_ket = new_T1_ket * T1_S[jnp.newaxis, :]
1134-
# new_T1_bra = T1_S[:, jnp.newaxis] * new_T1_bra
1135-
#
1136-
# new_T1_ket = new_T1_ket.reshape(
1137-
# new_T1_tmp.shape[0], new_T1_tmp.shape[1], new_T1_ket.shape[1]
1138-
# )
1139-
# new_T1_bra = new_T1_bra.reshape(
1140-
# new_T1_bra.shape[0], new_T1_tmp.shape[2], new_T1_tmp.shape[3]
1141-
# )
1142-
11431028
new_T1_ket = apply_contraction_jitted(
11441029
"ctmrg_split_transfer_absorption_top_T1_ket",
11451030
[working_tensor],
@@ -1278,41 +1163,6 @@ def do_bottom_absorption_split_transfer(
12781163
x, y, 0, 0
12791164
).right_phys_bra
12801165

1281-
# new_T3_tmp = apply_contraction_jitted(
1282-
# "ctmrg_split_transfer_absorption_bottom_T3",
1283-
# [working_tensor],
1284-
# [working_tensor_obj],
1285-
# [
1286-
# T3_ket_projector_left,
1287-
# T3_bra_projector_left,
1288-
# T3_ket_projector_right,
1289-
# T3_bra_projector_right,
1290-
# ],
1291-
# )
1292-
#
1293-
# # new_T3_tmp += new_T3_tmp.conj().transpose(0, 2, 1, 3)
1294-
# # new_T3_tmp /= 2
1295-
#
1296-
# new_T3_tmp_matrix = new_T3_tmp.reshape(
1297-
# new_T3_tmp.shape[0] * new_T3_tmp.shape[1],
1298-
# new_T3_tmp.shape[2] * new_T3_tmp.shape[3],
1299-
# )
1300-
# new_T3_ket, T3_S, new_T3_bra = gauge_fixed_svd(new_T3_tmp_matrix)
1301-
#
1302-
# new_T3_ket = new_T3_ket[:, : working_tensor_obj.interlayer_chi]
1303-
# T3_S = jnp.sqrt(T3_S[: working_tensor_obj.interlayer_chi])
1304-
# new_T3_bra = new_T3_bra[: working_tensor_obj.interlayer_chi, :]
1305-
#
1306-
# new_T3_ket = new_T3_ket * T3_S[jnp.newaxis, :]
1307-
# new_T3_bra = T3_S[:, jnp.newaxis] * new_T3_bra
1308-
#
1309-
# new_T3_ket = new_T3_ket.reshape(
1310-
# new_T3_tmp.shape[0], new_T3_tmp.shape[1], new_T3_ket.shape[1]
1311-
# )
1312-
# new_T3_bra = new_T3_bra.reshape(
1313-
# new_T3_bra.shape[0], new_T3_tmp.shape[2], new_T3_tmp.shape[3]
1314-
# )
1315-
13161166
new_T3_ket = apply_contraction_jitted(
13171167
"ctmrg_split_transfer_absorption_bottom_T3_ket",
13181168
[working_tensor],

varipeps/ctmrg/projectors.py

-68
Original file line numberDiff line numberDiff line change
@@ -1045,50 +1045,6 @@ def _split_transfer_workhorse(
10451045
projector_second_ketbra.shape[1],
10461046
)
10471047

1048-
# first_bra = jnp.tensordot(first_ketbra, projector_first_ketbra, ((2, 3), (1, 2)))
1049-
# first_bra = first_bra.transpose(0, 2, 1)
1050-
# first_bra_matrix = first_bra.reshape(first_bra.shape[0], first_bra.shape[1] * first_bra.shape[2])
1051-
#
1052-
# second_bra = jnp.tensordot(projector_second_ketbra, second_ketbra, ((0, 1), (0, 1)))
1053-
# second_bra = second_bra.transpose(0, 2, 1)
1054-
# second_bra_matrix = second_bra.reshape(second_bra.shape[0] * second_bra.shape[1], second_bra.shape[2])
1055-
#
1056-
# product_matrix_bra = jnp.dot(first_bra_matrix, second_bra_matrix)
1057-
# S_inv_sqrt_bra, U_bra, Vh_bra, smallest_S_bra = _truncated_SVD(
1058-
# product_matrix_bra, chi, truncation_eps
1059-
# )
1060-
#
1061-
# projector_first_bra = jnp.dot(
1062-
# U_bra.transpose().conj() * S_inv_sqrt_bra[:, jnp.newaxis], first_bra_matrix
1063-
# )
1064-
# projector_second_bra = jnp.dot(
1065-
# second_bra_matrix, Vh_bra.transpose().conj() * S_inv_sqrt_bra
1066-
# )
1067-
#
1068-
# projector_first_bra = projector_first_bra.reshape(
1069-
# projector_first_bra.shape[0],
1070-
# first_bra.shape[1],
1071-
# first_bra.shape[2]
1072-
# )
1073-
#
1074-
# projector_second_bra = projector_second_bra.reshape(
1075-
# second_bra.shape[0],
1076-
# second_bra.shape[1],
1077-
# projector_second_bra.shape[1]
1078-
# )
1079-
1080-
# product_matrix_braket = jnp.dot(first_braket, second_braket)
1081-
# S_inv_sqrt_braket, U_braket, Vh_braket, smallest_S_braket = _truncated_SVD(
1082-
# product_matrix_braket, chi, truncation_eps
1083-
# )
1084-
#
1085-
# projector_first_braket = jnp.dot(
1086-
# U_braket.transpose().conj() * S_inv_sqrt_braket[:, jnp.newaxis], first_braket
1087-
# )
1088-
# projector_second_braket = jnp.dot(
1089-
# second_braket, Vh_braket.transpose().conj() * S_inv_sqrt_braket
1090-
# )
1091-
10921048
return (
10931049
projector_first_ketbra,
10941050
projector_second_ketbra,
@@ -1307,30 +1263,6 @@ def calc_left_projectors_split_transfer(
13071263
truncation_eps,
13081264
)
13091265

1310-
# projector_left_top_ket = projector_left_top_ket.reshape(
1311-
# peps_tensor_objs[0][0].left_lower_transfer_shape,
1312-
# peps_tensors[0][0].shape[1],
1313-
# projector_left_top_ket.shape[1],
1314-
# )
1315-
#
1316-
# projector_left_bottom_ket = projector_left_bottom_ket.reshape(
1317-
# projector_left_bottom_ket.shape[0],
1318-
# peps_tensor_objs[1][0].left_upper_transfer_shape,
1319-
# peps_tensors[1][0].shape[4],
1320-
# )
1321-
#
1322-
# projector_left_top_bra = projector_left_top_bra.reshape(
1323-
# peps_tensor_objs[0][0].left_lower_transfer_shape,
1324-
# peps_tensors[0][0].shape[1],
1325-
# projector_left_top_bra.shape[1],
1326-
# )
1327-
#
1328-
# projector_left_bottom_bra = projector_left_bottom_bra.reshape(
1329-
# projector_left_bottom_bra.shape[0],
1330-
# peps_tensor_objs[1][0].left_upper_transfer_shape,
1331-
# peps_tensors[1][0].shape[4],
1332-
# )
1333-
13341266
top_tensor_phys_ket_left = apply_contraction_jitted(
13351267
"ctmrg_split_transfer_phys_top",
13361268
[peps_tensors[0][0]],

0 commit comments

Comments
 (0)