Skip to content

Commit

Permalink
macroexpand generated expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Nov 30, 2024
1 parent aec7690 commit 6b63f43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/transfermatrix/transfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ apply a transfer matrix to the left.
t_top = tensorexpr(:A, 2:(N₂ + 1), -(N₁ + 1))
t_bot = tensorexpr(:Ā, (1, (3:(N₂ + 1))...), -1)
t_in = tensorexpr(:v, 1, (-(2:N₁)..., 2))
return :(return @plansor $t_out := $t_in * $t_top * conj($t_bot))
return macroexpand(@__MODULE__,
:(return @plansor $t_out := $t_in * $t_top * conj($t_bot)))
end

"""
Expand All @@ -41,7 +42,8 @@ apply a transfer matrix to the right.
t_top = tensorexpr(:A, (-1, reverse(3:(N₂ + 1))...), 1)
t_bot = tensorexpr(:Ā, (-(N₁ + 1), reverse(3:(N₂ + 1))...), 2)
t_in = tensorexpr(:v, 1, (-(2:N₁)..., 2))
return :(return @plansor $t_out := $t_top * conj($t_bot) * $t_in)
return macroexpand(@__MODULE__,
:(return @plansor $t_out := $t_top * conj($t_bot) * $t_in))
end

# transfer, but the upper A is an excited tensor
Expand Down

0 comments on commit 6b63f43

Please sign in to comment.