Skip to content

Clean up docstring for CTMRG contractions, particularly labeling of projectors #325

@Yue-Zhengyuan

Description

@Yue-Zhengyuan

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 of P_right is called envlabel(:out):

|~~~~~~~~| -- |~~~~~~|
|quadrant| |P_left| --
|~~~~~~~~| -- |~~~~~~|
| |
[P_right]
|

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.

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_right in renormalize_north_edge:

```
|~~~~~~| -- 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:

```
|
|~~~~~~~| -- 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_top appears at the bottom of the east edge (possibly of the convention drawn above?):

```
|
[~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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions