A controlled quantum operation applies a gate to a target qubit only for amplitude pairs whose control-qubit positions contain the required value. With controls set to 1, the operation limits quantum parallelism to selected parts of the state. section 4.4
Implement a controlled operation by narrowing the amplitude pairs before applying the ordinary gate transformation:
- Generate pairs of outcomes that differ only at the target position. section 4.4.1
- For one control, retain pairs whose control position contains 1; for multiple controls, require 1 at every control position. section 4.4.1 section 4.4.2
- Recombine each retained pair with the selected gate, leaving all other amplitudes unchanged. section 4.4
Two controls on a three-qubit state
Applying an X operation with controls [1, 2] and target 0 selects only the outcomes 110 and 111, or indices 6 and 7. The operation swaps those two amplitudes while leaving the other six unchanged. section 4.4.2
Figure 4.27 Pair processing for applying a controlled X gate to a three-qubit state with target qubit 0 and control qubit 2
Visualize controlled-X processing as highlighted amplitude pairs; the control selects which butterfly-like pairs participate. section 4.4

