A target qubit is the position selected by a quantum gate to determine which state amplitudes are recombined. In binary outcome labels, each pair differs only at that qubit’s position; all such pairs can be updated in parallel. section 4.3 section 1.4.3
Use the target index to find amplitude pairs in a simulator:
- Index qubits from right to left, with the rightmost binary digit as qubit 0. section 4.3.1
- For target t, pair each outcome whose digit t is 0 with the outcome obtained by adding 2^t to its decimal index. section 4.3.1
- Apply the gate’s two-by-two matrix to every pair, preserving the state’s organization around the selected stride. section 12.3.1
Three-qubit pairing
For target t = 0, outcomes 000 and 001 form a pair, so their decimal indices differ by 1. For t = 1, 000 pairs with 010, differing by 2; for t = 2, 000 pairs with 100, differing by 4. Applying Hadamard gates to targets 0, 1, and 2 transforms the initialized state [1, 0, 0, 0, 0, 0, 0, 0] into eight equal amplitudes of approximately 0.3536. section 4.3.1 section 4.3.4
Figure 4.15 The pairs of outcomes for applying a single-qubit gate to a three-qubit system with the target qubit in position 0
Visualize the target-0 pairing pattern across a three-qubit state before implementing the indexing logic. section 4.3.1

