[BUG] Error Exporting QASM File: MidMeasureMP
Operation Not Supported
#6900
Labels
bug 🐛
Something isn't working
MidMeasureMP
Operation Not Supported
#6900
Expected behavior
The expected behavior is that the circuit imported from QASM with a final measurement can be re-exported to QASM without any errors. Specifically, the measurement operation should be preserved and not converted to a mid-measure operation.
Actual behavior
The actual behavior is that when trying to re-export the circuit to QASM, a ValueError is raised stating that the operation
MidMeasureMP
is not supported by the QASM serializer. This is unexpected because the initial QASM file only contained a final measurement, and it is unclear why the measurement is being converted to a mid-measure operation.Additional information
To reproduce the issue, run the following code.
The error is 100% reproducible and is not dependent on any specific hardware or environment. The issue appears to be with the way Pennylane handles measurement operations when importing and exporting circuits to and from QASM.
Let me know if you need more info
Source code
Tracebacks
System information
Name: PennyLane Version: 0.38.0 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: .../lib/python3.10/site-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, toml, typing-extensions Required-by: PennyLane-qiskit, PennyLane_Lightning Platform info: Linux-5.15.0-130-generic-x86_64-with-glibc2.35 Python version: 3.10.14 Numpy version: 1.26.4 Scipy version: 1.14.1 Installed devices: - qiskit.aer (PennyLane-qiskit-0.38.1) - qiskit.basicaer (PennyLane-qiskit-0.38.1) - qiskit.basicsim (PennyLane-qiskit-0.38.1) - qiskit.remote (PennyLane-qiskit-0.38.1) - default.clifford (PennyLane-0.38.0) - default.gaussian (PennyLane-0.38.0) - default.mixed (PennyLane-0.38.0) - default.qubit (PennyLane-0.38.0) - default.qubit.autograd (PennyLane-0.38.0) - default.qubit.jax (PennyLane-0.38.0) - default.qubit.legacy (PennyLane-0.38.0) - default.qubit.tf (PennyLane-0.38.0) - default.qubit.torch (PennyLane-0.38.0) - default.qutrit (PennyLane-0.38.0) - default.qutrit.mixed (PennyLane-0.38.0) - default.tensor (PennyLane-0.38.0) - null.qubit (PennyLane-0.38.0) - lightning.qubit (PennyLane_Lightning-0.38.0)
Existing GitHub issues
The text was updated successfully, but these errors were encountered: