[BUG] mcm_mode="one-shot" passes all shot requests to custom back end at once #6463
Open
1 task done
Labels
bug 🐛
Something isn't working
Expected behavior
(I develop the
pennylane-qrack
custom back end.) When we run the ZNE tutorial being developed by Unitary Fund and Catalyst, asmcm_mode="one-shot"
is used (for "weak simulation condition," for noise simulation), we expect that if we request 1,000 shots, then PennyLane should iterate the process 1,000 times of running the original circuit on the back end and requesting 1 measurement shot output at a time.Actual behavior
If I run the tutorial with the correct setting and this branch that prints the number of shots received by the back end per request for measurement samples, then the extra
print()
statement shows that PennyLane is requesting 1,000 shots at once for a single execution of the original circuit on the back end, despitemcm_mode="one-shot"
.Additional information
It's important that the circuit is run top-to-bottom for every single individual shot, because Qrack introduces physically-realistic noise via stochastic Pauli noise, such that the circuit actually ends up with hidden gates inserted stochastically by the back end on every single separate shot, modeling physical noise, whereas requesting 1,000 shots from the back end at once gives every single shot the exact same (random) bit-flip and phase-flip errors, which is not the intent or a physically-accurate noise model.
Source code
Tracebacks
No response
System information
Name: PennyLane Version: 0.40.0.dev0 Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network. Home-page: https://github.com/PennyLaneAI/pennylane Author: Author-email: License: Apache License 2.0 Location: /home/iamu/qrack_venv_3-12/lib/python3.12/site-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, toml, typing-extensions Required-by: PennyLane-Catalyst, pennylane-qrack, PennyLane_Lightning Platform info: Linux-6.8.0-47-generic-x86_64-with-glibc2.35 Python version: 3.12.7 Numpy version: 1.26.4 Scipy version: 1.12.0 Installed devices: - qrack.simulator (pennylane-qrack-0.10.1) - lightning.qubit (PennyLane_Lightning-0.38.0) - nvidia.custatevec (PennyLane-Catalyst-0.8.1) - nvidia.cutensornet (PennyLane-Catalyst-0.8.1) - oqc.cloud (PennyLane-Catalyst-0.8.1) - softwareq.qpp (PennyLane-Catalyst-0.8.1) - default.clifford (PennyLane-0.40.0.dev0) - default.gaussian (PennyLane-0.40.0.dev0) - default.mixed (PennyLane-0.40.0.dev0) - default.qubit (PennyLane-0.40.0.dev0) - default.qutrit (PennyLane-0.40.0.dev0) - default.qutrit.mixed (PennyLane-0.40.0.dev0) - default.tensor (PennyLane-0.40.0.dev0) - null.qubit (PennyLane-0.40.0.dev0) - reference.qubit (PennyLane-0.40.0.dev0)
Existing GitHub issues
The text was updated successfully, but these errors were encountered: