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:
This pattern applies K operators to the target qubit(s), controlled by c control qubits.
If the Select operator applies fewer target operators than the maximally supported number (2^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 U with c controls and K<2^c target operators.
Control state without overlap on the states |i\rangle for i\geq K.
Outputs
Decomposition of U with reduced number of control nodes.
Example
Consider a Select operator with c=4 control qubits, two target qubits, and K=11<16=2^c target
operators:
Applying the partial Select simplification allows us to remove the trailing turned-off control
nodes on qubit 1 and qubit 3, as well as 2^c-K=5 intermediate turned-off control nodes
on qubit 0 and a single intermediate control node on qubit 2:
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 iteration technique presented in [1] or with generic
Select-U(2) decompositions.
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.