Open glassnotes opened 2 months ago
Given it works with two shots, I have a feeling its yet another squeezing issue.
Thanks @glassnotes! How urgent / blocking is this for you?
Note that the problem seems specific to the new one-shot approach because the following works:
import pennylane as qml
dev = qml.device("default.qubit", wires=2, shots=1)
@qml.qnode(dev, mcm_method="deferred")
def apply_mcm():
qml.Hadamard(wires=0)
m0 = qml.measure(wires=0)
return qml.sample(wires=1)
apply_mcm()
In our application we're working with quite a large circuit (>25 qubits), so deferred measurement isn't an option. But as @albi3ro notes, it works for multiple shots, so it's not an outright blocker any more (thanks for pointing this out!).
Expected behavior
When performing a circuit with mid-circuit measurements, returning sample measurements on which no mid-circuit measurements have been performed should work.
Actual behavior
An error (which appears related to the mid-circuit measurement collection) is thrown.
Additional information
No response
Source code
Tracebacks
System information
Existing GitHub issues