# Multiple random coin flips without measurements

The question is similar to this one. As suggested in the answer, I can easily do this with just one qubit: I repeatedly Hadamard it and measure in order to have a fair coin flip at every point. The problem with it is that, because of the measurements, the computation is not reversible.

So, again, suppose that in my circuit I have to generate multiple, say n, random coin flips. For example, this coin flips could be used to activate n CNOTs half of the time.

The trivial solution could be to use n different qubits and Hadamard them. However, this gets really huge when n is large.

Is there any better way? By better I mean using a smaller number of qubits and only a few simple quantum gates.

• It seems as if you ask the same question again, as you already asked. – nippon Dec 17 '18 at 13:47
• @nippon yes, but I thought that the previous question could remain for the general case, while in this case I want a reversible circuit. – tigerjack89 Dec 18 '18 at 15:31

• I haven't said that I want to generate a truly random number; I want to just toss n coins. For example, suppose I want to apply a CNOT 50% of the time: I can Hadamard one qubit and then use it to control the CNOT. This computation is obviously reversible: I can CNOT and Hadamard again to return to the original state. Take a look at this for example goo.gl/htrJWL – tigerjack89 Dec 18 '18 at 15:24
• No, I mean having a qbit in the $|+\rangle$ state (which you get to by putting $|0\rangle$ through Hadamard gate) as the control bit of a CNOT gate just entangles the control bit with the target bit. It doesn't activate the CNOT half the time or something like that. – ahelwer Dec 20 '18 at 21:45