Skip to content

Contracting planar tensors with changeable legs #252

@Chenqitrg

Description

@Chenqitrg

Hi Jutho and Lukas,

I am trying to contract two planar tensors, but the corresponding contracted legs are some variables that can be changed as an input parameter of a function.
For example, I want to contract

@planar LT[(-1, -2, -3); -4] := L[-3; 1] * T[1; (-2, -1, -4)]

but in the following sense

ind1 = (-1, -2, -3)
ind2 = (-2, -1, -4)
@planar LT[ind1; -4] := L[-3; 1] * T[1; ind2]

Is there a way to achieve this?

Edit:

Found a planarcontract!

Sorry I am still confused with the conventions used in planarcontract!. According to the documentation TensorOperations.tensorcontract!, in my naive thinking, if I want to bend leg 2 and 3 in LT after contraction, it seems that I should write something like

V = Vect[IsingAnyon](:I => 1, :σ => 1) # error
# V = ℂ^2 # no error
T = rand(V ← V ⊗ V ⊗ V)

L = rand(V ← V)
ind1 = (-1, -2, -3)
ind2 = (-2, -1, -4)
LT = transpose(T, ((3,2,1), (4,)))
LT = TensorKit.planarcontract!(LT, L, ((1,), (2,)), T, ((1,), (2,3,4)), ((3,2,1), (4,)), 1, 0)

But this is not correct for sector being IsingAnyon. It seems that for non-bosonic sector, the planarcontract! will call reorder_indices, which restricts the length(pAB[1]) == length(pA[1]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions