# How to calculate probability of measuring $|1\rangle$ after application of $R_x$ gate

I was trying to understand how to calculate the probability of measuring $$|1\rangle$$ when executing the following circuit in Qiskit:

qc = QuantumCircuit(1)
qc.rx(3*math.pi/4, 0)


The answer in the book states it’s 0.8536 but I can’t understand the logic behind this.

I tried with the matrix of the $$R_x$$ gate but I am unable to achieve the same result.

You start out with $$|0\rangle$$.

You multiply that with

$$\begin{bmatrix} \cos(\theta/2) & -i \cdot \sin(\theta/2) \\ -i \cdot \sin(\theta/2) & \cos(\theta/2) \end{bmatrix}$$

where $$\theta=3 \pi/4$$ , which gets you

$$\begin{bmatrix} \cos(\theta/2) \\ -i \cdot \sin(\theta/2) \end{bmatrix}$$.

Now you take the lower entry of the vector to calculate your probability using $$|x|²$$.

• Question 3: In the below code snippet, what is the probability of measuring |1>? qc = QuantumCircuit(1) qc.rx(3*math.pi/4, 0) Commented Aug 11, 2023 at 6:49
• sorry for the confusion. I am just learning the things as well. This shuld be the way to solve now :)
– ilga
Commented Aug 11, 2023 at 7:19
• So if I take sin 3 pi by 4, it would be |0.74|² which is not equal to 0.85. Commented Aug 11, 2023 at 7:48
• You have an error in your calculation. You should put your calculation in the question
– ilga
Commented Aug 11, 2023 at 8:37
• Note that when you put qc.rx(3*math.pi/4,0), you are setting $\theta = \pi/4$, so your bottom entry becomes $- i \cdot \sin(3\pi/8)$ i.e. don't forget to divide the angle by 2! And also separately there seems to be a slight confusion about the states, because if you do the calculation, the probability of measuring the $|0\rangle$ state should be about 0.86 (not the $|1\rangle$ state) Commented Aug 11, 2023 at 11:07