# Measurement of 1 qubit in a two qubit system

I created two qubits in IBM quantum experience and measured the second qubit without applying any gate. The result I got had a computational basis of 00 and 10. How does the measurement of the second qubit change the basis to 00 and 10? I have just started to learn quantum computing, so the question may sound silly.

If you had run this on the statevector_simulator then you will only see $$|00\rangle$$. However, due to hardware noise, which in this case coming out from the measurement error, you will have some $$|1\rangle$$ in your measurement on $$q_1$$. Depends on the hardware noise level, you might see 'more' or 'less' of $$|1\rangle$$ appearing in your result. If you want to improve your output probabilities result, just add more shots.

Update: Why would we would we only see the state $$|00\rangle$$ in the ideal world, like if we have used the statevector_simulator instead of the hardware?

The reason is because the starting/initial state on a quantum computer always start in the state $$|000\cdots 0\rangle$$. That is, every qubit initialize with $$|0\rangle$$. And this state can be prepared with very high fidelity. In your case, you have two qubit, so your system is initialize at the state $$|00\rangle$$. That is $$|q_0\rangle = |0\rangle$$ and $$|q_1 \rangle = |0 \rangle$$. So now without doing any operation on this qubit, you ask the quantum computer, what state is the second qubit, $$q_1$$ in? The answer should be $$|0\rangle$$ if you have a measurement process with no noise! Because the state the qubit $$q_1$$, $$|q_1\rangle = |0\rangle$$. There is no other answer it can give you. However, if there is noise presence, it might change this answer from a $$|0\rangle$$ to a $$|1\rangle$$ every so often, depending on the noise level of course. Say you ask 100 times, 95 of the time you will get the correct answer of $$|0\rangle$$ and 5 time it will return a $$|1\rangle$$ due to error. Think of this as like when you are driving in car through a scenic mountain area, then your friend call and ask if you want to come over to hangout. Because of where you are, the signal is not very clear, so eventhough you say "YUP", he/she might hear as a "NOPE" instead.... so if you have say"YUP", "YUP",.... "YUP" 100 times, he/she might pick up a "NOPE" 5 time out of the 100 time. This is what you see in your histogram plot... sometime the measurement process pick-up a $$|1\rangle$$ because of the noise in the measurement process as your friend has picked up a "NOPE" from bad signal.

Note that this should not be confusing with the state $$|q_1 \rangle = \dfrac{|0\rangle + |1 \rangle}{\sqrt{2}}$$... In this case, when you ask the quantum computer, "Hey QC, what state is $$|q_1\rangle$$ in? It will return you with a $$|0\rangle$$ or a $$|1\rangle$$ with $$1/2$$ probability. This is not because of the noise in your system. If you run this experiment $$100,000$$ time, you might get $$49820$$ time it will returns a $$|0\rangle$$ and $$50,180$$ time it will returns a $$|1\rangle$$. This is because your state $$|q_1\rangle$$ is in superposition of both $$|0\rangle$$ and $$|1\rangle$$, so when making a measurement, it will collapse onto either one of these state. And in this case, where $$|q_1 \rangle = \dfrac{|0\rangle + |1 \rangle}{\sqrt{2}}$$, the probability of collapsing onto the state $$|0\rangle$$ is 50% probability and the state $$|1\rangle$$ is also 50%. This is similar to tossing a coin if you think about it...

• How is it that only 00 bais will be present in the simulator? I don't understand – K Sreerag Nov 20 '20 at 16:34
• the simulator simulates an ideal quantum computer. Therefore, no noise (accept you want to explicit add it). – luciano Nov 20 '20 at 16:45
• @KSreerag I have updated the my answer to make it more clear. – KAJ226 Nov 20 '20 at 17:28
• @KAJ226 Thank you. – K Sreerag Nov 20 '20 at 23:22

Quantum computer are not perfect. There are certain limitation to quantum computers currently. Qubits are highly susceptible to noise and are error prone. A stray commic ray or thermal vibrations can change the results of the calculation. The Quantum computer must be maintained at very cold temperatures and if that temperature is not maintained then the qubit can have give faulty results. You'll notice that when ibm qiskit runs your program it runs the program several times, to calculate an average score to account for this quantum noise. You can change the number of time qiskit runs results to create a more accurate result.

If you look at the 'y-axis' of your results, you will notice this algorithm was run 100 times. (see under histogram). Looks like one in 100 times this algorithm gave an incorrect result.

What you are seeing here is coming from the fact that quantum computation on real machines is not perfect.

In a perfect world, since you did not put any gates on your circuit, the state it should return is $$|00\rangle$$, the common initial state on any machine by default.
However, on real quantum machines, qubits can experience noise from the operations you are doing. Here, the $$|1\rangle$$ on the Qubit 1 comes from an error when measuring the Qubit, and there isn't really a way to completely avoid those errors when running quantum circuits on real machines.

Does that answer your question or do you need more explanation on something? Feel free to ask :)

• By measurement, we are calculating the probability of that particular qubit becoming zero. right? – K Sreerag Nov 20 '20 at 16:47
• So if that's the case shouldn't the basis be 00 and 10(in case we are measuring the second qubit) in an ideal case(in the simulator). why is it only 00 – K Sreerag Nov 20 '20 at 16:48
• By measuring one time, you recover a classical bit from the Qubit, see this as the Qubit that collapses on the bit, you don't get much information from this. If you want the probability of a Qubit state, you would want to run the same circuit multiple times and count how many times you have each possible state to approximate the probability of getting each one. – Lena Nov 20 '20 at 16:51
• So in the case where I am running this on the actual quantum computer, I will get a probability of being in 00 and 10 states. right? – K Sreerag Nov 20 '20 at 16:52
• Thank you for your guidance – K Sreerag Nov 20 '20 at 17:13