# How to "eliminate" some components of the state vector?

I have $$n*k$$ qubits. At the very beginning the length of the state vector is $$2^{nk}$$. After some manipulations (Qiskit circuit) I reduce it to $$k^n$$ and it looks like $$a|1...\rangle +a|0...\rangle ...$$ Now I want to "eliminate " the $$|0...\rangle$$ components, and keep only the $$|1...\rangle$$ ones, if possible with the same coefficient for all (equiprobability).

Applying Grover I can find $$c|1...\rangle +d|0...\rangle ...$$

with $$c >> d$$, but I guess there is a simpler and more efficient method. But which one?

• From my understanding, there isn't really a more asymptotically efficient method than Grover's. You can do the repeat-until-success methods, or finally you can use some sequence of controlled $R_y$ rotations. But the last option is dependent on your coefficients $a$ and which states you have already zeroed out. In general it is exponential in gate depth, but you can always give it a shot and see if in practice it works OK for your situation. But I believe in general the problem you are posing does not have an easy trick to solve it Nov 16 at 8:49

## 1 Answer

If you can use repeat-until-success patterns, you can just measure the first qubit: if the measurement result is 1, you have the state you want, with the basis vectors that start with 0 eliminated. If the measurement result is 0, however, you have the opposite of what you want, so you'll need to repeat the process from scratch, preparing the state again and measuring the first qubit again.

• I could indeed do that but it would be not very efficient, for there are far more |0...> than |1...> as soon as n and k increase. Jun 17 at 19:38