-
Notifications
You must be signed in to change notification settings - Fork 27
Description
The docstrings (and @tensor index labels) for CTMRG contractions urgently need a careful revision, which is now causing me lots of headaches... I can easily spot several inconsistencies. To list a few:
- In
renormalize_corner, the codomain index ofP_rightis calledenvlabel(:out):
PEPSKit.jl/src/algorithms/contractions/ctmrg_contractions.jl
Lines 584 to 589 in aa5875c
| |~~~~~~~~| -- |~~~~~~| | |
| |quadrant| |P_left| -- | |
| |~~~~~~~~| -- |~~~~~~| | |
| | | | |
| [P_right] | |
| | |
PEPSKit.jl/src/algorithms/contractions/ctmrg_contractions.jl
Lines 598 to 602 in aa5875c
| P_right_e = tensorexpr( | |
| :P_right, | |
| (envlabel(:out),), | |
| (envlabel(:L), ntuple(i -> virtuallabel(:L, i), N - 1)...), | |
| ) |
However, immediately below in renormalize_northwest_corner, it is called χ_in. It is also against the intuition that codomain indices are "out" indices.
PEPSKit.jl/src/algorithms/contractions/ctmrg_contractions.jl
Lines 658 to 666 in aa5875c
| function renormalize_northwest_corner( | |
| E_west, C_northwest, E_north, P_left, P_right, A::PEPSSandwich | |
| ) | |
| return @autoopt @tensor corner[χ_in; χ_out] := | |
| P_right[χ_in; χ1 D1 D2] * | |
| E_west[χ1 D3 D4; χ2] * C_northwest[χ2; χ3] * E_north[χ3 D5 D6; χ4] * | |
| ket(A)[d; D5 D7 D1 D3] * conj(bra(A)[d; D6 D8 D2 D4]) * | |
| P_left[χ4 D7 D8; χ_out] | |
| end |
- Suppose we accept the convention for
P_left,P_rightinrenormalize_north_edge:
PEPSKit.jl/src/algorithms/contractions/ctmrg_contractions.jl
Lines 940 to 956 in aa5875c
| ``` | |
| |~~~~~~| -- E_north -- |~~~~~~~| | |
| -- |P_left| | |P_right| -- | |
| |~~~~~~| -- A -- |~~~~~~~| | |
| | | |
| ``` | |
| """ | |
| function renormalize_north_edge( | |
| (row, col), env::CTMRGEnv, P_right, P_left, network::InfiniteSquareNetwork | |
| ) | |
| return renormalize_north_edge( | |
| env.edges[NORTH, _prev(row, end), col], | |
| P_right[NORTH, row, col], | |
| P_left[NORTH, row, _prev(col, end)], | |
| network[row, col], # so here it's fine | |
| ) | |
| end |
It looks fine that P_left is one column before the others. But then in renormalize_south_edge:
PEPSKit.jl/src/algorithms/contractions/ctmrg_contractions.jl
Lines 1020 to 1037 in aa5875c
| ``` | |
| | | |
| |~~~~~~~| -- A -- |~~~~~~| | |
| -- |P_right| | |P_left| -- | |
| |~~~~~~~| -- E_south -- |~~~~~~| | |
| | | |
| ``` | |
| """ | |
| function renormalize_south_edge( | |
| (row, col), env::CTMRGEnv, P_left, P_right, network::InfiniteSquareNetwork | |
| ) | |
| return renormalize_south_edge( | |
| env.edges[SOUTH, _next(row, end), col], | |
| P_left[SOUTH, row, col], | |
| P_right[SOUTH, row, _next(col, end)], | |
| network[row, col], | |
| ) | |
| end |
First, line 1025 shouldn't be there. Besides, suddenly P_right is at the next column (instead of previous), despite being on the left. I don't quite get it... It may be due to the convention used by SimultaneousCTMRG, but it is really a weird convention.
Besides, I also want to stop calling the projectors P_left, P_right, P_bottom, P_top. It looks kind of unnatural in the above example that P_right is appearing to the left of the south edge. Are they currently named along the "canonical" environment space arrow direction?
┌-←-P_right-←-P_left-←-┐
↓ ↑
P_top P_bot
↓ ↑
P_bot P_top
↓ ↑
└-→-P_left-→-P_right-→-┘
- Finally, one more example in which
P_topappears at the bottom of the east edge (possibly of the convention drawn above?):
PEPSKit.jl/src/algorithms/contractions/ctmrg_contractions.jl
Lines 1061 to 1080 in aa5875c
| ``` | |
| | | |
| [~P_bottom~] | |
| | | | |
| E_west -- A -- | |
| | | | |
| [~~P_top~~~] | |
| | | |
| ``` | |
| """ | |
| function renormalize_west_edge( # For simultaneous CTMRG scheme | |
| (row, col), env::CTMRGEnv, P_top::Array{Pt, 3}, P_bottom::Array{Pb, 3}, network::InfiniteSquareNetwork, | |
| ) where {Pt, Pb} | |
| return renormalize_west_edge( | |
| env.edges[WEST, row, _prev(col, end)], | |
| P_top[WEST, row, col], | |
| P_bottom[WEST, _next(row, end), col], | |
| network[row, col], | |
| ) | |
| end |
Anyway, may I ask @pbrehmer to summarize how the projectors are labeled in the docstring?