Skip to content

Commit

Permalink
get rid of unnecessary permutes in TRG
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorVanthilt committed Feb 14, 2025
1 parent fccdcab commit d3ae4a1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/schemes/trg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ function step!(scheme::TRG, trunc::TensorKit.TruncationScheme)

U, S, V, _ = tsvd(scheme.T, ((1, 4), (2, 3)); trunc=trunc)

# Flip legs to their original domain (to mitigate space mismatch at the end)
U = permute(U, ((1,), (2, 3)))
V = permute(V, ((1, 2), (3,)))

@plansor begin
C[-1; -2 -3] := U[-1; -2 1] * sqrt(S)[1; -3]
D[-1 -2; -3] := sqrt(S)[-1; 1] * V[1 -2; -3]
C[-1 -2; -3] := U[-1 -2; 1] * sqrt(S)[1; -3]
D[-1; -2 -3] := sqrt(S)[-1; 1] * V[1; -2 -3]
end

# @plansor complains here, not sure why
@tensor scheme.T[-1 -2; -3 -4] := D[-1 1; 4] * B[-2; 3 1] * C[3; 2 -3] * A[4 2; -4]
@tensor scheme.T[-1 -2; -3 -4] := D[-1; 1 4] * B[-2; 3 1] * C[3 2; -3] * A[4 2; -4]
return scheme
end

Expand Down

0 comments on commit d3ae4a1

Please sign in to comment.