Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My planar contractions currently lead to space mismatches. #10

Closed
Gertian opened this issue Nov 22, 2023 · 6 comments
Closed

My planar contractions currently lead to space mismatches. #10

Gertian opened this issue Nov 22, 2023 · 6 comments
Assignees

Comments

@Gertian
Copy link

Gertian commented Nov 22, 2023

In my first commit I managed to make the relevant diagrams planar trough the introduction of braiding symbols.

The resulting code however gives a spacemismatch on the contraction :

function northwest_corner(E4, C1, E1, peps_above, peps_below=peps_above)
    @planar opt=true corner[-1 -2 -3; -4 -5 -6] := 
        E4[-1 1 2; 3] *
        C1[3; 4] *
        E1[4 5 6; -4] *
        peps_above[21; 11 10 18 17] *
        conj(peps_below[21; 13 14 15 16])*
        τ[5 7;6 8]*τ[-5 9;-6 10]*τ[8 12;9 11]*τ[7 14;12 13]*τ[15 2;16 19]*τ[19 1;17 20]*τ[20 -2;18 -3]
end

The stack leads to this final function :

function planarcontract!(C::AbstractTensorMap{S,N₁,N₂},
                         A::BraidingTensor{S}   , (oindA, cindA)::Index2Tuple{2,2}, 
                         B::AbstractTensorMap{S}, (cindB, oindB)::Index2Tuple{2,N₃},
                         (p1, p2)::Index2Tuple{N₁,N₂},
                         α::Number, β::Number,
                         backend::Backend...) where {S,N₁,N₂,N₃}

which spits out :
ERROR: SpaceMismatch("(ℂ^1 ⊗ ℂ^1) ← ((ℂ^1)' ⊗ ℂ^1) ≠ permute(((ℂ^1)' ⊗ ℂ^1) ← (ℂ^1 ⊗ (ℂ^1)')[(2, 4), (1, 3)] * (ℂ^1 ⊗ ℂ^1 ⊗ (ℂ^1)') ← ℂ^1[(2, 3), (1, 4)], ((1, 2), (3, 4))")
Stacktrace:

I suspect that the origin of this bug is a mislabeling of my tau indices but I dont know which is the appropriate labeling.
@Jutho ?

@Gertian Gertian self-assigned this Nov 22, 2023
@Gertian
Copy link
Author

Gertian commented Nov 22, 2023

Update : The following version seems to work just fine I'll find out why tomorrow :)

    function northwest_corner_planar(E4, C1, E1, peps_above, peps_below=peps_above)
        @planar opt=true corner[L1 S s4; L4 E3 e3] :=
            E4[L1 W w3; L2] *
            C1[L2; L3] *
            E1[L3 N3 n2; L4] *
            peps_above[P1; N1 E1 S W] *
            conj(peps_below[P3;n1 e1 s1 w1]) *
            τ[e1 n1; n2 e2] * τ[w2 s2; s1 w1] * τ[P2 s3; s2 P3] * τ[P1 N1; N2 P2] *
            τ[e2 E2; E3 e3] * τ[E1 s4; s3 E2] * τ[w3 N2; N3 w2]
    end
    ```

@Gertian
Copy link
Author

Gertian commented Nov 22, 2023

Update : it was indeed the convention of \tau indices.
The contractions now work but in all likeliness there are still conventions that I don't understand !

@Gertian Gertian closed this as completed Nov 22, 2023
@Jutho
Copy link

Jutho commented Nov 23, 2023

Hi Gertian, what is the confusion about the tau indices? It's as always:
outgoing1 outgoing2 incoming1 incoming2

where the tau tensor maps incoming1 to outgoing2 and vice versa (whether it is braided above or below does not matter for fermions/symmetric braiding).

@Gertian
Copy link
Author

Gertian commented Nov 23, 2023

Lets say we have two lines a, b crossing. Naively I thought that all definitions such as
tau[a1 b1; b2 a2] --> a1, b1 cross into b2 a2
and
tau[a1 b2;b1 a2] --> a1, b2 cross into b1 a2
would both lead to a planar diagram but this is not true.

As I understand these different choices easily arise when rotating crossings and naively taking the same rule for indices as is depicted below where the purple line shows my naive separation between domain and codomain.
tmp

I suspect that there is some rule related to drawing the crossings that I'm not aware of that solves this ambiguity ?

@Jutho
Copy link

Jutho commented Nov 23, 2023

The correct way to think of the tau is that

image

@Gertian
Copy link
Author

Gertian commented Nov 23, 2023

Ok that makes sense.
So in a contraction this would be tau[a1 a2; b1 b2]

Could you however reinterpret this as a crossing from a2,b2 to b1 a1 and hence use tau[a2 b2;a1 b1] ?

@Gertian Gertian reopened this Nov 26, 2023
@Gertian Gertian closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants