1. Compilation/
  2. Partial Select

Partial Select

A frequently occurring control pattern in quantum algorithms is that of uniformly controlled rotations, called SelectPauliRot in PennyLane, or more generally of Select operators. They are commonly depicted as follows:

Typical circuit drawings for Select operators

This pattern applies KK operators to the target qubit(s), controlled by cc control qubits. If the Select operator applies fewer target operators than the maximally supported number (2c2^c) and the state on the control qubits is guaranteed to have no overlap with the unused basis states, the control structure of Select can be simplified [1].

Inputs

  • Select operator UU with cc controls and K<2cK<2^c target operators.
  • Control state without overlap on the states i|i\rangle for iKi\geq K.

Outputs

  • Decomposition of UU with reduced number of control nodes.

Example

Consider a Select operator with c=4c=4 control qubits, two target qubits, and K=11<16=2cK=11<16=2^c target operators:

0: ─╭○──╭○──╭○──╭○──╭○──╭○──╭○──╭○──╭●──╭●──╭●───┤
1: ─├○──├○──├○──├○──├●──├●──├●──├●──├○──├○──├○───┤
2: ─├○──├○──├●──├●──├○──├○──├●──├●──├○──├○──├●───┤
3: ─├○──├●──├○──├●──├○──├●──├○──├●──├○──├●──├○───┤
4: ─├U0─├U1─├U2─├U3─├U4─├U5─├U6─├U7─├U8─├U9─├U10─┤
5: ─╰U0─╰U1─╰U2─╰U3─╰U4─╰U5─╰U6─╰U7─╰U8─╰U9─╰U10─┤.

Applying the partial Select simplification allows us to remove the trailing turned-off control nodes on qubit 11 and qubit 33, as well as 2cK=52^c-K=5 intermediate turned-off control nodes on qubit 00 and a single intermediate control node on qubit 22:

0: ─╭○──╭○──╭○──────────────────────╭●──╭●──╭●───┤
1: ─├○──├○──├○──╭○──╭●──╭●──╭●──╭●──│───│───│────┤
2: ─├○──├○──├●──├●──├○──├○──├●──├●──├○──│───├●───┤
3: ─├○──├●──├○──├●──├○──├●──├○──├●──├○──├●──│────┤
4: ─├U0─├U1─├U2─├U3─├U4─├U5─├U6─├U7─├U8─├U9─├U10─┤
5: ─╰U0─╰U1─╰U2─╰U3─╰U4─╰U5─╰U6─╰U7─╰U8─╰U9─╰U10─┤.

Typical usage

Typically, this transformation reduces the control structure of a Select operator, also called a multiplexer, or of a uniformly controlled rotation (qml.SelectPauliRot). This reduction interacts non-trivially with other compilation techniques for Select operators. For example, it may be combined with lazy Select simplifications. However, it is only to a limited extent compatible with, or beneficial for use with, the unary iterator technique presented in [1] or with generic Select-U(2) decompositions.

References

[1] "Encoding electronic spectra in quantum circuits with linear T complexity", Ryan Babbush et al. 1805.03662, Phys. Rev. X 8, 041015, (2018).

Cite this page

@misc{PennyLane-PartialSelect,
title={Partial Select},
howpublished={\url{https://pennylane.ai/compilation/partial-select}},
year={2025}
}

Page author(s)

David Wierichs

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.