A selection register is a quantum register whose qubits encode item inclusion. Each qubit corresponds to one item: 1 includes it, while 0 excludes it. With three items, the register uses three qubits and represents every binary selection. section 2.3.1 section 10.1.2
Use the register as the key that connects selections to computed attributes:
- Represent a selection such as 110 as a bitstring whose positions identify included items. section 2.3.1
- Place the selection register in superposition with a Hadamard gate on each qubit to represent all possible selections. section 10.1.2 section 11.3.1
- Use the selection qubits as controls while value and weight registers encode linear functions of the selection variables. section 10.1.2
Three-item knapsack
For items with values 2, 3, and 1 and weights 3, 2, and 1, a three-qubit selection register indexes eight combinations. The selection 011 corresponds to value 5 and weight 5; the associated value and weight registers encode those results. section 2.3.1 section 10.1.2
Figure 2.9 The register for encoding item selections. Each qubit corresponds to an item.
A register diagram makes the one-qubit-per-item mapping visible before circuit construction. section 2.3.1
