0
$\begingroup$

enter image description hereI am new to quantum computing. My circuit contains only one qubit, one Hadamard gate and an operation to measure the state of the qubit. So, as I understand, the qubit is in superposition state after doing through the H gate, and has a probability of 50% of being in both states 0 and 1. After I measure it, (as in we force it to get out of its wave-like state or superposition state),I always end up with an output of 1? Is not it supposed to be random (quantum randomness) ?

$\endgroup$
6
  • $\begingroup$ perhaps you could show your code? It's easier to help if we know exactly what you've tried to do! $\endgroup$
    – DaftWullie
    Feb 17, 2023 at 12:37
  • $\begingroup$ actually its not a code but only a visualition of these quantum gates on the q-sphere. I added a picture. thank you for your help $\endgroup$
    – Wiss
    Feb 17, 2023 at 12:57
  • $\begingroup$ What is the plus in a circle? $\endgroup$
    – DaftWullie
    Feb 17, 2023 at 13:30
  • $\begingroup$ its for changing the phase and state of the qubit $\endgroup$
    – Wiss
    Feb 17, 2023 at 14:14
  • $\begingroup$ Perhaps try first without those + operators. You can also try quirk to double check the results $\endgroup$
    – rhundt
    Feb 17, 2023 at 16:20

1 Answer 1

1
$\begingroup$

The problem comes from the fact the in simulation a measurement gate really measures. In other words, the result is either 0 or 1. Try to remove measurement and you will see 50:50 states 0 and 1. Then try to run your circuit on simulator. The result should be also 50:50, or very close to this distribution.

Note that you do not have to reset the qubit. At the beginning it is always in state 0. Moreover, two $X$ gates cancel each other, so you can remove it. To change the phase of your state, use only one negation.

$\endgroup$
2
  • $\begingroup$ okey i understand thank you very muuch!! $\endgroup$
    – Wiss
    Feb 18, 2023 at 9:54
  • $\begingroup$ @Wiss: you are welcome. Could you please accept my answer provided your problem is solved? Thanks. $\endgroup$ Feb 18, 2023 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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