Skip to content

Commit 3520c0f

Browse files
authored
macroexpand generated expressions (#197)
1 parent 66d346e commit 3520c0f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/transfermatrix/transfer.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ apply a transfer matrix to the left.
2121
t_top = tensorexpr(:A, 2:(N₂ + 1), -(N₁ + 1))
2222
t_bot = tensorexpr(:Ā, (1, (3:(N₂ + 1))...), -1)
2323
t_in = tensorexpr(:v, 1, (-(2:N₁)..., 2))
24-
return :(return @plansor $t_out := $t_in * $t_top * conj($t_bot))
24+
return macroexpand(@__MODULE__,
25+
:(return @plansor $t_out := $t_in * $t_top * conj($t_bot)))
2526
end
2627

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

4749
# transfer, but the upper A is an excited tensor

0 commit comments

Comments
 (0)