Skip to content

Commit 4dc144b

Browse files
committed
avoid @autoopt
1 parent 0ff55b6 commit 4dc144b

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

src/algorithms/contractions/ctmrg_contractions.jl

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ function enlarge_northwest_corner(
5454
E_west::CTMRG_PF_EdgeTensor, C_northwest::CTMRGCornerTensor,
5555
E_north::CTMRG_PF_EdgeTensor, A::PFTensor,
5656
)
57-
return @autoopt @tensor corner[χ_S D_S; χ_E D_E] :=
58-
E_west[χ_S D1; χ1] * C_northwest[χ1; χ2] * E_north[χ2 D2; χ_E] * A[D1 D_S; D2 D_E]
57+
return @tensor begin
58+
EC[χ_S DW; χ2] := E_west[χ_S DW; χ1] * C_northwest[χ1; χ2]
59+
ECE[χ_S χ_E; DW DN] := EC[χ_S DW; χ2] * E_north[χ2 DN; χ_E]
60+
corner[χ_S D_S; χ_E D_E] := ECE[χ_S χ_E; DW DN] * A[DW D_S; DN D_E]
61+
end
5962
end
6063

6164
"""
@@ -92,8 +95,11 @@ function enlarge_northeast_corner(
9295
E_north::CTMRG_PF_EdgeTensor, C_northeast::CTMRGCornerTensor,
9396
E_east::CTMRG_PF_EdgeTensor, A::PFTensor,
9497
)
95-
return @autoopt @tensor corner[χ_W D_W; χ_S D_S] :=
96-
E_north[χ_W D1; χ1] * C_northeast[χ1; χ2] * E_east[χ2 D2; χ_S] * A[D_W D_S; D1 D2]
98+
return @tensor begin
99+
EC[χ_W DN; χ2] := E_north[χ_W DN; χ1] * C_northeast[χ1; χ2]
100+
ECE[χ_W χ_S; DN DE] := EC[χ_W DN; χ2] * E_east[χ2 DE; χ_S]
101+
corner[χ_W D_W; χ_S D_S] := ECE[χ_W χ_S; DN DE] * A[D_W D_S; DN DE]
102+
end
97103
end
98104

99105
"""
@@ -130,8 +136,11 @@ function enlarge_southeast_corner(
130136
E_east::CTMRG_PF_EdgeTensor, C_southeast::CTMRGCornerTensor,
131137
E_south::CTMRG_PF_EdgeTensor, A::PFTensor,
132138
)
133-
return @autoopt @tensor corner[χ_N D_N; χ_W D_W] :=
134-
E_east[χ_N D1; χ1] * C_southeast[χ1; χ2] * E_south[χ2 D2; χ_W] * A[D_W D2; D_N D1]
139+
return @tensor begin
140+
EC[χ_N D1; χ2] := E_east[χ_N D1; χ1] * C_southeast[χ1; χ2]
141+
ECE[χ_N χ_W; D1 D2] := EC[χ_N D1; χ2] * E_south[χ2 D2; χ_W]
142+
corner[χ_N D_N; χ_W D_W] := ECE[χ_N χ_W; D1 D2] * A[D_W D2; D_N D1]
143+
end
135144
end
136145

137146
"""
@@ -168,8 +177,11 @@ function enlarge_southwest_corner(
168177
E_south::CTMRG_PF_EdgeTensor, C_southwest::CTMRGCornerTensor,
169178
E_west::CTMRG_PF_EdgeTensor, A::PFTensor,
170179
)
171-
return @autoopt @tensor corner[χ_E D_E; χ_N D_N] :=
172-
E_south[χ_E D1; χ1] * C_southwest[χ1; χ2] * E_west[χ2 D2; χ_N] * A[D2 D1; D_N D_E]
180+
return @tensor begin
181+
EC[χ_E D1; χ2] := E_south[χ_E D1; χ1] * C_southwest[χ1; χ2]
182+
ECE[χ_E χ_N; D2 D1] := EC[χ_E D1; χ2] * E_west[χ2 D2; χ_N]
183+
corner[χ_E D_E; χ_N D_N] := ECE[χ_E χ_N; D2 D1] * A[D2 D1; D_N D_E]
184+
end
173185
end
174186

175187
# Projector contractions
@@ -1067,8 +1079,11 @@ function renormalize_west_edge(
10671079
end
10681080
end
10691081
function renormalize_west_edge(E_west::CTMRG_PF_EdgeTensor, P_bottom, P_top, A::PFTensor)
1070-
return @autoopt @tensor edge[χ_S D_E; χ_N] :=
1071-
E_west[χ1 D1; χ2] * A[D1 D5; D3 D_E] * P_bottom[χ2 D3; χ_N] * P_top[χ_S; χ1 D5]
1082+
return @tensor begin
1083+
PE[χ_S χNW; D_W D_S] := P_top[χ_S; χSW D_S] * E_west[χSW D_W; χNW]
1084+
PEA[χ_S D_E; χNW D_N] := PE[χ_S χNW; D_W D_S] * A[D_W D_S; D_N D_E]
1085+
edge[χ_S D_E; χ_N] := PEA[χ_S D_E; χNW D_N] * P_bottom[χNW D_N; χ_N]
1086+
end
10721087
end
10731088

10741089
# Gauge fixing contractions

0 commit comments

Comments
 (0)