-
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.
Allow multi controlled x decomposition without working wires (#5735)
**Context:** `MultiControlled.decomposition()` gives an error when no `work_wire` is provided. **Description of the Change:** Implement decomposition given in Lemma 7.5 of [1] to decompose a general multi controlled unitary gate. `MultiControlledX` being a particular case. The function `ctrl_decomp_zyz` now returns the correct decomposition including a controlled global phase. It now checks that this decomposition only works for single control wire. A decomposition for single controlled `GlobalPhase` is now available using Lemma 5.2 of [1], i.e. adds a `PhaseShift` to the control wire. Raise an exception when used with more than one control. **Benefits:** Decomposition of a MultiControlledX (and in general any multi controlled unitary) is now possible even if work wires are not provided. If controlled gate is SU(2), this resorts to the specialized algorithm from Lemma 7.9, yielding a decomposition with $\mathcal{O}(\text{len(control wires)})$ gates. For general unitaries, the decomposition yields $\mathcal{O}(\text{len(control wires)}^2)$ gates. ### Sources: [1] Barenco et al. (1995). <https://arxiv.org/abs/quant-ph/9503016> [SC-38954] --------- Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai> Co-authored-by: Christina Lee <christina@xanadu.ai>
- Loading branch information
1 parent
348dbf6
commit 4abe8ac
Showing
8 changed files
with
434 additions
and
101 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
Oops, something went wrong.