- Compilation/
Control logic decompositions
Control logic decompositions
Controlled quantum gates are a fundamental building block for algorithm design and
unitary synthesis. Essential techniques like linear combinations of unitaries,
Select
-applying a gate
(qml.Select),
or QROM
s (demo)
all use controlled gates.
Consequently, decomposing (groups of) controlled quantum gates is an important step in quantum compilation.
Inputs
- Circuit description containing quantum control logic.
Outputs
- Circuit description containing reduced quantum control logic. The reduction is typically seen in the number of control nodes and/or the number of controlled gates.
Covered decompositions
We show the following four decompositions:
- Control of a compute/uncompute pattern [1]
- Linear combination of QSVTs
- Controlled global phases [2]
- Flipped and controlled phase shifts
Examples
We give one brief example for each of the four techniques. See the respective tabs for more details and examples.
-
Controlled versions of a compute/uncompute pattern can be simplified. This allows us to skip control nodes like in the following example:
0: ─╭RX(0.50)─╭●────╭●─╭RX(0.50)†─┤ = 0: ──RX(0.50)─╭●────╭●──RX(0.50)†─┤ 1: ─│─────────├X─╭●─├X─│──────────┤ 1: ───────────╰X─╭●─╰X────────────┤ 2: ─│─────────│──├X─│──│──────────┤ 2: ──────────────├X───────────────┤ ctrl: ─╰●────────╰●─╰●─╰●─╰●─────────┤ ctrl: ──────────────╰●───────────────┤.
-
Linear combinations of QSVT circuits can be condensed, leading to simplifications like the following:
aux: ──H─╭○─────╭○────────────╭○─────╭○─────────────╭○──────╭●─────╭●────────────╭●─────H─┤↗₀│ c: ────╰∏_ϕ_0─├BlockEncode0─╰∏_ϕ_1─├BlockEncode0†─╰∏_ϕ_2──╰∏_τ_0─├BlockEncode0─╰∏_τ_1─────────┤ t: ───────────╰BlockEncode0────────╰BlockEncode0†────────────────╰BlockEncode0────────────────┤. = aux: ──H─────╭●─────────────────────────╭●─────╭○─────────────╭○─────H─┤↗₀│ c: ──∏_ϕ_0─╰∏_θ_0─╭BlockEncode0─∏_ϕ_1─╰∏_θ_1─├BlockEncode0†─╰∏_ϕ_2────────┤ t: ───────────────╰BlockEncode0──────────────╰BlockEncode0†───────────────┤.
-
Controlled global phases, unlike their non-controlled counterparts, cannot simply be skipped. Instead, they decompose into phase shift gates, with any of the controls acting as new target:
0: ──╭GlobalPhase(a)─┤ = 0: ──────────┤ = 0: ──────────┤ = 0: ──────────┤ 1: ──├●──────────────┤ 1: ──╭Rϕ(-a)─┤ 1: ──╭●──────┤ 1: ──╭●──────┤ 2: ──├●──────────────┤ 2: ──├●──────┤ 2: ──├Rϕ(-a)─┤ 2: ──├●──────┤ 3: ──╰●──────────────┤ 3: ──╰●──────┤ 3: ──╰●──────┤ 3: ──╰Rϕ(-a)─┤
-
(Controlled) phase shift gates, in turn, can be decomposed via this relationship into (controlled) R_Z gates, leading to staircase circuits:
0: ──╭Rϕ(a)─┤ ≅ 0: ──╭RZ(a)───────────────────┤ 1: ──├●─────┤ 1: ──├●─────╭RZ(a/2)──────────┤ 2: ──╰●─────┤ 2: ──╰●─────╰●────────RZ(a/4)─┤
Typical usage
These decomposition tricks are usually applied to high-level or intermediate-level circuit descriptions that allow insight into the control logic applied to some subroutine.
References
[1] "A software methodology for compiling quantum programs", Thomas Häner, Damian S. Steiger, Krysta Svore, Matthias Troyer, Quantum Sci. Technol. 3 020501, 2018
[2] "Quantum computation and quantum information", Michael A. Nielsen, Isaac L. Chuang, Cambridge Press, 2010, Cambridge University Press
Cite this page
@misc{PennyLane-ctrl-logic-decomp, title={Control logic decompositions}, howpublished={\url{https://pennylane.ai/compilation/ctrl-logic-decomp}}, year={2025} }
Page author(s)
David Wierichs
I like to think about differentiation and representations of quantum programs, and I enjoy coding up research ideas and useful features for anyone to use in PennyLane.