# Find probability of a single qubit's measurement results from a 5 qubit state

I have a tensor product of a 5 qubit state |h>. From this I want to calculate the probability of the 2nd qubit being in state |1>. Can someone show me how I can do this? I know I can use the Born rule but I am not sure how. For context I am using Python and NumPy.

• How is the state presented to you? 2^5 amplitudes in the computational basis? As a circuit applied to a starting state? – AHusain Jul 10 at 21:58
• @AHusain Presented as a 32 entry long vector tensor product of the 5 qubit states – meelszz Jul 10 at 22:26

So probability of the second qubit being in state $$|1\rangle$$ is the probability of the 5 qubit system being in a state that has $$|1\rangle$$ as the second qubit.
So among all the 32 states, find the ones that have $$|1\rangle$$ in the second qubit, which will be half of them, for example $$|01100\rangle$$ and $$|11111\rangle$$. Add up the corresponding probabilities, which is the absolute square of the amplitudes presented to you in vector form.
$$\begin{matrix} 000 \\ 001 \\ 010 \\ 011 \\100 \\ 101 \\ 110 \\ 111 \\ \end{matrix} \begin{bmatrix} 0 \\0.577 \\ 0 \\ 0.577\\ 0\\ 0\\ 0\\ 0.577\\ \end{bmatrix}$$
In the above case, the probability that the second qubit is $$|1\rangle$$ is probability that it will be in $$|010\rangle, |011\rangle, |110\rangle$$ or $$|111\rangle$$, which is $$|0.577|^2 + |0.577|^2$$ which is 0.666.