@@ -105,14 +105,14 @@ function contract_local_operator1x1(
105105 env:: BPEnv ,
106106 )
107107 row, col = Tuple (ind)
108- M_north = env. messages [NORTH, _prev ( row, end ), mod1 (col, end ) ]
109- M_east = env. messages [EAST, mod1 ( row, end ), _next ( col, end ) ]
110- M_south = env. messages [SOUTH, _next ( row, end ), mod1 (col, end ) ]
111- M_west = env. messages [WEST, mod1 ( row, end ), _prev ( col, end ) ]
108+ M_north = env[NORTH, row - 1 , col ]
109+ M_east = env[EAST, row, col + 1 ]
110+ M_south = env[SOUTH, row + 1 , col ]
111+ M_west = env[WEST, row, col - 1 ]
112112
113113 return @autoopt @tensor begin
114- ket[mod1 ( row, end ), mod1 ( col, end ) ][dt; DNt DEt DSt DWt] *
115- conj (bra[mod1 ( row, end ), mod1 ( col, end ) ][db; DNb DEb DSb DWb]) *
114+ ket[row, col][dt; DNt DEt DSt DWt] *
115+ conj (bra[row, col][db; DNb DEb DSb DWb]) *
116116 O[db; dt] *
117117 M_north[DNt; DNb] *
118118 M_east[DEt; DEb] *
@@ -125,14 +125,14 @@ function contract_local_norm1x1(
125125 ind:: CartesianIndex{2} , ket:: InfinitePEPS , bra:: InfinitePEPS , env:: BPEnv
126126 )
127127 row, col = Tuple (ind)
128- M_north = env. messages [NORTH, _prev ( row, end ), mod1 (col, end ) ]
129- M_east = env. messages [EAST, mod1 ( row, end ), _next ( col, end ) ]
130- M_south = env. messages [SOUTH, _next ( row, end ), mod1 (col, end ) ]
131- M_west = env. messages [WEST, mod1 ( row, end ), _prev ( col, end ) ]
128+ M_north = env[NORTH, row - 1 , col ]
129+ M_east = env[EAST, row, col + 1 ]
130+ M_south = env[SOUTH, row + 1 , col ]
131+ M_west = env[WEST, row, col - 1 ]
132132
133133 return @autoopt @tensor begin
134- ket[mod1 ( row, end ), mod1 ( col, end ) ][d; DNt DEt DSt DWt] *
135- conj (bra[mod1 ( row, end ), mod1 ( col, end ) ][d; DNb DEb DSb DWb]) *
134+ ket[row, col][d; DNt DEt DSt DWt] *
135+ conj (bra[row, col][d; DNb DEb DSb DWb]) *
136136 M_north[DNt; DNb] *
137137 M_east[DEt; DEb] *
138138 M_south[DSb; DSt] *
@@ -148,17 +148,17 @@ function contract_local_operator2x1(
148148 env:: BPEnv ,
149149 )
150150 row, col = Tuple (coord)
151- M_north = env. messages [NORTH, _prev ( row, end ), mod1 (col, end ) ]
152- M_northeast = env. messages [EAST, mod1 ( row, end ), _next ( col, end ) ]
153- M_southeast = env. messages [EAST, _next ( row, end ), _next ( col, end ) ]
154- M_south = env. messages [SOUTH, mod1 ( row + 2 , end ), mod1 ( col, end ) ]
155- M_southwest = env. messages [WEST, _next ( row, end ), _prev ( col, end ) ]
156- M_northwest = env. messages [WEST, mod1 ( row, end ), _prev ( col, end ) ]
151+ M_north = env[NORTH, row - 1 , col ]
152+ M_northeast = env[EAST, row, col + 1 ]
153+ M_southeast = env[EAST, row + 1 , col + 1 ]
154+ M_south = env[SOUTH, row + 2 , col]
155+ M_southwest = env[WEST, row + 1 , col - 1 ]
156+ M_northwest = env[WEST, row, col - 1 ]
157157
158- return @autoopt @tensor ket[mod1 ( row, end ), mod1 ( col, end ) ][dNt; DNt DNEt DMt DNWt] *
159- ket[_next ( row, end ), mod1 (col, end ) ][dSt; DMt DSEt DSt DSWt] *
160- conj (bra[mod1 ( row, end ), mod1 ( col, end ) ][dNb; DNb DNEb DMb DNWb]) *
161- conj (bra[_next ( row, end ), mod1 (col, end ) ][dSb; DMb DSEb DSb DSWb]) *
158+ return @autoopt @tensor ket[row, col][dNt; DNt DNEt DMt DNWt] *
159+ ket[row + 1 , col ][dSt; DMt DSEt DSt DSWt] *
160+ conj (bra[row, col][dNb; DNb DNEb DMb DNWb]) *
161+ conj (bra[row + 1 , col ][dSb; DMb DSEb DSb DSWb]) *
162162 M_north[DNt; DNb] *
163163 M_northeast[DNEt; DNEb] *
164164 M_southeast[DSEt; DSEb] *
@@ -176,16 +176,16 @@ function contract_local_operator1x2(
176176 env:: BPEnv ,
177177 )
178178 row, col = Tuple (coord)
179- M_west = env. messages [WEST, mod1 ( row, end ), _prev ( col, end ) ]
180- M_northwest = env. messages [NORTH, _prev ( row, end ), mod1 (col, end ) ]
181- M_northeast = env. messages [NORTH, _prev ( row, end ), _next ( col, end ) ]
182- M_east = env. messages [EAST, mod1 ( row, end ), mod1 ( col + 2 , end ) ]
183- M_southeast = env. messages [SOUTH, _next ( row, end ), _next ( col, end ) ]
184- M_southwest = env. messages [SOUTH, _next ( row, end ), mod1 (col, end ) ]
185- A_west = ket[mod1 ( row, end ), mod1 ( col, end ) ]
186- Ā_west = bra[mod1 ( row, end ), mod1 ( col, end ) ]
187- A_east = ket[mod1 ( row, end ), _next ( col, end ) ]
188- Ā_east = bra[mod1 ( row, end ), _next ( col, end ) ]
179+ M_west = env[WEST, row, col - 1 ]
180+ M_northwest = env[NORTH, row - 1 , col ]
181+ M_northeast = env[NORTH, row - 1 , col + 1 ]
182+ M_east = env[EAST, row, col + 2 ]
183+ M_southeast = env[SOUTH, row + 1 , col + 1 ]
184+ M_southwest = env[SOUTH, row + 1 , col ]
185+ A_west = ket[row, col]
186+ Ā_west = bra[row, col]
187+ A_east = ket[row, col + 1 ]
188+ Ā_east = bra[row, col + 1 ]
189189
190190 return @autoopt @tensor begin
191191 A_west[dWt; DNWt DMt DSWt DWt] *
@@ -206,17 +206,17 @@ function contract_local_norm2x1(
206206 coord:: CartesianIndex{2} , ket:: InfinitePEPS , bra:: InfinitePEPS , env:: BPEnv
207207 )
208208 row, col = Tuple (coord)
209- M_north = env. messages [NORTH, _prev ( row, end ), mod1 (col, end ) ]
210- M_northeast = env. messages [EAST, mod1 ( row, end ), _next ( col, end ) ]
211- M_southeast = env. messages [EAST, _next ( row, end ), _next ( col, end ) ]
212- M_south = env. messages [SOUTH, mod1 ( row + 2 , end ), mod1 ( col, end ) ]
213- M_southwest = env. messages [WEST, _next ( row, end ), _prev ( col, end ) ]
214- M_northwest = env. messages [WEST, mod1 ( row, end ), _prev ( col, end ) ]
209+ M_north = env[NORTH, row - 1 , col ]
210+ M_northeast = env[EAST, row, col + 1 ]
211+ M_southeast = env[EAST, row + 1 , col + 1 ]
212+ M_south = env[SOUTH, row + 2 , col]
213+ M_southwest = env[WEST, row + 1 , col - 1 ]
214+ M_northwest = env[WEST, row, col - 1 ]
215215
216- return @autoopt @tensor ket[mod1 ( row, end ), mod1 ( col, end ) ][dN; DNt DNEt DMt DNWt] *
217- ket[_next ( row, end ), mod1 (col, end ) ][dS; DMt DSEt DSt DSWt] *
218- conj (bra[mod1 ( row, end ), mod1 ( col, end ) ][dN; DNb DNEb DMb DNWb]) *
219- conj (bra[_next ( row, end ), mod1 (col, end ) ][dS; DMb DSEb DSb DSWb]) *
216+ return @autoopt @tensor ket[row, col][dN; DNt DNEt DMt DNWt] *
217+ ket[row + 1 , col ][dS; DMt DSEt DSt DSWt] *
218+ conj (bra[row, col][dN; DNb DNEb DMb DNWb]) *
219+ conj (bra[row + 1 , col ][dS; DMb DSEb DSb DSWb]) *
220220 M_north[DNt; DNb] *
221221 M_northeast[DNEt; DNEb] *
222222 M_southeast[DSEt; DSEb] *
@@ -230,17 +230,17 @@ function contract_local_norm1x2(
230230 )
231231 row, col = Tuple (coord)
232232
233- M_west = env. messages [WEST, mod1 ( row, end ), _prev ( col, end ) ]
234- M_northwest = env. messages [NORTH, _prev ( row, end ), mod1 (col, end ) ]
235- M_northeast = env. messages [NORTH, _prev ( row, end ), _next ( col, end ) ]
236- M_east = env. messages [EAST, mod1 ( row, end ), mod1 ( col + 2 , end ) ]
237- M_southeast = env. messages [SOUTH, _next ( row, end ), _next ( col, end ) ]
238- M_southwest = env. messages [SOUTH, _next ( row, end ), mod1 (col, end ) ]
233+ M_west = env[WEST, row, col - 1 ]
234+ M_northwest = env[NORTH, row - 1 , col ]
235+ M_northeast = env[NORTH, row - 1 , col + 1 ]
236+ M_east = env[EAST, row, col + 2 ]
237+ M_southeast = env[SOUTH, row + 1 , col + 1 ]
238+ M_southwest = env[SOUTH, row + 1 , col ]
239239
240- A_west = ket[mod1 ( row, end ), mod1 ( col, end ) ]
241- Ā_west = bra[mod1 ( row, end ), mod1 ( col, end ) ]
242- A_east = ket[mod1 ( row, end ), _next ( col, end ) ]
243- Ā_east = bra[mod1 ( row, end ), _next ( col, end ) ]
240+ A_west = ket[row, col]
241+ Ā_west = bra[row, col]
242+ A_east = ket[row, col + 1 ]
243+ Ā_east = bra[row, col + 1 ]
244244
245245 return @autoopt @tensor begin
246246 A_west[dW; DNWt DMt DSWt DWt] *
0 commit comments