I apply Grover's on an eigh qubits circuit I just want to amplify the states whose qubits 6 and 7 are |1> The following test works (the state 11011001 is correctly amplified)
good_state=[6,7]
# Test
oracle = Statevector.from_label('11011001')
...
but is it possible to replace the label '11011001' by something like '11<any 6 bits>'? An more generally by '<n times 1><(8-n any bits)>'? More precisely, here is an example. After some manipulations, the state vector is $ \frac{\sqrt{2}}{4} |00010101\rangle+\frac{\sqrt{2}}{4} |00101010\rangle+\frac{\sqrt{2}}{4} |01010110\rangle+\frac{\sqrt{2}}{4} |01101001\rangle+\frac{\sqrt{2}}{4} |10011010\rangle+\frac{\sqrt{2}}{4} |10100101\rangle+\frac{\sqrt{2}}{4} |11011001\rangle+\frac{\sqrt{2}}{4} |11100110\rangle $ Ideally, in that case, the "label" should be something like '11011001 OR 11100110'.
---- 2023-06-29 Actually I simplified the problem. I now just want to amplify the states whose binary strings in the state vector have the leftmost bit equal to 1.