Pytorch backend and dynamic computation graph


Does Pennylane support constructing PQC in the style of Pytorch dynamic computation graphs?

For example,

we first define we are going to have a circuit with 1 wire/qubit, and in the pytorch forward() call,
gates are dynamically added to the wire with a for loop, sth like:


pqc = PQC(n_wires=1)

def forward():
      for i in range(n):
           pqc.add(rx, wire=[0])


Hello wcqc,

Thank you for your question. This is not currently supported, but we hope to be able to implement this in a future version of PennyLane :slight_smile: