Skip to content

Commit

Permalink
performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Feb 26, 2025
1 parent 913c4e8 commit fef41ad
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/operators/abstractmpo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,23 @@ end
# TODO: diagram

function _fuse_mpo_mpo(O1::MPOTensor, O2::MPOTensor, Fₗ, Fᵣ)
return @plansor O′[-1 -2; -3 -4] := Fₗ[-1; 1 2] *
O2[1 3; -3 5] *
O1[2 -2; 3 4] *
conj(Fᵣ[-4; 5 4])
return if O1 isa BraidingTensor && O2 isa BraidingTensor
elseif O1 isa BraidingTensor
@plansor O′[-1 -2; -3 -4] := Fₗ[-1; 1 2] *
O2[1 3; -3 5] *
τ[2 -2; 3 4] *
conj(Fᵣ[-4; 5 4])
elseif O2 isa BraidingTensor
@plansor O′[-1 -2; -3 -4] := Fₗ[-1; 1 2] *
τ[1 3; -3 5] *
O1[2 -2; 3 4] *
conj(Fᵣ[-4; 5 4])
else
@plansor O′[-1 -2; -3 -4] := Fₗ[-1; 1 2] *
O2[1 3; -3 5] *
O1[2 -2; 3 4] *
conj(Fᵣ[-4; 5 4])
end
end

"""
Expand Down

0 comments on commit fef41ad

Please sign in to comment.