# Doing $|0\rangle$ then Hadamard gate then measurement

I am starting to use quantum experience and following exactly first example from lecture. After initializing the qubit to $$|0\rangle$$, then applying a Hadamard gate, the probability for measuring $$|1\rangle$$ is 50%. When I apply measurement, the probability for 1 becomes 100%. It should be 50% as in the lecture.

• You could post your code? Otherwise there isn't really a question here to answer. (Please don't post it as an image but rather edit your question and use the relevant formatting tools. Jul 21, 2021 at 8:09

The state $$|\psi \rangle = \dfrac{|0\rangle + |1\rangle}{\sqrt{2}}$$ do indeed have 50% of being measured in the state $$|0\rangle$$ and 50% of being measured in the state $$|1\rangle$$. However, once you measured $$|\psi \rangle$$, it will collapesed into either the state $$|0\rangle$$ or $$|1\rangle$$. Now, if it collapses to $$|0\rangle$$ then your chances of measuring it in $$|0\rangle$$ is 100%. And if it collapses to $$|1\rangle$$ then your chances of measuring it in $$|1\rangle$$ is 100%.
Note that the circuit generate the state $$|\psi \rangle = \dfrac{|0\rangle + |1\rangle}{\sqrt{2}}$$ before the measurement operation. But the probability and Statevector graph you see at the bottom of the figure are not for $$|\psi \rangle$$, but rather the state that $$|\psi \rangle$$ has collapsed to. Which is either $$|0\rangle$$ or $$|1\rangle$$ as we discussed above.
If you remove the measurement operation then you will see that it will go back to 50% for both the state $$|0\rangle$$ and $$|1\rangle$$.
The reason why you always see that the circuit is always in the state $$|1\rangle$$ in the Quantum Composer is because the Visualization seed is fixed (the red outline box on the figure above). If you select some other number for the Visualization seed 'box' then you will see that your state might collapsed to the state $$|0\rangle$$ instead.