[BUG] Unitary Matrix Mismatch in OpenQASM cu
Gate Implementation
#6942
Labels
bug 🐛
Something isn't working
cu
Gate Implementation
#6942
Expected behavior
The unitary matrix generated by the
cu
gate in the OpenQASM code should match the expected unitary matrix.Actual behavior
The unitary matrix generated by the
cu
gate in the OpenQASM code is significantly different from the expected one, leading to an incorrect implementation.Additional information
This issue can be reproduced consistently. The discrepancy between the expected and actual unitary matrices suggests a potential bug in the conversion process.
A circuit with a
cu
gate, with two parameters and two qubits, is converted to OpenQASM viaqml.make_qscript
andqs.to_openqasm
. You can run this code to verify that they implement different unitaries: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: