-
Notifications
You must be signed in to change notification settings - Fork 603
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CNOT decomposition method returns DecompositionUndefinedError (#6039)
**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>
- Loading branch information
1 parent
eb7c349
commit c534c17
Showing
6 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters