[BUG] The matrix representing a qfunc that contains qml.Barrier
gives MatrixUndefinedError
#6329
Open
1 task done
Labels
bug 🐛
Something isn't working
Expected behavior
Calling
qml.matrix
on a qfunc withqml.Barrier
present should behave as ifBarrier
is not present.Actual behavior
MatrixUndefinedError
Additional information
A circuit or a QNode with only
qml.Barrier
raises aMatrixUndefinedError
whenqml.matrix
is called. This should return an identity matrix where the number of wires is that given inwire_order
. Currently:Source code
Tracebacks
System information
Name: PennyLane Version: 0.38.1 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: /Users/isaac/.virtualenvs/pennylane-catalyst/lib/python3.11/site-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, toml, typing-extensions Required-by: PennyLane-Catalyst, PennyLane_Lightning Platform info: macOS-14.6.1-arm64-arm-64bit Python version: 3.11.9 Numpy version: 1.26.4 Scipy version: 1.12.0 Installed devices: - default.clifford (PennyLane-0.39.0.dev6) - default.gaussian (PennyLane-0.39.0.dev6) - default.mixed (PennyLane-0.39.0.dev6) - default.qubit (PennyLane-0.39.0.dev6) - default.qubit.autograd (PennyLane-0.39.0.dev6) - default.qubit.jax (PennyLane-0.39.0.dev6) - default.qubit.legacy (PennyLane-0.39.0.dev6) - default.qubit.tf (PennyLane-0.39.0.dev6) - default.qubit.torch (PennyLane-0.39.0.dev6) - default.qutrit (PennyLane-0.39.0.dev6) - default.qutrit.mixed (PennyLane-0.39.0.dev6) - default.tensor (PennyLane-0.39.0.dev6) - null.qubit (PennyLane-0.39.0.dev6) - 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) - lightning.qubit (PennyLane_Lightning-0.38.0)
Existing GitHub issues
The text was updated successfully, but these errors were encountered: