# Multiple random coin flips

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 small (fixed??) number of qubits and only a few simple quantum gates.

This depends on exactly what you want to do with the outcome. If you want to use the $$n$$ outcomes simultaneously, then you need $$n$$ separate coins. Alternatively, you are happy to implement them all in sequence (one after the other), then what you could do is:

• start with qubit in the state $$|0\rangle$$
• measure it in the 0/1 basis
• drive the controlled-not off it