Hi colleagues! I am interested to know are there any native-Python (see below) quantum devices, either built-in or from a third-party plugin, which would return me a “real” sampled value of a mid-circuit measurement rather than a MeasurementValue.
In essence, I’d like the following code to work without qml.cond
import pennylane as qml
@qml.qnode(qml.device(???)) # Anything ?
def circuit():
qml.PauliX(wires=0)
m1 = qml.measure(0)
if m1: # NOT qml.cond(m1==1, qml.PauliZ)(wires=0)
qml.PauliZ(wires=0)
return qml.state()
print(circuit())
I would like the above code to return the sampled final states, possibly varying from shot to shot.
I am aware of the Catalyst approach which surprisingly does what I need. However, in my actual problem, I would like to pass m1
to a non-traceable Python procedure (and the callbacks look like an overhead), so that is why I’m asking about a native device.