April 2025
Intermediate to advanced
376 pages
9h 41m
English
In chapter 4, we explain one way of selecting outcome pairs. Following are two additional methods, which may perform better depending on the context.
Given a target qubit position t, we can traverse through all outcomes and select pairs by finding the “0 side” of a pair and adding 2t to find the “1 side.” Given n qubits, we know the decimal forms of the outcomes are 0 to 2n – 1. For each possible outcome, we check whether the target qubit in the binary form is 0 using the is_bit_set function. If the target qubit is 0 in the binary form, we find the second item in the pair by ...