# Randomness using simple parallel Hadamard circuit

I've recently tried to build a Random generator using 5 hadamard gates (shown as U2 below) measured to 5 classical bits in parallel as shown in the circuit image.

I've executed this circuit for 8192 shots (and repeated this many times) hoping to get somehow flat histogram of every of 32 possible states. Yet, instead i've found that probability decreases in almost linear fassion from |00000> -> |11111> which is bizare. I'm very new to quantum computing - could someone explain me why there is visible such strong linear dependence? Or maybe this is expected, but why?

What I tried up til now:

• I've tried to change measurment order and using/not using barrier before measurements. Everything was calculated on ibmq_burlington mashine.
• I've also tried error mitigation (CompleteMeasFitter prepared and applied to results, with no luck - as before I can see a strong linear relation).

Can anybody help me to understand this behaviour?

• Why aren't you using the default Hadamard gates? Jul 14, 2020 at 18:13
• Well, I am. This figure is copied from IBM Quantum experience website and it always shows H gates like this. In my qiskit Jupyter notebook it shows as normal H gate. For absolute clarity, this is how I make my circuit in qiskit: circuit.h(0) circuit.h(1) circuit.h(2) circuit.h(3) circuit.h(4) circuit.barrier() circuit.measure([4,3,2,1,0], [4,3,2,1,0]) Jul 14, 2020 at 18:22
• Well, it seems that ibmq_essex is working as expected using the same circuit, I've tried also ibmq_london and effect is similar to burlington. May be this conected with qbit topology on those mashines ? Jul 14, 2020 at 18:50
• Yes, based on Qiskit's documentation, $U2(0,\pi) = H$ (qiskit.org/documentation/stubs/…) Are you getting the same results on a simulator? I ran the same experiment in the simulator and could not reproduce your results Jul 14, 2020 at 18:50
• I've checked and ibmq_qasm_simulator runing the same circuit shows "flat" histogram, as expected. Jul 14, 2020 at 18:55

The issue is that you are using noisy hardware with imperfect operations and measurements. In particular, the most likely problem here is that after you prepare a qubit it immediately begins decaying towards the ground state $$|0\rangle$$ via interactions with the environment. Each qubit will be slightly more likely to be measured as 0 instead of 1 than you'd expect from a noiseless machine. Try grouping by the number of 1s in the result and the effect will stand out even more.