Hi!
I have noticed that Zygote struggles with gradient computation for circuits that have nested put components - e.g., chain(10, [put(10, (i,j) => chain(2, [put(2, 1=>Rx(0)), put(2, 2=>Ry(0))])) for i=1:5, j=6:10]). The gradient computation time (it could be the compilation time, though) grows enormously in comparison to the equivalent "flat" circuit without nested puts.
I don't know what's the issue, but I think it would be good to have a method in YaoBlocks.Optimise that removes nested puts.
Hi!
I have noticed that Zygote struggles with gradient computation for circuits that have nested put components - e.g.,
chain(10, [put(10, (i,j) => chain(2, [put(2, 1=>Rx(0)), put(2, 2=>Ry(0))])) for i=1:5, j=6:10]). The gradient computation time (it could be the compilation time, though) grows enormously in comparison to the equivalent "flat" circuit without nested puts.I don't know what's the issue, but I think it would be good to have a method in YaoBlocks.Optimise that removes nested puts.