[BUG] Controlled.has_sparse_matrix
is incorrect for ops without matrices or sparse matrices
#7024
Closed
1 task done
Labels
bug 🐛
Something isn't working
Expected behavior
Operator.has_sparse_matrix
should agree with whether or not an actual matrix is returned byOperator.sparse_matrix
Actual behavior
Controlled.has_sparse_matrix
is always true.Additional information
No response
Source code
>>> op = qml.ctrl(qml.Permute(np.array([1, 0, 2]), (0, 1, 2)), (3, 4)) >>> op.has_sparse_matrix True >>> op.sparse_matrix() SparseMatrixUndefinedError
Tracebacks
System information
Existing GitHub issues
The text was updated successfully, but these errors were encountered: