@@ -6,6 +6,20 @@ const CTMRGCornerTensor{T,S} = AbstractTensorMap{T,S,1,1}
66# Enlarged corner contractions
77# ----------------------------
88
9+ #=
10+ These contractions are hand-optimized by the following heuristics:
11+
12+ 1. ensure contraction order gives minimal scaling in χ = D²
13+ 2. ensure dominant permutation is as efficient as possible by making large legs contiguous,
14+ ie moving them to the front
15+
16+ This second part is mostly important for dealing with non-abelian symmetries, where the
17+ permutations are strongly non-negligable.
18+
19+ For a small benchmark study:
20+ https://gist.github.com/lkdvos/a562c2b09ef461398729ccefdab34745
21+ =#
22+
923"""
1024$(SIGNATURES)
1125
@@ -25,12 +39,18 @@ function enlarge_northwest_corner(
2539 E_north:: CTMRG_PEPS_EdgeTensor ,
2640 A:: PEPSSandwich ,
2741)
28- return @autoopt @tensor corner[χ_S D_Sabove D_Sbelow; χ_E D_Eabove D_Ebelow] :=
29- E_west[χ_S D1 D2; χ1] *
30- C_northwest[χ1; χ2] *
31- E_north[χ2 D3 D4; χ_E] *
32- ket(A)[d; D3 D_Eabove D_Sabove D1] *
33- conj(bra(A)[d; D4 D_Ebelow D_Sbelow D2])
42+ return @tensor begin
43+ EC[χS DWt DWb; χ2] := E_west[χS DWt DWb; χ1] * C_northwest[χ1; χ2]
44+
45+ # already putting χE in front here to make next permute cheaper
46+ ECE[χS χE DWb DNb; DWt DNt] := EC[χS DWt DWb; χ2] * E_north[χ2 DNt DNb; χE]
47+
48+ ECEket[χS χE DEt DSt; DWb DNb d] :=
49+ ECE[χS χE DWb DNb; DWt DNt] * ket(A)[d; DNt DEt DSt DWt]
50+
51+ corner[χS DSt DSb; χE DEt DEb] :=
52+ ECEket[χS χE DEt DSt; DWb DNb d] * conj(bra(A)[d; DNb DEb DSb DWb])
53+ end
3454end
3555function enlarge_northwest_corner(
3656 E_west:: CTMRG_PF_EdgeTensor ,
@@ -61,12 +81,18 @@ function enlarge_northeast_corner(
6181 E_east:: CTMRG_PEPS_EdgeTensor ,
6282 A:: PEPSSandwich ,
6383)
64- return @autoopt @tensor corner[χ_W D_Wabove D_Wbelow; χ_S D_Sabove D_Sbelow] :=
65- E_north[χ_W D1 D2; χ1] *
66- C_northeast[χ1; χ2] *
67- E_east[χ2 D3 D4; χ_S] *
68- ket(A)[d; D1 D3 D_Sabove D_Wabove] *
69- conj(bra(A)[d; D2 D4 D_Sbelow D_Wbelow])
84+ return @tensor begin
85+ EC[χW DNt DNb; χ2] := E_north[χW DNt DNb; χ1] * C_northeast[χ1; χ2]
86+
87+ # already putting χE in front here to make next permute cheaper
88+ ECE[χW χS DNb DEb; DNt DEt] := EC[χW DNt DNb; χ2] * E_east[χ2 DEt DEb; χS]
89+
90+ ECEket[χW χS DSt DWt; DNb DEb d] :=
91+ ECE[χW χS DNb DEb; DNt DEt] * ket(A)[d; DNt DEt DSt DWt]
92+
93+ corner[χW DWt DWb; χS DSt DSb] :=
94+ ECEket[χW χS DSt DWt; DNb DEb d] * conj(bra(A)[d; DNb DEb DSb DWb])
95+ end
7096end
7197function enlarge_northeast_corner(
7298 E_north:: CTMRG_PF_EdgeTensor ,
@@ -97,12 +123,18 @@ function enlarge_southeast_corner(
97123 E_south:: CTMRG_PEPS_EdgeTensor ,
98124 A:: PEPSSandwich ,
99125)
100- return @autoopt @tensor corner[χ_N D_Nabove D_Nbelow; χ_W D_Wabove D_Wbelow] :=
101- E_east[χ_N D1 D2; χ1] *
102- C_southeast[χ1; χ2] *
103- E_south[χ2 D3 D4; χ_W] *
104- ket(A)[d; D_Nabove D1 D3 D_Wabove] *
105- conj(bra(A)[d; D_Nbelow D2 D4 D_Wbelow])
126+ return @tensor begin
127+ EC[χN DEt DEb; χ2] := E_east[χN DEt DEb; χ1] * C_southeast[χ1; χ2]
128+
129+ # already putting χE in front here to make next permute cheaper
130+ ECE[χN χW DEb DSb; DEt DSt] := EC[χN DEt DEb; χ2] * E_south[χ2 DSt DSb; χW]
131+
132+ ECEket[χN χW DNt DWt; DEb DSb d] :=
133+ ECE[χN χW DEb DSb; DEt DSt] * ket(A)[d; DNt DEt DSt DWt]
134+
135+ corner[χN DNt DNb; χW DWt DWb] :=
136+ ECEket[χN χW DNt DWt; DEb DSb d] * conj(bra(A)[d; DNb DEb DSb DWb])
137+ end
106138end
107139function enlarge_southeast_corner(
108140 E_east:: CTMRG_PF_EdgeTensor ,
@@ -133,12 +165,18 @@ function enlarge_southwest_corner(
133165 E_west:: CTMRG_PEPS_EdgeTensor ,
134166 A:: PEPSSandwich ,
135167)
136- return @autoopt @tensor corner[χ_E D_Eabove D_Ebelow; χ_N D_Nabove D_Nbelow] :=
137- E_south[χ_E D1 D2; χ1] *
138- C_southwest[χ1; χ2] *
139- E_west[χ2 D3 D4; χ_N] *
140- ket(A)[d; D_Nabove D_Eabove D1 D3] *
141- conj(bra(A)[d; D_Nbelow D_Ebelow D2 D4])
168+ return @tensor begin
169+ EC[χE DSt DSb; χ2] := E_south[χE DSt DSb; χ1] * C_southwest[χ1; χ2]
170+
171+ # already putting χE in front here to make next permute cheaper
172+ ECE[χE χN DSb DWb; DSt DWt] := EC[χE DSt DSb; χ2] * E_west[χ2 DWt DWb; χN]
173+
174+ ECEket[χE χN DNt DEt; DSb DWb d] :=
175+ ECE[χE χN DSb DWb; DSt DWt] * ket(A)[d; DNt DEt DSt DWt]
176+
177+ corner[χE DEt DEb; χN DNt DNb] :=
178+ ECEket[χE χN DNt DEt; DSb DWb d] * conj(bra(A)[d; DNb DEb DSb DWb])
179+ end
142180end
143181function enlarge_southwest_corner(
144182 E_south:: CTMRG_PF_EdgeTensor ,
0 commit comments