0
$\begingroup$

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.

$\endgroup$
1
  • 2
    $\begingroup$ 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. $\endgroup$
    – Rammus
    Jul 21 '21 at 8:09
2
$\begingroup$

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%.

What you see is probably something like this:

enter image description here

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.

$\endgroup$
1
  • 1
    $\begingroup$ Ok quite clear for me now vizualisation and its seed. I continue my trail and see when running on real server the result of measure is around 500/500 with 1000 shots . One thing : i don't understand why in the lecture from Elias Combarro the visualisation after measure was 50% 50% . May there were some changes on the visualisation since. Nevertheless As i said quite clear now and many thanks $\endgroup$
    – alain pane
    Jul 22 '21 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.