I’m curious if I can design a circuit in which I apply a gate on a qumode based on the outcome of a measurement on another qumode, something like this:
This behaviour is currently not supported in PennyLane.
It’s something we could think about implementing in the future. However, it is not clear that it plays well with the automatic differentiation which is the core feature of the library (because you can’t usually compute a gradient of a conditioning step), so depending on your use-case, it may or may not be of value to have this in the library.
In the meantime, this is supported in our sister library, Strawberry Fields:
import strawberryfields as sf
from strawberryfields import ops
prog = sf.Program(2)
x = .0991
theta = .744
phi = .655
with prog.context as q:
ops.Dgate(4.0, x) | q[0]
ops.Dgate(4.0, x) | q[1]
ops.BSgate(theta, phi) | q
MeasureP | q[0]
ops.Sgate(q[0].par, np.pi) | q[1]
MeasureX | q[1]
eng = sf.Engine("gaussian", backend_options={"cutoff_dim": 5})
results = eng.run(prog)
Check out the Strawberry Fields teleportation tutorial for more details on photonic feed-forward.