You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Context:**
Before CNOT inherited from `Controlled`, its decomposition method
returned a `DecompositionUndefinedError`. Now it uses the smart
decomposition functions from `Controlled`, which in this case make it
decompose to itself.
```
>>> op = qml.CNOT([0, 1])
>>> op.decomposition()
[CNOT(wires=[0, 1])]
```
The change in the decomposition method of CNOT was unintentional, and
operators should not decompose to themselves.
**Description of the Change:**
We put it back how it was:
```
>>> op = qml.CNOT([0, 1])
>>> op.decomposition()
DecompositionUndefinedError
```
**Related GitHub Issues:**
#5711
---------
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Christina Lee <christina@xanadu.ai>
Expected behavior
A decomposition should always return either an error, or a decomposition into other operators
Actual behavior
CNOT decomposes into CNOT
Additional information
No response
Source code
>>> qml.CNOT([0, 1]).decomposition() [CNOT(wires=[0, 1])]
Tracebacks
System information
Existing GitHub issues
The text was updated successfully, but these errors were encountered: