I was wondering if it's theoretically possible to have a while loop that runs a bit like this:
- You initialize a set of qbits with the H-gate.
- You perform a set of operations on them.
- You check the state of those qbits and decide to either go back to step 2 or to continue with step 4.
- You measure the outcome.
What I understand is that you can do this if you work with upper bounds (How to implement a while loop in a quantum computer?) where you simply use conditional operations a number of times. If I'm not mistaken this also requires an additional qbit for every loop iteration you make. So if you want to loop 10 times, you need 10 qbits to store the whether the condition was made or not.
However, what I am looking for is the possibility to have it run indefinitely until all undesired states of the superposition are filtered out. Basically creating something that sounds a lot like a non-deterministic computer.
I was thinking maybe it could work something like this: Imagine you start with a qbyte in a uniform superposition and you desire it to be in a superposition where [1111111> is a near 99% outcome. Every iteration you see a single 0 in your qbyte, you perform Hadamard operations on all qbits. Now instead of using just a quantum computer, I would suggest putting both a quantum computer and a cat in a box. The cat operates the quantum computer and at the end of an iteration the cat measures the qbyte. If the qbyte is all 1's, the cat will stop and wait for some nice human to open the box. If a single qbyte is a 0, then the cat will Hadamard all the qbits again and repeat the process until they're all 1's.
Does any of this make sense? I was thinking since the cat itself is unobserved, it can be in a quantum superposition while measuring the qbytes. I am not very knowledgeable on the field of quantum mechanics and am also a bit novice to quantum computing, so a lot of the stuff I just said probably doesn't make much sense. So, feel free to point out all my misinformed/misguided/misinterpreted errors in my argument.